@opendaw/studio-core-wasm 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ var UR=Object.defineProperty;var H=(t,e)=>()=>(t&&(e=t(t=0)),e);var _a=(t,e)=>{f
2
2
  `).slice(0,4).join(`
3
3
  `);if(n instanceof Error)return i(n.stack||n.message);if(typeof n=="string")return n;if(n&&typeof n=="object"){let a=n;if(a.stack)return i(a.stack);if(a.message)return a.message;try{return JSON.stringify(n,null,2)}catch{}}return String(n)}})(WN||(WN={}))});var Cg,A=H(()=>{"use strict";al();KM();WM();yg();LM();GM();HM();qM();s_();XM();Pg();eN();rN();iN();dN();fN();mN();Eg();bt();gN();qo();vN();d_();xN();$g();Ag();yN();bN();_N();ol();EN();SN();MN();NN();$N();kN();IN();p_();y_();AN();BN();TN();RN();Ng();CN();zN();ON();UN();FN();jN();KN();LN();Cg=Symbol.for("@openDAW/lib-std");globalThis[Cg]?console.debug(`%c${Cg.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[Cg]=!0,console.debug(`%c${Cg.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"))});var Og,ZN=H(()=>{"use strict";rt();Og=class t{static DEFAULT_SIZE=512;static DEFAULT_DECAY=.9;#e;#t;#r;#i;#n;#a;#s;#o;#c;#l=0;decay=!1;constructor({size:e,decay:r}={}){e??=t.DEFAULT_SIZE,this.#c=r??t.DEFAULT_DECAY,this.#e=e<<1,this.#r=new Vg(this.#e),this.#i=new Float32Array(this.#e),this.#n=new Float32Array(this.#e),this.#a=Wp.create(Wp.Type.Blackman,this.#e),this.#t=e,this.#s=new Float32Array(e),this.#o=new Float32Array(e)}clear(){this.#s.fill(0),this.#i.fill(0),this.#o.fill(0),this.#l=0}reset(){this.#l=0}numBins(){return this.#t}bins(){return this.#s}waveform(){return this.#o}process(e,r,n,i){for(let a=n;a<i;++a)this.#i[this.#l]=e[a]+r[a],++this.#l===this.#e&&this.#u()}#u(){for(let r=0;r<this.#t;++r)this.#o[r]=this.#i[r<<1];for(let r=0;r<this.#e;++r)this.#i[r]*=this.#a[r];this.#r.process(this.#i,this.#n);let e=1/this.#t;for(let r=0;r<this.#t;++r){let n=this.#i[r],i=this.#n[r],a=Math.sqrt(n*n+i*i)*e;this.#s[r]<a?this.#s[r]=a:this.decay&&(this.#s[r]*=this.#c)}this.#l=0,this.#n.fill(0),this.decay=!1}}});var A_,GN,HN,qN,LR,ZR,GR,Ve,Lp=H(()=>{"use strict";A_=(t,e)=>Math.floor(3840/e)*t,GN=(t,e=4,r=4)=>{let n=A_(1,r),i=Math.floor(t/n),a=Math.floor(i/e),s=(Math.floor(t)-A_(a*e,r))%n,c=Math.floor(s/240),u=s%240;return{bars:a,beats:i-a*e,semiquavers:c,ticks:u}},HN=(t,e)=>t*e/60*960,qN=(t,e)=>t*60/960/e,LR=(t,e)=>e*60/960/t,ZR=(t,e,r)=>HN(t/r,e),GR=(t,e,r)=>qN(t,e)*r,Ve={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:A_,toParts:GN,secondsToPulses:HN,pulsesToSeconds:qN,secondsToBpm:LR,samplesToPulses:ZR,pulsesToSamples:GR,toString:(t,e=4,r=4)=>{let{bars:n,beats:i,semiquavers:a,ticks:o}=GN(t|0,e,r);return`${n+1}.${i+1}.${a+1}:${o}`}}});var Yt,Ug,E_=H(()=>{"use strict";Lp();Yt=128,Ug=Ve.fromSignature(1,48)});var JN,YN=H(()=>{"use strict";A();E_();JN=class t{static Empty=new t(2);#e;constructor(e=2){this.#e=ie.create(()=>new Float32Array(Yt),e)}clear(e,r){this.#e.forEach(n=>n.fill(0,e,r))}numChannels(){return this.#e.length}getChannel(e){return e<this.numChannels()?this.#e[e]:this.#e[this.numChannels()-1]}assertSanity(){ee(!this.#e.some(e=>e.some(r=>isNaN(r))),"AudioBuffer is invalid (NaN)")}channels(){return this.#e}replace(e){this.replaceInto(e.#e)}replaceInto(e){ee(e.length===2,"mixLayout: target.length must be 2"),ee(this.#e.length===1||this.#e.length===2,"mixLayout: target.length must be 1 or 2"),this.#e.length===1?(e[0].set(this.#e[0]),e[1].set(this.#e[0])):(e[0].set(this.#e[0]),e[1].set(this.#e[1]))}mixInto(e){ee(e.length===2,"mixLayout: target.length must be 2"),ee(this.#e.length===1||this.#e.length===2,"mixLayout: target.length must be 1 or 2");let[r,n]=e;if(this.#e.length===1){let[i]=this.#e;for(let a=0;a<Yt;a++)r[a]+=i[a],n[a]+=i[a]}else{let[i,a]=this.#e;for(let o=0;o<Yt;o++)r[o]+=i[o],n[o]+=a[o]}}}});var XN,QN=H(()=>{"use strict";(function(t){t[t.Idle=0]="Idle",t[t.Attack=1]="Attack",t[t.Decay=2]="Decay",t[t.Sustain=3]="Sustain",t[t.Release=4]="Release"})(XN||(XN={}))});var jg,S_=H(()=>{"use strict";A();(function(t){let e=new Rg;t.count=()=>e.count(),t.create=(r,n,i)=>{let a=n*Float32Array.BYTES_PER_ELEMENT,o=a*i,s=new SharedArrayBuffer(o),c=ie.create(u=>new Float32Array(s,u*a,n),i);return e.add(s),{sampleRate:r,numberOfFrames:n,numberOfChannels:i,frames:c}}})(jg||(jg={}))});var e$,t$=H(()=>{"use strict";(function(t){function e(r,n,i={}){console.time("bpm detection");let{interval:a=64,scanSteps:o=1024,scanSamples:s=2048,minBPM:c=90,maxBPM:u=180}=i,f=new Float32Array(Math.floor(r.length/a)),v=0,m=0,w=0;for(let ke of r){let mt=Math.abs(ke);v+=(mt-v)*(mt>v?1/8:1/512),++m===a&&(m=0,f[w++]=v)}if(!f.length)return NaN;let y=(ke,mt)=>ke[Math.floor(mt)]??0,P=ke=>n/(ke/60)/a,V=ke=>n/(ke*a)*60,O=[-32,-16,-8,-4,-2,-1,1,2,4,8,16,32],C=[-.5,-.25,.25,.5],G=ke=>{let mt=Math.random()*f.length,te=y(f,mt),_e=0,$r=0;for(let Hr of O){let or=1/Math.abs(Hr);_e+=or*Math.abs(y(f,mt+Hr*ke)-te),$r+=or}for(let Hr of C){let or=Math.abs(Hr);_e-=or*Math.abs(y(f,mt+Hr*ke)-te),$r+=or}return _e/$r},Y=ke=>{let mt=0;for(let te=0;te<s;++te)mt+=G(ke);return mt/s},me=P(c),ge=P(u),Ee=(me-ge)/o,he=c,Me=1/0;for(let ke=ge;ke<=me;ke+=Ee){let mt=V(ke),te=Y(ke)*(c/mt);te<Me&&(Me=te,he=mt)}return console.timeEnd("bpm detection"),he}t.detect=e})(e$||(e$={}))});var Mj,r$,Nj,$j,i$,kj,Ij,n$=H(()=>{"use strict";Mj=Math.PI*2,r$=new ArrayBuffer(8),Nj=new Float64Array(r$),$j=new Uint32Array(r$),i$=new ArrayBuffer(8),kj=new Float64Array(i$),Ij=new Uint32Array(i$)});var a$=H(()=>{"use strict"});var o$=H(()=>{"use strict"});var HR,s$,l$=H(()=>{"use strict";HR=Math.log(10)/20,s$=t=>Math.exp(t*HR)});var c$=H(()=>{"use strict"});var u$,d$=H(()=>{"use strict";A();(function(t){t.Major=[0,2,4,5,7,9,11],t.Minor=[0,2,3,5,7,8,10],t.Minor7=[0,3,7,10],t.Minor9=[0,3,7,10,14],t.Dominant7=[0,2,4,5,7,9,10],t.NoteLabels=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],t.compile=(e,r,n,i)=>ie.create(a=>{let o=n+a*2,s=e[o%7]+Math.floor(o/7)*12;return r+s},i),t.toString=e=>t.NoteLabels[e%12]+(Math.floor(e/12)-2)})(u$||(u$={}))});var p$=H(()=>{"use strict"});var f$=H(()=>{"use strict"});var Zp,Gp,go,qr,Yo,Kg,P_=H(()=>{"use strict";A();(function(t){t.Comparator=(e,r)=>e.position-r.position,t.PositionExtractor=e=>e.position})(Zp||(Zp={}));(function(t){t.complete=e=>e.position+e.duration,t.DescendingComparator=(e,r)=>t.complete(r)-t.complete(e)})(Gp||(Gp={}));(function(t){t.globalToLocal=(r,n)=>sl(n-r.position+r.loopOffset,r.loopDuration),t.locateLoop=({position:r,complete:n,loopOffset:i,loopDuration:a},o,s)=>{if(!(a>0))return _.None;let c=r-i,u=c+a;if(c>=s||u<=o)return _.None;let f=Math.max(c,o),v=Math.min(u,s);return _.wrap({index:0,rawStart:c,rawEnd:u,regionStart:Math.max(c,r),regionEnd:Math.min(u,n),resultStart:f,resultEnd:v,resultStartValue:c<f?(f-c)/a:0,resultEndValue:u>v?(v-c)/a:1})};function*e({position:r,complete:n,loopOffset:i,loopDuration:a},o,s){if(!(a>0))return;let c=r-i,u=Math.max(r,o),f=Math.min(n,s),v=Math.floor((u-c)/a),m=c+v*a;for(;m<f;){let w=m+a,y=Math.max(m,r),P=Math.min(w,n),V=Math.max(m,u),O=Math.min(w,f),C=m<V?(V-m)/a:0,G=w>O?(O-m)/a:1;yield{index:v++,rawStart:m,rawEnd:w,regionStart:y,regionEnd:P,resultStart:V,resultEnd:O,resultStartValue:C,resultEndValue:G},m=w}}t.locateLoops=e})(go||(go={}));qr=class t{static DefaultComparator=(e,r)=>e.position-r.position;static create(e){return new t(e??t.DefaultComparator)}#e;constructor(e){this.#e=new Kg(e)}add(e){this.#e.add(e)}remove(e){return this.#e.remove(e)}contains(e){return this.#e.contains(e)}clear(){this.#e.clear()}optAt(e){return this.#e.optAt(e)}asArray(){return this.#e.asArray()}lowerEqual(e,r){return this.#e.lowerEqual(e,r)}greaterEqual(e,r){return this.#e.greaterEqual(e,r)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,r){return this.#e.isEmpty()?mo.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r,n){return this.#e.isEmpty()?mo.empty():this.#e.iterate(this.#e.ceilFirstIndex(e),r,n)}first(){return this.#e.optAt(0)}last(){return this.#e.optAt(this.#e.length()-1)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},Yo=class t{static Comparator=(e,r)=>e.position-r.position;static create(e){return new t(e)}#e;constructor(e=t.Comparator){this.#e=new Kg(e)}add(e){this.#e.add(e)}remove(e){return this.#e.remove(e)}contains(e){return this.#e.contains(e)}clear(){this.#e.clear()}optAt(e){return this.#e.optAt(e)}asArray(){return this.#e.asArray()}lowerEqual(e,r){return this.#e.lowerEqual(e,r)}greaterEqual(e,r){return this.#e.greaterEqual(e,r)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,r){return this.#e.isEmpty()?mo.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r){if(this.#e.isEmpty())return mo.empty();let n=Math.max(0,this.#e.floorLastIndex(e)),i=this.#e.optAt(n);if(i===null)return mo.empty();for(;i.position+i.duration<=e;)if(i=this.#e.optAt(++n),i===null||i.position>=r)return mo.empty();return this.#e.iterate(n,r)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},Kg=class{comparator;#e=[];#t=!1;modCount=0;constructor(e){this.comparator=e}add(e){if(this.#e.includes(e))throw new Error(`Duplicate event added: ${e}`);++this.modCount,this.#e.push(e),this.#e.length>1&&(this.#t=!0)}remove(e){++this.modCount;let r=this.#e.indexOf(e);return r===-1?!1:(this.#e.splice(r,1),!0)}contains(e){if(this.#e.length===0)return!1;this.#t&&this.#r();let n=e.position,i=vt.leftMostMapped(this.#e,n,Hn,Zp.PositionExtractor);for(let a=i;a<this.#e.length;a++){let o=this.#e[a];if(o===e)return!0;if(o.position!==n)return!1}return!1}clear(){++this.modCount,ie.clear(this.#e),this.#t=!1}optAt(e){return e<0||e>=this.#e.length?null:(this.#t&&this.#r(),this.#e[e])}asArray(){return this.#t&&this.#r(),this.#e}lowerEqual(e,r){if(r===void 0)return this.optAt(this.floorLastIndex(e));let n=this.floorLastIndex(e);for(;n>=0;){let i=this.#e[n--];if(r(i))return i}return null}greaterEqual(e,r){if(r===void 0)return this.optAt(this.ceilFirstIndex(e));let n=this.ceilFirstIndex(e);for(;n<this.#e.length;){let i=this.#e[n++];if(r(i))return i}return null}floorLastIndex(e){return this.#t&&this.#r(),vt.rightMostMapped(this.#e,e,Hn,Zp.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),vt.leftMostMapped(this.#e,e,Hn,Zp.PositionExtractor)}iterateFrom(e,r){let n=this.floorLastIndex(e),i=n;if(i<0)return this.iterate(0,Rr.MAX_VALUE,r);for(;i>=0;){let a=this.optAt(i);if(a!==null&&r!==void 0&&r(a))return this.iterate(i,Rr.MAX_VALUE,r);i--}return this.iterate(n,Rr.MAX_VALUE,r)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,r,n=qc.alwaysTrue){for(this.#t&&this.#r();e<this.#e.length;){let i=this.#e[e++];if(i.position>=r)return;n(i)&&(yield i)}}#r(){this.#e.sort(this.comparator),this.#t=!1}}});var Wg,h$=H(()=>{"use strict";A();(function(t){t.hasFading=e=>e.in>0||e.out>0,t.gainAt=(e,r,n)=>{let{in:i,out:a,inSlope:o,outSlope:s}=n,c=1,u=1;i>0&&e<i&&(c=cr.normalizedAt(e/i,o));let f=r-a;if(a>0&&e>f){let v=(e-f)/a;u=1-cr.normalizedAt(v,s)}return Math.min(c,u)},t.fillGainBuffer=(e,r,n,i,a,o)=>{let{in:s,out:c,inSlope:u,outSlope:f}=o;if(e.fill(1,0,a),s<=0&&c<=0)return;let v=i-c;if(r>=s&&n<=v)return;let m=(n-r)/a;if(s>0&&r<s){let w=Math.min(n,s),y=Math.min(a,Math.ceil((w-r)/m));if(y>0){let P=r/s,V=w/s,O=cr.walk(u,y,P,V);for(let C=0;C<y;C++)e[C]=O.next().value}}if(c>0&&n>v){let w=Math.max(r,v),y=Math.max(0,Math.floor((w-r)/m)),P=a-y;if(P>0){let V=(w-v)/c,O=(n-v)/c,C=cr.walk(f,P,1-V,1-O);for(let G=y;G<a;G++)e[G]=Math.min(e[G],C.next().value)}}}})(Wg||(Wg={}))});var Vg,m$=H(()=>{"use strict";Vg=class t{static reverse(e){return e=(e&1431655765)<<1|e>>>1&1431655765,e=(e&858993459)<<2|e>>>2&858993459,e=(e&252645135)<<4|e>>>4&252645135,e=e<<24|(e&65280)<<8|e>>>8&65280|e>>>24,e}#e;#t;#r;#i;constructor(e){this.#e=e;let r=e/2;this.#t=32-Math.floor(Math.log2(e))|0,this.#r=new Float32Array(r),this.#i=new Float32Array(r);for(let n=0;n<r;n++){let i=2*Math.PI*n/e;this.#r[n]=Math.cos(i),this.#i[n]=Math.sin(i)}}process(e,r){let n,i,a,o;for(let u=0;u<this.#e;++u)i=t.reverse(u)>>>this.#t,i>u&&(o=e[u],e[u]=e[i],e[i]=o,o=r[u],r[u]=r[i],r[i]=o);let s=this.#r,c=this.#i;for(let u=2;u<=this.#e;u<<=1){let f=u>>1,v=this.#e/u;for(n=0;n<this.#e;n+=u){let m=n+f;for(i=n,a=0;i<m;i++,a=a+v|0){let w=i+f|0,y=s[a],P=c[a],V=e[w],O=r[w],C=V*y+O*P,G=O*y-V*P,Y=e[i],me=r[i];e[w]=Y-C,r[w]=me-G,e[i]=Y+C,r[i]=me+G}}if(u===this.#e)break}}inverse(e,r){let n=this.#e;for(let a=0;a<n;a++)r[a]=-r[a];this.process(e,r);let i=1/n;for(let a=0;a<n;a++)e[a]*=i,r[a]=-r[a]*i}}});var g$=H(()=>{"use strict"});var Xo,v$=H(()=>{"use strict";Lp();(function(t){t.builder=()=>new e,t.toDouble=([r,n])=>r/n,t.toPPQN=([r,n])=>Ve.fromSignature(r,n);class e{#e=[];add(n){return this.#e.push(n),this}asArray(){return this.#e}asAscendingArray(){return this.#e.toSorted((n,i)=>t.toDouble(n)-t.toDouble(i))}asDescendingArray(){return this.#e.toSorted((n,i)=>t.toDouble(i)-t.toDouble(n))}}})(Xo||(Xo={}))});var x$=H(()=>{"use strict"});var y$=H(()=>{"use strict"});var w$=H(()=>{"use strict"});var b$,Lg,_$=H(()=>{"use strict";A();(function(t){t.Identity={warp:e=>e,unwarp:e=>e}})(b$||(b$={}));Lg=class{#e;constructor(e){this.#e=e}warp(e){return this.#t(!0,e)}unwarp(e){return this.#t(!1,e)}#t(e,r){let n=this.#e.duration(),i=c_(r,n),a=(r-i)/n,o=e?this.#e.fx(a):this.#e.fy(a);return i+o*n}}});var Sa,F$=H(()=>{"use strict";(function(t){t[t.sine=0]="sine",t[t.triangle=1]="triangle",t[t.saw=2]="saw",t[t.square=3]="square"})(Sa||(Sa={}))});var A$=H(()=>{"use strict"});var Xc,M_=H(()=>{"use strict";(function(t){t[t.Linear=0]="Linear",t[t.EqualPower=1]="EqualPower"})(Xc||(Xc={}))});var Qc,E$=H(()=>{"use strict";A();(function(t){t.BlackKeyIndices=[1,3,6,8,10],t.BlackKeyBits=t.BlackKeyIndices.reduce((r,n)=>r|=1<<n,0),t.Names={English:["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"],German:["C","Cis","D","Dis","E","F","Fis","G","Gis","A","Ais","H"],Solfege:["Do","Do#","R\xE9","R\xE9#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],French:["Do","Do#","R\xE9","R\xE9#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],Spanish:["Do","Do#","Re","Re#","Mi","Fa","Fa#","Sol","Sol#","La","La#","Si"],Japanese:["\u30C9","\u30C9\u266F","\u30EC","\u30EC\u266F","\u30DF","\u30D5\u30A1","\u30D5\u30A1\u266F","\u30BD","\u30BD\u266F","\u30E9","\u30E9\u266F","\u30B7"]},t.isBlackKey=r=>(t.BlackKeyBits&1<<r%12)!==0,t.toFullString=r=>`${t.Names.English[r%12]}${Math.floor(r/12)-2}`,t.keyboardTracking=(r,n)=>bg((r-60)*n);class e{#e;#t;constructor(n,...i){this.#e=n,this.#t=i.reduce((a,o)=>a|=1<<o,0)}get name(){return this.#e}get bits(){return this.#t}has(n){return(this.#t&1<<n%12)!==0}equals(n){return this.#t===n.bits}}t.StockScales=[new e("Major",0,2,4,5,7,9,11),new e("Natural Minor",0,2,3,5,7,8,10),new e("Harmonic Minor",0,2,3,5,7,8,11),new e("Melodic Minor",0,2,3,5,7,9,11),new e("Dorian",0,2,3,5,7,9,10),new e("Phrygian",0,1,3,5,7,8,10),new e("Lydian",0,2,4,6,7,9,11),new e("Mixolydian",0,2,4,5,7,9,10),new e("Locrian",0,1,3,5,6,8,10),new e("Pentatonic Major",0,2,4,7,9),new e("Pentatonic Minor",0,3,5,7,10),new e("Blues",0,3,5,6,7,10),new e("Whole Tone",0,2,4,6,8,10),new e("Diminished",0,2,3,5,6,8,9,11),new e("Augmented",0,3,4,7,8,11)]})(Qc||(Qc={}))});var S$=H(()=>{"use strict"});var eu,P$=H(()=>{"use strict";P_();(function(t){t.isOfType=e=>e.type==="note-event",t.Comparator=(e,r)=>{let n=e.position-r.position;if(n!==0)return n;let i=e.pitch-r.pitch;return i!==0?i:0},t.curveFunc=(e,r)=>r<0?e**2**-r:1-(1-e)**2**r,t.inverseCurveFunc=(e,r)=>r<0?e**2**r:1-Math.max(0,1-e)**2**-r,t.CompleteComparator=(e,r)=>{let n=Gp.complete(e)-Gp.complete(r);return n!==0?n:e.pitch-r.pitch}})(eu||(eu={}))});var M$=H(()=>{"use strict"});var N$=H(()=>{"use strict"});var ul,N_=H(()=>{"use strict";A();M_();(function(t){t.zero=()=>({ll:0,lr:0,rl:0,rr:0}),t.identity=()=>({ll:1,lr:0,rl:0,rr:1}),t.update=(e,{gain:r,panning:n,invertL:i,invertR:a,stereo:o,swap:s},c=Xc.EqualPower)=>{let[u,f]=t.panningToGains(n,c),v=u*r,m=f*r;i&&(v*=-1),a&&(m*=-1);let w=Math.max(0,-o),y=Math.max(0,o),P=1-y,V=1+y,O=w*.5,C=1-w,G=(P+V)*.5,Y=(P-V)*.5,me=(P-V)*.5,ge=(P+V)*.5,Ee=v*(O+C)*G+m*O*Y,he=v*(O+C)*me+m*O*ge,Me=v*O*G+m*(O+C)*Y,ke=v*O*me+m*(O+C)*ge;s?(e.ll=he,e.rl=Ee,e.lr=ke,e.rr=Me):(e.ll=Ee,e.lr=Me,e.rl=he,e.rr=ke)},t.panningToGains=(e,r)=>{let n=Se(e,-1,1);switch(r){case Xc.Linear:return[Math.min(1-n,1),Math.min(n+1,1)];case Xc.EqualPower:return[Math.cos((n+1)*l_),Math.sin((n+1)*l_)]}},t.applyFrame=(e,r,n)=>[e.ll*r+e.rl*n,e.lr*r+e.rr*n],t.processFrames=(e,r,n,i,a)=>{let[o,s]=r,[c,u]=n;for(let f=i;f<a;f++){let v=o[f],m=s[f];c[f]=e.ll*v+e.rl*m,u[f]=e.lr*v+e.rr*m}},t.replaceFrames=(e,[r,n],i,a)=>{for(let o=i;o<a;o++){let s=r[o],c=n[o];r[o]=e.ll*s+e.rl*c,n[o]=e.lr*s+e.rr*c}}})(ul||(ul={}))});var $$,k$=H(()=>{"use strict";N_();(function(t){t.linear=(n,i=.005)=>new e(Math.ceil(n*i)|0),t.stereoMatrix=(n,i=.005)=>new r(Math.ceil(n*i)|0);class e{#e;#t=0;#r=0;#i=0;#n=0;constructor(i){this.#e=i}set(i,a){this.#t!==i&&(a===!0?(this.#r=i,this.#i=(i-this.#t)/this.#e,this.#n=this.#e):(this.#t=this.#r=i,this.#i=0,this.#n=0))}get(){return this.#t}moveAndGet(){return 0<this.#n&&(this.#t+=this.#i,--this.#n===0&&(this.#i=0,this.#t=this.#r)),this.#t}isFixed(i){return this.#t===i&&this.#n===0}isInterpolating(){return this.#n>0}}class r{#e;#t=ul.zero();#r=ul.zero();#i=ul.zero();#n=0;constructor(i){this.#e=i}update(i,a,o){ul.update(this.#r,i,a),o===!0?(this.#i.ll=(this.#r.ll-this.#t.ll)/this.#e,this.#i.lr=(this.#r.lr-this.#t.lr)/this.#e,this.#i.rl=(this.#r.rl-this.#t.rl)/this.#e,this.#i.rr=(this.#r.rr-this.#t.rr)/this.#e,this.#n=this.#e):(this.#t.ll=this.#r.ll,this.#t.lr=this.#r.lr,this.#t.rl=this.#r.rl,this.#t.rr=this.#r.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#n=0)}processFrames(i,a,o,s){let[c,u]=i,[f,v]=a;if(this.isInterpolating())for(let m=o;m<s;m++){let w=c[m],y=u[m],P=this.moveAndGet();f[m]=P.ll*w+P.rl*y,v[m]=P.lr*w+P.rr*y}else{let m=this.#r;for(let w=o;w<s;w++){let y=c[w],P=u[w];f[w]=m.ll*y+m.rl*P,v[w]=m.lr*y+m.rr*P}}}set(i,a){this.#a(i)||(a===!0?(this.#r.ll=i.ll,this.#r.lr=i.lr,this.#r.rl=i.rl,this.#r.rr=i.rr,this.#i.ll=(i.ll-this.#t.ll)/this.#e,this.#i.lr=(i.lr-this.#t.lr)/this.#e,this.#i.rl=(i.rl-this.#t.rl)/this.#e,this.#i.rr=(i.rr-this.#t.rr)/this.#e,this.#n=this.#e):(this.#t.ll=this.#r.ll=i.ll,this.#t.lr=this.#r.lr=i.lr,this.#t.rl=this.#r.rl=i.rl,this.#t.rr=this.#r.rr=i.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#n=0))}get(){return this.#t}moveAndGet(){return 0<this.#n&&(this.#t.ll+=this.#i.ll,this.#t.lr+=this.#i.lr,this.#t.rl+=this.#i.rl,this.#t.rr+=this.#i.rr,--this.#n===0&&(this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#t.ll=this.#r.ll,this.#t.lr=this.#r.lr,this.#t.rl=this.#r.rl,this.#t.rr=this.#r.rr)),this.#t}isFixed(i){return this.#a(i)&&this.#n===0}isInterpolating(){return this.#n>0}#a(i){return this.#t.ll===i.ll&&this.#t.lr===i.lr&&this.#t.rl===i.rl&&this.#t.rr===i.rr}}t.StereoMatrixRamp=r})($$||($$={}))});var $_,qR,JR,YR,gK,XR,vK,I$=H(()=>{"use strict";$_=new Float32Array([-.00048076361,0,.00174689293,0,-.00421638042,0,.00854519755,0,-.01627072692,0,.03203375191,0,-.08251235634,0,.31203505397,.5,.31203505397,0,-.08251235634,0,.03203375191,0,-.01627072692,0,.00854519755,0,-.00421638042,0,.00174689293,0,-.00048076361]),qR=new Float32Array(12),JR=new Float32Array(11);for(let t=0,e=0,r=0;t<$_.length;t++)t%2===0?qR[e++]=$_[t]:JR[r++]=$_[t];YR=16,gK=YR-1,XR=32,vK=XR-1});var B$,T$=H(()=>{"use strict";(function(t){t.convert=(e,r,n)=>{if(e.length===0)return new Float32Array(0);if(r===n)return e.slice();let i=r/n,a=Math.max(1,Math.floor(e.length/i)),o=new Float32Array(a);for(let s=0;s<a;s++){let c=s*i,u=Math.floor(c),f=c-u,v=e[u],m=e[Math.min(u+1,e.length-1)];o[s]=v+f*(m-v)}return o},t.calculateOutputLength=(e,r,n)=>{if(e===0)return 0;let i=r/n;return Math.max(1,Math.floor(e/i))}})(B$||(B$={}))});var D$=H(()=>{"use strict"});var R$=H(()=>{"use strict"});var C$=H(()=>{"use strict"});var Zg,z$=H(()=>{"use strict";Zg=class{#e;#t;#r;#i;constructor(e){this.#e=new Float32Array(e),this.#t=1/e,this.#r=0,this.#i=0}pushPop(e){let r=e*e;return this.#i-=this.#e[this.#r],this.#i+=r,this.#e[this.#r]=r,++this.#r===this.#e.length&&(this.#r=0),this.#i<=0?0:Math.sqrt(this.#i*this.#t)}processBlock(e,r,n){let i=this.#e,a=i.length,o=this.#r,s=this.#i;for(let c=r;c<n;c++){let u=e[c]*e[c];s+=u-i[o],i[o]=u,++o===a&&(o=0)}return this.#r=o,this.#i=s,s<=0?0:Math.sqrt(s*this.#t)}clear(){this.#e.fill(0),this.#i=0,this.#r=0}}});var Gg,O$=H(()=>{"use strict";Gg=class t{static#e=.003;static#t=.02;#r;#i;#n=0;constructor(e){this.#r=Math.pow(.01,1/(t.#e*e)),this.#i=Math.pow(.01,1/(t.#t*e))}clear(){this.#n=0}replace(e,r,n){let i=this.#r,a=this.#i,[o,s]=e.channels(),c=this.#n;for(let u=r;u<n;++u){let f=o[u],v=s[u],m=Math.max(Math.abs(f),Math.abs(v));if(c=m>c?i*(c-m)+m:a*(c-m)+m,c>1){let w=1/c;o[u]=f*w,s[u]=v*w}}this.#n=c}}});var V$=H(()=>{"use strict"});var U$=H(()=>{"use strict"});var ui,dl,k_,j$=H(()=>{"use strict";A();(function(t){t.Musical="musical",t.Seconds="seconds"})(ui||(ui={}));(function(t){function e(r,n,i){return new k_(r,n,i)}t.aware=e})(dl||(dl={}));k_=class{#e;#t;#r;constructor(e,r,n){this.#r=n,this.#t=r,this.#e=e}toPPQN(e){let r=this.#r.getValue();if(this.getTimeBase()===ui.Musical)return r;let n=this.#e.ppqnToSeconds(e),i=n+r;return this.#e.intervalToPPQN(n,i)}fromPPQN(e,r){if(this.getTimeBase()===ui.Musical)this.#r.setValue(e);else{let n=this.#e.intervalToSeconds(r,r+e);this.#r.setValue(n)}}toSeconds(e){let r=this.#r.getValue();return this.getTimeBase()===ui.Seconds?r:this.#e.intervalToSeconds(e,e+r)}toSamples(e,r){return this.toSeconds(e)*r}rawValue(){return this.#r.getValue()}getTimeBase(){return fo(this.#t.getValue(),ui)}}});var K$=H(()=>{"use strict"});var W$=H(()=>{"use strict"});var L$=H(()=>{"use strict"});var Z$,G$=H(()=>{"use strict";(function(t){t.SILENCE_RMS=.001,t.STRONG_ATTACK=.6,t.NOISY_HARMONICITY=.4,t.DENSITY_REF=4,t.REGULARITY_INTERVALS=4,t.WEIGHT_BIAS=-4,t.WEIGHT_DENSITY=1.5,t.WEIGHT_STRENGTH=1,t.WEIGHT_INHARMONIC=8,t.WEIGHT_REGULARITY=1;let e=n=>n.length===0?0:n.reduce((i,a)=>i+a,0)/n.length,r=n=>{if(n.length===0)return 0;let i=n.slice().sort((o,s)=>o-s),a=i.length>>1;return i.length%2===1?i[a]:(i[a-1]+i[a])*.5};t.beatRegularity=n=>{if(n.length<3)return 0;let i=n.slice(1).map((c,u)=>c-n[u]),a=e(i);if(a<=0)return 0;let o=e(i.map(c=>(c-a)**2));return Math.min(1,i.length/t.REGULARITY_INTERVALS)/(1+Math.sqrt(o)/a)},t.rmsOf=n=>{let{frames:i,numberOfFrames:a,numberOfChannels:o}=n;if(a===0||o===0)return 0;let s=0;for(let c=0;c<o;c++){let u=i[c];for(let f=0;f<a;f++)s+=u[f]**2}return Math.sqrt(s/(a*o))},t.drumLoopProbability=n=>{let i=Math.min(1,n.onsetsPerSecond/t.DENSITY_REF),a=t.WEIGHT_BIAS+t.WEIGHT_DENSITY*i+t.WEIGHT_STRENGTH*n.strengthMedian+t.WEIGHT_INHARMONIC*(1-n.harmonicityMedian)+t.WEIGHT_REGULARITY*n.beatRegularity;return 1/(1+Math.exp(-a))},t.aggregate=(n,i,a,o)=>{let s=n.filter(m=>m.rms>=t.SILENCE_RMS),c=s.map(m=>m.strength),u=s.map(m=>m.harmonicity),f=s.length,v={durationSeconds:i,onsetCount:n.length,onsetsPerSecond:i>0?n.length/i:0,strengthMean:e(c),strengthMedian:r(c),harmonicityMean:e(u),harmonicityMedian:r(u),pitchedFraction:f===0?0:s.filter(m=>m.period>0).length/f,percussiveFraction:f===0?0:s.filter(m=>m.strength>=t.STRONG_ATTACK&&m.harmonicity<=t.NOISY_HARMONICITY).length/f,beatRegularity:t.beatRegularity(n.map(m=>m.position)),rms:a,analyzerVersion:o};return{...v,drumLoopProbability:t.drumLoopProbability(v)}}})(Z$||(Z$={}))});var H$,q$=H(()=>{"use strict";Lp();H$=Ve.fromSignature(1,384)});var Jr,Hg,J$=H(()=>{"use strict";A();Jr={None:{type:"none"},Linear:{type:"linear"},Curve:t=>t===.5?Jr.Linear:{type:"curve",slope:t}};(function(t){t.Comparator=(i,a)=>{let o=i.position-a.position;if(o!==0)return o;let s=i.index-a.index;return s!==0?s:i===a?0:W(`${i} and ${a} are identical in terms of comparison`)};function*e(i,a,o){if(i.isEmpty())return ur.empty();for(let s of i.iterateFrom(a))if(yield s,s.position>=o)return}t.iterateWindow=e,t.nextEvent=(i,a)=>{let o=i.asArray(),s=vt.rightMost(o,a,t.Comparator);return s===-1?null:o[s+1]??null},t.valueAt=(i,a,o)=>{if(i.isEmpty())return o;let s=i.iterateFrom(a),{done:c,value:u}=s.next();if(c)return o;if(u.position<=a){let{done:f,value:v}=s.next();if(f)return u.value;if(a<v.position)return n(u,v,a);if(u.interpolation===Jr.None)return u.value}return u.value};function*r(i,a,o,s){if(i.isEmpty())return;let c=i.iterateFrom(a),{done:u,value:f}=c.next();if(u)return;let v=o/s,m=f;if(m.position>a){for(;a<m.position;)if(yield{position:a,value:m.value},a+=v,a>o)return;m.position<=o&&(yield m)}for(;a<=o;){let{done:w,value:y}=c.next();if(w)break;for(;a<y.position;){if(a>o)return;yield{position:a,value:n(m,y,a)},a+=v}y.position<o&&(m.interpolation===Jr.None&&(yield{position:y.position,value:m.value}),yield y),m=y}for(;a<=o;)yield{position:a,value:m.value},a+=v}t.quantise=r;let n=({value:i,position:a,interpolation:o},s,c)=>o.type==="none"?i:o.type==="linear"?i+(c-a)/(s.position-a)*(s.value-i):o.type==="curve"?cr.valueAt({slope:o.slope,steps:s.position-a,y0:i,y1:s.value},c-a):W("Unknown interpolation")})(Hg||(Hg={}))});var Y$,X$=H(()=>{"use strict";A();S_();(function(t){t.decodeFloats=a=>{let o=new DataView(a);if(o.getUint32(0,!0)!==1179011410||o.getUint32(8,!0)!==1163280727)return W("Not a RIFF/WAVE file");let s=-1,c=-1,u=0;for(let C=12;C+8<=o.byteLength;){let G=o.getUint32(C,!0),Y=o.getUint32(C+4,!0),me=C+8+(Y+1&-2);G===544501094&&(s=C+8),G===1635017060&&(c=C+8,u=Y),C=me}if(s<0||c<0)return W("Missing fmt or data chunk");let f=o.getUint16(s,!0),v=o.getUint16(s+2,!0),m=o.getUint32(s+4,!0),w=o.getUint16(s+12,!0),y=o.getUint16(s+14,!0),P=y/8;if(w!==v*P)return W("Invalid block alignment");let V=Math.floor(u/w),O=jg.create(m,V,v);if(f===3&&y===32){let C=new Float32Array(a,c,V*v);for(let G=0,Y=0;G<V;G++)for(let me=0;me<v;me++)O.frames[me][G]=C[Y++]}else if(f===1&&y===16)for(let C=0,G=c;C<V;C++)for(let Y=0;Y<v;Y++)O.frames[Y][C]=o.getInt16(G,!0)/32768,G+=2;else if(f===1&&y===24)for(let C=0,G=c;C<V;C++)for(let Y=0;Y<v;Y++){let me=o.getUint16(G,!0),ge=o.getInt8(G+2);O.frames[Y][C]=(ge*65536+me)/8388608,G+=3}else return W(`Unsupported WAV format: ${f}, ${y}-bit`);return O},t.encodeInts16=(a,o=Number.MAX_SAFE_INTEGER)=>{let c=a.sampleRate,u,f,v;"getChannelData"in a?(v=ie.create(O=>a.getChannelData(O),a.numberOfChannels),u=a.length,f=a.numberOfChannels):(v=a.frames,u=a.numberOfFrames,f=a.frames.length),u=Math.min(o,u);let m=u*f*2,w=44+m,y=new ArrayBuffer(w),P=new DataView(y);P.setUint32(0,1179011410,!0),P.setUint32(4,w-8,!0),P.setUint32(8,1163280727,!0),P.setUint32(12,544501094,!0),P.setUint32(16,16,!0),P.setUint16(20,1,!0),P.setUint16(22,f,!0),P.setUint32(24,c,!0),P.setUint32(28,c*f*2,!0),P.setUint16(32,f*2,!0),P.setUint16(34,16,!0),P.setUint32(36,1635017060,!0),P.setUint32(40,m,!0);let V=44;for(let O=0;O<u;++O)for(let C=0;C<f;++C){let G=v[C][O],Y=G<-1?-1:G>1?1:G;P.setInt16(V,Math.round(Y*32767),!0),V+=2}return P.buffer},t.encodeFloats=(a,o=Number.MAX_SAFE_INTEGER)=>{let s=Float32Array.BYTES_PER_ELEMENT,c=a.sampleRate,u,f,v;"getChannelData"in a?(v=ie.create(V=>a.getChannelData(V),a.numberOfChannels),u=a.length,f=a.numberOfChannels):(v=a.frames,u=a.numberOfFrames,f=a.frames.length),u=Math.min(o,u);let m=44+u*f*s,w=new ArrayBuffer(m),y=new DataView(w);y.setUint32(0,1179011410,!0),y.setUint32(4,m-8,!0),y.setUint32(8,1163280727,!0),y.setUint32(12,544501094,!0),y.setUint32(16,16,!0),y.setUint16(20,3,!0),y.setUint16(22,f,!0),y.setUint32(24,c,!0),y.setUint32(28,c*f*s,!0),y.setUint16(32,f*s,!0),y.setUint16(34,8*s,!0),y.setUint32(36,1635017060,!0),y.setUint32(40,f*u*s,!0);let P=44;for(let V=0;V<u;++V)for(let O=0;O<f;++O)y.setFloat32(P,v[O][V],!0),P+=s;return y.buffer}})(Y$||(Y$={}))});var Q$,ek=H(()=>{"use strict";A();(function(t){t.Equations=["hardclip","cubicSoft","tanh","sigmoid","arctan","asymmetric"],t.apply=(e,r)=>{switch(r){case"hardclip":return e<-1?-1:e>1?1:e;case"cubicSoft":{let n=e<-1?-1:e>1?1:e;return(3*n-n*n*n)*.5}case"tanh":return Math.tanh(e);case"sigmoid":return Math.sign(e)*(1-Math.exp(-Math.abs(e)));case"arctan":return 2/Math.PI*Math.atan(e);case"asymmetric":if(e>=0)return e/(1+e);if(e>=-2/3)return e;if(e>=-1){let n=3*(e+1);return n*n*(2-n)/3-1}return-1;default:return Aa(r)}},t.process=(e,r,n,i)=>{let[a,o]=e,{sign:s,exp:c,abs:u,atan:f,tanh:v,PI:m}=Math,w=2/m;switch(r){case"hardclip":for(let y=n;y<i;y++)a[y]=a[y]<-1?-1:a[y]>1?1:a[y],o[y]=o[y]<-1?-1:o[y]>1?1:o[y];return;case"cubicSoft":for(let y=n;y<i;y++){let P=a[y]<-1?-1:a[y]>1?1:a[y],V=o[y]<-1?-1:o[y]>1?1:o[y];a[y]=(3*P-P*P*P)*.5,o[y]=(3*V-V*V*V)*.5}return;case"tanh":for(let y=n;y<i;y++)a[y]=v(a[y]),o[y]=v(o[y]);return;case"sigmoid":for(let y=n;y<i;y++)a[y]=s(a[y])*(1-c(-u(a[y]))),o[y]=s(o[y])*(1-c(-u(o[y])));return;case"arctan":for(let y=n;y<i;y++)a[y]=w*f(a[y]),o[y]=w*f(o[y]);return;case"asymmetric":for(let y=n;y<i;y++){if(a[y]>=0)a[y]=a[y]/(1+a[y]);else if(a[y]<-1)a[y]=-1;else if(a[y]<-2/3){let P=3*(a[y]+1);a[y]=P*P*(2-P)/3-1}if(o[y]>=0)o[y]=o[y]/(1+o[y]);else if(o[y]<-1)o[y]=-1;else if(o[y]<-2/3){let P=3*(o[y]+1);o[y]=P*P*(2-P)/3-1}}return;default:return Aa(r)}}})(Q$||(Q$={}))});var Wp,tk=H(()=>{"use strict";(function(t){let e;(function(r){r[r.Bartlett=0]="Bartlett",r[r.Blackman=1]="Blackman",r[r.BlackmanHarris=2]="BlackmanHarris",r[r.Hamming=3]="Hamming",r[r.Hanning=4]="Hanning"})(e=t.Type||(t.Type={})),t.create=(r,n)=>{let i=new Float32Array(n),a=Math.PI/(n-1);switch(r){case e.Bartlett:{let o=(n>>1)-1,s=0;for(;s<=o;++s)i[s]=2*s/(n-1);for(;s<n;++s)i[s]=2-2*s/(n-1);return i}case e.Blackman:{let o=2*a,s=4*a;for(let c=0;c<n;++c)i[c]=.42323-.49755*Math.cos(o*c)+.07922*Math.cos(s*c);return i}case e.BlackmanHarris:{let o=2*a,s=4*a,c=6*a;for(let u=0;u<n;++u)i[u]=.35875-.48829*Math.cos(o*u)+.14128*Math.cos(s*u)-.01168*Math.cos(c*u);return i}case e.Hamming:{let o=2*a;for(let s=0;s<n;++s)i[s]=.54-.46*Math.cos(o*s);return i}case e.Hanning:{let o=2*a;for(let s=0;s<n;++s)i[s]=.5-.5*Math.cos(o*s);return i}}}})(Wp||(Wp={}))});var qg,rt=H(()=>{"use strict";ZN();YN();QN();S_();t$();n$();a$();o$();c$();d$();E_();p$();f$();P_();h$();m$();g$();v$();x$();y$();w$();_$();A$();M_();E$();S$();P$();M$();Lp();N$();k$();I$();T$();D$();R$();C$();z$();O$();V$();U$();j$();K$();W$();L$();G$();N_();q$();l$();J$();X$();ek();tk();F$();qg=Symbol.for("@openDAW/lib-dsp");globalThis[qg]?console.debug(`%c${qg.description}%c is already available in ${globalThis.constructor.name}.`,"color: hsl(10, 83%, 60%)","color: inherit"):(globalThis[qg]=!0,console.debug(`%c${qg.description}%c is now available in ${globalThis.constructor.name}.`,"color: hsl(200, 83%, 60%)","color: inherit"))});var BD={};_a(BD,{PeakBroadcaster:()=>FM});var FM,TD=H(()=>{"use strict";A();rt();FM=class t{static PEAK_DECAY=Math.exp(-1/(sampleRate*.25));static RMS_WINDOW=Math.floor(sampleRate*.3);#e;#t;#r;#i;#n;#a=0;#s=0;#o=0;#c=0;constructor(e,r){this.#e=e,this.#t=r,this.#r=new Float32Array(4),this.#i=ie.create(()=>new Zg(t.RMS_WINDOW),2),this.#n=this.#e.broadcastFloats(this.#t,this.#r,n=>{this.#r[0]=this.#a,this.#r[1]=this.#s,this.#r[2]=this.#o,this.#r[3]=this.#c})}clear(){this.#i[0].clear(),this.#i[1].clear(),this.#a=0,this.#s=0}process(e,r,n=0,i=Yt){let a=i-n,o=t.PEAK_DECAY**a,s=0,c=0;for(let u=n;u<i;u++){let f=Math.abs(e[u]),v=Math.abs(r[u]);f>s&&(s=f),v>c&&(c=v)}this.#a=Math.max(s,this.#a*o),this.#s=Math.max(c,this.#s*o),this.#o=this.#i[0].processBlock(e,n,i),this.#c=this.#i[1].processBlock(r,n,i)}processStereo([e,r],n=0,i=Yt){this.process(e,r,n,i)}terminate(){this.#n.terminate()}}});A();A();var Jo;(function(t){class e{value;constructor(s){this.value=s}}t.Transfer=e,t.makeTransferable=o=>new e(o),t.sender=(o,s)=>s(new i(o)),t.executor=(o,s)=>new a(o,s);let r=o=>{let s=[];for(let c of o)c instanceof e?s.push(c.value):(c instanceof MessagePort||typeof ImageBitmap<"u"&&c instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&c instanceof OffscreenCanvas)&&s.push(c);return s},n=o=>o instanceof e?o.value:o;class i{#e;#t=new Map;#r;#i=0;constructor(s){this.#e=s,this.#r=s.subscribe(this.#n)}terminate(){this.#r.terminate()}dispatchAndForget=(s,...c)=>{let u=r(c);this.#e.send({type:"send",returnId:!1,func:s.name,args:Array.from(ur.map(c,f=>({value:n(f)})))},u)};dispatchAndReturn=(s,...c)=>new Promise((u,f)=>{let v=ur.reduce(c,(w,y,P)=>(typeof y=="function"&&w.push([P,y]),w),[]);this.#t.set(this.#i,{executorTuple:{resolve:u,reject:f},callbacks:new Map(v)});let m=r(c);this.#e.send({type:"send",returnId:this.#i,func:s.name,args:Array.from(ur.map(c,(w,y)=>typeof w=="function"?{callback:y}:{value:n(w)}))},m),this.#i++});#n=s=>{let c=this.#t.get(s.returnId);K(c)?s.type==="resolve"?(c.executorTuple.resolve(s.resolve),this.#t.delete(s.returnId)):s.type==="reject"?(c.executorTuple.reject(s.reject),this.#t.delete(s.returnId)):s.type==="callback"&&c.callbacks?.get(s.funcAt).apply(this,s.args):W(`Promise has already been resolved. ${JSON.stringify(s)}`)}}class a{#e;#t;#r;constructor(s,c){this.#e=s,this.#t=c,this.#r=s.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=s=>{ee(s.type==="send",()=>"Message type must be 'send'");let c=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),u=He(c[s.func],`${s.func.toString()} does not exists on ${this.#t}`),f=s.returnId;if(f===!1)u.apply(this.#t,s.args.map(v=>"value"in v?v.value:W(`${s.func.toString()} has no promise.`)));else try{u.apply(this.#t,s.args.map(m=>"callback"in m?(...w)=>this.#s(f,m.callback,w):m.value)).then(m=>{try{this.#n(f,m)}catch(w){this.#a(f,w)}},m=>this.#a(f,m))}catch(v){this.#a(f,v)}};#n=(s,c)=>this.#e.send({type:"resolve",returnId:s,resolve:c});#a=(s,c)=>this.#e.send({type:"reject",returnId:s,reject:c});#s=(s,c,u)=>this.#e.send({type:"callback",returnId:s,funcAt:c,args:u})}t.Executor=a})(Jo||(Jo={}));A();var __={for:t=>new w_(t)},WR=[],w_=class{#e;#t=new xe;constructor(e){if(this.#e=e,K(e.onmessage)||K(e.onmessageerror))throw console.error(e),new Error(`${e} is already wrapped.`);e.onmessage=r=>this.#t.notify(r.data),e.onmessageerror=r=>{throw new Error(r.type)}}send(e,r){this.#e.postMessage(e,r??WR)}channel(e){return new b_(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},b_=class t{#e;#t;#r=new xe;#i;constructor(e,r){this.#e=e,this.#t=r,this.#i=e.subscribe(n=>{K(n)&&n.__id__==="42"&&n.channel===r&&this.#r.notify(n.message)})}send(e,r){this.#e.send({__id__:"42",channel:this.#t,message:e},r)}channel(e){return new t(this,e)}subscribe(e){return this.#r.subscribe(e)}terminate(){this.#i.terminate(),this.#r.terminate()}};A();A();var cl;(function(t){t.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),t.frames=e=>new Promise(r=>{let n=e,i=()=>{--n<=0?r():requestAnimationFrame(i)};requestAnimationFrame(i)}),t.timeSpan=(e,...r)=>new Promise(n=>setTimeout(n,e.millis(),...r)),t.event=(e,r)=>new Promise(n=>e.addEventListener(r,n,{once:!0})),t.observable=e=>new Promise(r=>{let n=e.subscribe(()=>{n.terminate(),r()})}),t.complete=e=>new Promise((r,n)=>{let i=setInterval(()=>{let{status:a,value:o,error:s}=sr(()=>e.next());if(a==="success"){let{done:c,value:u}=o;c&&(clearInterval(i),r(u))}else clearInterval(i),n(s)},0)})})(cl||(cl={}));var F_=class{maxRetry;timeSpan;#e=0;constructor(e,r){this.maxRetry=e,this.timeSpan=r}retry(e,r){return++this.#e===this.maxRetry?!1:(console.debug(`${e} > will retry in ${this.timeSpan.toString()}`),setTimeout(r,this.timeSpan.millis()),!0)}},zg;(function(t){class e{value;status="resolved";constructor(s){this.value=s}error=Op("Cannot access error when promise is resolved")}t.ResolveResult=e;class r{error;status="rejected";constructor(s){this.error=s}value=Op("Cannot access value when promise is rejected")}t.RejectedResult=r,t.makeAbortable=async(o,s)=>{let c=!0;return o.own(ve.create(()=>c=!1)),new Promise((u,f)=>s.then(v=>{c&&u(v)},v=>{c&&f(v)}))},t.tryCatch=o=>o.then(s=>new e(s),s=>new r(s));let n=new F_(3,ll.seconds(3));t.retry=(o,s=n)=>o().catch(c=>new Promise((u,f)=>{let v=m=>{s.retry(m,()=>o().then(w=>u(w),v))||f(m)};v(c)})),t.guardedRetry=(o,s)=>{let c=async(u=0)=>{try{return await o()}catch(f){if(s(f,++u))return console.debug(`retry after failure (online: ${navigator.onLine}):`,f),await cl.timeSpan(ll.seconds(1)),c(u);throw new Error(`Failed after ${u} retries: ${f}`)}};return c()},t.approvedRetry=(o,s)=>{let c=async()=>{try{return await o()}catch(u){if(await Yc.approve(s(u)))return c();throw u}};return c()},t.delay=(o,s)=>Promise.all([o,cl.timeSpan(s)]).then(([c])=>c),t.fail=(o,s="fail")=>Promise.reject(s),t.timeout=(o,s,c)=>new Promise((u,f)=>{let v=!0,m=setTimeout(()=>{v=!1,f(new Error(c??"timeout"))},s.millis());o.then(w=>{v&&u(w)},w=>{v&&f(w)}).finally(()=>clearTimeout(m))}),t.sequentialAll=o=>o.reduce((s,c)=>s.then(async u=>[...u,await c()]),Promise.resolve([])),t.sequentialize=o=>{let s=Promise.resolve();return c=>{let u=()=>o(c),f=s.then(u,u);return s=f.catch(()=>{}),f}},t.memoizeAsync=(o,s)=>{let c=null,u=Date.now();return()=>{let f=Date.now();return(cn(c)||K(s)&&f-u>s.millis())&&(u=f,c=o(),c.catch(v=>(c=null,v))),c}},t.allWithLimit=async(o,s=1)=>{let c=new Array(o.length),u=0,f=!1,v=async()=>{for(;u<o.length&&!f;){let m=u++;try{let w=await o[m]();f||(c[m]=w)}catch(w){throw f=!0,w}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},v)),c},t.allSettledWithLimit=async(o,s=1)=>{let c=new Array(o.length),u=0,f=async()=>{for(;u<o.length;){let v=u++;try{let m=await o[v]();c[v]={status:"fulfilled",value:m}}catch(m){c[v]={status:"rejected",reason:m}}}};return await Promise.all(Array.from({length:Math.min(s,o.length)},f)),c};class i{max;#e;#t=0;constructor(s=1){this.max=s,this.#e=[]}async add(s){if(this.#t<this.max)return this.#t++,s().finally(()=>this.#r());{let c=Promise.withResolvers();return this.#e.push([s,c]),c.promise.finally(()=>this.#r())}}#r(){if(ee(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[s,{resolve:c,reject:u}]=this.#e.shift();this.#t++,s().then(c,u)}}}t.Limit=i;class a{#e;#t;#r;#i=_.None;constructor(s,c,u){this.#e=s,this.#t=c,this.#r=u}update(s){this.#i=_.wrap(s),s.then(c=>{this.#i.contains(s)&&this.#e(c)}).catch(c=>{this.#i.contains(s)&&this.#t(c)}).finally(()=>{this.#i.contains(s)&&(this.terminate(),$(this.#r))})}terminate(){this.#i=_.None}}t.Latest=a})(zg||(zg={}));rt();A();var ze=class t{static newSet(e){return new Jc(e,t.Comparator)}static compose=(e,...r)=>{let n=r.length===0?this.#e:new Int16Array(r);return ee(n.every((i,a)=>i===r[a]),`fieldKeys (${n.join(",")}) only allows i16`),new t(e,n)};static decode(e){let r=e.split("/");return ee(r.length>0,"Unable to parse Address"),t.compose(k.parse(r[0]),...r.slice(1).map(n=>parseInt(n)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,r,n){let i=e.values(),a=vt.leftMostMapped(i,r,k.Comparator,n),o=i.length;if(a<0||a>=o)return null;for(let s=a;s<o;s++)if(k.Comparator(n(i[s]),r)!==0)return a<s?[a,s]:null;return[a,o]}static Comparator=(e,r)=>{let n=k.Comparator(e.#t,r.#t);if(n!==0)return n;let i=Math.min(e.#r.length,r.#r.length);for(let a=0;a<i;a++){let o=e.#r[a]-r.#r[a];if(o!==0)return o}return e.#r.length-r.#r.length};static MinimalComparator=(e,r)=>{let n=k.Comparator(e.#t,r.#t);if(n!==0)return n;let i=Math.min(e.#r.length,r.#r.length);for(let a=0;a<i;a++){let o=e.#r[a]-r.#r[a];if(o!==0)return o}return 0};static LengthComparator=(e,r)=>{let n=k.Comparator(e.#t,r.#t);return n!==0?n:r.#r.length-e.#r.length};static#e=new Int16Array(0);#t;#r;constructor(e,r){this.#t=e,this.#r=r}get uuid(){return this.#t}get fieldKeys(){return this.#r}isBox(){return this.#r.length===0}isContent(){return!this.isBox()}equals(e){return t.Comparator(this,e)===0}compareTo(e){return t.Comparator(this,e)}append(e){return new t(this.#t,new Int16Array([...this.#r,e]))}startsWith(e){return k.Comparator(e.#t,this.#t)===0&&e.#r.length<=this.#r.length&&e.#r.every((r,n)=>this.#r[n]===r)}write(e){e.writeBytes(new Int8Array(this.#t.buffer)),e.writeByte(this.#r.length),this.#r.forEach(r=>e.writeShort(r))}moveTo(e){return new t(e,this.#r)}decompose(){return[this.#t,this.#r]}toJSON(){return{uuid:Array.from(this.#t.values()),fields:Array.from(this.#r.values())}}toArrayBuffer(){let e=new Uint8Array(k.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,k.length),e.buffer}toString(){return[k.toString(this.#t),...this.#r].join("/")}static read(e){let r=k.fromDataInput(e),n=e.readByte();return t.compose(r,...ie.create(()=>e.readShort(),n))}},pl;(function(t){t.AddressReader=e=>e.address,t.Comparator=({address:e},{address:r})=>ze.Comparator(e,r),t.equals=(e,r)=>{let[n,i]=vt.rangeMapped(r,e,ze.Comparator,t.AddressReader);return r.slice(n,i+1)},t.startsWith=(e,r)=>{let[n,i]=vt.rangeMapped(r,e,ze.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>a.address.startsWith(e))},t.endsWith=(e,r)=>{let n=vt.leftMostMapped(r,e,ze.LengthComparator,t.AddressReader),i=vt.rightMostMapped(r,e,ze.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>e.startsWith(a.address))}})(pl||(pl={}));A();A();var Pa=class t{static validate(e,r){if(e.address.equals(r.address))return _.wrap(`PointerField cannot point to itself: ${e}`);if(!r.pointerRules.accepts.some(n=>n===e.pointerType)){let n=r.pointerRules.accepts.join(", ");return _.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${n}).`)}return _.None}#e;#t;constructor(e){this.#e=e,this.#t=new dr}subscribe(e,...r){return this.#r(this.#t,e,r)}catchupAndSubscribe(e,...r){let n=ze.newSet(i=>i.address);return n.addMany(this.filter(...r)),n.forEach(i=>e.onAdded(i)),this.subscribe({onAdded:i=>{n.add(i)&&e.onAdded(i)},onRemoved:i=>{jM(n.removeByKeyIfExist(i.address))&&e.onRemoved(i)}},...r)}filter(...e){return e.length===0?this.incoming():ur.filter(this.incoming().values(),r=>e.some(n=>n===r.pointerType))}size(){return this.incoming().length}isEmpty(){return this.size()===0}nonEmpty(){return this.size()>0}contains(e){return this.incoming().some(r=>e.address.equals(r.address))}incoming(){return this.#e.graph.edges().incomingEdgesOf(this.#e).slice()}onAdded(e){let r=t.validate(e,this.#e);if(r.nonEmpty())return W(r.unwrap());this.#t.proxy.onAdded(e)}onRemoved(e){this.#t.proxy.onRemoved(e)}toString(){return`{Pointers ${this.#e.address}, pointers: ${this.incoming().values().map(e=>e.toString())}}`}#r(e,r,n){return e.subscribe({onAdded:i=>{(n.length===0||n.some(a=>a===i.pointerType))&&r.onAdded(i)},onRemoved:i=>{(n.length===0||n.some(a=>a===i.pointerType))&&r.onRemoved(i)}})}};var I_=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},tu=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Z=class t{static hook(e){return new t(e)}#e;#t;#r;#i;#n;constructor({parent:e,fieldKey:r,fieldName:n,pointerRules:i,deprecated:a}){this.#e=e,this.#t=r,this.#r=n,this.#i=i,this.#n=a,(i.mandatory||i.exclusive)&&this.graph.edges().watchVertex(this)}accept(e){return $(e.visitField,this)}get box(){return this.#e.box}get graph(){return this.#e.graph}get parent(){return this.#e}get fieldKey(){return this.#t}get fieldName(){return this.#r}get pointerRules(){return this.#i}get deprecated(){return this.#n}get pointerHub(){return new Pa(this)}get address(){return this.#e.address.append(this.#t)}get debugPath(){return`${this.box.name}:${this.box.mapFields(e=>e.fieldName,...this.address.fieldKeys).join("/")}`}isBox(){return!1}isField(){return!0}isAttached(){return this.graph.findBox(this.address.uuid).nonEmpty()}fields(){return ie.empty()}record(){return kg.empty()}getField(e){return W()}optField(e){return _.None}read(e){}write(e){}toJSON(){}fromJSON(e){return W("fromJSON should never be called on a field")}disconnect(){if(this.pointerHub.isEmpty())return;let e=this.pointerHub.incoming();e.forEach(r=>{r.defer(),(r.mandatory||this.pointerRules.mandatory&&e.length===1)&&(console.warn(`[Field.disconnect] Deleting ${r.box} because pointer.mandatory=${r.mandatory} or (field.mandatory=${this.pointerRules.mandatory} and lastPointer=${e.length===1})`),r.box.delete())})}toString(){return`{${this.box.constructor.name}:${this.constructor.name} (${this.fieldName}) ${this.address.toString()}`}};I_([Zc,tu("design:type",Pa),tu("design:paramtypes",[])],Z.prototype,"pointerHub",null);I_([Zc,tu("design:type",ze),tu("design:paramtypes",[])],Z.prototype,"address",null);I_([Zc,tu("design:type",String),tu("design:paramtypes",[])],Z.prototype,"debugPath",null);A();var p=Object.freeze({mandatory:!1,exclusive:!1,accepts:[]});var qn=class t extends Z{static create(e,r,n){return new t(e,r,n)}#e;constructor(e,r,n){super(e),this.#e=ie.create(i=>r({parent:this,fieldKey:i,fieldName:String(i),pointerRules:p,deprecated:e.deprecated}),n)}accept(e){return $(e.visitArrayField,this)}fields(){return this.#e}record(){return ie.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return He(this.#e[e])}optField(e){return _.wrap(this.#e[e])}read(e){this.#e.forEach(r=>r.read(e))}write(e){this.#e.filter(r=>!r.deprecated).forEach(r=>r.write(e))}size(){return this.#e.length}toJSON(){if(!this.deprecated)return Object.values(this.#e).map(e=>e.toJSON()??null)}fromJSON(e){if(!this.deprecated)if(Array.isArray(e))e.forEach((r,n)=>this.#e[n].fromJSON(r));else return W("Type mismatch")}};A();A();var Qo;(function(t){t.writeFields=(r,n)=>{let i=Object.entries(n).filter(([a,o])=>!o.deprecated);r.writeInt(1179403347),r.writeShort(i.length),i.forEach(([a,o])=>{let s=Gt.create();o.write(s);let c=new Int8Array(s.toArrayBuffer());r.writeShort(Number(a)),r.writeInt(c.length),r.writeBytes(c)})},t.readFields=(r,n)=>{ee(r.readInt()===1179403347,"Serializer header is corrupt");let i=r.readShort();for(let a=0;a<i;a++){let o=r.readShort();if(xg(n[o]))continue;let s=r.readInt(),c=new Int8Array(s);r.readBytes(c);let{status:u,error:f}=sr(()=>n[o]?.read(new lt(c.buffer)));u==="failure"&&console.warn(n,f)}}})(Qo||(Qo={}));var QR=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},rk=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},D=class t{static DEBUG_DELETION=!1;static Index=0;#e;#t;#r;#i;#n;#a;#s;#o=t.Index++;constructor({uuid:e,graph:r,name:n,pointerRules:i,resource:a,ephemeral:o}){this.#e=ze.compose(e),this.#t=r,this.#r=n,this.#i=i,this.#n=a,this.#a=o===!0,this.#s=this.initializeFields(),(i.mandatory||i.exclusive)&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#s)}record(){return this.#s}getField(e){return He(this.#s[e],()=>`Field ${String(e)} not found in ${this.toString()}`)}optField(e){return _.wrap(this.#s[e])}subscribe(e,r){return this.graph.subscribeVertexUpdates(e,this.address,r)}subscribeDeletion(e){return this.graph.subscribeDeletion(this.address.uuid,e)}get box(){return this}get name(){return this.#r}get graph(){return this.#t}get parent(){return this}get address(){return this.#e}get pointerRules(){return this.#i}get resource(){return this.#n}get ephemeral(){return this.#a}get creationIndex(){return this.#o}get pointerHub(){return new Pa(this)}estimateMemory(){let e=new Lc;return this.write(e),e.count}isBox(){return!0}asBox(e){return je(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){Qo.readFields(e,this.#s)}write(e){Qo.writeFields(e,this.#s)}serialize(){let e=Gt.create();return e.writeInt(this.#o),e.writeString(this.name),e.writeBytes(new Int8Array(this.address.uuid.buffer)),this.write(e),e.toArrayBuffer()}toArrayBuffer(){let e=Gt.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#s).reduce((e,[r,n])=>{let i=n.toJSON();return K(i)&&(e[r]=i),e},{})}fromJSON(e){if(nl(e))Object.entries(e).forEach(([r,n])=>{let i=this.#s[parseInt(r)];K(n)&&i.fromJSON(n)});else return W("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...r){if(r.length===0)return ie.empty();let n=this.getField(r[0]),i=[e(n)];for(let a=1;a<r.length;a++)n=n.getField(r[a]),i.push(e(n));return i}searchVertex(e){if(e.length===0)return _.wrap(this);let r=this.optField(e[0]);if(r.isEmpty())return _.None;for(let n=1;n<e.length;n++)if(r=r.unwrap().optField(e[n]),r.isEmpty())return _.None;return r}delete(){if(!this.isAttached())return;let{boxes:e,pointers:r}=this.graph.dependenciesOf(this);t.DEBUG_DELETION&&(console.debug(`Delete ${this.toString()}`),console.debug(" unplugs",[...r].map(n=>n.toString()).join(`
4
4
  `)),console.debug(" unstages",[...e].map(n=>n.toString()).join(`
5
- `),this));for(let n of r)n.defer();for(let n of e)n.unstage();this.unstage()}unstage(){this.graph.unstageBox(this)}isValid(){if(this.#i.mandatory&&this.pointerHub.incoming().length===0)return!1;let e=r=>r.every(n=>n.accept({visitPointerField:i=>!i.mandatory||i.nonEmpty(),visitArrayField:i=>e(i.fields()),visitObjectField:i=>e(i.fields()),visitPrimitiveField:i=>!0,visitField:i=>!0})??!0);return e(this.fields())}toString(){return`${this.constructor.name} ${this.address.toString()}`}};QR([Zc,rk("design:type",Pa),rk("design:paramtypes",[])],D.prototype,"pointerHub",null);var Hp;(function(t){t.clampInt32=(e,r)=>r,t.clampFloat32=(e,r)=>r})(Hp||(Hp={}));A();var Ke;(function(t){t[t.This=0]="This",t[t.Parent=1]="Parent",t[t.Children=2]="Children"})(Ke||(Ke={}));var Jg;(function(t){t.create=()=>new B_})(Jg||(Jg={}));var B_=class{#e=new qp(pl.equals);#t=new qp(pl.startsWith);#r=new qp(pl.endsWith);#i=[];#n=0;#a=!1;subscribe(e,r,n){let i=new T_(r,e,this.#n++,n);if(this.#a){let a=new D_(i,e);return this.#i.push(a),a}else return this.subscribeMonitor(i,e)}dispatch(e){this.#a=!0,[...this.#e.filter(e),...this.#t.filter(e),...this.#r.filter(e)].sort(({order:n},{order:i})=>n-i).forEach(n=>n.procedure(e)),this.#a=!1,this.#i.forEach(n=>n.subscribe(this)),this.#i.length=0}subscribeMonitor(e,r){switch(r){case Ke.This:return this.#e.subscribe(e);case Ke.Parent:return this.#t.subscribe(e);case Ke.Children:return this.#r.subscribe(e);default:return Aa(r)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},T_=class{address;propagation;order;procedure;constructor(e,r,n,i){this.address=e,this.propagation=r,this.order=n,this.procedure=i}toString(){return`{ Monitor address: ${this.address}, propagation: ${Ke[this.propagation]}, order: ${this.order} }`}},qp=class{filterStrategy;#e=[];#t=!0;constructor(e){this.filterStrategy=e}subscribe(e){return this.#e.push(e),this.#t=this.#e.length<2,{terminate:()=>{let r=this.#e.length;for(;--r>=0;)this.#e[r]===e&&this.#e.splice(r,1)}}}stations(){return this.#t||(this.#e.sort(pl.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},D_=class{monitor;propagation;#e=new ae;#t=!1;constructor(e,r){this.monitor=e,this.propagation=r}subscribe(e){this.#t||(this.#e.terminate(),this.#e.own(e.subscribeMonitor(this.monitor,this.propagation)))}terminate(){this.#t=!0,this.#e.terminate()}};A();var Bt;(function(t){t.Boolean="boolean",t.Float32="float32",t.Int32="int32",t.String="string",t.Bytes="bytes"})(Bt||(Bt={}));var vo={[Bt.Boolean]:{type:Bt.Boolean,encode:(t,e)=>t.writeBoolean(e),decode:t=>t.readBoolean()},[Bt.Float32]:{type:Bt.Float32,encode:(t,e)=>t.writeFloat(e),decode:t=>t.readFloat()},[Bt.Int32]:{type:Bt.Int32,encode:(t,e)=>t.writeInt(e),decode:t=>t.readInt()},[Bt.String]:{type:Bt.String,encode:(t,e)=>t.writeString(e),decode:t=>t.readString()},[Bt.Bytes]:{type:Bt.Bytes,encode:(t,e)=>{t.writeInt(e.length),t.writeBytes(e)},decode:t=>{let e=new Int8Array(t.readInt());return t.readBytes(e),e}}},fl=class extends Z{#e;#t;#r;constructor(e,r,n){super(e),this.#e=r,this.#t=n,this.#r=this.#t}accept(e){return $(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Ke.This,this.address,()=>e(this))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}get type(){return this.#e}get initValue(){return this.#t}setInitValue(e){ee(this.graph.constructingBox(),"Cannot change initial value at runtime"),this.setValue(this.#t=this.clamp(e))}getValue(){return this.#r}setValue(e){let r=this.#r,n=this.clamp(e);this.equals(n)||(this.#r=n,this.graph.onPrimitiveValueUpdate(this,r,n))}writeValue(e,r){ee(!this.deprecated,"PrimitiveField.write: deprecated field"),this.serialization().encode(e,r)}readValue(e){return this.serialization().decode(e)}toJSON(){if(this.deprecated)return;let e=this.getValue();return ArrayBuffer.isView(e)?W("not implemented"):e}fromJSON(e){return W("Type mismatch")}reset(){this.setValue(this.#t)}},B=class t extends fl{static create(e,r=!1){return new t(e,r)}constructor(e,r){super(e,Bt.Boolean,r)}toggle(){this.setValue(!this.getValue())}serialization(){return vo[Bt.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){ee(!this.deprecated,"BooleanField.write: deprecated field"),e.writeBoolean(this.getValue())}fromJSON(e){this.deprecated||(typeof e=="boolean"?this.setValue(e):console.warn("BooleanField Type mismatch",e,this.address.toString()))}},F=class t extends fl{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,Bt.Float32,i),this.#e=r,this.#t=n}serialization(){return vo[Bt.Float32]}equals(e){return this.getValue()===e}clamp(e){return Hp.clampFloat32(this.#e,ho.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){ee(!this.deprecated,"FLoat32Field.write: deprecated field"),e.writeFloat(this.getValue())}get unit(){return this.#t}get constraints(){return this.#e}fromJSON(e){this.deprecated||(typeof e=="number"?this.setValue(e):console.warn("Float32Field Type mismatch",e,this.address.toString()))}},N=class t extends fl{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,Bt.Int32,i),this.#e=r,this.#t=n}serialization(){return vo[Bt.Int32]}equals(e){return this.getValue()===e}clamp(e){return Hp.clampInt32(this.#e,Rr.toInt(e))}read(e){this.setValue(e.readInt())}write(e){ee(!this.deprecated,"Int32Field.write: deprecated field"),e.writeInt(this.getValue())}get unit(){return this.#t}get constraints(){return this.#e}fromJSON(e){this.deprecated||(typeof e=="number"&&e===Math.floor(e)&&e>=Rr.MIN_VALUE&&e<=Rr.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},T=class t extends fl{static create(e,r=""){return new t(e,r)}constructor(e,r){super(e,Bt.String,r)}serialization(){return vo[Bt.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){ee(!this.deprecated,"StringField.write: deprecated field"),e.writeString(this.getValue())}fromJSON(e){this.deprecated||(typeof e=="string"?this.setValue(e):console.warn("StringField Type mismatch",e,this.address.toString()))}},ik=class t extends fl{static create(e,r=this.#e){return new t(e,r)}static#e=Object.freeze(new Int8Array(0));constructor(e,r){super(e,Bt.Bytes,r)}serialization(){return vo[Bt.Bytes]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){let r=new Int8Array(e.readInt());e.readBytes(r),this.setValue(r)}write(e){ee(!this.deprecated,"ByteArrayField.write: deprecated field");let r=this.getValue();e.writeInt(r.length),e.writeBytes(r)}toJSON(){if(!this.deprecated)return Array.from(this.getValue().values())}fromJSON(e){this.deprecated||(Array.isArray(e)&&e.every(r=>typeof r=="number")?this.setValue(new Int8Array(e)):console.warn("ByteArrayField Type mismatch",e,this.address.toString()))}};A();var ak=t=>{let e=k.newSet(i=>i),r=k.newSet(i=>i);for(let i of t)i instanceof hl?e.add(i.uuid):i instanceof vl&&r.add(i.uuid);let n=k.newSet(i=>i);for(let i of e.values())r.hasKey(i)&&n.add(i);return n.isEmpty()?t:t.filter(i=>i instanceof hl||i instanceof vl?!n.hasKey(i.uuid):i instanceof gl||i instanceof ml?!n.hasKey(i.address.uuid):!0)},nk;(function(t){t.decode=e=>{let r=e.readInt();return ie.create(()=>{switch(e.readString()){case"new":{let i=k.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new hl(i,a,o.buffer)}case"pointer":{let i=ze.read(e),a=e.readBoolean()?_.wrap(ze.read(e)):_.None,o=e.readBoolean()?_.wrap(ze.read(e)):_.None;return new gl(i,a,o)}case"primitive":{let i=ze.read(e),a=e.readString(),o=vo[a],s=o.decode(e),c=o.decode(e);return new ml(i,o,s,c)}case"delete":{let i=k.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new vl(i,a,o.buffer)}}},r)}})(nk||(nk={}));var hl=class{type="new";#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.createBox(this.#t,this.#e,r=>r.read(new lt(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),k.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${k.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},ml=class{type="primitive";#e;#t;#r;#i;constructor(e,r,n,i){this.#e=e,this.#t=r,this.#r=n,this.#i=i}get address(){return this.#e}get serialization(){return this.#t}get oldValue(){return this.#r}get newValue(){return this.#i}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).setValue(this.#r)}forward(e){this.field(e).setValue(this.#i)}field(e){return e.findVertex(this.#e).unwrap(()=>`Could not find PrimitiveField at ${this.#e}`)}write(e){e.writeString(this.type),this.#e.write(e),e.writeString(this.#t.type),this.#t.encode(e,this.#r),this.#t.encode(e,this.#i)}toString(){return`{PrimitiveUpdate oldValue: ${this.#r}, newValue: ${this.#i}`}},gl=class{type="pointer";#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}get address(){return this.#e}get oldAddress(){return this.#t}get newAddress(){return this.#r}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).targetAddress=this.#t}forward(e){this.field(e).targetAddress=this.#r}field(e){return e.findVertex(this.#e).unwrap(()=>`Could not find PointerField at ${this.#e}`)}write(e){e.writeString(this.type),this.#e.write(e),this.#t.match({none:()=>e.writeBoolean(!1),some:r=>{e.writeBoolean(!0),r.write(e)}}),this.#r.match({none:()=>e.writeBoolean(!1),some:r=>{e.writeBoolean(!0),r.write(e)}})}toString(){return`{PointerUpdate oldValue: ${this.#t.unwrapOrNull()}, newValue: ${this.#r.unwrapOrNull()}`}},vl=class{type="delete";#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}inverse(e){e.createBox(this.#t,this.#e,r=>r.read(new lt(this.#r)))}write(e){e.writeString(this.type),k.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${k.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};A();A();A();var EL=Symbol("Unreferenceable"),I=class t extends Z{static create(e,r,n){return new t(e,r,n)}static encodeWith(e,r){ee(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=_.wrap(e);let n=sr(r);if(this.#e=_.None,n.status==="failure")throw n.error;return n.value}static decodeWith(e,r){ee(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=_.wrap(e);let n=sr(r);if(this.#t=_.None,n.status==="failure")throw n.error;return n.value}static#e=_.None;static#t=_.None;#r;#i;#n=_.None;#a=_.None;constructor(e,r,n){super(e),this.#r=r,this.#i=n,n&&this.graph.edges().watchVertex(this)}get pointerHub(){return W(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return $(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Ke.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}refer(e){this.targetVertex=_.wrap(e)}defer(){this.targetVertex=_.None}get targetVertex(){return this.graph.inTransaction()?this.#a.flatMap(e=>this.graph.findVertex(e)):this.#n}set targetVertex(e){if(e.nonEmpty()){let r=Pa.validate(this,e.unwrap());r.nonEmpty()&&W(r.unwrap())}this.targetAddress=e.map(r=>r.address)}get targetAddress(){return this.#a}set targetAddress(e){let r=this.#a;r.isEmpty()&&e.isEmpty()||(e.nonEmpty()&&r.unwrapOrNull()?.equals(e.unwrap()))===!0||(this.#a=e,this.graph.onPointerAddressUpdated(this,r,e))}isEmpty(){return this.targetAddress.isEmpty()}nonEmpty(){return this.targetAddress.nonEmpty()}ifVertex(e){this.targetVertex.nonEmpty()&&e(this.targetVertex.unwrap("targetVertex"))}resolvedTo(e){this.#n=e}read(e){let r=e.readBoolean()?_.wrap(ze.read(e)):_.None;this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}write(e){ee(!this.deprecated,"PointerField.write: deprecated field"),t.#e.match({none:()=>this.#a,some:r=>r.map(this)}).match({none:()=>e.writeBoolean(!1),some:r=>{e.writeBoolean(!0),r.write(e)}})}toJSON(){if(!this.deprecated)return t.#e.match({none:()=>this.#a,some:e=>e.map(this)}).match({none:()=>null,some:e=>e.toString()})}fromJSON(e){if(!this.deprecated)if(cn(e)||typeof e=="string"){let r=_.wrap(cn(e)?null:ze.decode(e));this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}else return W(`Pointer at (${this.address}) has type mismatch. value (${e}) must be a string, but is ${typeof e}.`)}};var Yg=class{#e;#t;#r;#i;#n;#a;constructor(){this.#e=ze.newSet(e=>e.address),this.#t=ze.newSet(e=>e.address),this.#r=ze.newSet(e=>e.address),this.#i=ze.newSet(([e])=>e),this.#n=ze.newSet(([e])=>e.address),this.#a=k.newSet(e=>e)}watchVertex(e){if(Ft(e,I)){if(!e.mandatory)return W("watchVertex called but has no edge requirement");this.#e.add(e)}else{let{mandatory:r,exclusive:n}=e.pointerRules;if(!r&&!n)return W("watchVertex called but has no edge requirement");r&&this.#t.add(e),n&&this.#r.add(e)}this.#a.add(e.address.uuid)}unwatchVerticesOf(...e){let r=({box:{address:{uuid:n}}})=>n;for(let{address:{uuid:n}}of e)this.#o(this.#e,n,r),this.#o(this.#t,n,r),this.#o(this.#r,n,r);for(let n of e){let i=this.outgoingEdgesOf(n);if(i.length>0)return W(`${n} has outgoing edges: ${i.map(([o,s])=>`[${o.toString()}, ${s.toString()}]`)}`);let a=this.incomingEdgesOf(n);if(a.length>0)return W(`${n} has incoming edges from: ${a.map(o=>o.toString())}`)}}forgetVerticesOf(e){let r=({box:{address:{uuid:i}}})=>i,{address:{uuid:n}}=e;this.#o(this.#e,n,r),this.#o(this.#t,n,r),this.#o(this.#r,n,r)}connect(e,r){this.#n.add([e,r]),this.#i.opt(r).match({none:()=>this.#i.add([r,[e]]),some:([,n])=>n.push(e)}),this.#a.add(e.address.uuid),this.#a.add(r.uuid)}disconnect(e){let[,r]=this.#n.removeByKey(e.address),[,n]=this.#i.get(r,"incoming by address");ie.remove(n,e),n.length===0&&this.#i.removeByKey(r),this.#a.add(e.address.uuid),this.#a.add(r.uuid)}isConnected(e,r){return this.#n.opt(e.address).mapOr(([,n])=>n.equals(r),!1)}outgoingEdgesOf(e){return this.#s(this.#n,e.address.uuid,([{box:{address:{uuid:r}}}])=>r)}incomingEdgesOf(e){return e.isBox()?this.#s(this.#i,e.address.uuid,([{uuid:r}])=>r).flatMap(([r,n])=>n):this.#i.opt(e.address).mapOr(([r,n])=>n,ie.empty())}clearAffected(){this.#a.clear()}tryValidateAffected(){let e=({box:{address:{uuid:r}}})=>r;for(let r of this.#a.values()){let n=this.#s(this.#e,r,e);for(let o of n)if(o.isEmpty())return this.#a.clear(),o.mandatory?_.wrap(new Error(`Pointer ${o.toString()} requires an edge.`)):_.wrap(new Error(`Illegal state: ${o} has no edge requirements.`));let i=this.#s(this.#t,r,e);for(let o of i)if(o.pointerHub.isEmpty())return this.#a.clear(),o.pointerRules.mandatory?_.wrap(new Error(`Target ${o.toString()} requires an edge.`)):_.wrap(new Error(`Illegal state: ${o} has no edge requirements.`));let a=this.#s(this.#r,r,e);for(let o of a){let s=o.pointerHub.size();if(s>1)return this.#a.clear(),_.wrap(new Error(`Target ${o.toString()} is exclusive but has ${s} incoming pointers.`))}}return this.#a.clear(),_.None}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?(console.warn(`[GraphEdges] Validation failed: Pointer ${e.toString()} requires an edge.`),W(`Pointer ${e.toString()} requires an edge.`)):W(`Illegal state: ${e} has no edge requirements.`)}),this.#t.forEach(e=>{if(e.pointerHub.isEmpty())return e.pointerRules.mandatory?(console.warn(e),console.warn(`[GraphEdges] Validation failed: Target ${e.toString()} requires an edge.`),W(`Target ${e.toString()} requires an edge.`)):W(`Illegal state: ${e} has no edge requirements.`)}),this.#r.forEach(e=>{let r=e.pointerHub.size();if(r>1)return console.warn(`[GraphEdges] Validation failed: Target ${e.toString()} is exclusive but has ${r} incoming pointers.`),W(`Target ${e.toString()} is exclusive but has ${r} incoming pointers.`)})}#s(e,r,n){let i=ze.boxRange(e,r,n);return K(i)?e.values().slice(i[0],i[1]):ie.empty()}#o(e,r,n){let i=ze.boxRange(e,r,n);K(i)&&e.removeRange(i[0],i[1])}};var xo=class{#e;#t;#r;#i;#n;#a;#s;#o;#c;#l;#u;#m;#v;#g=!1;#d=!1;#p=!1;constructor(e=_.None){this.#e=e,this.#t=k.newSet(r=>r.address.uuid),this.#r=[],this.#i=[],this.#n=[],this.#c=Jg.create(),this.#a=new dr,this.#s=new dr,this.#o=new dr,this.#l=new Yg,this.#u=ze.newSet(({pointer:r})=>r.address),this.#m=[],this.#v=k.newSet(r=>r.uuid)}beginTransaction(){ee(!this.#g,"Transaction already in progress"),this.#g=!0,this.#n.length=0,this.#o.proxy.onBeginTransaction()}abortTransaction(){ee(this.#g,"No transaction in progress"),this.#b(),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>this.#y(e,r)),this.#r.length=0),this.#h()}endTransaction(){ee(this.#g,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>{this.#n.push(r),this.#f(e,r)}),this.#r.length=0),!this.#p&&this.#e.nonEmpty()&&this.#l.tryValidateAffected().ifSome(e=>{throw this.#b(),this.#h(),e}),this.#x(),this.#h()}inTransaction(){return this.#g}constructingBox(){return this.#d}createBox(e,r,n){return this.#e.unwrap("No box-factory installed")(e,this,r,n)}stageBox(e,r){if(this.#w(),ee(!this.#d,"Cannot construct box while other box is constructing"),K(r)){this.#d=!0;let a=sr(()=>r(e));if(this.#d=!1,a.status==="failure")throw this.#_(e),a.error}if(!this.#t.add(e))return this.#_(e),W(`${e.name} ${e.address.toString()} already staged`);let i=new hl(e.address.uuid,e.name,e.toArrayBuffer());return this.#p||this.#n.push(i),this.#a.proxy.onUpdate(i),this.#s.proxy.onUpdate(i),e}subscribeTransaction(e){return this.#o.subscribe(e)}subscribeToAllUpdates(e){return this.#a.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#s.subscribe(e)}subscribeVertexUpdates(e,r,n){return this.#c.subscribe(e,r,n)}subscribeEndTransaction(e){this.#m.push(e)}subscribeDeletion(e,r){let n=this.#v.getOrCreate(e,()=>({uuid:e,listeners:new Set}));return n.listeners.add(r),{terminate:()=>{n.listeners.delete(r),n.listeners.size===0&&this.#v.removeByKeyIfExist(e)}}}unstageBox(e){this.#w();let r=this.#t.removeByKey(e.address.uuid);ee(r===e,`${e} could not be found to unstage`),this.#l.unwatchVerticesOf(e);let n=new vl(e.address.uuid,e.name,e.toArrayBuffer());this.#p||this.#n.push(n),this.#v.removeByKeyIfExist(e.address.uuid)?.listeners.forEach(i=>i()),this.#a.proxy.onUpdate(n),this.#s.proxy.onUpdate(n)}findBox(e){return this.#t.opt(e)}findVertex(e){return this.#t.opt(e.uuid).flatMap(r=>r.searchVertex(e.fieldKeys))}boxes(){return this.#t.values()}edges(){return this.#l}checksum(){let e=new Sg;return this.boxes().forEach(r=>r.write(e)),e.result()}onPrimitiveValueUpdate(e,r,n){if(this.#w(),e.isAttached()&&!this.#d){let i=new ml(e.address,e.serialization(),r,n);this.#p||this.#n.push(i),this.#c.dispatch(i),this.#a.proxy.onUpdate(i),this.#s.proxy.onUpdate(i)}}onPointerAddressUpdated(e,r,n){this.#w(),r.nonEmpty()&&this.#l.disconnect(e),n.nonEmpty()&&this.#l.connect(e,n.unwrap());let i=new gl(e.address,r,n);this.#d?this.#r.push({pointerField:e,update:i}):(this.#p||this.#n.push(i),this.#y(e,i),this.#s.proxy.onUpdate(i))}#y(e,r){let{oldAddress:n,newAddress:i}=r;e.resolvedTo(i.flatMap(o=>this.findVertex(o))),this.#u.opt(e.address).match({none:()=>this.#u.add({pointer:e,initial:n,final:i,index:this.#u.size()}),some:o=>o.final=i}),this.#c.dispatch(r),this.#a.proxy.onUpdate(r)}#f(e,r){let{oldAddress:n,newAddress:i}=r;e.resolvedTo(i.flatMap(o=>this.findVertex(o))),this.#u.opt(e.address).match({none:()=>this.#u.add({pointer:e,initial:n,final:i,index:this.#u.size()}),some:o=>o.final=i}),this.#i.push({pointerField:e,update:r})}#x(){for(let{update:e}of this.#i)this.#c.dispatch(e),this.#a.proxy.onUpdate(e);this.#i.length=0}#h(){for(this.#u.values().toSorted((e,r)=>e.index-r.index).forEach(({pointer:e,initial:r,final:n})=>{r.equals(n)||(r.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onRemoved(e)),n.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#u.clear(),this.#g=!1;this.#m.length>0;)this.#m.splice(0).forEach(e=>e()),this.#m.length>0&&console.debug(`${this.#m.length} new observers while notifying`);this.#o.proxy.onEndTransaction(this.#p),this.#p=!1}#b(){this.#p=!0;for(let{update:r}of this.#r)this.#n.push(r);this.#r.length=0;let e=ak(this.#n.splice(0));for(let r=e.length-1;r>=0;r--){let n=e[r];if((n instanceof gl||n instanceof ml)&&this.findVertex(n.address).isEmpty()){console.warn(`[BoxGraph] rollback skips ${n.type}-update, vertex not found at ${n.address.toString()}`);continue}n.inverse(this)}this.#i.length=0,this.#l.clearAffected(),this.#u.clear(),this.#n.length=0}#_(e){for(let r=this.#r.length-1;r>=0;r--)this.#r[r].pointerField.box===e&&this.#r.splice(r,1);this.#l.outgoingEdgesOf(e).forEach(([r])=>this.#l.disconnect(r)),this.#l.forgetVerticesOf(e)}findOrphans(e){let r=this.#F(e);return this.boxes().filter(n=>!r.has(n))}#F(e){let r=new Set,n=[e];for(;n.length>0;){let i=n.pop();if(!r.has(i)){r.add(i),this.#A(i).forEach(a=>{a.targetAddress.ifSome(o=>{this.findBox(o.uuid).ifSome(s=>{r.has(s)||n.push(s)})})});for(let a of i.incomingEdges())r.has(a.box)||n.push(a.box)}}return r}#A(e){let r=[],n=i=>{for(let a of i)a.accept({visitPointerField:o=>r.push(o),visitObjectField:o=>n(o.fields()),visitArrayField:o=>n(o.fields())})};return n(e.fields()),r}dependenciesOf(e,r={}){let n=K(r.excludeBox)?r.excludeBox:qc.alwaysFalse,i=K(r.alwaysFollowMandatory)?r.alwaysFollowMandatory:!1,a=K(r.stopAtResources)?r.stopAtResources:!1,o=new Set,s=new Set,c=(f,v=!1)=>{if(!(o.has(f)||!v&&n(f))){if(o.add(f),a&&K(f.resource)){f.incomingEdges().forEach(m=>{s.add(m);let w=m.targetAddress.mapOr(y=>!y.isBox(),!1);if(m.mandatory&&w){if(f.resource==="shared"&&m.targetAddress.flatMap(P=>this.findVertex(P)).mapOr(P=>P.pointerRules.mandatory,!1))return;c(m.box)}});return}f.outgoingEdges().filter(([m])=>!s.has(m)).forEach(([m,w])=>{let y=this.findVertex(w).unwrap(`Could not find target of ${m.toString()}`);if(s.add(m),y.pointerRules.mandatory&&(i||y.pointerHub.incoming().filter(P=>P.targetAddress.mapOr(V=>V.equals(w),!1)).every(P=>s.has(P))))return c(y.box)}),f.incomingEdges().forEach(m=>{s.add(m),m.mandatory&&c(m.box)})}},u=Array.isArray(e)?e:[e];return u.forEach(f=>c(f,!0)),u.forEach(f=>o.delete(f)),{boxes:o,pointers:Array.from(s).reverse()}}verifyPointers(){this.#l.validateRequirements();let e=0,r=n=>{for(let i of n.fields())i.accept({visitPointerField:a=>{if(a.targetAddress.nonEmpty()){let o=a.targetVertex.nonEmpty(),s=this.findVertex(a.targetAddress.unwrap()).nonEmpty();ee(o,`pointer ${a.address} is broken`),ee(s,`Cannot find target for pointer ${a.address}`),e++}},visitObjectField:a=>r(a)})};return this.#t.forEach(n=>r(n)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#t.values().reduce((e,r)=>(e[k.toString(r.address.uuid)]={class:r.name,"incoming links":r.incomingEdges().length,"outgoing links":r.outgoingEdges().length,"est. memory (bytes)":r.estimateMemory()},e),{}))}debugDependencies(){console.debug("Dependencies:"),this.boxes().forEach(e=>{console.debug(` ${e}`);for(let r of this.dependenciesOf(e).boxes)console.debug(` ${r}`)})}addressToDebugPath(e){return e.flatMap(r=>r.isBox()?this.findBox(r.uuid).map(n=>n.name):this.findBox(r.uuid).flatMap(n=>n.searchVertex(r.fieldKeys).map(i=>i.isField()?i.debugPath:W("Unknown address"))))}toArrayBuffer(){let e=Gt.create(),r=this.#t.values();return e.writeInt(r.length),r.forEach(n=>{let i=n.serialize();e.writeInt(i.byteLength),e.writeBytes(new Int8Array(i))}),e.toArrayBuffer()}fromArrayBuffer(e,r=!0){ee(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let n=new lt(e),i=n.readInt();this.beginTransaction();let a=[];for(let o=0;o<i;o++){let s=n.readInt(),c=new Int8Array(s);n.readBytes(c);let u=new lt(c.buffer),f=u.readInt(),v=u.readString(),m=k.fromDataInput(u);a.push({creationIndex:f,name:v,uuid:m,boxStream:u})}a.sort((o,s)=>o.creationIndex-s.creationIndex).forEach(({name:o,uuid:s,boxStream:c})=>this.createBox(o,s,u=>u.read(c))),r?this.endTransaction():(this.#r.length>0&&(this.#r.forEach(({pointerField:o,update:s})=>this.#y(o,s)),this.#r.length=0),this.#l.clearAffected(),this.#h())}toJSON(){let e={};for(let r of this.#t.values())e[r.address.toString()]={name:r.name,fields:He(r.toJSON())};return e}fromJSON(e,r=!0){if(typeof e!="object"||e===null||Array.isArray(e))return W("Expected object");this.beginTransaction();let n=Object.entries(e);for(let[i,{name:a,fields:o}]of n)this.createBox(a,k.parse(i),s=>{let c=sr(()=>s.fromJSON(o));c.status==="failure"&&console.warn(c.error)});r?this.endTransaction():(this.#r.length>0&&(this.#r.forEach(({pointerField:i,update:a})=>this.#y(i,a)),this.#r.length=0),this.#l.clearAffected(),this.#h())}#w(){ee(this.#g,()=>"Modification only prohibited in transaction mode.")}};A();var bi;(function(t){t.insertOrder=(e,r=Number.MAX_SAFE_INTEGER)=>{let n=t.collectIndexedBoxes(e),i=Se(r,0,n.length);if(i<n.length)for(let a=i;a<n.length;a++)n[a].index.setValue(a+1);return i},t.removeOrder=(e,r)=>{let n=t.collectIndexedBoxes(e);if(r<n.length)for(let i=r+1;i<n.length;i++)n[i].index.setValue(i-1)},t.moveIndex=(e,r,n)=>{let i=t.collectIndexedBoxes(e),a=i[r];if(n<0){let o=Se(r+n,0,i.length-1);for(let s=o;s<r;s++)i[s].index.setValue(s+1);a.index.setValue(o)}else if(n>1){let o=Se(r+(n-1),0,i.length-1);for(let s=r;s<o;s++)i[s+1].index.setValue(s);a.index.setValue(o)}else console.warn(`moveIndex had no effect: startIndex: ${r}, delta: ${n}`)},t.moveIndices=(e,r,n)=>{let i=t.collectIndexedBoxes(e),a=new Set(r),o=0;for(;o<r.length&&r[o]<n;)o++;let s=n-o,c=s,u=s+r.length,f=0,v=0,m=0;for(let w=0;w<i.length;w++){let y=i[w],P=a.has(w)?c+v++:w<n?f++:u+m++;y.index.setValue(P)}},t.isIndexedBox=e=>"index"in e&&e.index instanceof N,t.collectIndexedBoxes=(e,r)=>e.pointerHub.incoming().map(({box:n})=>t.isIndexedBox(n)&&(r===void 0||n instanceof r)?n:W(`${n} has no index field`)).sort((n,i)=>n.index.getValue()-i.index.getValue())})(bi||(bi={}));A();var De=class extends Z{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return $(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return He(this.#e[e])}optField(e){return _.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(Ke.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){Qo.readFields(e,this.#e)}write(e){Qo.writeFields(e,this.#e)}toJSON(){if(!this.deprecated)return Object.entries(this.#e).reduce((e,[r,n])=>(e[r]=n.toJSON(),e),{})}fromJSON(e){if(!this.deprecated)if(nl(e))Object.entries(e).forEach(([r,n])=>{let i=this.#e[parseInt(r)];K(n)&&i.fromJSON(n)});else return W("Type mismatch")}};var es;(function(t){t[t.Float=0]="Float",t[t.FloatArray=1]="FloatArray",t[t.Integer=2]="Integer",t[t.IntegerArray=3]="IntegerArray",t[t.ByteArray=4]="ByteArray"})(es||(es={}));var Jp;(function(t){t[t.WRITE=0]="WRITE",t[t.READ=1]="READ"})(Jp||(Jp={}));var ru;(function(t){t[t.ID=15793935]="ID",t[t.START=15790320]="START",t[t.END=986895]="END"})(ru||(ru={}));A();var Xg=class t{static create(e,r){return new t(e.channel(r))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#n=Gt.create(0);#a=_.None;#s=_.None;#o=_.None;#c=-1;#l=-1;#u=!1;#m=!1;#v=0;constructor(e){this.#i=Jo.sender(e,({dispatchAndForget:r})=>new class{sendShareLock(n){r(this.sendShareLock,n)}sendUpdateData(n){r(this.sendUpdateData,n)}sendUpdateStructure(n){r(this.sendUpdateStructure,n)}})}flush(){let e=this.#g();if(e.nonEmpty()){this.#m||(this.#i.sendShareLock(this.#t),this.#m=!0),this.#i.sendUpdateStructure(e.unwrap());let r=this.#e.length,n=this.#d(),i=r+n;if(this.#a.isEmpty()||this.#a.unwrap().byteLength<i||r!==this.#v){let o=_g(i),s=new SharedArrayBuffer(o);this.#s=_.wrap(new Uint8Array(s,0,r)),this.#n=Gt.use(s,r),this.#a=_.wrap(s),this.#v=r,this.#i.sendUpdateData(s)}}this.#a.isEmpty()||Atomics.load(this.#r,0)===Jp.WRITE&&(this.#p(this.#n),this.#n.position=0,Atomics.store(this.#r,0,Jp.READ))}broadcastFloat(e,r){return this.#f(new class{type=es.Float;address=e;capacity=8;put(n,i){n.writeFloat(r())}})}broadcastInteger(e,r){return this.#f(new class{type=es.Integer;address=e;capacity=8;put(n,i){n.writeInt(r())}})}broadcastFloats(e,r,n){return this.#f(new class{type=es.FloatArray;address=e;capacity=4+(r.byteLength<<2);put(i,a){n?.(a),i.writeInt(r.length);for(let o of r)i.writeFloat(o)}})}broadcastIntegers(e,r,n){return this.#f(new class{type=es.IntegerArray;address=e;capacity=4+(r.byteLength<<2);put(i,a){n(a),i.writeInt(r.length),r.forEach(o=>i.writeInt(o))}})}broadcastByteArray(e,r,n){return this.#f(new class{type=es.ByteArray;address=e;capacity=4+r.byteLength;put(i,a){n(a),i.writeInt(r.byteLength),i.writeBytes(r)}})}#g(){if(this.#u){try{this.#o=_.wrap(this.#h())}catch(e){throw e}this.#u=!1}if(this.#o.nonEmpty()){let e=this.#o;return this.#o=_.None,e}return _.None}#d(){return this.#l===-1&&(this.#l=this.#y()+12),this.#l}terminate(){ie.clear(this.#e),this.#o=_.None,this.#u=!1,this.#l=0}#p(e){ee(!this.#u&&this.#o.isEmpty(),"Cannot flush while update is available");let r=this.#d();ee(e.remaining>=r,"Insufficient data"),e.writeInt(this.#c),e.writeInt(ru.START);let n=this.#s;for(let i=0;i<this.#e.length;i++){let a=n.nonEmpty()&&n.unwrap()[i]!==0;this.#e[i].put(e,a)}e.writeInt(ru.END)}#y(){return this.#e.reduce((e,r)=>e+r.capacity,0)}#f(e){return this.#e.push(e),this.#x(),{terminate:()=>{ie.removeOpt(this.#e,e),this.#x()}}}#x(){this.#l=-1,this.#u=!0}#h(){let e=Gt.create();e.writeInt(ru.ID),e.writeInt(++this.#c),e.writeInt(this.#e.length);for(let{address:r,type:n}of this.#e)r.write(e),e.writeByte(n);return e.toArrayBuffer()}};A();var ok;(function(t){t.NoSync="nosync",t.Pitch="pitch",t.Timestretch="timestretch",t.AudioFit="audiofit"})(ok||(ok={}));var sk;(function(t){t[t.Pre=0]="Pre",t[t.Post=1]="Post"})(sk||(sk={}));var Tt;(function(t){t.Instrument="instrument",t.Bus="bus",t.Aux="aux",t.Output="output"})(Tt||(Tt={}));A();var ts={white:new lr(0,0,100),blue:new lr(189,100,65),green:new lr(150,77,69),yellow:new lr(60,100,84),cream:new lr(65,20,83),orange:new lr(31,100,73),red:new lr(354,100,65),purple:new lr(314,100,78),bright:new lr(197,5,95),gray:new lr(197,31,88),dark:new lr(197,15,70),shadow:new lr(197,10,55),black:new lr(197,10,25),background:new lr(197,8,9),panelBackground:new lr(197,14,12),panelBackgroundBright:new lr(197,13,19),panelBackgroundDark:new lr(197,14,11)};var We;(function(t){t[t.Add=0]="Add",t[t.Adsr=1]="Adsr",t[t.ArrowDown=2]="ArrowDown",t[t.ArrowLeft=3]="ArrowLeft",t[t.ArrowRight=4]="ArrowRight",t[t.ArrowUp=5]="ArrowUp",t[t.AudioBus=6]="AudioBus",t[t.AudioDevice=7]="AudioDevice",t[t.AudioFile=8]="AudioFile",t[t.AutoGain=9]="AutoGain",t[t.Automation=10]="Automation",t[t.BassGuitar=11]="BassGuitar",t[t.Book=12]="Book",t[t.Box=13]="Box",t[t.Browse=14]="Browse",t[t.Bug=15]="Bug",t[t.Capture=16]="Capture",t[t.Chain=17]="Chain",t[t.ChatEmpty=18]="ChatEmpty",t[t.ChatMessage=19]="ChatMessage",t[t.Copy=20]="Copy",t[t.Maximizer=21]="Maximizer",t[t.Fold=22]="Fold",t[t.Folder=23]="Folder",t[t.Charts=24]="Charts",t[t.Checkbox=25]="Checkbox",t[t.Clips=26]="Clips",t[t.Close=27]="Close",t[t.CloudFolder=28]="CloudFolder",t[t.Code=29]="Code",t[t.CollapseDown=30]="CollapseDown",t[t.Compressor=31]="Compressor",t[t.Connected=32]="Connected",t[t.Cube=33]="Cube",t[t.Cursor=34]="Cursor",t[t.Curve=35]="Curve",t[t.Dattorro=36]="Dattorro",t[t.Delete=37]="Delete",t[t.Dial=38]="Dial",t[t.DinSlot=39]="DinSlot",t[t.Disconnected=40]="Disconnected",t[t.Divide=41]="Divide",t[t.DragConnections=42]="DragConnections",t[t.Dropdown=43]="Dropdown",t[t.Dropbox=44]="Dropbox",t[t.DrumSet=45]="DrumSet",t[t.Tidal=46]="Tidal",t[t.Duration=47]="Duration",t[t.EditBox=48]="EditBox",t[t.Effects=49]="Effects",t[t.Embed=50]="Embed",t[t.EQ=51]="EQ",t[t.Eraser=52]="Eraser",t[t.Exclude=53]="Exclude",t[t.Exit=54]="Exit",t[t.ExpandWidth=55]="ExpandWidth",t[t.FileList=56]="FileList",t[t.Film=57]="Film",t[t.Flask=58]="Flask",t[t.Focus=59]="Focus",t[t.Fullscreen=60]="Fullscreen",t[t.Gate=61]="Gate",t[t.Generator=62]="Generator",t[t.GoogleDrive=63]="GoogleDrive",t[t.Nextcloud=64]="Nextcloud",t[t.Groove=65]="Groove",t[t.Guitar=66]="Guitar",t[t.GuitarTab=67]="GuitarTab",t[t.Headphone=68]="Headphone",t[t.Heart=69]="Heart",t[t.Help=70]="Help",t[t.HighPass=71]="HighPass",t[t.HighShelf=72]="HighShelf",t[t.Insert=73]="Insert",t[t.InsertDown=74]="InsertDown",t[t.Invert=75]="Invert",t[t.Info=76]="Info",t[t.Lock=77]="Lock",t[t.Loop=78]="Loop",t[t.LoopEnd=79]="LoopEnd",t[t.LoopStart=80]="LoopStart",t[t.LowPass=81]="LowPass",t[t.LowShelf=82]="LowShelf",t[t.Magnet=83]="Magnet",t[t.MainMenu=84]="MainMenu",t[t.Maximized=85]="Maximized",t[t.Menu=86]="Menu",t[t.Merge=87]="Merge",t[t.Metronome=88]="Metronome",t[t.Microphone=89]="Microphone",t[t.Midi=90]="Midi",t[t.Minimized=91]="Minimized",t[t.Mix=92]="Mix",t[t.Mixing=93]="Mixing",t[t.Mute=94]="Mute",t[t.NanoWave=95]="NanoWave",t[t.NeuralAmp=96]="NeuralAmp",t[t.New=97]="New",t[t.NoAudio=98]="NoAudio",t[t.Note=99]="Note",t[t.NotePad=100]="NotePad",t[t.Notification=101]="Notification",t[t.OpenDAW=102]="OpenDAW",t[t.Panel=103]="Panel",t[t.Paste=104]="Paste",t[t.Peak=105]="Peak",t[t.Pencil=106]="Pencil",t[t.Piano=107]="Piano",t[t.Play=108]="Play",t[t.Playfield=109]="Playfield",t[t.PlayOnce=110]="PlayOnce",t[t.PlayRepeat=111]="PlayRepeat",t[t.PlayAlternate=112]="PlayAlternate",t[t.Pointer=113]="Pointer",t[t.Popout=114]="Popout",t[t.Primary=115]="Primary",t[t.Random=116]="Random",t[t.Record=117]="Record",t[t.Rectangle=118]="Rectangle",t[t.Redo=119]="Redo",t[t.Region=120]="Region",t[t.Robot=121]="Robot",t[t.RoundDown=122]="RoundDown",t[t.RoundUp=123]="RoundUp",t[t.Run=124]="Run",t[t.Sawtooth=125]="Sawtooth",t[t.Saxophone=126]="Saxophone",t[t.Scissors=127]="Scissors",t[t.Search=128]="Search",t[t.Share=129]="Share",t[t.SelectDown=130]="SelectDown",t[t.SelectUp=131]="SelectUp",t[t.Shadertoy=132]="Shadertoy",t[t.Shutdown=133]="Shutdown",t[t.Signalsmith=134]="Signalsmith",t[t.Sine=135]="Sine",t[t.Solo=136]="Solo",t[t.SoundFont=137]="SoundFont",t[t.Speaker=138]="Speaker",t[t.SpeakerHeadphone=139]="SpeakerHeadphone",t[t.Square=140]="Square",t[t.Stack=141]="Stack",t[t.Start=142]="Start",t[t.Stereo=143]="Stereo",t[t.Stop=144]="Stop",t[t.Subtract=145]="Subtract",t[t.Sun=146]="Sun",t[t.Swap=147]="Swap",t[t.System=148]="System",t[t.Table=149]="Table",t[t.Tape=150]="Tape",t[t.TapeReel=151]="TapeReel",t[t.Time=152]="Time",t[t.Timeline=153]="Timeline",t[t.Tone3000=154]="Tone3000",t[t.Tool=155]="Tool",t[t.Triangle=156]="Triangle",t[t.Undo=157]="Undo",t[t.Unknown=158]="Unknown",t[t.UserFolder=159]="UserFolder",t[t.Velocity=160]="Velocity",t[t.Vinyl=161]="Vinyl",t[t.Vocoder=162]="Vocoder",t[t.Volume=163]="Volume",t[t.VUMeter=164]="VUMeter",t[t.Warning=165]="Warning",t[t.Waveform=166]="Waveform",t[t.Zeitgeist=167]="Zeitgeist",t[t.Github=168]="Github",t[t.Discord=169]="Discord",t[t.Instagram=170]="Instagram",t[t.LinkedIn=171]="LinkedIn",t[t.Neon=172]="Neon",t[t.Ring=173]="Ring",t[t.Noise=174]="Noise",t[t.Vaporisateur=175]="Vaporisateur",t[t.FolderOpen=176]="FolderOpen",t[t.FolderAdd=177]="FolderAdd"})(We||(We={}));(function(t){t.toName=e=>t[e],t.fromName=e=>t[e]??t.Rectangle})(We||(We={}));var l;(function(t){t[t.Deprecated=NaN]="Deprecated",t[t.MetaData=0]="MetaData",t[t.AudioBusses=1]="AudioBusses",t[t.AudioConnection=2]="AudioConnection",t[t.AudioEffectHost=3]="AudioEffectHost",t[t.AudioFile=4]="AudioFile",t[t.AudioOutput=5]="AudioOutput",t[t.AudioPlayMode=6]="AudioPlayMode",t[t.AudioUnit=7]="AudioUnit",t[t.AudioUnits=8]="AudioUnits",t[t.Automation=9]="Automation",t[t.AuxSend=10]="AuxSend",t[t.Capture=11]="Capture",t[t.ClipCollection=12]="ClipCollection",t[t.ConnectionCollection=13]="ConnectionCollection",t[t.Device=14]="Device",t[t.DeviceUserInterface=15]="DeviceUserInterface",t[t.Editing=16]="Editing",t[t.FileUploadState=17]="FileUploadState",t[t.Groove=18]="Groove",t[t.InstrumentHost=19]="InstrumentHost",t[t.MarkerEvents=20]="MarkerEvents",t[t.MarkerTrack=21]="MarkerTrack",t[t.MIDIControl=22]="MIDIControl",t[t.MIDIControllers=23]="MIDIControllers",t[t.MIDIDevice=24]="MIDIDevice",t[t.MIDIEffectHost=25]="MIDIEffectHost",t[t.ModularSetup=26]="ModularSetup",t[t.Modulation=27]="Modulation",t[t.ModuleCollection=28]="ModuleCollection",t[t.NoteEventCollection=29]="NoteEventCollection",t[t.NoteEventFeature=30]="NoteEventFeature",t[t.NoteEvents=31]="NoteEvents",t[t.NotesConnection=32]="NotesConnection",t[t.Parameter=33]="Parameter",t[t.ParameterController=34]="ParameterController",t[t.PianoMode=35]="PianoMode",t[t.ProjectMeta=36]="ProjectMeta",t[t.RegionCollection=37]="RegionCollection",t[t.Sample=38]="Sample",t[t.Selection=39]="Selection",t[t.Shadertoy=40]="Shadertoy",t[t.SideChain=41]="SideChain",t[t.SignatureAutomation=42]="SignatureAutomation",t[t.SoundfontFile=43]="SoundfontFile",t[t.StepAutomation=44]="StepAutomation",t[t.Timeline=45]="Timeline",t[t.TrackCollection=46]="TrackCollection",t[t.TransientMarkers=47]="TransientMarkers",t[t.User=48]="User",t[t.ValueEventCollection=49]="ValueEventCollection",t[t.ValueEvents=50]="ValueEvents",t[t.ValueInterpolation=51]="ValueInterpolation",t[t.VoltageConnection=52]="VoltageConnection",t[t.WarpMarkers=53]="WarpMarkers",t[t.NeuralAmpModel=54]="NeuralAmpModel",t[t.CompositeCell=55]="CompositeCell",t[t.AudioEffectCompositeCell=56]="AudioEffectCompositeCell",t[t.Pattern=57]="Pattern"})(l||(l={}));var Qg;(function(t){t[t.Once=0]="Once",t[t.Repeat=1]="Repeat",t[t.Pingpong=2]="Pingpong"})(Qg||(Qg={}));var Ma;(function(t){t[t.Monophonic=0]="Monophonic",t[t.Polyphonic=1]="Polyphonic"})(Ma||(Ma={}));A();rt();A();A();A();var lk=(t,e)=>{if(t===e)return 0;let r=t-e;return r===0?W(`Indices cannot be equal (${t}, ${e})`):r};var yo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},zr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ev,Jn,rs,tv,wo,jt=class t{static create(e,r,n){return new t(e,r,n)}constructor(e,r,n){ev.set(this,void 0),Jn.set(this,void 0),rs.set(this,void 0),tv.set(this,void 0),wo.set(this,null),yo(this,ev,e,"f"),yo(this,Jn,k.newSet(i=>i.adapter.uuid),"f"),yo(this,rs,new dr,"f"),yo(this,tv,e.pointerHub.catchupAndSubscribe({onAdded:i=>{yo(this,wo,null,"f");let a=r(i.box),o=a.indexField.subscribe(()=>{yo(this,wo,null,"f"),zr(this,rs,"f").proxy.onReorder(a)}),s=zr(this,Jn,"f").add({adapter:a,subscription:o});ee(s,`Could not add ${a}`),zr(this,rs,"f").proxy.onAdd(a)},onRemoved:i=>{yo(this,wo,null,"f");let a=i.box.address.uuid,{adapter:o,subscription:s}=zr(this,Jn,"f").removeByKey(a);s.terminate(),zr(this,rs,"f").proxy.onRemove(o)}},n),"f")}field(){return zr(this,ev,"f")}subscribe(e){return zr(this,rs,"f").subscribe(e)}catchupAndSubscribe(e){return zr(this,Jn,"f").forEach(({adapter:r})=>e.onAdd(r)),this.subscribe(e)}getAdapterByIndex(e){let r=vt.exactMapped(this.adapters(),e,lk,n=>n.indexField.getValue());return r===-1?_.None:_.wrap(this.adapters()[r])}getAdapterById(e){return zr(this,Jn,"f").opt(e).map(({adapter:r})=>r)}getMinFreeIndex(){let e=this.adapters();for(let r=0;r<e.length;r++)if(e[r].indexField.getValue()>r)return r;return e.length}adapters(){return zr(this,wo,"f")===null&&yo(this,wo,zr(this,Jn,"f").values().map(({adapter:e})=>e).filter(e=>e.box.isAttached()).sort((e,r)=>e.indexField.getValue()-r.indexField.getValue()),"f"),zr(this,wo,"f")}move(e,r){this.moveIndex(e.indexField.getValue(),r)}moveIndex(e,r){if(r===0)return;let n=this.adapters(),i=n[e],a=Se(e+r,0,n.length-1);if(a!==e){if(r<0)for(let o=a;o<e;o++)n[o].indexField.setValue(o+1);else for(let o=e;o<a;o++)n[o+1].indexField.setValue(o);i.indexField.setValue(a)}}size(){return zr(this,Jn,"f").size()}isEmpty(){return this.size()===0}terminate(){yo(this,wo,null,"f"),zr(this,Jn,"f").forEach(({subscription:e})=>e.terminate()),zr(this,Jn,"f").clear(),zr(this,rs,"f").terminate(),zr(this,tv,"f").terminate()}};ev=new WeakMap,Jn=new WeakMap,rs=new WeakMap,tv=new WeakMap,wo=new WeakMap;A();rt();A();A();var bo;(function(t){t.names=["MetaDataBox","ProjectMetaBox","RootBox","SelectionBox","UserInterfaceBox","UploadFileBox","ShadertoyBox","MIDIControllerBox","TimelineBox","TrackBox","NoteEventBox","NoteEventRepeatBox","NoteEventCollectionBox","NoteRegionBox","NoteClipBox","ValueEventBox","ValueEventCollectionBox","ValueEventCurveBox","ValueRegionBox","ValueClipBox","SignatureEventBox","AudioRegionBox","AudioClipBox","AudioPitchStretchBox","AudioTimeStretchBox","AudioSignalsmithBox","TransientMarkerBox","WarpMarkerBox","MarkerBox","AudioFileBox","SoundfontFileBox","NeuralAmpModelBox","AudioUnitBox","CaptureAudioBox","CaptureMidiBox","AudioBusBox","AuxSendBox","GrooveShuffleBox","UnknownAudioEffectDeviceBox","UnknownMidiEffectDeviceBox","DeviceInterfaceKnobBox","ModularDeviceBox","StereoToolDeviceBox","MaximizerDeviceBox","CompressorDeviceBox","GateDeviceBox","DelayDeviceBox","AutotuneDeviceBox","CrusherDeviceBox","DattorroReverbDeviceBox","VelocityDeviceBox","FoldDeviceBox","TidalDeviceBox","RevampDeviceBox","ReverbDeviceBox","VaporisateurDeviceBox","MIDIOutputDeviceBox","MIDIOutputBox","MIDIOutputParameterBox","SoundfontDeviceBox","NeonDeviceBox","NanoDeviceBox","PlayfieldDeviceBox","PlayfieldSampleBox","TapeDeviceBox","ArpeggioDeviceBox","PitchDeviceBox","ZeitgeistDeviceBox","NeuralAmpDeviceBox","VocoderDeviceBox","WaveshaperDeviceBox","WerkstattDeviceBox","WerkstattParameterBox","WerkstattSampleBox","SpielwerkDeviceBox","ApparatDeviceBox","CubedDeviceBox","NoopInstrumentBox","CompositeDeviceBox","CompositeCellBox","AudioEffectCompositeBox","AudioEffectCompositeCellBox","StereoCompositeBox","FrequencySplitBox","ModularBox","ModuleConnectionBox","ModularAudioInputBox","ModularAudioOutputBox","ModuleDelayBox","ModuleMultiplierBox","ModuleGainBox"],t.create=(e,r,n,i)=>{switch(e){case"MetaDataBox":return Yn.create(r,n,i);case"ProjectMetaBox":return rv.create(r,n,i);case"RootBox":return is.create(r,n,i);case"SelectionBox":return Na.create(r,n,i);case"UserInterfaceBox":return _o.create(r,n,i);case"UploadFileBox":return iv.create(r,n,i);case"ShadertoyBox":return nv.create(r,n,i);case"MIDIControllerBox":return av.create(r,n,i);case"TimelineBox":return xl.create(r,n,i);case"TrackBox":return _i.create(r,n,i);case"NoteEventBox":return ns.create(r,n,i);case"NoteEventRepeatBox":return ov.create(r,n,i);case"NoteEventCollectionBox":return Fo.create(r,n,i);case"NoteRegionBox":return yl.create(r,n,i);case"NoteClipBox":return iu.create(r,n,i);case"ValueEventBox":return Xn.create(r,n,i);case"ValueEventCollectionBox":return Qn.create(r,n,i);case"ValueEventCurveBox":return as.create(r,n,i);case"ValueRegionBox":return wl.create(r,n,i);case"ValueClipBox":return nu.create(r,n,i);case"SignatureEventBox":return au.create(r,n,i);case"AudioRegionBox":return os.create(r,n,i);case"AudioClipBox":return ou.create(r,n,i);case"AudioPitchStretchBox":return su.create(r,n,i);case"AudioTimeStretchBox":return lu.create(r,n,i);case"AudioSignalsmithBox":return cu.create(r,n,i);case"TransientMarkerBox":return sv.create(r,n,i);case"WarpMarkerBox":return $a.create(r,n,i);case"MarkerBox":return uu.create(r,n,i);case"AudioFileBox":return dn.create(r,n,i);case"SoundfontFileBox":return ka.create(r,n,i);case"NeuralAmpModelBox":return lv.create(r,n,i);case"AudioUnitBox":return it.create(r,n,i);case"CaptureAudioBox":return Ia.create(r,n,i);case"CaptureMidiBox":return Ba.create(r,n,i);case"AudioBusBox":return ea.create(r,n,i);case"AuxSendBox":return du.create(r,n,i);case"GrooveShuffleBox":return pu.create(r,n,i);case"UnknownAudioEffectDeviceBox":return cv.create(r,n,i);case"UnknownMidiEffectDeviceBox":return uv.create(r,n,i);case"DeviceInterfaceKnobBox":return dv.create(r,n,i);case"ModularDeviceBox":return pv.create(r,n,i);case"StereoToolDeviceBox":return fv.create(r,n,i);case"MaximizerDeviceBox":return fu.create(r,n,i);case"CompressorDeviceBox":return hv.create(r,n,i);case"GateDeviceBox":return mv.create(r,n,i);case"DelayDeviceBox":return gv.create(r,n,i);case"AutotuneDeviceBox":return vv.create(r,n,i);case"CrusherDeviceBox":return xv.create(r,n,i);case"DattorroReverbDeviceBox":return yv.create(r,n,i);case"VelocityDeviceBox":return wv.create(r,n,i);case"FoldDeviceBox":return bv.create(r,n,i);case"TidalDeviceBox":return _v.create(r,n,i);case"RevampDeviceBox":return Fv.create(r,n,i);case"ReverbDeviceBox":return Av.create(r,n,i);case"VaporisateurDeviceBox":return hu.create(r,n,i);case"MIDIOutputDeviceBox":return mu.create(r,n,i);case"MIDIOutputBox":return ss.create(r,n,i);case"MIDIOutputParameterBox":return bl.create(r,n,i);case"SoundfontDeviceBox":return gu.create(r,n,i);case"NeonDeviceBox":return vu.create(r,n,i);case"NanoDeviceBox":return xu.create(r,n,i);case"PlayfieldDeviceBox":return yu.create(r,n,i);case"PlayfieldSampleBox":return Ta.create(r,n,i);case"TapeDeviceBox":return wu.create(r,n,i);case"ArpeggioDeviceBox":return Ev.create(r,n,i);case"PitchDeviceBox":return Sv.create(r,n,i);case"ZeitgeistDeviceBox":return Pv.create(r,n,i);case"NeuralAmpDeviceBox":return Mv.create(r,n,i);case"VocoderDeviceBox":return Nv.create(r,n,i);case"WaveshaperDeviceBox":return $v.create(r,n,i);case"WerkstattDeviceBox":return kv.create(r,n,i);case"WerkstattParameterBox":return Da.create(r,n,i);case"WerkstattSampleBox":return _l.create(r,n,i);case"SpielwerkDeviceBox":return Iv.create(r,n,i);case"ApparatDeviceBox":return bu.create(r,n,i);case"CubedDeviceBox":return _u.create(r,n,i);case"NoopInstrumentBox":return Fu.create(r,n,i);case"CompositeDeviceBox":return Bv.create(r,n,i);case"CompositeCellBox":return Tv.create(r,n,i);case"AudioEffectCompositeBox":return Dv.create(r,n,i);case"AudioEffectCompositeCellBox":return Au.create(r,n,i);case"StereoCompositeBox":return Rv.create(r,n,i);case"FrequencySplitBox":return Cv.create(r,n,i);case"ModularBox":return zv.create(r,n,i);case"ModuleConnectionBox":return Ov.create(r,n,i);case"ModularAudioInputBox":return Vv.create(r,n,i);case"ModularAudioOutputBox":return Uv.create(r,n,i);case"ModuleDelayBox":return jv.create(r,n,i);case"ModuleMultiplierBox":return Kv.create(r,n,i);case"ModuleGainBox":return Wv.create(r,n,i);default:return W(`Unknown box class '${e}'`)}},t.deserialize=(e,r)=>{let n=new lt(r),i=n.readString(),a=k.fromDataInput(n),o=t.create(i,e,a);return o.read(n),o}})(bo||(bo={}));A();var Yn=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MetaDataBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="MetaDataBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMetaDataBox,this)}get tags(){return t.Tags}get target(){return this.getField(1)}get origin(){return this.getField(2)}get value(){return this.getField(3)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"target",deprecated:!1,pointerRules:p},l.MetaData,!0),2:T.create({parent:this,fieldKey:2,fieldName:"origin",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"value",deprecated:!1,pointerRules:p},"{}")}}};A();var rv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ProjectMetaBox",pointerRules:{accepts:[l.ProjectMeta],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ProjectMetaBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitProjectMetaBox,this)}get tags(){return t.Tags}get projectName(){return this.getField(1)}get artist(){return this.getField(2)}get description(){return this.getField(3)}get tagList(){return this.getField(4)}get notepad(){return this.getField(5)}get created(){return this.getField(6)}get modified(){return this.getField(7)}get coverId(){return this.getField(8)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"projectName",deprecated:!1,pointerRules:p}),2:T.create({parent:this,fieldKey:2,fieldName:"artist",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"description",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"tagList",deprecated:!1,pointerRules:p},"[]"),5:T.create({parent:this,fieldKey:5,fieldName:"notepad",deprecated:!1,pointerRules:p}),6:T.create({parent:this,fieldKey:6,fieldName:"created",deprecated:!1,pointerRules:p}),7:T.create({parent:this,fieldKey:7,fieldName:"modified",deprecated:!1,pointerRules:p}),8:T.create({parent:this,fieldKey:8,fieldName:"coverId",deprecated:!1,pointerRules:p})}}};A();var Lv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get keyboard(){return this.getField(1)}get timeRangeInQuarters(){return this.getField(2)}get noteScale(){return this.getField(3)}get noteLabels(){return this.getField(4)}get transpose(){return this.getField(5)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:p},{length:4},"",0),2:F.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:p},{min:1,max:64,scaling:"linear"},"",8),3:F.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:p},{min:.5,max:2,scaling:"linear"},"",1),4:B.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:p},!1),5:N.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-48,max:48},"st",0)}}};var is=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"RootBox",pointerRules:{accepts:[l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="RootBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitRootBox,this)}get tags(){return t.Tags}get timeline(){return this.getField(1)}get users(){return this.getField(2)}get created(){return this.getField(3)}get groove(){return this.getField(4)}get baseFrequency(){return this.getField(5)}get modularSetups(){return this.getField(10)}get audioUnits(){return this.getField(20)}get audioBusses(){return this.getField(21)}get outputDevice(){return this.getField(30)}get outputMidiDevices(){return this.getField(35)}get pianoMode(){return this.getField(40)}get shadertoy(){return this.getField(100)}get projectMeta(){return this.getField(101)}get editingChannel(){return this.getField(111)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:p},l.Timeline,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[l.User],mandatory:!1,exclusive:!1}}),3:T.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0),5:F.create({parent:this,fieldKey:5,fieldName:"baseFrequency",deprecated:!1,pointerRules:p},{min:400,max:480,scaling:"linear"},"Hz",440),10:Z.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!1,exclusive:!1}}),20:Z.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[l.AudioUnits],mandatory:!1,exclusive:!1}}),21:Z.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[l.AudioBusses],mandatory:!1,exclusive:!1}}),30:Z.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!0,exclusive:!1}}),35:Z.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!1,exclusive:!1}}),40:Lv.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:p}),100:I.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:p},l.Shadertoy,!1),101:I.create({parent:this,fieldKey:101,fieldName:"projectMeta",deprecated:!1,pointerRules:p},l.ProjectMeta,!1),111:I.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:p},l.Editing,!1)}}};A();var Na=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SelectionBox",pointerRules:p,resource:void 0,ephemeral:!0}),n)}static ClassName="SelectionBox";static Resource=void 0;static Ephemeral=!0;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitSelectionBox,this)}get tags(){return t.Tags}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:p},l.Selection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:p},l.Selection,!0)}}};A();var _o=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UserInterfaceBox",pointerRules:{accepts:[l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="UserInterfaceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitUserInterfaceBox,this)}get tags(){return t.Tags}get root(){return this.getField(1)}get selection(){return this.getField(10)}get uploadStates(){return this.getField(11)}get editingDeviceChain(){return this.getField(21)}get editingTimelineRegion(){return this.getField(22)}get editingModularSystem(){return this.getField(23)}get midiControllers(){return this.getField(30)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.User,!0),10:Z.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[l.FileUploadState],mandatory:!1,exclusive:!1}}),21:I.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:p},l.Editing,!1),22:I.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:p},l.Editing,!1),23:I.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:p},l.Editing,!1),30:Z.hook({parent:this,fieldKey:30,fieldName:"midiControllers",deprecated:!1,pointerRules:{accepts:[l.MIDIControllers],mandatory:!1,exclusive:!1}})}}};A();var iv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UploadFileBox",pointerRules:p,resource:void 0,ephemeral:!0}),n)}static ClassName="UploadFileBox";static Resource=void 0;static Ephemeral=!0;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitUploadFileBox,this)}get tags(){return t.Tags}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:p},l.FileUploadState,!0),2:I.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.FileUploadState,!0)}}};A();var nv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ShadertoyBox",pointerRules:{accepts:[l.Shadertoy],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ShadertoyBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitShadertoyBox,this)}get tags(){return t.Tags}get shaderCode(){return this.getField(1)}get highres(){return this.getField(2)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"shaderCode",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:p},!0)}}};A();var av=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIControllerBox",pointerRules:p,resource:void 0,ephemeral:!0}),n)}static ClassName="MIDIControllerBox";static Resource=void 0;static Ephemeral=!0;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMIDIControllerBox,this)}get tags(){return t.Tags}get controllers(){return this.getField(1)}get parameter(){return this.getField(2)}get deviceId(){return this.getField(3)}get deviceChannel(){return this.getField(4)}get controlId(){return this.getField(5)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"controllers",deprecated:!1,pointerRules:p},l.MIDIControllers,!0),2:I.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.MIDIControl,!0),3:T.create({parent:this,fieldKey:3,fieldName:"deviceId",deprecated:!1,pointerRules:p}),4:N.create({parent:this,fieldKey:4,fieldName:"deviceChannel",deprecated:!1,pointerRules:p},{min:0,max:127},""),5:N.create({parent:this,fieldKey:5,fieldName:"controlId",deprecated:!1,pointerRules:p},{min:0,max:127},"")}}};A();var Zv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get nominator(){return this.getField(1)}get denominator(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4),2:N.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4)}}};var Gv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get from(){return this.getField(2)}get to(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),2:N.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:p},"any","ppqn",0),3:N.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:p},"any","ppqn",15360)}}};var Hv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get markers(){return this.getField(1)}get index(){return this.getField(10)}get enabled(){return this.getField(20)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),10:N.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),20:B.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var qv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get events(){return this.getField(1)}get index(){return this.getField(10)}get minBpm(){return this.getField(15)}get maxBpm(){return this.getField(16)}get enabled(){return this.getField(20)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!1),10:N.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",2),15:N.create({parent:this,fieldKey:15,fieldName:"minBpm",deprecated:!1,pointerRules:p},{min:30,max:999},"bpm",60),16:N.create({parent:this,fieldKey:16,fieldName:"maxBpm",deprecated:!1,pointerRules:p},{min:31,max:1e3},"bpm",240),20:B.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var Jv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get events(){return this.getField(1)}get index(){return this.getField(10)}get enabled(){return this.getField(20)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.SignatureAutomation],mandatory:!1,exclusive:!1}}),10:N.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",1),20:B.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var xl=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TimelineBox",pointerRules:{accepts:[l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TimelineBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitTimelineBox,this)}get tags(){return t.Tags}get root(){return this.getField(1)}get signature(){return this.getField(10)}get loopArea(){return this.getField(11)}get deprecatedMarkerTrack(){return this.getField(20)}get markerTrack(){return this.getField(21)}get tempoTrack(){return this.getField(22)}get signatureTrack(){return this.getField(23)}get durationInPulses(){return this.getField(30)}get bpm(){return this.getField(31)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[l.Timeline],mandatory:!0,exclusive:!1}}),10:Zv.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:p}),11:Gv.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:p}),20:Z.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!0,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),21:Hv.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:p}),22:qv.create({parent:this,fieldKey:22,fieldName:"tempoTrack",deprecated:!1,pointerRules:p}),23:Jv.create({parent:this,fieldKey:23,fieldName:"signatureTrack",deprecated:!1,pointerRules:p}),30:N.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:p},"positive","ppqn",491520),31:F.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:p},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};A();var _i=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TrackBox",pointerRules:{accepts:[l.Selection,l.PianoMode,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TrackBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitTrackBox,this)}get tags(){return t.Tags}get tracks(){return this.getField(1)}get target(){return this.getField(2)}get regions(){return this.getField(3)}get clips(){return this.getField(4)}get index(){return this.getField(10)}get type(){return this.getField(11)}get enabled(){return this.getField(20)}get excludePianoMode(){return this.getField(30)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:p},l.TrackCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:p},l.Automation,!0),3:Z.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[l.RegionCollection],mandatory:!1,exclusive:!1}}),4:Z.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[l.ClipCollection],mandatory:!1,exclusive:!1}}),10:N.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),11:N.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:p},{values:[0,1,2,3]},""),20:B.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),30:B.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:p},!1)}}};A();var ns=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteEventBox",pointerRules:{accepts:[l.Selection,l.NoteEventFeature],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteEventBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteEventBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get pitch(){return this.getField(20)}get velocity(){return this.getField(21)}get playCount(){return this.getField(22)}get playCurve(){return this.getField(23)}get cent(){return this.getField(24)}get chance(){return this.getField(25)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEvents,!0),10:N.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:N.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn",240),20:N.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),21:F.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:p},"unipolar","%",.7874015748031497),22:N.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),23:F.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:p},"bipolar","%",0),24:F.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:p},{min:-50,max:50,scaling:"linear"},"ct",0),25:N.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:p},{min:0,max:100},"",100)}}};A();var ov=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteEventRepeatBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="NoteEventRepeatBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteEventRepeatBox,this)}get tags(){return t.Tags}get event(){return this.getField(1)}get count(){return this.getField(2)}get curve(){return this.getField(3)}get length(){return this.getField(4)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.NoteEventFeature,!0),2:N.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),3:F.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:p},"bipolar","%",0),4:F.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:p},"unipolar","%",1)}}};A();var Fo=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:"shared",ephemeral:!1}),n)}static ClassName="NoteEventCollectionBox";static Resource="shared";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.NoteEvents],mandatory:!1,exclusive:!1}}),2:Z.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.NoteEventCollection],mandatory:!0,exclusive:!1}})}}};A();var yl=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteRegionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteRegionBox,this)}get tags(){return t.Tags}get regions(){return this.getField(1)}get events(){return this.getField(2)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get eventOffset(){return this.getField(14)}get mute(){return this.getField(15)}get label(){return this.getField(16)}get hue(){return this.getField(17)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),10:N.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:N.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:N.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:N.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:N.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:p},"any","ppqn"),15:B.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:p}),16:T.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:p}),17:N.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};A();var ls=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get loop(){return this.getField(1)}get reverse(){return this.getField(2)}get mute(){return this.getField(3)}get speed(){return this.getField(4)}get quantise(){return this.getField(5)}get trigger(){return this.getField(6)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:p},!0),2:B.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:p}),4:N.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:p},"non-negative",""),5:N.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:p},"non-negative",""),6:N.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:p},"non-negative","")}}};var iu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteClipBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteClipBox,this)}get tags(){return t.Tags}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:ls.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:N.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:B.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:T.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:N.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};A();var Xn=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueEventBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueEventBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueEventBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get position(){return this.getField(10)}get index(){return this.getField(11)}get interpolation(){return this.getField(12)}get value(){return this.getField(13)}get slope(){return this.getField(14)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEvents,!0),10:N.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:N.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:N.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[l.ValueInterpolation],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),13:F.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:p},"any",""),14:F.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:p},"any","",NaN)}}};A();var Qn=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:"shared",ephemeral:!1}),n)}static ClassName="ValueEventCollectionBox";static Resource="shared";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.ValueEvents],mandatory:!1,exclusive:!1}}),2:Z.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.ValueEventCollection],mandatory:!0,exclusive:!1}})}}};A();var as=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueEventCurveBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="ValueEventCurveBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueEventCurveBox,this)}get tags(){return t.Tags}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.ValueInterpolation,!0),2:F.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:p},"unipolar","%",.5)}}};A();var wl=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueRegionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueRegionBox,this)}get tags(){return t.Tags}get regions(){return this.getField(1)}get events(){return this.getField(2)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get mute(){return this.getField(14)}get label(){return this.getField(15)}get hue(){return this.getField(16)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),10:N.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:N.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:N.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:N.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:B.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:T.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:N.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};A();var nu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueClipBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueClipBox,this)}get tags(){return t.Tags}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:ls.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:N.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:B.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:T.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:N.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};A();var au=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SignatureEventBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="SignatureEventBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitSignatureEventBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get index(){return this.getField(9)}get relativePosition(){return this.getField(10)}get nominator(){return this.getField(21)}get denominator(){return this.getField(22)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.SignatureAutomation,!0),9:N.create({parent:this,fieldKey:9,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),10:N.create({parent:this,fieldKey:10,fieldName:"relativePosition",deprecated:!1,pointerRules:p},"positive","bars",1),21:N.create({parent:this,fieldKey:21,fieldName:"nominator",deprecated:!1,pointerRules:p},"positive","",4),22:N.create({parent:this,fieldKey:22,fieldName:"denominator",deprecated:!1,pointerRules:p},"positive","",4)}}};A();var Yv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get in(){return this.getField(1)}get out(){return this.getField(2)}get inSlope(){return this.getField(3)}get outSlope(){return this.getField(4)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"in",deprecated:!1,pointerRules:p},"positive","ppqn",0),2:F.create({parent:this,fieldKey:2,fieldName:"out",deprecated:!1,pointerRules:p},"positive","ppqn",0),3:F.create({parent:this,fieldKey:3,fieldName:"inSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.75),4:F.create({parent:this,fieldKey:4,fieldName:"outSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.25)}}};var os=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioRegionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioRegionBox,this)}get tags(){return t.Tags}get regions(){return this.getField(1)}get file(){return this.getField(2)}get playback(){return this.getField(3)}get timeBase(){return this.getField(4)}get events(){return this.getField(5)}get warping(){return this.getField(6)}get waveformOffset(){return this.getField(7)}get playMode(){return this.getField(8)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get mute(){return this.getField(14)}get label(){return this.getField(15)}get hue(){return this.getField(16)}get gain(){return this.getField(17)}get fading(){return this.getField(18)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:T.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:p},"musical"),5:I.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:I.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:F.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:I.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:N.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:F.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","mixed"),12:F.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","mixed"),13:F.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"any","mixed"),14:B.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:T.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:N.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),17:F.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),18:Yv.create({parent:this,fieldKey:18,fieldName:"fading",deprecated:!1,pointerRules:p})}}};A();var ou=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioClipBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioClipBox,this)}get tags(){return t.Tags}get clips(){return this.getField(1)}get file(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get events(){return this.getField(5)}get warping(){return this.getField(6)}get waveformOffset(){return this.getField(7)}get playMode(){return this.getField(8)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}get gain(){return this.getField(14)}get playback(){return this.getField(20)}get timeBase(){return this.getField(21)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:ls.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),5:I.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:I.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:F.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:I.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:F.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"any","ppqn"),11:B.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:T.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:N.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),14:F.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),20:T.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!0,pointerRules:p}),21:T.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:p},"musical")}}};A();var su=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioPitchStretchBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioPitchStretchBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioPitchStretchBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}})}}};A();var lu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioTimeStretchBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioTimeStretchBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioTimeStretchBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}get transientPlayMode(){return this.getField(2)}get playbackRate(){return this.getField(3)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:N.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:p},"positive","enum",2),3:F.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:p},"positive","ratio",1)}}};A();var cu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioSignalsmithBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioSignalsmithBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioSignalsmithBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}get transpose(){return this.getField(2)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:F.create({parent:this,fieldKey:2,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-24,max:24,scaling:"linear"},"st",0)}}};A();var sv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TransientMarkerBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TransientMarkerBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitTransientMarkerBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get position(){return this.getField(2)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.TransientMarkers,!0),2:F.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};A();var $a=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WarpMarkerBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="WarpMarkerBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitWarpMarkerBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get position(){return this.getField(2)}get seconds(){return this.getField(3)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.WarpMarkers,!0),2:N.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:F.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};A();var uu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MarkerBox",pointerRules:{accepts:[l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="MarkerBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMarkerBox,this)}get tags(){return t.Tags}get track(){return this.getField(1)}get position(){return this.getField(2)}get plays(){return this.getField(3)}get label(){return this.getField(4)}get hue(){return this.getField(5)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:p},l.MarkerTrack,!0),2:N.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:N.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:p},"non-negative","",1),4:T.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:N.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};A();var dn=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioFileBox",pointerRules:{accepts:[l.AudioFile,l.FileUploadState,l.MetaData],mandatory:!0,exclusive:!1},resource:"preserved",ephemeral:!1}),n)}static ClassName="AudioFileBox";static Resource="preserved";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioFileBox,this)}get tags(){return t.Tags}get startInSeconds(){return this.getField(1)}get endInSeconds(){return this.getField(2)}get fileName(){return this.getField(3)}get transientMarkers(){return this.getField(10)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),2:F.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),3:T.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[l.TransientMarkers],mandatory:!1,exclusive:!1}})}}};A();var ka=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[l.SoundfontFile],mandatory:!0,exclusive:!1},resource:"preserved",ephemeral:!1}),n)}static ClassName="SoundfontFileBox";static Resource="preserved";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitSoundfontFileBox,this)}get tags(){return t.Tags}get fileName(){return this.getField(1)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:p})}}};A();var lv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NeuralAmpModelBox",pointerRules:{accepts:[l.NeuralAmpModel],mandatory:!0,exclusive:!1},resource:"preserved",ephemeral:!1}),n)}static ClassName="NeuralAmpModelBox";static Resource="preserved";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNeuralAmpModelBox,this)}get tags(){return t.Tags}get label(){return this.getField(1)}get model(){return this.getField(2)}get packId(){return this.getField(3)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:p}),2:T.create({parent:this,fieldKey:2,fieldName:"model",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"packId",deprecated:!1,pointerRules:p})}}};A();var Xv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get automationCollapsed(){return this.getField(1)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"automationCollapsed",deprecated:!1,pointerRules:p})}}};var it=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[l.Selection,l.Automation,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioUnitBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioUnitBox,this)}get tags(){return t.Tags}get type(){return this.getField(1)}get collection(){return this.getField(2)}get editing(){return this.getField(3)}get index(){return this.getField(11)}get volume(){return this.getField(12)}get panning(){return this.getField(13)}get mute(){return this.getField(14)}get solo(){return this.getField(15)}get tracks(){return this.getField(20)}get midiEffects(){return this.getField(21)}get input(){return this.getField(22)}get audioEffects(){return this.getField(23)}get auxSends(){return this.getField(24)}get output(){return this.getField(25)}get capture(){return this.getField(26)}get userInterface(){return this.getField(30)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"type",deprecated:!1,pointerRules:p},"instrument"),2:I.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioUnits,!0),3:Z.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:N.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:F.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-96,mid:-9,max:6,scaling:"decibel"},"dB"),13:F.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),14:B.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:B.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:Z.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[l.TrackCollection],mandatory:!1,exclusive:!1}}),21:Z.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),22:Z.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost,l.AudioOutput],mandatory:!1,exclusive:!0}}),23:Z.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),24:Z.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[l.AuxSend],mandatory:!1,exclusive:!1}}),25:I.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!1),26:I.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:p},l.Capture,!1),30:Xv.create({parent:this,fieldKey:30,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};A();var Ia=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[l.Capture],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CaptureAudioBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitCaptureAudioBox,this)}get tags(){return t.Tags}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get requestChannels(){return this.getField(10)}get gainDb(){return this.getField(11)}get inputLatency(){return this.getField(12)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:p}),2:T.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:N.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:p},"any","",2),11:F.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:p},"decibel","dB",0),12:F.create({parent:this,fieldKey:12,fieldName:"inputLatency",deprecated:!1,pointerRules:p},"any","s",-2)}}};A();var Ba=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[l.Capture],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CaptureMidiBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitCaptureMidiBox,this)}get tags(){return t.Tags}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get channel(){return this.getField(10)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:p}),2:T.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:N.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:p},"any","",-1)}}};A();var ea=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioBusBox",pointerRules:{accepts:[l.SideChain,l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioBusBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioBusBox,this)}get tags(){return t.Tags}get collection(){return this.getField(1)}get output(){return this.getField(2)}get input(){return this.getField(3)}get enabled(){return this.getField(4)}get icon(){return this.getField(5)}get label(){return this.getField(6)}get color(){return this.getField(7)}get minimized(){return this.getField(8)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioBusses,!0),2:I.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:Z.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!1,exclusive:!1}}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:p}),6:T.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:p}),7:T.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:p},"red"),8:B.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:p})}}};A();var du=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AuxSendBox",pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AuxSendBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAuxSendBox,this)}get tags(){return t.Tags}get audioUnit(){return this.getField(1)}get targetBus(){return this.getField(2)}get index(){return this.getField(3)}get routing(){return this.getField(4)}get sendGain(){return this.getField(5)}get sendPan(){return this.getField(6)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:p},l.AuxSend,!0),2:I.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:N.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:p},{values:[0,1]},"",1),5:F.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB"),6:F.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};A();var pu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[l.Groove],mandatory:!0,exclusive:!1},resource:"internal",ephemeral:!1}),n)}static ClassName="GrooveShuffleBox";static Resource="internal";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitGrooveShuffleBox,this)}get tags(){return t.Tags}get label(){return this.getField(1)}get amount(){return this.getField(10)}get duration(){return this.getField(11)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:p}),10:F.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6),11:N.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"non-negative","ppqn",480)}}};A();var cv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="UnknownAudioEffectDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitUnknownAudioEffectDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get comment(){return this.getField(10)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};A();var uv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="UnknownMidiEffectDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitUnknownMidiEffectDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get comment(){return this.getField(10)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};A();var dv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="DeviceInterfaceKnobBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitDeviceInterfaceKnobBox,this)}get tags(){return t.Tags}get userInterface(){return this.getField(1)}get parameter(){return this.getField(2)}get index(){return this.getField(3)}get anchor(){return this.getField(10)}get color(){return this.getField(11)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:p},l.DeviceUserInterface,!0),2:I.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.ParameterController,!0),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),10:F.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:p},"unipolar","%"),11:T.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:p})}}};A();var Qv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[l.DeviceUserInterface],mandatory:!1,exclusive:!1}})}}};var pv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModularDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitModularDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modularSetup(){return this.getField(10)}get userInterface(){return this.getField(11)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:p},l.ModularSetup,!0),11:Qv.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};A();var fv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="StereoToolDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitStereoToolDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get panning(){return this.getField(11)}get stereo(){return this.getField(12)}get invertL(){return this.getField(13)}get invertR(){return this.getField(14)}get swap(){return this.getField(15)}get panningMixing(){return this.getField(20)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-72,mid:0,max:12,scaling:"decibel"},"dB",0),11:F.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),12:F.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),13:B.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),14:B.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:B.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:N.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:p},{values:[0,1]},"",0)}}};A();var fu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MaximizerDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="MaximizerDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitMaximizerDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lookahead(){return this.getField(10)}get threshold(){return this.getField(11)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:p},!0),11:F.create({parent:this,fieldKey:11,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:0,scaling:"linear"},"dB",0)}}};A();var hv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CompressorDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitCompressorDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lookahead(){return this.getField(10)}get automakeup(){return this.getField(11)}get autoattack(){return this.getField(12)}get autorelease(){return this.getField(13)}get inputgain(){return this.getField(14)}get threshold(){return this.getField(15)}get ratio(){return this.getField(16)}get knee(){return this.getField(17)}get attack(){return this.getField(18)}get release(){return this.getField(19)}get makeup(){return this.getField(20)}get mix(){return this.getField(21)}get sideChain(){return this.getField(30)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),11:B.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!0),12:B.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),13:B.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),14:F.create({parent:this,fieldKey:14,fieldName:"inputgain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-30,max:30,scaling:"linear"},"dB",0),15:F.create({parent:this,fieldKey:15,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-60,max:0,scaling:"linear"},"dB",-10),16:F.create({parent:this,fieldKey:16,fieldName:"ratio",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:24,scaling:"exponential"},"",2),17:F.create({parent:this,fieldKey:17,fieldName:"knee",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),18:F.create({parent:this,fieldKey:18,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:100,scaling:"linear"},"ms",0),19:F.create({parent:this,fieldKey:19,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:5,max:1500,scaling:"linear"},"ms",25),20:F.create({parent:this,fieldKey:20,fieldName:"makeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-40,max:40,scaling:"linear"},"dB",0),21:F.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),30:I.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};A();var mv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"GateDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="GateDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitGateDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get threshold(){return this.getField(10)}get return(){return this.getField(11)}get attack(){return this.getField(12)}get hold(){return this.getField(13)}get release(){return this.getField(14)}get floor(){return this.getField(15)}get inverse(){return this.getField(16)}get sideChain(){return this.getField(30)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-80,max:0,scaling:"linear"},"dB",-6),11:F.create({parent:this,fieldKey:11,fieldName:"return",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),12:F.create({parent:this,fieldKey:12,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",1),13:F.create({parent:this,fieldKey:13,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:500,scaling:"linear"},"ms",50),14:F.create({parent:this,fieldKey:14,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:2e3,scaling:"linear"},"ms",100),15:F.create({parent:this,fieldKey:15,fieldName:"floor",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-72,max:0,scaling:"linear"},"dB",-72),16:B.create({parent:this,fieldKey:16,fieldName:"inverse",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),30:I.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};A();var gv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="DelayDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitDelayDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get delayMusical(){return this.getField(10)}get feedback(){return this.getField(11)}get cross(){return this.getField(12)}get filter(){return this.getField(13)}get wet(){return this.getField(14)}get dry(){return this.getField(15)}get preSyncTimeLeft(){return this.getField(16)}get preMillisTimeLeft(){return this.getField(17)}get preSyncTimeRight(){return this.getField(19)}get preMillisTimeRight(){return this.getField(20)}get delayMillis(){return this.getField(22)}get lfoSpeed(){return this.getField(23)}get lfoDepth(){return this.getField(24)}get version(){return this.getField(99)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"delayMusical",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",13),11:F.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),12:F.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:F.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:F.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),15:F.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),16:F.create({parent:this,fieldKey:16,fieldName:"preSyncTimeLeft",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",8),17:F.create({parent:this,fieldKey:17,fieldName:"preMillisTimeLeft",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),19:F.create({parent:this,fieldKey:19,fieldName:"preSyncTimeRight",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",0),20:F.create({parent:this,fieldKey:20,fieldName:"preMillisTimeRight",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),22:F.create({parent:this,fieldKey:22,fieldName:"delayMillis",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),23:F.create({parent:this,fieldKey:23,fieldName:"lfoSpeed",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.1,max:5,scaling:"exponential"},"Hz",.1),24:F.create({parent:this,fieldKey:24,fieldName:"lfoDepth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:50,scaling:"linear"},"ms",0),99:N.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};A();var vv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AutotuneDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AutotuneDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitAutotuneDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get key(){return this.getField(10)}get scale(){return this.getField(11)}get amount(){return this.getField(12)}get retune(){return this.getField(13)}get shift(){return this.getField(14)}get smooth(){return this.getField(15)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"key",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:11},"",0),11:N.create({parent:this,fieldKey:11,fieldName:"scale",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:7},"",1),12:F.create({parent:this,fieldKey:12,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:F.create({parent:this,fieldKey:13,fieldName:"retune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),14:F.create({parent:this,fieldKey:14,fieldName:"shift",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-12,max:12,scaling:"linear"},"st",0),15:F.create({parent:this,fieldKey:15,fieldName:"smooth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6)}}};A();var xv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CrusherDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitCrusherDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get crush(){return this.getField(10)}get bits(){return this.getField(11)}get boost(){return this.getField(12)}get mix(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),11:N.create({parent:this,fieldKey:11,fieldName:"bits",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:16},"bits",16),12:F.create({parent:this,fieldKey:12,fieldName:"boost",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),13:F.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:1,scaling:"exponential"},"%",1)}}};A();var yv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"DattorroReverbDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="DattorroReverbDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitDattorroReverbDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get preDelay(){return this.getField(10)}get bandwidth(){return this.getField(11)}get inputDiffusion1(){return this.getField(12)}get inputDiffusion2(){return this.getField(13)}get decay(){return this.getField(14)}get decayDiffusion1(){return this.getField(15)}get decayDiffusion2(){return this.getField(16)}get damping(){return this.getField(17)}get excursionRate(){return this.getField(18)}get excursionDepth(){return this.getField(19)}get wet(){return this.getField(20)}get dry(){return this.getField(21)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),11:F.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.9999),12:F.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),13:F.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.625),14:F.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),15:F.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),16:F.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),17:F.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.005),18:F.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),19:F.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),20:F.create({parent:this,fieldKey:20,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),21:F.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};A();var wv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"VelocityDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="VelocityDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitVelocityDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get magnetPosition(){return this.getField(10)}get magnetStrength(){return this.getField(11)}get randomSeed(){return this.getField(12)}get randomAmount(){return this.getField(13)}get offset(){return this.getField(14)}get mix(){return this.getField(15)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:F.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:N.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",2048),13:F.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),14:F.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),15:F.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};A();var bv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="FoldDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitFoldDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get drive(){return this.getField(10)}get overSampling(){return this.getField(11)}get volume(){return this.getField(12)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"drive",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:30,scaling:"linear"},"dB",0),11:N.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:p},{length:3},"",0),12:F.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-18,max:0,scaling:"linear"},"dB",0)}}};A();var _v=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TidalDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TidalDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitTidalDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get slope(){return this.getField(10)}get symmetry(){return this.getField(11)}get rate(){return this.getField(20)}get depth(){return this.getField(21)}get offset(){return this.getField(22)}get channelOffset(){return this.getField(23)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",-.25),11:F.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),20:F.create({parent:this,fieldKey:20,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:16,scaling:"linear"},"",3),21:F.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","",1),22:F.create({parent:this,fieldKey:22,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0),23:F.create({parent:this,fieldKey:23,fieldName:"channelOffset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0)}}};A();var Yp=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get order(){return this.getField(11)}get q(){return this.getField(12)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:F.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:N.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},""),12:F.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Xp=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get gain(){return this.getField(11)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:F.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:F.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB")}}};var Eu=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get gain(){return this.getField(11)}get q(){return this.getField(12)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:F.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:F.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB"),12:F.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Fv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="RevampDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitRevampDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get highPass(){return this.getField(10)}get lowShelf(){return this.getField(11)}get lowBell(){return this.getField(12)}get midBell(){return this.getField(13)}get highBell(){return this.getField(14)}get highShelf(){return this.getField(15)}get lowPass(){return this.getField(16)}get gain(){return this.getField(17)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Yp.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:p}),11:Xp.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:p}),12:Eu.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:p}),13:Eu.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:p}),14:Eu.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:p}),15:Xp.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:p}),16:Yp.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:p}),17:F.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-18,max:18,scaling:"linear"},"db")}}};A();var Av=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ReverbDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitReverbDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get decay(){return this.getField(10)}get preDelay(){return this.getField(11)}get damp(){return this.getField(12)}get filter(){return this.getField(13)}get wet(){return this.getField(14)}get dry(){return this.getField(15)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:F.create({parent:this,fieldKey:11,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:.5,scaling:"exponential"},"s",0),12:F.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),13:F.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:F.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-3),15:F.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};A();var ex=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get waveform(){return this.getField(1)}get volume(){return this.getField(2)}get octave(){return this.getField(3)}get tune(){return this.getField(4)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1,2,3]},""),2:F.create({parent:this,fieldKey:2,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","db",-1/0),3:N.create({parent:this,fieldKey:3,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-3,max:3},"oct",0),4:F.create({parent:this,fieldKey:4,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct")}}};var tx=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get waveform(){return this.getField(1)}get rate(){return this.getField(2)}get sync(){return this.getField(3)}get targetTune(){return this.getField(10)}get targetCutoff(){return this.getField(11)}get targetVolume(){return this.getField(12)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1,2,3]},""),2:F.create({parent:this,fieldKey:2,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1e-4,max:30,scaling:"exponential"},"Hz",1e-4),3:B.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),10:F.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),11:F.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),12:F.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%")}}};var rx=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get attack(){return this.getField(1)}get hold(){return this.getField(2)}get release(){return this.getField(3)}get volume(){return this.getField(4)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),2:F.create({parent:this,fieldKey:2,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),3:F.create({parent:this,fieldKey:3,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),4:F.create({parent:this,fieldKey:4,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","db",.001)}}};var hu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="VaporisateurDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitVaporisateurDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get octave(){return this.getField(11)}get tune(){return this.getField(12)}get waveform(){return this.getField(13)}get cutoff(){return this.getField(14)}get resonance(){return this.getField(15)}get attack(){return this.getField(16)}get release(){return this.getField(17)}get filterEnvelope(){return this.getField(18)}get decay(){return this.getField(19)}get sustain(){return this.getField(20)}get glideTime(){return this.getField(21)}get voicingMode(){return this.getField(22)}get unisonCount(){return this.getField(23)}get unisonDetune(){return this.getField(24)}get unisonStereo(){return this.getField(25)}get filterOrder(){return this.getField(26)}get filterKeyboard(){return this.getField(27)}get lfo(){return this.getField(30)}get oscillators(){return this.getField(40)}get noise(){return this.getField(50)}get version(){return this.getField(99)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),11:N.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","oct"),12:F.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","ct"),13:N.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),14:F.create({parent:this,fieldKey:14,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),15:F.create({parent:this,fieldKey:15,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"q"),16:F.create({parent:this,fieldKey:16,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s"),17:F.create({parent:this,fieldKey:17,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s"),18:F.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),19:F.create({parent:this,fieldKey:19,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),20:F.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),21:F.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),22:N.create({parent:this,fieldKey:22,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),23:N.create({parent:this,fieldKey:23,fieldName:"unisonCount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[1,3,5]},"",1),24:F.create({parent:this,fieldKey:24,fieldName:"unisonDetune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:1200,scaling:"exponential"},"ct",30),25:F.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),26:N.create({parent:this,fieldKey:26,fieldName:"filterOrder",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[1,2,3,4]},"",1),27:F.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),30:tx.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:p}),40:qn.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:p},e=>ex.create(e),2),50:rx.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:p}),99:N.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};A();var ix=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get id(){return this.getField(1)}get label(){return this.getField(2)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"id",deprecated:!1,pointerRules:p}),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p})}}};var mu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIOutputDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="MIDIOutputDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitMIDIOutputDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get deprecatedDevice(){return this.getField(10)}get channel(){return this.getField(11)}get deprecatedDelay(){return this.getField(12)}get parameters(){return this.getField(13)}get device(){return this.getField(14)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:ix.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:p}),11:N.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:p},{min:0,max:15},"ch"),12:N.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:p},"any","ms",10),13:Z.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),14:I.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:p},l.MIDIDevice,!1)}}};A();var ss=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIOutputBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="MIDIOutputBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMIDIOutputBox,this)}get tags(){return t.Tags}get root(){return this.getField(1)}get device(){return this.getField(2)}get id(){return this.getField(3)}get label(){return this.getField(4)}get delayInMs(){return this.getField(5)}get sendTransportMessages(){return this.getField(6)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.MIDIDevice,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!0,exclusive:!1}}),3:T.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:N.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:p},{min:0,max:500},"ms",10),6:B.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:p},!0)}}};A();var bl=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIOutputParameterBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="MIDIOutputParameterBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMIDIOutputParameterBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get label(){return this.getField(2)}get controller(){return this.getField(3)}get value(){return this.getField(4)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Parameter,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:N.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:p},{min:0,max:127},"#",64),4:F.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!0,exclusive:!1}},"unipolar","%")}}};A();var gu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="SoundfontDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitSoundfontDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get file(){return this.getField(10)}get presetIndex(){return this.getField(11)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:p},l.SoundfontFile,!1),11:N.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:p},{min:0,max:65535},"")}}};A();var nx=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get wave1(){return this.getField(1)}get wave2(){return this.getField(2)}get dcwKeyFollow(){return this.getField(3)}get dcaKeyFollow(){return this.getField(4)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"wave1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:8},"",0),2:N.create({parent:this,fieldKey:2,fieldName:"wave2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:9},"",0),3:F.create({parent:this,fieldKey:3,fieldName:"dcwKeyFollow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:9,scaling:"linear"},"",0),4:F.create({parent:this,fieldKey:4,fieldName:"dcaKeyFollow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:9,scaling:"linear"},"",0)}}};var ax=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get rate1(){return this.getField(1)}get rate2(){return this.getField(2)}get rate3(){return this.getField(3)}get rate4(){return this.getField(4)}get rate5(){return this.getField(5)}get rate6(){return this.getField(6)}get rate7(){return this.getField(7)}get rate8(){return this.getField(8)}get level1(){return this.getField(11)}get level2(){return this.getField(12)}get level3(){return this.getField(13)}get level4(){return this.getField(14)}get level5(){return this.getField(15)}get level6(){return this.getField(16)}get level7(){return this.getField(17)}get level8(){return this.getField(18)}get sustain(){return this.getField(20)}get end(){return this.getField(21)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"rate1",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),2:F.create({parent:this,fieldKey:2,fieldName:"rate2",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),3:F.create({parent:this,fieldKey:3,fieldName:"rate3",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),4:F.create({parent:this,fieldKey:4,fieldName:"rate4",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),5:F.create({parent:this,fieldKey:5,fieldName:"rate5",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),6:F.create({parent:this,fieldKey:6,fieldName:"rate6",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),7:F.create({parent:this,fieldKey:7,fieldName:"rate7",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),8:F.create({parent:this,fieldKey:8,fieldName:"rate8",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),11:F.create({parent:this,fieldKey:11,fieldName:"level1",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),12:F.create({parent:this,fieldKey:12,fieldName:"level2",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),13:F.create({parent:this,fieldKey:13,fieldName:"level3",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),14:F.create({parent:this,fieldKey:14,fieldName:"level4",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),15:F.create({parent:this,fieldKey:15,fieldName:"level5",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),16:F.create({parent:this,fieldKey:16,fieldName:"level6",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),17:F.create({parent:this,fieldKey:17,fieldName:"level7",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),18:F.create({parent:this,fieldKey:18,fieldName:"level8",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),20:N.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:p},{min:0,max:8},"",0),21:N.create({parent:this,fieldKey:21,fieldName:"end",deprecated:!1,pointerRules:p},{min:1,max:8},"",1)}}};var ox=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get wave(){return this.getField(1)}get delay(){return this.getField(2)}get rate(){return this.getField(3)}get depth(){return this.getField(4)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"wave",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},"",0),2:F.create({parent:this,fieldKey:2,fieldName:"delay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:99,scaling:"linear"},"",0),3:F.create({parent:this,fieldKey:3,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:99,scaling:"linear"},"",0),4:F.create({parent:this,fieldKey:4,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:99,scaling:"linear"},"",0)}}};var vu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NeonDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NeonDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitNeonDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lineSelect(){return this.getField(10)}get modulation(){return this.getField(11)}get octave(){return this.getField(12)}get detune(){return this.getField(13)}get glideTime(){return this.getField(15)}get tune(){return this.getField(16)}get voicingMode(){return this.getField(17)}get vibrato(){return this.getField(20)}get lines(){return this.getField(30)}get envelopes(){return this.getField(40)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"lineSelect",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},"",0),11:N.create({parent:this,fieldKey:11,fieldName:"modulation",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),12:N.create({parent:this,fieldKey:12,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-3,max:3},"oct",0),13:F.create({parent:this,fieldKey:13,fieldName:"detune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-4800,max:4800,scaling:"linear"},"ct",0),15:F.create({parent:this,fieldKey:15,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),16:F.create({parent:this,fieldKey:16,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct",0),17:N.create({parent:this,fieldKey:17,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),20:ox.create({parent:this,fieldKey:20,fieldName:"vibrato",deprecated:!1,pointerRules:p}),30:qn.create({parent:this,fieldKey:30,fieldName:"lines",deprecated:!1,pointerRules:p},e=>nx.create(e),2),40:qn.create({parent:this,fieldKey:40,fieldName:"envelopes",deprecated:!1,pointerRules:p},e=>ax.create(e),6)}}};A();var xu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NanoDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitNanoDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get file(){return this.getField(15)}get release(){return this.getField(20)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-3),15:I.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1),20:F.create({parent:this,fieldKey:20,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:8,scaling:"exponential"},"s",.1)}}};A();var yu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="PlayfieldDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitPlayfieldDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get samples(){return this.getField(10)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Z.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};A();var Ta=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[l.Editing,l.SideChain,l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="PlayfieldSampleBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes",copyable:!1});constructor(e){super(e)}accept(e){return $(e.visitPlayfieldSampleBox,this)}get tags(){return t.Tags}get device(){return this.getField(10)}get file(){return this.getField(11)}get midiEffects(){return this.getField(12)}get audioEffects(){return this.getField(13)}get index(){return this.getField(15)}get label(){return this.getField(20)}get icon(){return this.getField(21)}get enabled(){return this.getField(22)}get minimized(){return this.getField(23)}get mute(){return this.getField(40)}get solo(){return this.getField(41)}get exclude(){return this.getField(42)}get polyphone(){return this.getField(43)}get gate(){return this.getField(44)}get pitch(){return this.getField(45)}get sampleStart(){return this.getField(46)}get sampleEnd(){return this.getField(47)}get attack(){return this.getField(48)}get release(){return this.getField(49)}get volume(){return this.getField(50)}get panning(){return this.getField(51)}initializeFields(){return{10:I.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:p},l.Sample,!0),11:I.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),12:Z.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),13:Z.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),15:N.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),20:T.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!0,pointerRules:p}),21:T.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:p}),22:B.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),23:B.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:B.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),41:B.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),42:B.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),43:B.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),44:N.create({parent:this,fieldKey:44,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),45:F.create({parent:this,fieldKey:45,fieldName:"pitch",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct"),46:F.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),47:F.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),48:F.create({parent:this,fieldKey:48,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),49:F.create({parent:this,fieldKey:49,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.02),50:F.create({parent:this,fieldKey:50,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),51:F.create({parent:this,fieldKey:51,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};A();var wu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain,l.Automation],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TapeDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"audio"});constructor(e){super(e)}accept(e){return $(e.visitTapeDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get flutter(){return this.getField(10)}get wow(){return this.getField(11)}get noise(){return this.getField(12)}get saturation(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),11:F.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:F.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),13:F.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%")}}};A();var Ev=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ArpeggioDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitArpeggioDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modeIndex(){return this.getField(10)}get numOctaves(){return this.getField(11)}get rateIndex(){return this.getField(12)}get gate(){return this.getField(13)}get repeat(){return this.getField(14)}get velocity(){return this.getField(15)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"modeIndex",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),11:N.create({parent:this,fieldKey:11,fieldName:"numOctaves",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:5},"oct",1),12:N.create({parent:this,fieldKey:12,fieldName:"rateIndex",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:17},"",9),13:F.create({parent:this,fieldKey:13,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:2,scaling:"linear"},"",1),14:N.create({parent:this,fieldKey:14,fieldName:"repeat",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:16},"",1),15:F.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","",0)}}};A();var Sv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="PitchDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitPitchDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get semiTones(){return this.getField(10)}get cents(){return this.getField(11)}get octaves(){return this.getField(12)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"semiTones",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-36,max:36},"st",0),11:F.create({parent:this,fieldKey:11,fieldName:"cents",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-50,max:50,scaling:"linear"},"ct",0),12:N.create({parent:this,fieldKey:12,fieldName:"octaves",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-7,max:7},"oct",0)}}};A();var Pv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ZeitgeistDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitZeitgeistDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get groove(){return this.getField(10)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0)}}};A();var Mv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NeuralAmpDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NeuralAmpDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitNeuralAmpDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modelJson(){return this.getField(10)}get inputGain(){return this.getField(11)}get outputGain(){return this.getField(12)}get mono(){return this.getField(13)}get mix(){return this.getField(14)}get model(){return this.getField(20)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"modelJson",deprecated:!0,pointerRules:p}),11:F.create({parent:this,fieldKey:11,fieldName:"inputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),12:F.create({parent:this,fieldKey:12,fieldName:"outputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),13:B.create({parent:this,fieldKey:13,fieldName:"mono",deprecated:!1,pointerRules:p},!0),14:F.create({parent:this,fieldKey:14,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1,scaling:"linear"},"%",1),20:I.create({parent:this,fieldKey:20,fieldName:"model",deprecated:!1,pointerRules:p},l.NeuralAmpModel,!1)}}};A();var Nv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"VocoderDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="VocoderDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitVocoderDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get carrierMinFreq(){return this.getField(10)}get carrierMaxFreq(){return this.getField(11)}get modulatorMinFreq(){return this.getField(12)}get modulatorMaxFreq(){return this.getField(13)}get qEnd(){return this.getField(14)}get qStart(){return this.getField(15)}get envRelease(){return this.getField(16)}get mix(){return this.getField(17)}get bandCount(){return this.getField(18)}get modulatorSource(){return this.getField(19)}get envAttack(){return this.getField(20)}get gain(){return this.getField(21)}get sideChain(){return this.getField(30)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"carrierMinFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",100),11:F.create({parent:this,fieldKey:11,fieldName:"carrierMaxFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",12e3),12:F.create({parent:this,fieldKey:12,fieldName:"modulatorMinFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",100),13:F.create({parent:this,fieldKey:13,fieldName:"modulatorMaxFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",12e3),14:F.create({parent:this,fieldKey:14,fieldName:"qEnd",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:60,scaling:"exponential"},"",2),15:F.create({parent:this,fieldKey:15,fieldName:"qStart",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:60,scaling:"exponential"},"",20),16:F.create({parent:this,fieldKey:16,fieldName:"envRelease",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",30),17:F.create({parent:this,fieldKey:17,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),18:N.create({parent:this,fieldKey:18,fieldName:"bandCount",deprecated:!1,pointerRules:p},{values:[8,12,16]},"",16),19:T.create({parent:this,fieldKey:19,fieldName:"modulatorSource",deprecated:!1,pointerRules:p},"noise-pink"),20:F.create({parent:this,fieldKey:20,fieldName:"envAttack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.1,max:100,scaling:"exponential"},"ms",5),21:F.create({parent:this,fieldKey:21,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-20,max:20,scaling:"linear"},"dB",0),30:I.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};A();var $v=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WaveshaperDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="WaveshaperDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitWaveshaperDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get equation(){return this.getField(10)}get inputGain(){return this.getField(11)}get outputGain(){return this.getField(12)}get mix(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"equation",deprecated:!1,pointerRules:p},"hardclip"),11:F.create({parent:this,fieldKey:11,fieldName:"inputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:40,scaling:"linear"},"dB",0),12:F.create({parent:this,fieldKey:12,fieldName:"outputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB",0),13:F.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};A();var kv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WerkstattDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="WerkstattDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitWerkstattDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get code(){return this.getField(10)}get parameters(){return this.getField(11)}get samples(){return this.getField(12)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:Z.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};A();var Da=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WerkstattParameterBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="WerkstattParameterBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitWerkstattParameterBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get label(){return this.getField(2)}get index(){return this.getField(3)}get value(){return this.getField(4)}get defaultValue(){return this.getField(5)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Parameter,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:F.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),5:F.create({parent:this,fieldKey:5,fieldName:"defaultValue",deprecated:!1,pointerRules:p},"any","")}}};A();var _l=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WerkstattSampleBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="WerkstattSampleBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitWerkstattSampleBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get label(){return this.getField(2)}get index(){return this.getField(3)}get file(){return this.getField(4)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Sample,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:I.create({parent:this,fieldKey:4,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1)}}};A();var Iv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SpielwerkDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="SpielwerkDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitSpielwerkDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get code(){return this.getField(10)}get parameters(){return this.getField(11)}get samples(){return this.getField(12)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:Z.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};A();var bu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ApparatDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ApparatDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitApparatDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get code(){return this.getField(10)}get parameters(){return this.getField(11)}get samples(){return this.getField(12)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:Z.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};A();var sx=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get length(){return this.getField(1)}get steps(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"length",deprecated:!1,pointerRules:p},{min:1,max:64},"",16),2:qn.create({parent:this,fieldKey:2,fieldName:"steps",deprecated:!1,pointerRules:p},e=>N.create(e,"any","",60),64)}}};var _u=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CubedDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CubedDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitCubedDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get tuning(){return this.getField(10)}get cutoff(){return this.getField(11)}get resonance(){return this.getField(12)}get envMod(){return this.getField(13)}get decay(){return this.getField(14)}get accent(){return this.getField(15)}get volume(){return this.getField(16)}get waveform(){return this.getField(17)}get patternIndex(){return this.getField(20)}get patterns(){return this.getField(30)}get version(){return this.getField(99)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"tuning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct",0),11:F.create({parent:this,fieldKey:11,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),12:F.create({parent:this,fieldKey:12,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:F.create({parent:this,fieldKey:13,fieldName:"envMod",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),14:F.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),15:F.create({parent:this,fieldKey:15,fieldName:"accent",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),16:F.create({parent:this,fieldKey:16,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-12),17:N.create({parent:this,fieldKey:17,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1]},"",0),20:N.create({parent:this,fieldKey:20,fieldName:"patternIndex",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:15},"",0),30:qn.create({parent:this,fieldKey:30,fieldName:"patterns",deprecated:!1,pointerRules:p},e=>sx.create(e),16),99:N.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};A();var Fu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoopInstrumentBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoopInstrumentBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"audio"});constructor(e){super(e)}accept(e){return $(e.visitNoopInstrumentBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1)}}};A();var Bv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CompositeDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CompositeDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitCompositeDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get cells(){return this.getField(10)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Z.hook({parent:this,fieldKey:10,fieldName:"cells",deprecated:!1,pointerRules:{accepts:[l.CompositeCell],mandatory:!1,exclusive:!1}})}}};A();var Tv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CompositeCellBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CompositeCellBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitCompositeCellBox,this)}get tags(){return t.Tags}get composite(){return this.getField(1)}get instrument(){return this.getField(2)}get midiEffects(){return this.getField(3)}get audioEffects(){return this.getField(4)}get index(){return this.getField(5)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"composite",deprecated:!1,pointerRules:p},l.CompositeCell,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"instrument",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost],mandatory:!0,exclusive:!1}}),3:Z.hook({parent:this,fieldKey:3,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),4:Z.hook({parent:this,fieldKey:4,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),5:N.create({parent:this,fieldKey:5,fieldName:"index",deprecated:!1,pointerRules:p},"index","")}}};A();var Dv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioEffectCompositeBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioEffectCompositeBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitAudioEffectCompositeBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get entries(){return this.getField(10)}get input(){return this.getField(11)}get dry(){return this.getField(12)}get wet(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Z.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:F.create({parent:this,fieldKey:12,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-1/0),13:F.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};A();var Au=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioEffectCompositeCellBox",pointerRules:{accepts:[l.Editing,l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioEffectCompositeCellBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioEffectCompositeCellBox,this)}get tags(){return t.Tags}get composite(){return this.getField(1)}get audioEffects(){return this.getField(2)}get index(){return this.getField(3)}get label(){return this.getField(4)}get minimized(){return this.getField(5)}get gain(){return this.getField(40)}get mute(){return this.getField(41)}get solo(){return this.getField(42)}get pan(){return this.getField(43)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"composite",deprecated:!1,pointerRules:p},l.AudioEffectCompositeCell,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:T.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:F.create({parent:this,fieldKey:40,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),41:B.create({parent:this,fieldKey:41,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),42:B.create({parent:this,fieldKey:42,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),43:F.create({parent:this,fieldKey:43,fieldName:"pan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};A();var Rv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"StereoCompositeBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="StereoCompositeBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitStereoCompositeBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get entries(){return this.getField(10)}get input(){return this.getField(11)}get dry(){return this.getField(12)}get wet(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Z.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:F.create({parent:this,fieldKey:12,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-1/0),13:F.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};A();var Cv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"FrequencySplitBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="FrequencySplitBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitFrequencySplitBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get entries(){return this.getField(10)}get input(){return this.getField(11)}get dry(){return this.getField(12)}get wet(){return this.getField(13)}get crossover1(){return this.getField(14)}get crossover2(){return this.getField(15)}get crossover3(){return this.getField(16)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Z.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:F.create({parent:this,fieldKey:12,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-1/0),13:F.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),14:F.create({parent:this,fieldKey:14,fieldName:"crossover1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",200),15:F.create({parent:this,fieldKey:15,fieldName:"crossover2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",1e3),16:F.create({parent:this,fieldKey:16,fieldName:"crossover3",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",5e3)}}};A();var zv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="ModularBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModularBox,this)}get tags(){return t.Tags}get collection(){return this.getField(1)}get device(){return this.getField(2)}get editing(){return this.getField(3)}get modules(){return this.getField(11)}get connections(){return this.getField(12)}get label(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModularSetup,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!0,exclusive:!1}}),3:Z.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[l.ModuleCollection],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[l.ConnectionCollection],mandatory:!1,exclusive:!1}}),13:T.create({parent:this,fieldKey:13,fieldName:"label",deprecated:!1,pointerRules:p})}}};A();var Ov=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleConnectionBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleConnectionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleConnectionBox,this)}get tags(){return t.Tags}get collection(){return this.getField(1)}get source(){return this.getField(2)}get target(){return this.getField(3)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ConnectionCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:p},l.VoltageConnection,!0),3:I.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:p},l.VoltageConnection,!0)}}};A();var pn=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get collection(){return this.getField(1)}get label(){return this.getField(2)}get x(){return this.getField(3)}get y(){return this.getField(4)}get collapsed(){return this.getField(5)}get removable(){return this.getField(6)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModuleCollection,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:N.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:p},"any","x"),4:N.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:p},"any","y"),5:B.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:p},!1),6:B.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:p},!0)}}};var Vv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModularAudioInputBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModularAudioInputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:pn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};A();var Uv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModularAudioOutputBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModularAudioOutputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:pn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};A();var jv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleDelayBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleDelayBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get voltageInput(){return this.getField(10)}get voltageOutput(){return this.getField(11)}get time(){return this.getField(20)}initializeFields(){return{1:pn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:F.create({parent:this,fieldKey:20,fieldName:"time",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1,exclusive:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",500)}}};A();var Kv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleMultiplierBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleMultiplierBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get voltageInputX(){return this.getField(10)}get voltageInputY(){return this.getField(11)}get voltageOutput(){return this.getField(12)}get multiplier(){return this.getField(20)}initializeFields(){return{1:pn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:F.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:p},"unipolar","%")}}};A();var Wv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleGainBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleGainBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get voltageInput(){return this.getField(10)}get voltageOutput(){return this.getField(12)}get gain(){return this.getField(20)}initializeFields(){return{1:pn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:F.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1,exclusive:!1}},"decibel","dB")}}};A();rt();A();rt();A();var Fi;(function(t){t.map=e=>e===Bt.Int32||e===Bt.Boolean?Jr.None:Jr.Linear,t.write=(e,r)=>{if(r.type==="none")e.disconnect(),e.setValue(0);else if(r.type==="linear")e.disconnect(),e.setValue(1);else if(r.type==="curve"){e.setValue(0);let n=e.pointerHub.filter(l.ValueInterpolation).at(0)?.box;K(n)?(n_(n,as),n.slope.setValue(r.slope)):as.create(e.box.graph,k.generate(),i=>{i.slope.setValue(r.slope),i.event.refer(e)})}},t.read=e=>{let r=e.pointerHub.incoming().at(0)?.box;return K(r)?(n_(r,as),{type:"curve",slope:r.slope.getValue()}):e.getValue()===0?Jr.None:e.getValue()===1?Jr.Linear:W("Unknown Interpolation value")}})(Fi||(Fi={}));var cs=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},at=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Qp,Su,Kt,ef,us,tf,Ao=class t{constructor(e,r){this.type="value-event",Qp.set(this,new ae),Su.set(this,void 0),Kt.set(this,void 0),ef.set(this,void 0),us.set(this,void 0),tf.set(this,!1),cs(this,Su,e,"f"),cs(this,Kt,r,"f"),cs(this,ef,at(this,Qp,"f").own(new wg(()=>Fi.read(at(this,Kt,"f").interpolation))),"f");let n=()=>{at(this,ef,"f").invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};at(this,Qp,"f").ownAll(at(this,Kt,"f").subscribe(Ke.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let a=this.collection.unwrap(),o=i.address.fieldKeys,s=ie.equals(at(this,Kt,"f").index.address.fieldKeys,o),c=ie.equals(at(this,Kt,"f").position.address.fieldKeys,o);s||c?a.requestSorting():a.onEventPropertyChanged()}}),at(this,Kt,"f").interpolation.subscribe(n),at(this,Kt,"f").interpolation.pointerHub.subscribe({onAdded:({box:i})=>{at(this,us,"f").terminate(),cs(this,us,i.subscribe(Ke.Children,n),"f"),n()},onRemoved:()=>{at(this,us,"f").terminate(),cs(this,us,ve.Empty,"f"),n()}})),cs(this,us,at(this,Kt,"f").interpolation.pointerHub.filter(l.ValueInterpolation).at(0)?.box.subscribe(Ke.Children,n)??ve.Empty,"f")}onSelected(){cs(this,tf,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){cs(this,tf,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){at(this,us,"f").terminate(),at(this,Qp,"f").terminate()}get box(){return at(this,Kt,"f")}get uuid(){return at(this,Kt,"f").address.uuid}get address(){return at(this,Kt,"f").address}get position(){return at(this,Kt,"f").position.getValue()}get index(){return at(this,Kt,"f").index.getValue()}set interpolation(e){Fi.write(at(this,Kt,"f").interpolation,e)}get interpolation(){return at(this,ef,"f").get()}get value(){return at(this,Kt,"f").value.getValue()}get isSelected(){return at(this,tf,"f")}get collection(){return at(this,Kt,"f").events.targetVertex.map(e=>at(this,Su,"f").boxAdapters.adapterFor(e.box,Or))}copyTo(e){let r=e?.position??this.position,n=e?.index??this.index,i=Xn.create(at(this,Su,"f").boxGraph,k.generate(),a=>{a.position.setValue(r),a.index.setValue(n),a.events.refer(e?.events??this.collection.unwrap("collection").box.events),a.value.setValue(e?.value??this.value)});return Fi.write(i.interpolation,e?.interpolation??this.interpolation),at(this,Su,"f").boxAdapters.adapterFor(i,t)}copyFrom(e){return at(this,Kt,"f").position.setValue(e?.position??this.position),at(this,Kt,"f").index.setValue(e?.index??this.index),at(this,Kt,"f").events.refer(e?.events??this.collection.unwrap("collection").box.events),at(this,Kt,"f").value.setValue(e?.value??this.value),Fi.write(at(this,Kt,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};Qp=new WeakMap,Su=new WeakMap,Kt=new WeakMap,ef=new WeakMap,us=new WeakMap,tf=new WeakMap;Ao.Comparator=(t,e)=>{if(t===e)return W(`${t} is equal to itself`);let r=t.position-e.position;if(r!==0)return r;let n=t.index-e.index;return n!==0?n:W(`${t} and ${e} are identical in terms of comparison`)};var rf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},nt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},nf,af,ds,fn,Fl,Pu,Eo,lx,Or=class t{constructor(e,r){nf.add(this),af.set(this,new ae),ds.set(this,void 0),fn.set(this,void 0),Fl.set(this,void 0),Pu.set(this,void 0),Eo.set(this,void 0),rf(this,ds,e,"f"),rf(this,fn,r,"f"),rf(this,Fl,new xe,"f"),rf(this,Pu,k.newSet(i=>i.uuid),"f"),rf(this,Eo,qr.create(Ao.Comparator),"f");let n=i=>{let a=He(i.accept({visitValueEventBox:o=>nt(this,ds,"f").boxAdapters.adapterFor(o,Ao)}),`Could not find adapter for ${i}`);nt(this,Pu,"f").add(a)&&(nt(this,Eo,"f").add(a),nt(this,nf,"m",lx).call(this))};nt(this,fn,"f").events.pointerHub.incoming().forEach(({box:i})=>n(i)),nt(this,af,"f").own(nt(this,fn,"f").events.pointerHub.subscribe({onAdded:({box:i})=>n(i),onRemoved:({box:{address:{uuid:i}}})=>{nt(this,Eo,"f").remove(nt(this,Pu,"f").removeByKey(i)),nt(this,nf,"m",lx).call(this)}})),nt(this,af,"f").own(nt(this,fn,"f").owners.pointerHub.subscribe({onAdded:()=>nt(this,Fl,"f").notify(this),onRemoved:()=>nt(this,Fl,"f").notify(this)}))}valueAt(e,r){return Hg.valueAt(nt(this,Eo,"f"),e,r)}copy(){let e=nt(this,ds,"f").boxGraph,r=Qn.create(e,k.generate());return nt(this,Eo,"f").asArray().forEach(n=>n.copyTo({events:r.events})),nt(this,ds,"f").boxAdapters.adapterFor(r,t)}cut(e,r=E.unipolar()){let n=this.events.lowerEqual(e),i=this.events.greaterEqual(e);if(i===null)return n===null?_.None:_.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n===null)return _.wrap(this.createEvent({position:e,value:i.value,index:i.index,interpolation:i.interpolation}));if(n.position===e)return _.wrap(n);if(i.position===e)return _.wrap(i);if(n.interpolation.type==="none")return _.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n.interpolation.type==="linear"){let{position:a}=n,{position:o}=i,s=r.x(n.value),c=r.x(i.value),u=YM(s,c,(e-a)/(o-a));return _.wrap(this.createEvent({position:e,value:r.y(u),index:0,interpolation:n.interpolation}))}if(n.interpolation.type==="curve"){let{position:a}=n,{position:o}=i,s=r.x(n.value),c=r.x(i.value),u=o-a,f=e-a,v=cr.byHalf(u,s,cr.valueAt({slope:n.interpolation.slope,steps:u,y0:s,y1:c},u*.5),c),m=cr.valueAt(v,f),w=cr.slopeByHalf(s,cr.valueAt(v,f*.5),m);return Fi.write(n.box.interpolation,Jr.Curve(w)),_.wrap(this.createEvent({position:e,value:r.y(m),index:0,interpolation:Jr.Curve(cr.slopeByHalf(m,cr.valueAt(v,(f+u)*.5),c))}))}return W("Unknown interpolation type")}subscribeChange(e){return nt(this,Fl,"f").subscribe(e)}createEvent({position:e,index:r,value:n,interpolation:i}){let a=Math.trunc(e),o=nt(this,Pu,"f").values().find(c=>c.position===a&&c.index===r);if(K(o)&&o.box.isAttached())return o.box.value.setValue(n),Fi.write(o.box.interpolation,i),o;let s=Xn.create(nt(this,ds,"f").boxGraph,k.generate(),c=>{c.position.setValue(e),c.index.setValue(r),c.value.setValue(n),c.events.refer(nt(this,fn,"f").events)});return Fi.write(s.interpolation,i),nt(this,ds,"f").boxAdapters.adapterFor(s,Ao)}requestSorting(){nt(this,Eo,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){nt(this,nf,"m",lx).call(this)}terminate(){nt(this,af,"f").terminate()}get box(){return nt(this,fn,"f")}get uuid(){return nt(this,fn,"f").address.uuid}get address(){return nt(this,fn,"f").address}get numOwners(){return nt(this,fn,"f").owners.pointerHub.filter(l.ValueEventCollection).length}get events(){return nt(this,Eo,"f")}toString(){return`{ValueEventCollectionBox ${k.toString(nt(this,fn,"f").address.uuid)}}`}};af=new WeakMap,ds=new WeakMap,fn=new WeakMap,Fl=new WeakMap,Pu=new WeakMap,Eo=new WeakMap,nf=new WeakSet,lx=function(){nt(this,Fl,"f").notify(this)};var Al=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ge=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},El,ps,Sl,pr,Pl,lf,of,sf,Mu,fs=class{constructor(e,r){El.add(this),this.type="value-clip",ps.set(this,new ae),Sl.set(this,void 0),pr.set(this,void 0),Pl.set(this,void 0),lf.set(this,void 0),of.set(this,void 0),sf.set(this,ve.Empty),Al(this,Sl,e,"f"),Al(this,pr,r,"f"),Al(this,of,!0,"f"),Al(this,Pl,Ge(this,ps,"f").own(new un(!1)),"f"),Al(this,lf,Ge(this,ps,"f").own(new xe),"f"),Ge(this,ps,"f").own(Ge(this,pr,"f").pointerHub.subscribe({onAdded:()=>Ge(this,El,"m",Mu).call(this),onRemoved:()=>Ge(this,El,"m",Mu).call(this)})),Ge(this,ps,"f").own(Ge(this,pr,"f").subscribe(Ke.Children,n=>Ge(this,El,"m",Mu).call(this))),Ge(this,ps,"f").own(Ge(this,pr,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ge(this,sf,"f").terminate(),Al(this,sf,n.match({none:()=>ve.Empty,some:({box:i})=>Ge(this,Sl,"f").boxAdapters.adapterFor(i,Or).subscribeChange(()=>Ge(this,El,"m",Mu).call(this))}),"f"),Ge(this,El,"m",Mu).call(this)})),Al(this,of,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(e%this.duration,r)}catchupAndSubscribeSelected(e){return Ge(this,Pl,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ge(this,lf,"f").subscribe(e)}accept(e){return $(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ge(this,pr,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:Ge(this,pr,"f").events.targetVertex.unwrap("events.target");nu.create(Ge(this,Sl,"f").boxGraph,k.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(Ge(this,pr,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){Ge(this,Pl,"f").setValue(!0)}onDeselected(){Ge(this,Pl,"f").setValue(!1)}get isSelected(){return Ge(this,Pl,"f").getValue()}terminate(){Ge(this,sf,"f").terminate(),Ge(this,ps,"f").terminate()}get box(){return Ge(this,pr,"f")}get uuid(){return Ge(this,pr,"f").address.uuid}get address(){return Ge(this,pr,"f").address}get indexField(){return Ge(this,pr,"f").index}get duration(){return Ge(this,pr,"f").duration.getValue()}get mute(){return Ge(this,pr,"f").mute.getValue()}get hue(){return Ge(this,pr,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Ge(this,pr,"f").events.targetVertex.map(e=>Ge(this,Sl,"f").boxAdapters.adapterFor(e.box,Or))}get label(){return Ge(this,pr,"f").label.getValue()}get trackBoxAdapter(){return Ge(this,of,"f")?_.None:Ge(this,pr,"f").clips.targetVertex.map(e=>Ge(this,Sl,"f").boxAdapters.adapterFor(e.box,fr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${k.toString(Ge(this,pr,"f").address.uuid)} d: ${Ve.toString(this.duration)}}`}};ps=new WeakMap,Sl=new WeakMap,pr=new WeakMap,Pl=new WeakMap,lf=new WeakMap,of=new WeakMap,sf=new WeakMap,El=new WeakSet,Mu=function(){Ge(this,lf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};rt();A();A();rt();A();var cx=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},hn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},cf,ux,Ml,df,uf,dx,Nu=class{constructor(e){cf.add(this),this.type="transient-marker",ux.set(this,new ae),Ml.set(this,void 0),df.set(this,void 0),uf.set(this,!1),cx(this,Ml,e,"f"),cx(this,df,new xe,"f"),hn(this,ux,"f").own(e.subscribe(Ke.Children,()=>hn(this,cf,"m",dx).call(this)))}onSelected(){cx(this,uf,!0,"f"),hn(this,cf,"m",dx).call(this)}onDeselected(){cx(this,uf,!1,"f"),hn(this,cf,"m",dx).call(this)}get box(){return hn(this,Ml,"f")}get uuid(){return hn(this,Ml,"f").address.uuid}get address(){return hn(this,Ml,"f").address}get position(){return hn(this,Ml,"f").position.getValue()}get isSelected(){return hn(this,uf,"f")}subscribe(e){return hn(this,df,"f").subscribe(e)}terminate(){hn(this,ux,"f").terminate()}};ux=new WeakMap,Ml=new WeakMap,df=new WeakMap,uf=new WeakMap,cf=new WeakSet,dx=function(){hn(this,df,"f").notify()};var pf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Vr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},px,ff,Ra,hf,$u,fx,ta=class t{constructor(e,r){px.set(this,new ae),ff.set(this,void 0),Ra.set(this,void 0),hf.set(this,void 0),$u.set(this,void 0),fx.set(this,void 0),pf(this,ff,e,"f"),pf(this,Ra,r,"f"),pf(this,hf,k.newSet(({uuid:n})=>n),"f"),pf(this,$u,qr.create(t.Comparator),"f"),pf(this,fx,zg.memoizeAsync(async()=>{if(this.data.nonEmpty())return this.data.unwrap();let{promise:n,resolve:i,reject:a}=Promise.withResolvers(),o=this.getOrCreateLoader(),s=o.subscribe(c=>{c.type==="loaded"?(queueMicrotask(()=>s.terminate()),i(o.data.unwrap("State mismatch"))):c.type==="error"&&(queueMicrotask(()=>s.terminate()),a(new Error(c.reason)))});return n}),"f"),Vr(this,px,"f").ownAll(r.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Vr(this,ff,"f").boxAdapters.adapterFor(n.box,Nu);Vr(this,hf,"f").add(i)&&Vr(this,$u,"f").add(i)},onRemoved:({box:{address:{uuid:n}}})=>{Vr(this,$u,"f").remove(Vr(this,hf,"f").removeByKey(n))}}))}get box(){return Vr(this,Ra,"f")}get uuid(){return Vr(this,Ra,"f").address.uuid}get address(){return Vr(this,Ra,"f").address}get startInSeconds(){return Vr(this,Ra,"f").startInSeconds.getValue()}get endInSeconds(){return Vr(this,Ra,"f").endInSeconds.getValue()}get transients(){return Vr(this,$u,"f")}get fileName(){return Vr(this,Ra,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return Vr(this,fx,"f").call(this)}getOrCreateLoader(){return Vr(this,ff,"f").sampleManager.getOrCreate(Vr(this,Ra,"f").address.uuid)}terminate(){Vr(this,px,"f").terminate()}};px=new WeakMap,ff=new WeakMap,Ra=new WeakMap,hf=new WeakMap,$u=new WeakMap,fx=new WeakMap;ta.Comparator=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),W("Events at the same position: "+t.position+", "+e.position)):r};A();rt();A();var mf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},di=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},gf,hx,mx,So,xf,vf,gx,Ca=class{constructor(e,r){gf.add(this),this.type="warp-marker",hx.set(this,new ae),mx.set(this,void 0),So.set(this,void 0),xf.set(this,void 0),vf.set(this,!1),mf(this,mx,e,"f"),mf(this,So,r,"f"),mf(this,xf,new xe,"f"),di(this,hx,"f").own(r.subscribe(Ke.Children,()=>di(this,gf,"m",gx).call(this)))}onSelected(){mf(this,vf,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),di(this,gf,"m",gx).call(this)}onDeselected(){mf(this,vf,!1,"f"),di(this,gf,"m",gx).call(this)}get box(){return di(this,So,"f")}get uuid(){return di(this,So,"f").address.uuid}get address(){return di(this,So,"f").address}get position(){return di(this,So,"f").position.getValue()}get seconds(){return di(this,So,"f").seconds.getValue()}get isSelected(){return di(this,vf,"f")}get optWarping(){return di(this,So,"f").owner.targetVertex.map(e=>di(this,mx,"f").boxAdapters.adapterFor(e.box,za.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return di(this,xf,"f").subscribe(e)}terminate(){di(this,hx,"f").terminate()}};hx=new WeakMap,mx=new WeakMap,So=new WeakMap,xf=new WeakMap,vf=new WeakMap,gf=new WeakSet,gx=function(){di(this,xf,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};A();var ku=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),W("Events at the same position: "+t.position+", "+e.position)):r};var yf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Yr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},vx,xx,Nl,$l,wf,Iu,Oa=class{constructor(e,r){vx.set(this,new ae),xx.set(this,void 0),Nl.set(this,void 0),$l.set(this,void 0),wf.set(this,void 0),Iu.set(this,void 0),yf(this,xx,e,"f"),yf(this,Nl,r,"f"),yf(this,$l,new xe,"f"),yf(this,wf,k.newSet(({uuid:n})=>n),"f"),yf(this,Iu,qr.create(ku),"f"),Yr(this,vx,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Yr(this,xx,"f").boxAdapters.adapterFor(n.box,Ca);Yr(this,wf,"f").add(i)&&(Yr(this,Iu,"f").add(i),Yr(this,$l,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Yr(this,Iu,"f").remove(Yr(this,wf,"f").removeByKey(n)),Yr(this,$l,"f").notify()}}))}get box(){return Yr(this,Nl,"f")}get uuid(){return Yr(this,Nl,"f").address.uuid}get address(){return Yr(this,Nl,"f").address}get warpMarkers(){return Yr(this,Iu,"f")}clone(){let e=su.create(Yr(this,Nl,"f").graph,k.generate());return this.warpMarkers.asArray().forEach(r=>$a.create(e.graph,k.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Yr(this,$l,"f").subscribe(e)}onChanged(){Yr(this,$l,"f").notify()}terminate(){Yr(this,vx,"f").terminate()}};vx=new WeakMap,xx=new WeakMap,Nl=new WeakMap,$l=new WeakMap,wf=new WeakMap,Iu=new WeakMap;A();rt();var bf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},hr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},yx,wx,ra,kl,_f,Bu,Va=class{constructor(e,r){yx.set(this,new ae),wx.set(this,void 0),ra.set(this,void 0),kl.set(this,void 0),_f.set(this,void 0),Bu.set(this,void 0),bf(this,wx,e,"f"),bf(this,ra,r,"f"),bf(this,kl,new xe,"f"),bf(this,_f,k.newSet(({uuid:n})=>n),"f"),bf(this,Bu,qr.create(ku),"f"),hr(this,yx,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=hr(this,wx,"f").boxAdapters.adapterFor(n.box,Ca);hr(this,_f,"f").add(i)&&(hr(this,Bu,"f").add(i),hr(this,kl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{hr(this,Bu,"f").remove(hr(this,_f,"f").removeByKey(n)),hr(this,kl,"f").notify()}}))}get box(){return hr(this,ra,"f")}get uuid(){return hr(this,ra,"f").address.uuid}get address(){return hr(this,ra,"f").address}get warpMarkers(){return hr(this,Bu,"f")}get playbackRate(){return hr(this,ra,"f").playbackRate.getValue()}get cents(){return Math.log2(hr(this,ra,"f").playbackRate.getValue())*1200}set cents(e){hr(this,ra,"f").playbackRate.setValue(Se(2**(e/1200),.5,2))}get transientPlayMode(){return fo(hr(this,ra,"f").transientPlayMode.getValue(),Qg)}clone(){let e=lu.create(hr(this,ra,"f").graph,k.generate(),r=>{r.transientPlayMode.setValue(this.transientPlayMode),r.playbackRate.setValue(this.playbackRate),r.warpMarkers});return this.warpMarkers.asArray().forEach(r=>$a.create(e.graph,k.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return hr(this,kl,"f").subscribe(e)}onChanged(){hr(this,kl,"f").notify()}terminate(){hr(this,yx,"f").terminate()}};yx=new WeakMap,wx=new WeakMap,ra=new WeakMap,kl=new WeakMap,_f=new WeakMap,Bu=new WeakMap;A();rt();var Ff=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Xt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},bx,_x,mn,Il,Af,Tu,Ua=class{constructor(e,r){bx.set(this,new ae),_x.set(this,void 0),mn.set(this,void 0),Il.set(this,void 0),Af.set(this,void 0),Tu.set(this,void 0),Ff(this,_x,e,"f"),Ff(this,mn,r,"f"),Ff(this,Il,new xe,"f"),Ff(this,Af,k.newSet(({uuid:n})=>n),"f"),Ff(this,Tu,qr.create(ku),"f"),Xt(this,bx,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Xt(this,_x,"f").boxAdapters.adapterFor(n.box,Ca);Xt(this,Af,"f").add(i)&&(Xt(this,Tu,"f").add(i),Xt(this,Il,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Xt(this,Tu,"f").remove(Xt(this,Af,"f").removeByKey(n)),Xt(this,Il,"f").notify()}}))}get box(){return Xt(this,mn,"f")}get uuid(){return Xt(this,mn,"f").address.uuid}get address(){return Xt(this,mn,"f").address}get warpMarkers(){return Xt(this,Tu,"f")}get transpose(){return Xt(this,mn,"f").transpose.getValue()}set transpose(e){Xt(this,mn,"f").transpose.setValue(e)}get cents(){return Xt(this,mn,"f").transpose.getValue()*100}set cents(e){Xt(this,mn,"f").transpose.setValue(e/100)}clone(){let e=cu.create(Xt(this,mn,"f").graph,k.generate());return e.transpose.setValue(Xt(this,mn,"f").transpose.getValue()),this.warpMarkers.asArray().forEach(r=>$a.create(e.graph,k.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Xt(this,Il,"f").subscribe(e)}onChanged(){Xt(this,Il,"f").notify()}terminate(){Xt(this,bx,"f").terminate()}};bx=new WeakMap,_x=new WeakMap,mn=new WeakMap,Il=new WeakMap,Af=new WeakMap,Tu=new WeakMap;var za;(function(t){t.isAudioPlayMode=e=>e instanceof Oa||e instanceof Va||e instanceof Ua})(za||(za={}));var Ui=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ae=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Bl,Du,Tl,Wt,Dl,Rl,Ef,Pf,Sf,hs,Ru,Cu,zu,Ou=class{constructor(e,r){Bl.add(this),this.type="audio-clip",Du.set(this,new ae),Tl.set(this,void 0),Wt.set(this,void 0),Dl.set(this,void 0),Rl.set(this,void 0),Ef.set(this,void 0),Pf.set(this,void 0),Sf.set(this,void 0),hs.set(this,_.None),Ru.set(this,_.None),Cu.set(this,ve.Empty),Ui(this,Tl,e,"f"),Ui(this,Wt,r,"f"),Ui(this,Sf,!0,"f"),Ui(this,Dl,new Cr,"f"),Ui(this,Rl,Ae(this,Du,"f").own(new un(!1)),"f"),Ui(this,Ef,dl.aware(e.tempoMap,r.timeBase,r.duration),"f"),Ui(this,Pf,Ae(this,Du,"f").own(new xe),"f"),Ae(this,Du,"f").ownAll(Ae(this,Wt,"f").pointerHub.subscribe({onAdded:()=>Ae(this,Bl,"m",zu).call(this),onRemoved:()=>Ae(this,Bl,"m",zu).call(this)}),Ae(this,Wt,"f").playMode.catchupAndSubscribe(({targetVertex:n})=>{Ae(this,Cu,"f").terminate(),n.match({none:()=>Ae(this,Dl,"f").clear(),some:({box:i})=>{let a=Ae(this,Tl,"f").boxAdapters.adapterFor(i,za.isAudioPlayMode);Ui(this,Cu,a.subscribe(()=>Ae(this,Bl,"m",zu).call(this)),"f"),Ae(this,Dl,"f").wrap(a)}})}),Ae(this,Wt,"f").file.catchupAndSubscribe(n=>{Ui(this,hs,n.targetVertex.map(i=>Ae(this,Tl,"f").boxAdapters.adapterFor(i.box,ta)),"f"),Ae(this,Ru,"f").ifSome(i=>i.terminate()),Ui(this,Ru,Ae(this,hs,"f").map(i=>i.getOrCreateLoader().subscribe(()=>Ae(this,Bl,"m",zu).call(this))),"f")}),Ae(this,Wt,"f").subscribe(Ke.Children,n=>Ae(this,Bl,"m",zu).call(this))),Ui(this,Sf,!1,"f")}catchupAndSubscribeSelected(e){return Ae(this,Rl,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ae(this,Pf,"f").subscribe(e)}accept(e){return $(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){let r=this.observableOptPlayMode.map(n=>n.clone());ou.create(Ae(this,Tl,"f").boxGraph,k.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.gain.setValue(this.gain.getValue()),n.timeBase.setValue(this.timeBase),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(Ae(this,Wt,"f").clips.targetVertex.unwrap("clips.target")),n.file.refer(Ae(this,Wt,"f").file.targetVertex.unwrap("file.target")),n.events.refer(Ae(this,Wt,"f").events.targetVertex.unwrap("events.target")),r.ifSome(i=>n.playMode.refer(i))})}onSelected(){Ae(this,Rl,"f").setValue(!0)}onDeselected(){Ae(this,Rl,"f").setValue(!1)}get isSelected(){return Ae(this,Rl,"f").getValue()}get box(){return Ae(this,Wt,"f")}get uuid(){return Ae(this,Wt,"f").address.uuid}get address(){return Ae(this,Wt,"f").address}get indexField(){return Ae(this,Wt,"f").index}get duration(){return Ae(this,Ef,"f").toPPQN(0)}set duration(e){Ae(this,Ef,"f").fromPPQN(e,0)}get mute(){return Ae(this,Wt,"f").mute.getValue()}get hue(){return Ae(this,Wt,"f").hue.getValue()}get gain(){return Ae(this,Wt,"f").gain}get file(){return Ae(this,hs,"f").unwrap("Cannot access file.")}get optFile(){return Ae(this,hs,"f")}get observableOptPlayMode(){return Ae(this,Dl,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return _.None}get timeBase(){return fo(Ae(this,Wt,"f").timeBase.getValue(),ui)}get waveformOffset(){return Ae(this,Wt,"f").waveformOffset}get isPlayModeNoStretch(){return Ae(this,Wt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>Ft(e,Oa)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Ft(e,Va)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>Ft(e,Ua)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>za.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(Ae(this,hs,"f").isEmpty())return"No Audio File";let e=Ae(this,hs,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):Ae(this,Wt,"f").label.getValue()}get trackBoxAdapter(){return Ae(this,Sf,"f")?_.None:Ae(this,Wt,"f").clips.targetVertex.map(e=>Ae(this,Tl,"f").boxAdapters.adapterFor(e.box,fr))}get isMirrowed(){return!1}get canMirror(){return!1}get canResize(){return Ae(this,Dl,"f").nonEmpty()}terminate(){Ae(this,Ru,"f").ifSome(e=>e.terminate()),Ui(this,Ru,_.None,"f"),Ae(this,Cu,"f").terminate(),Ui(this,Cu,ve.Empty,"f"),Ae(this,Du,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${k.toString(Ae(this,Wt,"f").address.uuid)} d: ${Ve.toString(this.duration)}}`}};Du=new WeakMap,Tl=new WeakMap,Wt=new WeakMap,Dl=new WeakMap,Rl=new WeakMap,Ef=new WeakMap,Pf=new WeakMap,Sf=new WeakMap,hs=new WeakMap,Ru=new WeakMap,Cu=new WeakMap,Bl=new WeakSet,zu=function(){Ae(this,Pf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};A();rt();A();rt();rt();A();var Mf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Qt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Vu,_r,Fx,Nf,Cl=class t{constructor(e,r){this.type="note-event",Vu.set(this,void 0),_r.set(this,void 0),Fx.set(this,void 0),Nf.set(this,!1),Mf(this,Vu,e,"f"),Mf(this,_r,r,"f"),Mf(this,Fx,Qt(this,_r,"f").subscribe(Ke.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.collection.unwrap(),a=n.address.fieldKeys,o=ie.equals(Qt(this,_r,"f").pitch.address.fieldKeys,a),s=ie.equals(Qt(this,_r,"f").position.address.fieldKeys,a);o||s?i.requestSorting():i.onEventPropertyChanged()}}),"f")}onSelected(){Mf(this,Nf,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Mf(this,Nf,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Qt(this,Fx,"f").terminate()}get box(){return Qt(this,_r,"f")}get uuid(){return Qt(this,_r,"f").address.uuid}get address(){return Qt(this,_r,"f").address}get position(){return Qt(this,_r,"f").position.getValue()}get duration(){return Qt(this,_r,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return Qt(this,_r,"f").velocity.getValue()}get pitch(){return Qt(this,_r,"f").pitch.getValue()}get cent(){return Qt(this,_r,"f").cent.getValue()}get chance(){return Qt(this,_r,"f").chance.getValue()}get playCount(){return Qt(this,_r,"f").playCount.getValue()}get playCurve(){return Qt(this,_r,"f").playCurve.getValue()}get isSelected(){return Qt(this,Nf,"f")}get collection(){return Qt(this,_r,"f").events.targetVertex.map(e=>Qt(this,Vu,"f").boxAdapters.adapterFor(e.box,gn))}normalizedPitch(){if(this.collection.isEmpty())return .5;let{minPitch:e,maxPitch:r}=this.collection.unwrap();return e===r?.5:1-(this.pitch-e)/(r-e)}copyAsNoteEvent(){return{type:"note-event",position:this.position,duration:this.duration,pitch:this.pitch,cent:this.cent,velocity:this.velocity}}copyTo(e){return Qt(this,Vu,"f").boxAdapters.adapterFor(ns.create(Qt(this,Vu,"f").boxGraph,k.generate(),r=>{r.position.setValue(e?.position??this.position),r.duration.setValue(e?.duration??this.duration),r.pitch.setValue(e?.pitch??this.pitch),r.playCount.setValue(e?.playCount??this.playCount),r.events.refer(e?.events??this.collection.unwrap("collection").box.events),r.velocity.setValue(this.velocity),r.cent.setValue(this.cent),r.chance.setValue(this.chance)}),t)}computeCurveValue(e){return eu.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,r=this.collection.unwrap("collection").box.events,n=ie.create(i=>{let a=Math.floor(this.computeCurveValue(i/e)*this.duration),o=Math.floor(this.computeCurveValue((i+1)/e)*this.duration);return this.copyTo({position:Math.floor(this.position+a),duration:Math.max(1,o-a),playCount:1,events:r})},e);return Qt(this,_r,"f").delete(),n}};Vu=new WeakMap,_r=new WeakMap,Fx=new WeakMap,Nf=new WeakMap;var ja=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ie=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Po,$f,ms,ia,zl,kf,Ai,Ex,Sx,Px,gs,Ax,If,gn=class t{constructor(e,r){Po.add(this),$f.set(this,new ae),ms.set(this,void 0),ia.set(this,void 0),zl.set(this,void 0),kf.set(this,void 0),Ai.set(this,void 0),Ex.set(this,60),Sx.set(this,60),Px.set(this,0),gs.set(this,!1),ja(this,ms,e,"f"),ja(this,ia,r,"f"),ja(this,zl,new xe,"f"),ja(this,kf,k.newSet(n=>n.uuid),"f"),ja(this,Ai,qr.create(eu.Comparator),"f"),Ie(this,$f,"f").own(Ie(this,ia,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=Ie(this,ms,"f").boxAdapters.adapterFor(n,Cl);Ie(this,kf,"f").add(i)&&(Ie(this,Ai,"f").add(i),Ie(this,Po,"m",Ax).call(this))},onRemoved:({box:{address:{uuid:n}}})=>{Ie(this,Ai,"f").remove(Ie(this,kf,"f").removeByKey(n)),Ie(this,Po,"m",Ax).call(this)}})),Ie(this,$f,"f").own(Ie(this,ia,"f").owners.pointerHub.subscribe({onAdded:()=>Ie(this,zl,"f").notify(this),onRemoved:()=>Ie(this,zl,"f").notify(this)}))}copy(){let e=Ie(this,ms,"f").boxGraph,r=Fo.create(e,k.generate());return Ie(this,Ai,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Ie(this,ms,"f").boxAdapters.adapterFor(r,t)}createEvent({position:e,duration:r,velocity:n,pitch:i,chance:a,playCount:o,cent:s}){return Ie(this,ms,"f").boxAdapters.adapterFor(ns.create(Ie(this,ms,"f").boxGraph,k.generate(),c=>{c.position.setValue(e),c.duration.setValue(r),c.velocity.setValue(n),c.pitch.setValue(i),c.chance.setValue(a),c.playCount.setValue(o),c.cent.setValue(s),c.events.refer(Ie(this,ia,"f").events)}),Cl)}subscribeChange(e){return Ie(this,zl,"f").subscribe(e)}selectable(){return Ie(this,Ai,"f").asArray()}selectableAt(e){for(let r of Ie(this,Ai,"f").asArray())if(r.position<=e.u&&e.u<r.complete&&r.pitch===e.v)return ur.one(r);return ur.empty()}selectablesBetween(e,r){let n=[],i=Ie(this,Ai,"f").asArray(),a=Ie(this,Ai,"f").ceilFirstIndex(r.u);for(let o=0;o<a;o++){let s=i[o];s.complete>e.u&&s.pitch>=e.v&&s.pitch<=r.v&&n.push(s)}return n}overlapping(e,r,n){let i=[];for(let a of Ie(this,Ai,"f").asArray())a.pitch===n&&a.complete>e&&a.position<r&&i.push(a);return i}requestSorting(){Ie(this,Ai,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Ie(this,Po,"m",Ax).call(this)}terminate(){Ie(this,$f,"f").terminate()}get box(){return Ie(this,ia,"f")}get uuid(){return Ie(this,ia,"f").address.uuid}get address(){return Ie(this,ia,"f").address}get numOwners(){return Ie(this,ia,"f").owners.pointerHub.filter(l.NoteEventCollection).length}get events(){return Ie(this,gs,"f")||Ie(this,Po,"m",If).call(this),Ie(this,Ai,"f")}get minPitch(){return Ie(this,gs,"f")||Ie(this,Po,"m",If).call(this),Ie(this,Ex,"f")}get maxPitch(){return Ie(this,gs,"f")||Ie(this,Po,"m",If).call(this),Ie(this,Sx,"f")}get maxDuration(){return Ie(this,gs,"f")||Ie(this,Po,"m",If).call(this),Ie(this,Px,"f")}toString(){return`{NoteEventCollectionBox ${k.toString(Ie(this,ia,"f").address.uuid)}}`}};$f=new WeakMap,ms=new WeakMap,ia=new WeakMap,zl=new WeakMap,kf=new WeakMap,Ai=new WeakMap,Ex=new WeakMap,Sx=new WeakMap,Px=new WeakMap,gs=new WeakMap,Po=new WeakSet,Ax=function(){ja(this,gs,!1,"f"),Ie(this,zl,"f").notify(this)},If=function(){let e=127,r=0,n=0;Ie(this,Ai,"f").asArray().forEach(({pitch:i,duration:a})=>{e=Math.min(e,i),r=Math.max(r,i),n=Math.max(n,a)}),ja(this,Ex,e,"f"),ja(this,Sx,r,"f"),ja(this,Px,n,"f"),ja(this,gs,!0,"f")};var Ol=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},qe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Vl,Uu,Ul,mr,jl,Df,Bf,Tf,ju,Ku=class{constructor(e,r){Vl.add(this),this.type="note-clip",Uu.set(this,new ae),Ul.set(this,void 0),mr.set(this,void 0),jl.set(this,void 0),Df.set(this,void 0),Bf.set(this,void 0),Tf.set(this,ve.Empty),Ol(this,Ul,e,"f"),Ol(this,mr,r,"f"),Ol(this,Bf,!0,"f"),Ol(this,jl,qe(this,Uu,"f").own(new un(!1)),"f"),Ol(this,Df,qe(this,Uu,"f").own(new xe),"f"),qe(this,Uu,"f").ownAll(qe(this,mr,"f").pointerHub.subscribe({onAdded:()=>qe(this,Vl,"m",ju).call(this),onRemoved:()=>qe(this,Vl,"m",ju).call(this)}),qe(this,mr,"f").subscribe(Ke.Children,n=>qe(this,Vl,"m",ju).call(this)),qe(this,mr,"f").events.catchupAndSubscribe(({targetVertex:n})=>{qe(this,Tf,"f").terminate(),Ol(this,Tf,n.match({none:()=>ve.Empty,some:({box:i})=>qe(this,Ul,"f").boxAdapters.adapterFor(i,gn).subscribeChange(()=>qe(this,Vl,"m",ju).call(this))}),"f"),qe(this,Vl,"m",ju).call(this)})),Ol(this,Bf,!1,"f")}catchupAndSubscribeSelected(e){return qe(this,jl,"f").catchupAndSubscribe(e)}subscribeChange(e){return qe(this,Df,"f").subscribe(e)}accept(e){return $(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&qe(this,mr,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:qe(this,mr,"f").events.targetVertex.unwrap("events.target");iu.create(qe(this,Ul,"f").boxGraph,k.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(qe(this,mr,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){qe(this,jl,"f").setValue(!0)}onDeselected(){qe(this,jl,"f").setValue(!1)}get isSelected(){return qe(this,jl,"f").getValue()}terminate(){qe(this,Tf,"f").terminate(),qe(this,Uu,"f").terminate()}get box(){return qe(this,mr,"f")}get uuid(){return qe(this,mr,"f").address.uuid}get address(){return qe(this,mr,"f").address}get indexField(){return qe(this,mr,"f").index}get duration(){return qe(this,mr,"f").duration.getValue()}get mute(){return qe(this,mr,"f").mute.getValue()}get hue(){return qe(this,mr,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return qe(this,mr,"f").events.targetVertex.map(e=>qe(this,Ul,"f").boxAdapters.adapterFor(e.box,gn))}get label(){return qe(this,mr,"f").label.getValue()}get trackBoxAdapter(){return qe(this,Bf,"f")?_.None:qe(this,mr,"f").clips.targetVertex.map(e=>qe(this,Ul,"f").boxAdapters.adapterFor(e.box,fr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${k.toString(qe(this,mr,"f").address.uuid)} d: ${Ve.toString(this.duration)}}`}};Uu=new WeakMap,Ul=new WeakMap,mr=new WeakMap,jl=new WeakMap,Df=new WeakMap,Bf=new WeakMap,Tf=new WeakMap,Vl=new WeakSet,ju=function(){qe(this,Df,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var ck={for:(t,e)=>He(e.accept({visitNoteClipBox:r=>t.adapterFor(r,Ku),visitValueClipBox:r=>t.adapterFor(r,fs),visitAudioClipBox:r=>t.adapterFor(r,Ou)}),"")};var Mx=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},vs=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Nx,Wu,Rf,Cf,$x=class{constructor(e,r){Nx.set(this,void 0),Wu.set(this,void 0),Rf.set(this,void 0),Cf.set(this,void 0),Mx(this,Nx,e,"f"),Mx(this,Wu,new ae,"f"),Mx(this,Rf,vs(this,Wu,"f").own(new xe),"f"),Mx(this,Cf,vs(this,Wu,"f").own(jt.create(e.box.clips,n=>ck.for(r,n),l.ClipCollection)),"f"),vs(this,Cf,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return vs(this,Nx,"f")}get collection(){return vs(this,Cf,"f")}dispatchChange(){vs(this,Rf,"f").notify()}subscribeChanges(e){return vs(this,Rf,"f").subscribe(e)}terminate(){vs(this,Wu,"f").terminate()}};Nx=new WeakMap,Wu=new WeakMap,Rf=new WeakMap,Cf=new WeakMap;rt();A();A();A();rt();rt();var eC=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},vn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},pi,kx=class{constructor(e){pi.set(this,void 0),eC(this,pi,e,"f")}get inField(){return vn(this,pi,"f").in}get outField(){return vn(this,pi,"f").out}get inSlopeField(){return vn(this,pi,"f").inSlope}get outSlopeField(){return vn(this,pi,"f").outSlope}get in(){return vn(this,pi,"f").in.getValue()}get out(){return vn(this,pi,"f").out.getValue()}get inSlope(){return vn(this,pi,"f").inSlope.getValue()}get outSlope(){return vn(this,pi,"f").outSlope.getValue()}get hasFading(){return Wg.hasFading(this)}copyTo(e){e.in.setValue(this.in),e.out.setValue(this.out),e.inSlope.setValue(this.inSlope),e.outSlope.setValue(this.outSlope)}reset(){vn(this,pi,"f").in.setValue(0),vn(this,pi,"f").out.setValue(0),vn(this,pi,"f").inSlope.setValue(.75),vn(this,pi,"f").outSlope.setValue(.25)}};pi=new WeakMap;var At=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ne=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ji,zf,xn,ot,Lu,Zu,Gu,Of,na,Vf,xs,Hu,qu,Ju,Yu,Xu,Qu,ed,yn,td=class t{constructor(e,r){ji.add(this),this.type="audio-region",zf.set(this,void 0),xn.set(this,void 0),ot.set(this,void 0),Lu.set(this,void 0),Zu.set(this,void 0),Gu.set(this,void 0),Of.set(this,void 0),na.set(this,void 0),Vf.set(this,void 0),xs.set(this,_.None),Hu.set(this,ve.Empty),qu.set(this,ve.Empty),Ju.set(this,ve.Empty),Yu.set(this,ve.Empty),Xu.set(this,void 0),Qu.set(this,Number.NaN),ed.set(this,Number.NaN),At(this,xn,e,"f"),At(this,ot,r,"f"),At(this,zf,new ae,"f");let{timeBase:n,duration:i,loopDuration:a}=r;At(this,Lu,dl.aware(e.tempoMap,n,i),"f"),At(this,Zu,dl.aware(e.tempoMap,n,a),"f"),At(this,Gu,new Cr,"f"),At(this,Of,new xe,"f"),At(this,na,new kx(r.fading),"f"),At(this,Xu,!1,"f"),At(this,Vf,!0,"f"),ne(this,zf,"f").ownAll(ne(this,ot,"f").pointerHub.subscribe({onAdded:()=>ne(this,ji,"m",yn).call(this),onRemoved:()=>ne(this,ji,"m",yn).call(this)}),ne(this,ot,"f").file.catchupAndSubscribe(o=>{At(this,xs,o.targetVertex.map(s=>ne(this,xn,"f").boxAdapters.adapterFor(s.box,ta)),"f"),ne(this,Hu,"f").terminate(),At(this,Hu,ne(this,xs,"f").mapOr(s=>s.getOrCreateLoader().subscribe(()=>ne(this,ji,"m",yn).call(this)),ve.Empty),"f")}),ne(this,ot,"f").playMode.catchupAndSubscribe(({targetVertex:o})=>{ne(this,qu,"f").terminate(),o.match({none:()=>ne(this,Gu,"f").clear(),some:({box:s})=>{let c=ne(this,xn,"f").boxAdapters.adapterFor(s,za.isAudioPlayMode);At(this,qu,c.subscribe(()=>ne(this,ji,"m",yn).call(this)),"f"),ne(this,Gu,"f").wrap(c)}})}),ne(this,ot,"f").timeBase.catchupAndSubscribe(o=>{ne(this,Ju,"f").terminate(),fo(o.getValue(),ui)===ui.Seconds&&At(this,Ju,e.tempoMap.subscribe(()=>ne(this,ji,"m",yn).call(this)),"f")}),ne(this,ot,"f").subscribe(Ke.Children,o=>{if(!this.trackBoxAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let s=this.trackBoxAdapter.unwrap();ne(this,ot,"f").position.address.equals(o.address)?(s.regions.onIndexingChanged(),ne(this,ji,"m",yn).call(this)):ne(this,ji,"m",yn).call(this)}}),ne(this,ot,"f").events.catchupAndSubscribe(({targetVertex:o})=>{ne(this,Yu,"f").terminate(),At(this,Yu,o.match({none:()=>ve.Empty,some:({box:s})=>ne(this,xn,"f").boxAdapters.adapterFor(s,Or).subscribeChange(()=>ne(this,ji,"m",yn).call(this))}),"f"),ne(this,ji,"m",yn).call(this)})),At(this,Vf,!1,"f")}subscribeChange(e){return ne(this,Of,"f").subscribe(e)}accept(e){return $(e.visitAudioRegionBoxAdapter,this)}onSelected(){At(this,Xu,!0,"f"),ne(this,ji,"m",yn).call(this)}onDeselected(){At(this,Xu,!1,"f"),ne(this,ji,"m",yn).call(this)}get isSelected(){return ne(this,Xu,"f")}get box(){return ne(this,ot,"f")}get uuid(){return ne(this,ot,"f").address.uuid}get address(){return ne(this,ot,"f").address}get position(){return ne(this,ot,"f").position.getValue()}get duration(){return Number.isNaN(ne(this,Qu,"f"))&&At(this,Qu,ne(this,Lu,"f").toPPQN(this.position),"f"),ne(this,Qu,"f")}get complete(){return this.position+this.duration}get loopOffset(){return ne(this,ot,"f").loopOffset.getValue()}get loopDuration(){return Number.isNaN(ne(this,ed,"f"))&&At(this,ed,ne(this,Zu,"f").toPPQN(this.position),"f"),ne(this,ed,"f")}isNoteRegion(){return!1}isAudioRegion(){return!0}isValueRegion(){return!1}resolveDuration(e){return ne(this,Lu,"f").toPPQN(e)}resolveComplete(e){return e+this.resolveDuration(e)}resolveLoopDuration(e){return ne(this,Zu,"f").toPPQN(e)}get offset(){return this.position-this.loopOffset}get mute(){return ne(this,ot,"f").mute.getValue()}get hue(){return ne(this,ot,"f").hue.getValue()}get gain(){return ne(this,ot,"f").gain}get fading(){return ne(this,na,"f")}get file(){return ne(this,xs,"f").unwrap("Cannot access file.")}get optFile(){return ne(this,xs,"f")}get observableOptPlayMode(){return ne(this,Gu,"f")}get timeBase(){return fo(ne(this,ot,"f").timeBase.getValue(),ui)}get waveformOffset(){return ne(this,ot,"f").waveformOffset}get isPlayModeNoStretch(){return ne(this,ot,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>Ft(e,Oa)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Ft(e,Va)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>Ft(e,Ua)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>za.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(ne(this,xs,"f").isEmpty())return"No Audio File";let e=ne(this,xs,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):ne(this,ot,"f").label.getValue()}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}get trackBoxAdapter(){return ne(this,ot,"f").regions.targetVertex.map(e=>ne(this,xn,"f").boxAdapters.adapterFor(e.box,fr))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return ne(this,ot,"f").events.targetVertex.map(e=>ne(this,xn,"f").boxAdapters.adapterFor(e.box,Or))}set position(e){ne(this,ot,"f").position.setValue(e)}set duration(e){ne(this,Lu,"f").fromPPQN(e,this.position);let r=ne(this,na,"f").in+ne(this,na,"f").out;if(r>e){let n=e/r;ne(this,na,"f").inField.setValue(ne(this,na,"f").in*n),ne(this,na,"f").outField.setValue(ne(this,na,"f").out*n)}}set loopOffset(e){ne(this,ot,"f").loopOffset.setValue(sl(e,this.loopDuration))}set loopDuration(e){ne(this,Zu,"f").fromPPQN(e,this.position)}moveContentStart(e){let r=this.position,n=r+e;if(this.position=n,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e,this.timeBase===ui.Seconds){let i=e>=0?ne(this,xn,"f").tempoMap.intervalToSeconds(r,n):-ne(this,xn,"f").tempoMap.intervalToSeconds(n,r);ne(this,ot,"f").waveformOffset.setValue(this.waveformOffset.getValue()+i)}else this.optWarpMarkers.ifSome(i=>i.asArray().forEach(a=>a.box.position.setValue(a.position-e)))}copyTo(e){let r=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?r.copy().box.owners:r.box.owners,i=this.observableOptPlayMode.map(o=>o.clone()),a=ne(this,xn,"f").boxAdapters.adapterFor(os.create(ne(this,xn,"f").boxGraph,k.generate(),o=>{o.timeBase.setValue(ne(this,ot,"f").timeBase.getValue()),o.position.setValue(e?.position??ne(this,ot,"f").position.getValue()),o.regions.refer(e?.target??ne(this,ot,"f").regions.targetVertex.unwrap("regions.target")),o.file.refer(ne(this,ot,"f").file.targetVertex.unwrap("file.target")),o.events.refer(n),o.mute.setValue(this.mute),o.hue.setValue(this.hue),o.label.setValue(this.label),o.gain.setValue(this.gain.getValue()),o.waveformOffset.setValue(this.waveformOffset.getValue()),i.ifSome(s=>o.playMode.refer(s)),ne(this,na,"f").copyTo(o.fading)}),t);return a.loopDuration=e?.loopDuration??this.resolveLoopDuration(a.position),a.loopOffset=e?.loopOffset??this.loopOffset,a.duration=e?.duration??this.resolveDuration(a.position),a}consolidate(){}canFlatten(e){return e.length>0&&ie.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){return _.None}terminate(){ne(this,Hu,"f").terminate(),At(this,Hu,ve.Empty,"f"),ne(this,Ju,"f").terminate(),At(this,Ju,ve.Empty,"f"),ne(this,qu,"f").terminate(),At(this,qu,ve.Empty,"f"),ne(this,Yu,"f").terminate(),At(this,Yu,ve.Empty,"f"),ne(this,zf,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${k.toString(ne(this,ot,"f").address.uuid)}}`}};zf=new WeakMap,xn=new WeakMap,ot=new WeakMap,Lu=new WeakMap,Zu=new WeakMap,Gu=new WeakMap,Of=new WeakMap,na=new WeakMap,Vf=new WeakMap,xs=new WeakMap,Hu=new WeakMap,qu=new WeakMap,Ju=new WeakMap,Yu=new WeakMap,Xu=new WeakMap,Qu=new WeakMap,ed=new WeakMap,ji=new WeakSet,yn=function(){At(this,Qu,Number.NaN,"f"),At(this,ed,Number.NaN,"f"),!ne(this,Vf,"f")&&(ne(this,Of,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};rt();A();var Mo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Re=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ka,Ix,Wa,Et,Kf,Uf,rd,jf,No,id=class t{constructor(e,r){Ka.add(this),this.type="note-region",Ix.set(this,new ae),Wa.set(this,void 0),Et.set(this,void 0),Kf.set(this,void 0),Uf.set(this,void 0),rd.set(this,void 0),jf.set(this,ve.Empty),Mo(this,Wa,e,"f"),Mo(this,Et,r,"f"),Mo(this,Kf,new xe,"f"),Mo(this,rd,!1,"f"),Mo(this,Uf,!0,"f"),Re(this,Ix,"f").ownAll(Re(this,Et,"f").pointerHub.subscribe({onAdded:()=>Re(this,Ka,"m",No).call(this),onRemoved:()=>Re(this,Ka,"m",No).call(this)}),Re(this,Et,"f").subscribe(Ke.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Re(this,Et,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Re(this,Ka,"m",No).call(this)):Re(this,Ka,"m",No).call(this)}}),Re(this,Et,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Re(this,jf,"f").terminate(),Mo(this,jf,n.match({none:()=>ve.Empty,some:({box:i})=>Re(this,Wa,"f").boxAdapters.adapterFor(i,gn).subscribeChange(()=>Re(this,Ka,"m",No).call(this))}),"f"),Re(this,Ka,"m",No).call(this)})),Mo(this,Uf,!1,"f")}set position(e){Re(this,Et,"f").position.setValue(e)}set duration(e){Re(this,Et,"f").duration.setValue(e)}set loopOffset(e){Re(this,Et,"f").loopOffset.setValue(e)}set loopDuration(e){Re(this,Et,"f").loopDuration.setValue(e)}isNoteRegion(){return!0}isAudioRegion(){return!1}isValueRegion(){return!1}moveContentStart(e){this.optCollection.ifSome(r=>r.events.asArray().forEach(n=>n.box.position.setValue(n.position-e))),this.position=this.position+e,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e}subscribeChange(e){return Re(this,Kf,"f").subscribe(e)}accept(e){return $(e.visitNoteRegionBoxAdapter,this)}onSelected(){Mo(this,rd,!0,"f"),Re(this,Ka,"m",No).call(this)}onDeselected(){Mo(this,rd,!1,"f"),Re(this,Ka,"m",No).call(this)}get isSelected(){return Re(this,rd,"f")}*iterateActiveNotesAt(e){let r=this.optCollection;if(r.isEmpty())return;let n=r.unwrap(),i=go.globalToLocal(this,e);for(let a of n.events.iterateFrom(i-n.maxDuration)){if(i<a.position)return;i<a.complete&&(yield a.copyAsNoteEvent())}}terminate(){Re(this,jf,"f").terminate(),Re(this,Ix,"f").terminate()}get box(){return Re(this,Et,"f")}get uuid(){return Re(this,Et,"f").address.uuid}get address(){return Re(this,Et,"f").address}get position(){return Re(this,Et,"f").position.getValue()}get duration(){return Re(this,Et,"f").duration.getValue()}get loopOffset(){return Re(this,Et,"f").loopOffset.getValue()}get loopDuration(){return Re(this,Et,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}resolveDuration(e){return this.duration}resolveComplete(e){return e+this.duration}resolveLoopDuration(e){return this.loopDuration}get mute(){return Re(this,Et,"f").mute.getValue()}get hue(){return Re(this,Et,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Re(this,Et,"f").events.targetVertex.map(e=>Re(this,Wa,"f").boxAdapters.adapterFor(e.box,gn))}get label(){return Re(this,Et,"f").label.getValue()}get trackBoxAdapter(){return Re(this,Uf,"f")?_.None:Re(this,Et,"f").regions.targetVertex.map(e=>Re(this,Wa,"f").boxAdapters.adapterFor(e.box,fr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}copyTo(e){let r=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?r.copy().box.owners:r.box.owners;return Re(this,Wa,"f").boxAdapters.adapterFor(yl.create(Re(this,Wa,"f").boxGraph,k.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.target??Re(this,Et,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let r=Re(this,Wa,"f").boxGraph,n=Fo.create(r,k.generate());e.events.asArray().forEach(i=>i.copyTo({events:n.events})),Re(this,Et,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&ie.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){if(!this.canFlatten(e))return _.None;let r=Re(this,Wa,"f").boxGraph,n=e.toSorted(Yo.Comparator),i=ie.getFirst(n,"Internal error (no first)"),a=ie.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,c=i.trackBoxAdapter.unwrap("trackBoxAdapter"),u=Fo.create(r,k.generate()),f=Array.from(c.regions.collection.iterateRange(o,s));return f.filter(v=>v.isSelected).forEach(v=>{let m=v;for(let{resultStart:w,resultEnd:y,rawStart:P}of go.locateLoops(m,m.position,m.complete)){let V=Math.floor(w-P),O=Math.floor(y-P);for(let C of m.optCollection.unwrap("optCollection").events.iterateRange(V,O))C.copyTo({position:C.position+P-i.position,events:u.events})}}),f.forEach(({box:v})=>v.delete()),_.wrap(yl.create(r,k.generate(),v=>{v.position.setValue(o),v.duration.setValue(s-o),v.loopDuration.setValue(s-o),v.loopOffset.setValue(0),v.hue.setValue(this.hue),v.mute.setValue(this.mute),v.label.setValue(this.label),v.events.refer(u.owners),v.regions.refer(c.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${k.toString(Re(this,Et,"f").address.uuid)} p: ${Ve.toString(this.position)}, c: ${Ve.toString(this.complete)}}`}};Ix=new WeakMap,Wa=new WeakMap,Et=new WeakMap,Kf=new WeakMap,Uf=new WeakMap,rd=new WeakMap,jf=new WeakMap,Ka=new WeakSet,No=function(){Re(this,Kf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};rt();A();var $o=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},$e=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},aa,nd,La,St,Zf,ad,Wf,Lf,Za,ko=class t{constructor(e,r){aa.add(this),this.type="value-region",nd.set(this,new ae),La.set(this,void 0),St.set(this,void 0),Zf.set(this,void 0),ad.set(this,void 0),Wf.set(this,void 0),Lf.set(this,ve.Empty),$o(this,La,e,"f"),$o(this,St,r,"f"),$o(this,Wf,!0,"f"),$o(this,Zf,new xe,"f"),$o(this,ad,!1,"f"),$e(this,nd,"f").own($e(this,St,"f").pointerHub.subscribe({onAdded:()=>$e(this,aa,"m",Za).call(this),onRemoved:()=>$e(this,aa,"m",Za).call(this)})),$e(this,nd,"f").own($e(this,St,"f").subscribe(Ke.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();$e(this,St,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),$e(this,aa,"m",Za).call(this)):$e(this,aa,"m",Za).call(this)}})),$e(this,nd,"f").own($e(this,St,"f").events.catchupAndSubscribe(({targetVertex:n})=>{$e(this,Lf,"f").terminate(),$o(this,Lf,n.match({none:()=>ve.Empty,some:({box:i})=>$e(this,La,"f").boxAdapters.adapterFor(i,Or).subscribeChange(()=>$e(this,aa,"m",Za).call(this))}),"f"),$e(this,aa,"m",Za).call(this)})),$o(this,Wf,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(go.globalToLocal(this,e),r)}incomingValue(e){let r=this.optCollection;if(r.isEmpty())return e;let n=r.unwrap().events.greaterEqual(0);return K(n)&&n.position===0?n.value:this.valueAt(this.position,e)}outgoingValue(e){let r=this.optCollection;if(r.isEmpty())return e;let n=r.unwrap();return(this.complete-this.offset)%this.loopDuration===0?n.valueAt(this.loopDuration,e):n.valueAt(go.globalToLocal(this,this.complete),e)}subscribeChange(e){return $e(this,Zf,"f").subscribe(e)}accept(e){return $(e.visitValueRegionBoxAdapter,this)}onSelected(){$o(this,ad,!0,"f"),$e(this,aa,"m",Za).call(this)}onDeselected(){$o(this,ad,!1,"f"),$e(this,aa,"m",Za).call(this)}get isSelected(){return $e(this,ad,"f")}onValuesPropertyChanged(){$e(this,aa,"m",Za).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){$e(this,Lf,"f").terminate(),$e(this,nd,"f").terminate()}get box(){return $e(this,St,"f")}get uuid(){return $e(this,St,"f").address.uuid}get address(){return $e(this,St,"f").address}get position(){return $e(this,St,"f").position.getValue()}get duration(){return $e(this,St,"f").duration.getValue()}get loopOffset(){return $e(this,St,"f").loopOffset.getValue()}get loopDuration(){return $e(this,St,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}isNoteRegion(){return!1}isAudioRegion(){return!1}isValueRegion(){return!0}resolveDuration(e){return this.duration}resolveComplete(e){return e+this.duration}resolveLoopDuration(e){return this.loopDuration}get mute(){return $e(this,St,"f").mute.getValue()}get hue(){return $e(this,St,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return $e(this,St,"f").events.targetVertex.map(e=>$e(this,La,"f").boxAdapters.adapterFor(e.box,Or))}get label(){return $e(this,St,"f").label.getValue()}get trackBoxAdapter(){return $e(this,Wf,"f")?_.None:$e(this,St,"f").regions.targetVertex.map(e=>$e(this,La,"f").boxAdapters.adapterFor(e.box,fr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}set position(e){$e(this,St,"f").position.setValue(e)}set duration(e){$e(this,St,"f").duration.setValue(e)}set loopOffset(e){$e(this,St,"f").loopOffset.setValue(e)}set loopDuration(e){$e(this,St,"f").loopDuration.setValue(e)}moveContentStart(e){this.optCollection.ifSome(r=>r.events.asArray().forEach(n=>n.box.position.setValue(n.position-e))),this.position=this.position+e,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e}copyTo(e){let r=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?r.copy().box.owners:r.box.owners;return $e(this,La,"f").boxAdapters.adapterFor(wl.create($e(this,La,"f").boxGraph,k.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.target??$e(this,St,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let r=$e(this,La,"f").boxGraph,n=Qn.create(r,k.generate());e.asArray().forEach(i=>i.copyTo({events:n.events})),$e(this,St,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&ie.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){if(!this.canFlatten(e))return _.None;let r=$e(this,La,"f").boxGraph,n=e.toSorted(Yo.Comparator),i=ie.getFirst(n,"Internal error (no first)"),a=ie.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,c=i.trackBoxAdapter.unwrap("trackBoxAdapter"),u=Array.from(c.regions.collection.iterateRange(o,s)),f=[];u.filter(y=>y.isSelected).forEach(y=>{let P=y,V=P.optCollection.unwrap("optCollection"),O=V.events;for(let{rawStart:C,regionStart:G,regionEnd:Y}of go.locateLoops(P,P.position,P.complete)){let me=G-C,ge=Y-C,Ee=O.greaterEqual(me);if(!K(Ee)||Ee.position!==me){let Me=O.lowerEqual(me);K(Me)&&f.push({position:G-o,value:V.valueAt(me,0),interpolation:Me.interpolation})}let he=!1;for(let Me of O.iterateRange(me,Rr.MAX_VALUE)){let ke=Me.position+C;if(ke<Y)f.push({position:ke-o,value:Me.value,interpolation:Me.interpolation});else if(ke===Y){f.push({position:ke-o,value:Me.value,interpolation:Jr.None}),he=!0;break}else{f.push({position:Y-o,value:V.valueAt(ge,0),interpolation:Jr.None}),he=!0;break}}he||f.push({position:Y-o,value:V.valueAt(ge,0),interpolation:Jr.None})}});let v=[];for(let y of f){let P=v.length>0?v[v.length-1]:void 0;K(P)&&P.position===y.position&&P.value===y.value?v[v.length-1]=y:v.push(y)}let m=Qn.create(r,k.generate()),w=0;for(;w<v.length;){let y=w+1;for(;y<v.length&&v[y].position===v[w].position;)y++;let P=v[w],V=v[y-1],O=Xn.create(r,k.generate(),C=>{C.position.setValue(P.position),C.index.setValue(0),C.value.setValue(P.value),C.events.refer(m.events)});if(Fi.write(O.interpolation,y-w>1?Jr.None:P.interpolation),y-w>1){let C=Xn.create(r,k.generate(),G=>{G.position.setValue(V.position),G.index.setValue(1),G.value.setValue(V.value),G.events.refer(m.events)});Fi.write(C.interpolation,V.interpolation)}w=y}return u.forEach(({box:y})=>y.delete()),_.wrap(wl.create(r,k.generate(),y=>{y.position.setValue(o),y.duration.setValue(s-o),y.loopDuration.setValue(s-o),y.loopOffset.setValue(0),y.hue.setValue(this.hue),y.mute.setValue(this.mute),y.label.setValue(this.label),y.events.refer(m.owners),y.regions.refer(c.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${k.toString($e(this,St,"f").address.uuid)} p: ${Ve.toString(this.position)}, c: ${Ve.toString(this.complete)}}`}};nd=new WeakMap,La=new WeakMap,St=new WeakMap,Zf=new WeakMap,ad=new WeakMap,Wf=new WeakMap,Lf=new WeakMap,aa=new WeakSet,Za=function(){$e(this,Zf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var uk=(t,e)=>t.position-e.position,dk={for:(t,e)=>He(e.accept({visitNoteRegionBox:r=>t.adapterFor(r,id),visitAudioRegionBox:r=>t.adapterFor(r,td),visitValueRegionBox:r=>t.adapterFor(r,ko)}),"")};var od=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},gr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},sd,Kl,Gf,ld,ys,cd,Bx=class{constructor(e,r){sd.set(this,void 0),Kl.set(this,void 0),Gf.set(this,void 0),ld.set(this,void 0),ys.set(this,void 0),cd.set(this,void 0),od(this,sd,e,"f"),od(this,Kl,new ae,"f"),od(this,Gf,gr(this,Kl,"f").own(new xe),"f"),od(this,ld,gr(this,Kl,"f").own(new dr),"f"),od(this,ys,Yo.create(uk),"f"),od(this,cd,k.newSet(n=>n.uuid),"f"),gr(this,Kl,"f").ownAll(gr(this,sd,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=dk.for(r,n),a=gr(this,cd,"f").add(i);ee(a,`Cannot add ${n}`),gr(this,ys,"f").add(i);for(let o of gr(this,ys,"f").iterateRange(i.position,i.complete))if(o!==i&&o.position<i.complete&&o.complete>i.position){console.warn("[TrackRegions] Overlapping region added",{track:gr(this,sd,"f").listIndex,added:{p:i.position,d:i.duration,c:i.complete},existing:{p:o.position,d:o.duration,c:o.complete},stack:new Error().stack});break}gr(this,ld,"f").forEach(o=>o.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:n}}})=>{let i=gr(this,cd,"f").removeByKey(n);gr(this,ys,"f").remove(i),gr(this,ld,"f").forEach(a=>a.onRemoved(i)),this.dispatchChange()}},l.RegionCollection))}get trackBoxAdapter(){return gr(this,sd,"f")}get collection(){return gr(this,ys,"f")}get adapters(){return gr(this,cd,"f")}onIndexingChanged(){gr(this,ys,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),gr(this,ld,"f").subscribe(e)}subscribeChanges(e){return gr(this,Gf,"f").subscribe(e)}dispatchChange(){gr(this,Gf,"f").notify()}terminate(){gr(this,Kl,"f").terminate()}};sd=new WeakMap,Kl=new WeakMap,Gf=new WeakMap,ld=new WeakMap,ys=new WeakMap,cd=new WeakMap;A();A();var ye;(function(t){t[t.Undefined=0]="Undefined",t[t.Notes=1]="Notes",t[t.Audio=2]="Audio",t[t.Value=3]="Value"})(ye||(ye={}));(function(t){t.toLabelString=e=>{switch(e){case t.Audio:return"Audio";case t.Notes:return"Note";case t.Value:return"Automation";case t.Undefined:default:return"N/A"}},t.toIconSymbol=e=>{switch(e){case t.Audio:return We.Waveform;case t.Notes:return We.Piano;case t.Value:return We.Automation;case t.Undefined:return We.AudioBus;default:return We.Unknown}}})(ye||(ye={}));A();var Tx;(function(t){t.isDeviceBox=e=>e.tags.type==="device",t.isInstrumentDeviceBox=e=>t.isDeviceBox(e)&&e.tags.deviceType==="instrument",t.isEffectDeviceBox=e=>t.isDeviceBox(e)&&(e.tags.deviceType==="audio-effect"||e.tags.deviceType==="midi-effect"),t.isChainEffectOf=(e,r)=>t.isEffectDeviceBox(e)&&e.host.targetVertex.mapOr(n=>n.box===r,!1),t.lookupHostField=e=>K(e)&&"host"in e&&Ft(e.host,I)?e.host:W(`Could not find 'host' field in '${e?.name}'`),t.lookupLabelField=e=>K(e)&&"label"in e&&Ft(e.label,T)?e.label:W(`Could not find 'label' field in '${e?.name}'`),t.lookupEnabledField=e=>K(e)&&"enabled"in e&&Ft(e.enabled,B)?e.enabled:W(`Could not find 'enabled' field in '${e?.name}'`),t.lookupMinimizedField=e=>K(e)&&"minimized"in e&&Ft(e.minimized,B)?e.minimized:W(`Could not find 'minimized' field in '${e?.name}'`),t.lookupIndexField=e=>K(e)&&"index"in e&&Ft(e.index,N)?e.index:W(`Could not find 'index' field in '${e?.name}'`)})(Tx||(Tx={}));var pk;(function(t){t.toTrackType=e=>{switch(e){case"midi":return ye.Notes;case"audio":return ye.Audio;default:return W()}}})(pk||(pk={}));var R_;(function(t){t.chainOf=(e,r)=>r==="audio"?e.audioEffects:e.midiEffects,t.chainFieldOf=(e,r)=>r==="audio"?e.audioEffectsField:e.midiEffectsField,t.takesEffect=(e,r)=>t.chainFieldOf(e,r).nonEmpty()&&(r==="audio"||!e.hostsInstrument||e.inputAdapter.mapOr(n=>n.accepts==="midi",!1))})(R_||(R_={}));var oe;(function(t){t.isAny=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="bus"||e.type==="instrument"||e.type==="audio-effect"),t.isEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="audio-effect"),t.isInstrument=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="instrument",t.isMidiEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="midi-effect",t.isAudioEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="audio-effect",t.isHost=e=>e!==null&&typeof e=="object"&&"class"in e&&e.class==="device-host",t.deleteEffectDevices=e=>{if(e.length===0)return;ee(ie.satisfy(e,(a,o)=>a.deviceHost().address.equals(o.deviceHost().address)),"Devices are not connected to the same host");let r=e[0];R_.chainFieldOf(r.deviceHost(),r.accepts).unwrap(`host takes no ${r.accepts} effects`).pointerHub.filter(r.accepts==="audio"?l.AudioEffectHost:l.MIDIEffectHost).map(({box:a})=>Tx.lookupIndexField(a)).filter(a=>e.some(o=>k.Comparator(o.uuid,a.address.uuid)!==0)).sort((a,o)=>a.getValue()-o.getValue()).forEach((a,o)=>a.setValue(o)),e.forEach(a=>a.box.delete())}})(oe||(oe={}));A();var Dx=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Br=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ud,Rx,oa,Wl,Cx,zx=class{constructor(e,r){ud.set(this,void 0),Rx.set(this,new xe),oa.set(this,void 0),Wl.set(this,void 0),Cx.set(this,void 0),Dx(this,ud,e,"f"),Dx(this,oa,jt.create(e.box.tracks,n=>r.adapterFor(n,fr),l.TrackCollection),"f"),Dx(this,Wl,k.newSet(({uuid:n})=>n),"f"),Dx(this,Cx,Br(this,oa,"f").catchupAndSubscribe({onAdd:n=>Br(this,Wl,"f").add({uuid:n.uuid,subscription:n.regions.subscribeChanges(()=>Br(this,Rx,"f").notify())}),onRemove:({uuid:n})=>Br(this,Wl,"f").removeByKey(n).subscription.terminate(),onReorder:n=>{}}),"f")}create(e,r,n){let i=Br(this,ud,"f").box.graph,a=Br(this,ud,"f").box.tracks;_i.create(i,k.generate(),o=>{o.index.setValue(n??Br(this,oa,"f").getMinFreeIndex()),o.type.setValue(e),o.tracks.refer(a),o.target.refer(r)})}controls(e){return _.wrap(Br(this,oa,"f").adapters().find(r=>r.target.targetVertex.contains(e),!1))}delete(e){let r=Br(this,oa,"f").adapters(),n=r.indexOf(e);if(n===-1)return W(`Cannot delete ${e}. Does not exist.`);for(let i=n+1;i<r.length;i++)r[i].indexField.setValue(i-1);e.box.delete()}get audioUnitBox(){return Br(this,ud,"f").box}get collection(){return Br(this,oa,"f")}values(){return Br(this,oa,"f").adapters()}catchupAndSubscribe(e){return Br(this,oa,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return Br(this,Rx,"f").subscribe(e)}terminate(){Br(this,oa,"f").terminate(),Br(this,Cx,"f").terminate(),Br(this,Wl,"f").forEach(({subscription:e})=>e.terminate()),Br(this,Wl,"f").clear()}};ud=new WeakMap,Rx=new WeakMap,oa=new WeakMap,Wl=new WeakMap,Cx=new WeakMap;A();A();var se;(function(t){t.AudioBus="manuals/audio-bus",t.Arpeggio="manuals/devices/midi/arpeggio",t.Pitch="manuals/devices/midi/pitch",t.Spielwerk="manuals/devices/midi/spielwerk",t.Velocity="manuals/devices/midi/velocity",t.Zeitgeist="manuals/devices/midi/zeitgeist",t.Autotune="manuals/devices/audio/autotune",t.StereoTool="manuals/devices/audio/stereo-tool",t.Delay="manuals/devices/audio/delay",t.DattorroReverb="manuals/devices/audio/dattorro-reverb",t.Maximizer="manuals/devices/audio/maximizer",t.Compressor="manuals/devices/audio/compressor",t.Gate="manuals/devices/audio/gate",t.Reverb="manuals/devices/audio/cheap-reverb",t.Crusher="manuals/devices/audio/crusher",t.Fold="manuals/devices/audio/fold",t.Tidal="manuals/devices/audio/tidal",t.Revamp="manuals/devices/audio/revamp",t.Modular="manuals/devices/audio/modular",t.NeuralAmp="manuals/devices/audio/neural-amp",t.Vocoder="manuals/devices/audio/vocoder",t.Waveshaper="manuals/devices/audio/waveshaper",t.Werkstatt="manuals/devices/audio/werkstatt",t.AudioEffectComposite="manuals/devices/audio/effect-composite",t.StereoComposite="manuals/devices/audio/stereo-composite",t.Apparat="manuals/devices/instruments/apparat",t.Tape="manuals/devices/instruments/tape",t.Nano="manuals/devices/instruments/nano",t.Playfield="manuals/devices/instruments/playfield",t.Vaporisateur="manuals/devices/instruments/vaporisateur",t.Neon="manuals/devices/instruments/neon",t.MIDIOutput="manuals/devices/instruments/midi-output",t.Soundfont="manuals/devices/instruments/soundfont",t.FrequencySplit="manuals/devices/audio/frequency-split"})(se||(se={}));var fk=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},sa=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ox,Ki,Wi=class{constructor(e,r){this.type="bus",this.accepts="audio",this.manualUrl=se.AudioBus,Ox.set(this,void 0),Ki.set(this,void 0),fk(this,Ox,e,"f"),fk(this,Ki,r,"f")}catchupAndSubscribe(e){return e(this),sa(this,Ki,"f").subscribe(Ke.Children,()=>e(this))}get uuid(){return sa(this,Ki,"f").address.uuid}get address(){return sa(this,Ki,"f").address}get box(){return sa(this,Ki,"f")}get enabledField(){return sa(this,Ki,"f").enabled}get minimizedField(){return sa(this,Ki,"f").minimized}get iconField(){return sa(this,Ki,"f").icon}get labelField(){return sa(this,Ki,"f").label}get colorField(){return sa(this,Ki,"f").color}get iconSymbol(){return We.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return sa(this,Ox,"f").boxAdapters.adapterFor(sa(this,Ki,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){}toString(){return`{${this.constructor.name}}`}};Ox=new WeakMap,Ki=new WeakMap;var Hf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},zt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Io,dd,pd,Li,qf,Vx=class{constructor(e,r){Io.set(this,void 0),dd.set(this,void 0),pd.set(this,void 0),Li.set(this,void 0),qf.set(this,ve.Empty),Hf(this,Io,new ae,"f"),Hf(this,dd,zt(this,Io,"f").own(new xe),"f"),Hf(this,pd,zt(this,Io,"f").own(new un(We.Unknown)),"f"),Hf(this,Li,zt(this,Io,"f").own(new Cr),"f"),zt(this,Io,"f").own(zt(this,Li,"f").subscribe(n=>{zt(this,qf,"f").terminate(),Hf(this,qf,n.match({none:()=>(zt(this,dd,"f").notify(_.None),ve.Empty),some:({labelField:i,iconField:a})=>ve.many(a.catchupAndSubscribe(o=>zt(this,pd,"f").setValue(We.fromName(o.getValue()))),i.catchupAndSubscribe(o=>zt(this,dd,"f").notify(_.wrap(o.getValue()))))}),"f")})),zt(this,Io,"f").own(e.catchupAndSubscribe({onAdded:({box:n,pointerType:i})=>{if(zt(this,Li,"f").nonEmpty()){let o=zt(this,Li,"f").unwrap();W(`AudioUnitInput already has an input. Existing: ${o.box.name}@${o.box.address.toString()} (type: ${o.type}), Incoming: ${n.name}@${n.address.toString()} (pointerType: ${String(i)})`)}let a=n instanceof ea?r.adapterFor(n,Wi):r.adapterFor(n,oe.isInstrument);zt(this,Li,"f").unwrapOrNull()!==a&&zt(this,Li,"f").wrap(a)},onRemoved:({box:n})=>{ee(zt(this,Li,"f").unwrap("Cannot remove").box.address.equals(n.address),"Unexpected value to remove"),zt(this,Li,"f").clear()}},l.InstrumentHost,l.AudioOutput))}adapter(){return zt(this,Li,"f")}subscribe(e){return zt(this,Li,"f").subscribe(e)}catchupAndSubscribe(e){return e(zt(this,Li,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),zt(this,dd,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return zt(this,pd,"f").catchupAndSubscribe(e)}set label(e){this.adapter().ifSome(r=>r.labelField.setValue(e))}get label(){return this.adapter().map(e=>e.labelField.getValue())}set icon(e){this.adapter().ifSome(r=>r.iconField.setValue(We.toName(e)))}get icon(){return this.adapter().match({none:()=>We.Unknown,some:e=>We.fromName(e.iconField.getValue())})}get iconValue(){return zt(this,pd,"f")}terminate(){zt(this,Io,"f").terminate(),zt(this,qf,"f").terminate()}};Io=new WeakMap,dd=new WeakMap,pd=new WeakMap,Li=new WeakMap,qf=new WeakMap;A();var hk=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ll=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ux,Bo,ue=class{constructor(e){Ux.set(this,void 0),Bo.set(this,void 0),hk(this,Ux,e,"f"),hk(this,Bo,ze.newSet(r=>r.address),"f")}terminate(){Ll(this,Bo,"f").forEach(e=>e.terminate()),Ll(this,Bo,"f").clear()}parameters(){return Ll(this,Bo,"f").values()}parameterAt(e){return Ll(this,Bo,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,r,n,i,a,o){let s=new Zl(Ll(this,Ux,"f"),e,r,n,i,a,o),c=Ll(this,Bo,"f").add(s);return ee(c,`Could not add adapter for ${e}`),s}removeParameter(e){return Ll(this,Bo,"f").removeByKey(e)}};Ux=new WeakMap,Bo=new WeakMap;A();var Gl=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Dt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Hl,wn,ws,fd,jx,Kx,Jf,hd=class{constructor(e,r){Hl.set(this,void 0),wn.set(this,void 0),ws.set(this,void 0),fd.set(this,void 0),jx.set(this,void 0),Kx.set(this,void 0),Jf.set(this,ve.Empty),Gl(this,Hl,e,"f"),Gl(this,wn,r,"f"),Gl(this,ws,new ae,"f"),Gl(this,fd,Dt(this,ws,"f").own(new xe),"f"),Dt(this,ws,"f").own(r.targetBus.catchupAndSubscribe(()=>{Dt(this,Jf,"f").terminate(),Gl(this,Jf,this.optTargetBus.match({none:()=>(Dt(this,fd,"f").notify(_.None),ve.Empty),some:n=>n.catchupAndSubscribe(i=>Dt(this,fd,"f").notify(_.wrap(i)))}),"f")})),Gl(this,jx,Dt(this,ws,"f").own(new Zl(Dt(this,Hl,"f"),Dt(this,wn,"f").sendPan,E.bipolar(),S.percent({unit:"%",fractionDigits:0}),"panning")),"f"),Gl(this,Kx,Dt(this,ws,"f").own(new Zl(Dt(this,Hl,"f"),Dt(this,wn,"f").sendGain,E.DefaultDecibel,S.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),Dt(this,fd,"f").subscribe(e)}get uuid(){return Dt(this,wn,"f").address.uuid}get address(){return Dt(this,wn,"f").address}get box(){return Dt(this,wn,"f")}get indexField(){return Dt(this,wn,"f").index}get sendPan(){return Dt(this,jx,"f")}get sendGain(){return Dt(this,Kx,"f")}get targetBus(){return Dt(this,Hl,"f").boxAdapters.adapterFor(Dt(this,wn,"f").targetBus.targetVertex.unwrap("no audioUnit").box,Wi)}get optTargetBus(){return Dt(this,wn,"f").targetBus.targetVertex.flatMap(e=>_.wrap(e.box.accept({visitAudioBusBox:r=>Dt(this,Hl,"f").boxAdapters.adapterFor(r,Wi)})))}delete(){Dt(this,wn,"f").delete()}terminate(){Dt(this,ws,"f").terminate(),Dt(this,Jf,"f").terminate()}};Hl=new WeakMap,wn=new WeakMap,ws=new WeakMap,fd=new WeakMap,jx=new WeakMap,Kx=new WeakMap,Jf=new WeakMap;A();var Yf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ga=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Wx,Lx,md,gd,Xf,Zx=class{constructor(e,r){Wx.set(this,void 0),Lx.set(this,void 0),md.set(this,void 0),gd.set(this,void 0),Xf.set(this,ve.Empty),Yf(this,Wx,e,"f"),Yf(this,Lx,r,"f"),Yf(this,md,new ae,"f"),Yf(this,gd,Ga(this,md,"f").own(new xe),"f"),Ga(this,md,"f").own(e.catchupAndSubscribe(()=>{Ga(this,Xf,"f").terminate(),Yf(this,Xf,this.adapter.match({none:()=>(Ga(this,gd,"f").notify(_.None),ve.Empty),some:n=>n.catchupAndSubscribe(i=>Ga(this,gd,"f").notify(_.wrap(i)))}),"f")}))}subscribe(e){return Ga(this,gd,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return Ga(this,Wx,"f").targetVertex.flatMap(e=>_.wrap(e.box.accept({visitAudioBusBox:r=>Ga(this,Lx,"f").adapterFor(r,Wi)})))}terminate(){Ga(this,md,"f").terminate(),Ga(this,Xf,"f").terminate()}};Wx=new WeakMap,Lx=new WeakMap,md=new WeakMap,gd=new WeakMap,Xf=new WeakMap;var To=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},be=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Gx,mk,Ha,Zi,Lt,Jl,vd,ql,Hx,Qf,qx,Jx,gk,vk,bn=class{constructor(e,r){Gx.add(this),this.class="device-host",Ha.set(this,new ae),Zi.set(this,void 0),Lt.set(this,void 0),Jl.set(this,void 0),vd.set(this,void 0),ql.set(this,void 0),Hx.set(this,void 0),Qf.set(this,void 0),qx.set(this,void 0),Jx.set(this,void 0),To(this,Zi,e,"f"),To(this,Lt,r,"f"),To(this,Jl,be(this,Ha,"f").own(new ue(be(this,Zi,"f"))),"f"),To(this,vd,be(this,Ha,"f").own(new zx(this,be(this,Zi,"f").boxAdapters)),"f"),To(this,ql,be(this,Ha,"f").own(new Vx(be(this,Lt,"f").input.pointerHub,be(this,Zi,"f").boxAdapters)),"f"),To(this,Hx,be(this,Ha,"f").own(jt.create(be(this,Lt,"f").midiEffects,n=>be(this,Zi,"f").boxAdapters.adapterFor(n,oe.isMidiEffect),l.MIDIEffectHost)),"f"),To(this,Qf,be(this,Ha,"f").own(jt.create(be(this,Lt,"f").audioEffects,n=>be(this,Zi,"f").boxAdapters.adapterFor(n,oe.isAudioEffect),l.AudioEffectHost)),"f"),To(this,qx,be(this,Ha,"f").own(jt.create(be(this,Lt,"f").auxSends,n=>be(this,Zi,"f").boxAdapters.adapterFor(n,hd),l.AuxSend)),"f"),To(this,Jx,be(this,Ha,"f").own(new Zx(be(this,Lt,"f").output,be(this,Zi,"f").boxAdapters)),"f"),this.namedParameter=be(this,Gx,"m",gk).call(this,r),be(this,Gx,"m",vk).call(this)}get box(){return be(this,Lt,"f")}get uuid(){return be(this,Lt,"f").address.uuid}get address(){return be(this,Lt,"f").address}get indexField(){return be(this,Lt,"f").index}get type(){return be(this,Lt,"f").type.getValue()}get captureBox(){return be(this,Lt,"f").capture.targetVertex}get tracks(){return be(this,vd,"f")}get input(){return be(this,ql,"f")}get midiEffects(){return _.wrap(be(this,Hx,"f"))}get audioEffects(){return _.wrap(be(this,Qf,"f"))}get inputAdapter(){return be(this,ql,"f").adapter()}get auxSends(){return be(this,qx,"f")}get output(){return be(this,Jx,"f")}get isBus(){return this.input.adapter().mapOr(e=>e.type==="bus",!1)}get isInstrument(){return this.input.adapter().mapOr(e=>e.type==="instrument",!1)}get isOutput(){return be(this,Lt,"f").output.targetVertex.mapOr(e=>e.box.address.equals(be(this,Zi,"f").rootBoxAdapter.address),!1)}get automationCollapsed(){return be(this,Lt,"f").userInterface.automationCollapsed}get midiEffectsField(){return _.wrap(be(this,Lt,"f").midiEffects)}get inputField(){return be(this,Lt,"f").input}get audioEffectsField(){return _.wrap(be(this,Lt,"f").audioEffects)}get tracksField(){return be(this,Lt,"f").tracks}get minimizedField(){return be(this,ql,"f").adapter().unwrap("input.adapter").minimizedField}get isAudioUnit(){return!0}get hostsInstrument(){return!0}get label(){return be(this,ql,"f").adapter().mapOr(e=>e.labelField.getValue(),"")}deviceHost(){return this}audioUnitBoxAdapter(){return this}*labeledAudioOutputs(){let e=this.input.adapter();e.nonEmpty()&&(yield*e.unwrap().labeledAudioOutputs());for(let r of be(this,Qf,"f").adapters())yield*r.labeledAudioOutputs();yield{address:this.address,label:"Channelstrip",children:()=>_.None}}indicesLimit(){let e=be(this,Zi,"f").rootBoxAdapter.audioUnits.adapters(),r=this.indexField.getValue(),n=this.type,i=r,a=r;for(;i>0&&e[i-1].type===n;)i--;for(;a<e.length-1&&e[a+1].type===n;)a++;return[i,a+1]}move(e){be(this,Zi,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,r){be(this,vd,"f").collection.move(e,r)}deleteTrack(e){be(this,vd,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){be(this,Ha,"f").terminate()}};mk=bn,Ha=new WeakMap,Zi=new WeakMap,Lt=new WeakMap,Jl=new WeakMap,vd=new WeakMap,ql=new WeakMap,Hx=new WeakMap,Qf=new WeakMap,qx=new WeakMap,Jx=new WeakMap,Gx=new WeakSet,gk=function(e){return{volume:be(this,Jl,"f").createParameter(e.volume,mk.VolumeMapper,S.decible,"Volume"),panning:be(this,Jl,"f").createParameter(e.panning,E.bipolar(),S.panning,"Panning",.5),mute:be(this,Jl,"f").createParameter(e.mute,E.bool,S.bool,"Mute"),solo:be(this,Jl,"f").createParameter(e.solo,E.bool,S.bool,"Solo")}},vk=function(){let e=this.address.toString(),r=be(this,Lt,"f").capture.targetAddress.unwrapOrUndefined(),n=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${be(this,Lt,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${r}`;ee(this.type!==Tt.Instrument||be(this,Lt,"f").capture.targetAddress.nonEmpty(),n)};bn.VolumeMapper=E.decibel(-96,-9,6);var xd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Je=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Xl,Qr,Xr,Yl,Yx,Xx,eh,xk,yk,Qx,fr=class{constructor(e,r){Xl.add(this),Qr.set(this,void 0),Xr.set(this,void 0),Yl.set(this,void 0),Yx.set(this,void 0),Xx.set(this,void 0),eh.set(this,void 0),xd(this,Qr,e,"f"),xd(this,Xr,r,"f"),xd(this,Yl,new ae,"f"),xd(this,eh,Je(this,Yl,"f").own(new un(-1)),"f"),xd(this,Yx,Je(this,Yl,"f").own(new $x(this,e.boxAdapters)),"f"),xd(this,Xx,Je(this,Yl,"f").own(new Bx(this,e.boxAdapters)),"f")}catchupAndSubscribePath(e){let r=[_.None,_.None],n=()=>{r.every(i=>i.nonEmpty())?e(_.wrap(r.map(i=>i.unwrap()))):e(_.None)};return ve.many(Je(this,Xl,"m",xk).call(this,i=>{r[0].equals(i)||(r[0]=i,n())}),Je(this,Xl,"m",yk).call(this,i=>{r[1].equals(i)||(r[1]=i,n())}))}get context(){return Je(this,Qr,"f")}set targetName(e){Je(this,Xr,"f").target.targetVertex.ifSome(r=>{let n=r.box;if(n instanceof it){Je(this,Qr,"f").boxAdapters.adapterFor(n,bn).input.adapter().ifSome(a=>a.labelField.setValue(e));return}Je(this,Qr,"f").boxAdapters.optAdapter(n).ifSome(i=>{"labelField"in i&&i.labelField instanceof T&&i.labelField.setValue(e)}),Je(this,Xl,"m",Qx).call(this,n).flatMap(i=>Je(this,Qr,"f").boxAdapters.optAdapter(i)).ifSome(i=>{"labelField"in i&&i.labelField instanceof T&&i.labelField.setValue(e)})})}get targetName(){return Je(this,Xr,"f").target.targetVertex.flatMap(e=>{let r=e.box;if(r instanceof it)return Je(this,Qr,"f").boxAdapters.adapterFor(r,bn).input.label;let n=Je(this,Qr,"f").boxAdapters.optAdapter(r);if(n.nonEmpty()){let a=n.unwrap();if("labelField"in a&&a.labelField instanceof T)return _.wrap(a.labelField.getValue())}let i=Je(this,Xl,"m",Qx).call(this,r).flatMap(a=>Je(this,Qr,"f").boxAdapters.optAdapter(a));if(i.nonEmpty()){let a=i.unwrap();if("labelField"in a&&a.labelField instanceof T)return _.wrap(a.labelField.getValue())}return _.wrap(r.name)})}terminate(){Je(this,Yl,"f").terminate()}get audioUnit(){return je(Je(this,Xr,"f").tracks.targetVertex.unwrap("track has no audioUnit").box,it)}get target(){return Je(this,Xr,"f").target}get clips(){return Je(this,Yx,"f")}get regions(){return Je(this,Xx,"f")}get enabled(){return Je(this,Xr,"f").enabled}get indexField(){return Je(this,Xr,"f").index}get type(){return Je(this,Xr,"f").type.getValue()}get box(){return Je(this,Xr,"f")}get uuid(){return Je(this,Xr,"f").address.uuid}get address(){return Je(this,Xr,"f").address}get listIndex(){return Je(this,eh,"f").getValue()}set listIndex(e){Je(this,eh,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===ye.Audio;case"note-clip":return this.type===ye.Notes;case"value-clip":return this.type===ye.Value;case"audio-region":return this.type===ye.Audio;case"note-region":return this.type===ye.Notes;case"value-region":return this.type===ye.Value}}valueAt(e,r){if(!this.enabled.getValue())return r;let n=r,i=Je(this,Qr,"f").clipSequencing.iterate(this.uuid,e,e+H$);for(let{optClip:a,sectionFrom:o}of i)n=a.match({none:()=>{let s=this.regions.collection.lowerEqual(e,c=>!c.mute);if(s===null){let c=this.regions.collection.optAt(0);return Ft(c,ko)?c.incomingValue(r):r}else if(Ft(s,ko))return e<s.complete?s.valueAt(e,r):s.outgoingValue(r);return r},some:s=>o===e&&Ft(s,fs)&&!s.mute?s.valueAt(e,r):r});return n}get targetControlName(){return this.type!==ye.Value?_.None:Je(this,Xr,"f").target.targetVertex.flatMap(e=>e.isField()?Je(this,Qr,"f").parameterFieldAdapters.opt(e.address).map(r=>r.name):e.isBox()?_.wrap(e.name):W("Illegal State. Vertex is not a field nor box."))}};Qr=new WeakMap,Xr=new WeakMap,Yl=new WeakMap,Yx=new WeakMap,Xx=new WeakMap,eh=new WeakMap,Xl=new WeakSet,xk=function(e){let r=Je(this,Xr,"f").target.targetVertex;if(r.nonEmpty()){let n=r.unwrap().box;if(n instanceof it)return Je(this,Qr,"f").boxAdapters.adapterFor(n,bn).input.catchupAndSubscribeLabelChange(s=>e(s));let i=Je(this,Qr,"f").boxAdapters.optAdapter(n);if(i.nonEmpty()){let o=i.unwrap();if("labelField"in o&&o.labelField instanceof T)return o.labelField.catchupAndSubscribe(s=>e(_.wrap(s.getValue())))}let a=Je(this,Xl,"m",Qx).call(this,n).flatMap(o=>Je(this,Qr,"f").boxAdapters.optAdapter(o));if(a.nonEmpty()){let o=a.unwrap();if("labelField"in o&&o.labelField instanceof T)return o.labelField.catchupAndSubscribe(s=>e(_.wrap(s.getValue())))}return e(_.wrap(n.name)),ve.Empty}return e(_.None),ve.Empty},yk=function(e){let r=this.type;switch(r){case ye.Audio:case ye.Notes:return e(_.wrap(ye[r])),ve.Empty;case ye.Value:{let n=Je(this,Xr,"f").target.targetVertex.flatMap(i=>i.isField()?Je(this,Qr,"f").parameterFieldAdapters.opt(i.address):_.None);return n.isEmpty()?(e(this.targetControlName),ve.Empty):n.unwrap().catchupAndSubscribeName(i=>e(_.wrap(i)))}case ye.Undefined:return e(_.wrap("")),ve.Empty;default:return e(_.None),ve.Empty}},Qx=function(e){for(let[r]of e.outgoingEdges())if(r.pointerType===l.Parameter)return r.targetVertex.map(n=>n.box);return _.None};var er=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},we=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Gi,Hi,th,ey,ty,Ql,Do,bs,_s,Fs,As,ec,Es,rh,wk=[l.Automation,l.Modulation,l.MIDIControl,l.ParameterController],Zl=class{constructor(e,r,n,i,a,o,s){Gi.set(this,void 0),Hi.set(this,void 0),th.set(this,void 0),ey.set(this,void 0),ty.set(this,void 0),Ql.set(this,new ae),Do.set(this,void 0),bs.set(this,void 0),_s.set(this,void 0),Fs.set(this,void 0),As.set(this,_.None),ec.set(this,_.None),Es.set(this,null),rh.set(this,!1),er(this,Gi,e,"f"),er(this,Hi,r,"f"),er(this,_s,n,"f"),er(this,Fs,i,"f"),er(this,th,typeof a=="string"?Ig.seal(a):a,"f"),er(this,ey,o??0,"f"),er(this,ty,_.wrap(s),"f"),we(this,Ql,"f").own(we(this,Gi,"f").parameterFieldAdapters.register(this)),er(this,Do,we(this,Ql,"f").own(new xe),"f"),er(this,bs,new dr,"f"),we(this,Ql,"f").own(we(this,Hi,"f").subscribe(()=>we(this,Do,"f").notify(this))),we(this,Ql,"f").own(we(this,Hi,"f").pointerHub.catchupAndSubscribe({onAdded:c=>{we(this,bs,"f").proxy.onControlSourceAdd(C_(c.pointerType)),c.box.accept({visitTrackBox:u=>{ee(we(this,As,"f").isEmpty(),"Already assigned");let f=we(this,Gi,"f").boxAdapters.adapterFor(u,fr);er(this,As,_.wrap(f),"f"),we(this,Gi,"f").isMainThread&&er(this,ec,_.wrap(we(this,Gi,"f").liveStreamReceiver.subscribeFloat(we(this,Hi,"f").address,v=>{if(isNaN(v)){if(cn(we(this,Es,"f")))return;er(this,Es,null,"f"),we(this,Do,"f").notify(this);return}we(this,Es,"f")!==v&&(er(this,Es,v,"f"),we(this,Do,"f").notify(this))})),"f")}})},onRemoved:c=>{we(this,bs,"f").proxy.onControlSourceRemove(C_(c.pointerType)),c.box.accept({visitTrackBox:u=>{ee(we(this,As,"f").unwrapOrNull()?.address?.equals(u.address)===!0,`Unknown ${u}`),er(this,As,_.None,"f"),we(this,Gi,"f").isMainThread&&(we(this,ec,"f").ifSome(f=>f.terminate()),er(this,ec,_.None,"f"),er(this,Es,null,"f"),we(this,Do,"f").notify(this))}})}},...wk)),r.getValue(),n.clamp(r.getValue())}registerMidiControl(){return we(this,bs,"f").proxy.onControlSourceAdd("midi"),er(this,rh,!0,"f"),{terminate:()=>{er(this,rh,!1,"f"),we(this,bs,"f").proxy.onControlSourceRemove("midi")}}}get field(){return we(this,Hi,"f")}get valueMapping(){return we(this,_s,"f")}get stringMapping(){return we(this,Fs,"f")}get name(){return we(this,th,"f").getValue()}get anchor(){return we(this,ey,"f")}get type(){return we(this,Hi,"f").type}get address(){return we(this,Hi,"f").address}get track(){return we(this,As,"f")}catchupAndSubscribeName(e){return we(this,th,"f").catchupAndSubscribe(r=>e(r.getValue()))}registerTracks(e){return we(this,Gi,"f").parameterFieldAdapters.registerTracks(this.address,e)}touchStart(){we(this,Gi,"f").parameterFieldAdapters.touchStart(this.address),we(this,Gi,"f").parameterFieldAdapters.notifyWrite(this,this.getUnitValue())}touchEnd(){we(this,Gi,"f").parameterFieldAdapters.touchEnd(this.address)}updateMappings(e,r){er(this,_s,e,"f"),er(this,Fs,r,"f"),we(this,Do,"f").notify(this)}valueAt(e){let r=we(this,As,"f");if(r.nonEmpty()){let n=r.unwrap();if(n.enabled)return this.valueMapping.y(n.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return we(this,Do,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return we(this,rh,"f")&&e.onControlSourceAdd("midi"),we(this,Hi,"f").pointerHub.filter(...wk).forEach(r=>e.onControlSourceAdd(C_(r.pointerType))),we(this,bs,"f").subscribe(e)}getValue(){return we(this,Hi,"f").getValue()}setValue(e){if(e===this.getValue())return;let r=this.getUnitValue();we(this,Hi,"f").setValue(e),we(this,Gi,"f").parameterFieldAdapters.notifyWrite(this,r)}setUnitValue(e){this.setValue(we(this,_s,"f").y(e))}getUnitValue(){return we(this,_s,"f").x(this.getValue())}getControlledValue(){return we(this,_s,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return we(this,Es,"f")??this.getUnitValue()}getControlledPrintValue(){return we(this,Fs,"f").x(this.getControlledValue())}getPrintValue(){return we(this,Fs,"f").x(this.getValue())}setPrintValue(e){let r=we(this,Fs,"f").y(e);r.type==="unitValue"?this.setUnitValue(Se(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(we(this,ty,"f").unwrapOrElse(we(this,Hi,"f").initValue))}terminate(){we(this,ec,"f").ifSome(e=>e.terminate()),er(this,ec,_.None,"f"),we(this,Ql,"f").terminate()}};Gi=new WeakMap,Hi=new WeakMap,th=new WeakMap,ey=new WeakMap,ty=new WeakMap,Ql=new WeakMap,Do=new WeakMap,bs=new WeakMap,_s=new WeakMap,Fs=new WeakMap,As=new WeakMap,ec=new WeakMap,Es=new WeakMap,rh=new WeakMap;var C_=t=>{switch(t){case l.Automation:return"automated";case l.Modulation:return"modulated";case l.MIDIControl:return"midi";case l.ParameterController:return"external";default:return W(`${t.toString()} is an unknown pointer type`)}};var ry={min:400,max:480,default:440};A();var z_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},la=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ro,tc,iy,ny=class{constructor(e,r,n){Ro.set(this,void 0),tc.set(this,void 0),iy.set(this,void 0),z_(this,Ro,k.newSet(i=>i.uuid),"f"),z_(this,tc,new dr,"f"),z_(this,iy,e.catchupAndSubscribe({onAdded:i=>{let a=r(i.box),o=la(this,Ro,"f").add(a);ee(o,`Could not add ${a}`),la(this,tc,"f").proxy.onAdd(a)},onRemoved:i=>{let a=i.box.address.uuid;la(this,tc,"f").proxy.onRemove(la(this,Ro,"f").removeByKey(a))}},n),"f")}subscribe(e){return la(this,tc,"f").subscribe(e)}catchupAndSubscribe(e){return la(this,Ro,"f").forEach(r=>e.onAdd(r)),this.subscribe(e)}adapters(){return la(this,Ro,"f").values()}size(){return la(this,Ro,"f").size()}isEmpty(){return this.size()===0}terminate(){la(this,Ro,"f").clear(),la(this,tc,"f").terminate(),la(this,iy,"f").terminate()}};Ro=new WeakMap,tc=new WeakMap,iy=new WeakMap;A();A();rt();var O_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},V_,Ei,ih,_n,Ur,bk,ca=class{constructor(e,r){V_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Delay,ih.set(this,void 0),_n.set(this,void 0),Ur.set(this,void 0),O_(this,ih,e,"f"),O_(this,_n,r,"f"),O_(this,Ur,new ue(Pt(this,ih,"f")),"f"),this.namedParameter=Pt(this,V_,"m",bk).call(this,r)}get box(){return Pt(this,_n,"f")}get uuid(){return Pt(this,_n,"f").address.uuid}get address(){return Pt(this,_n,"f").address}get indexField(){return Pt(this,_n,"f").index}get labelField(){return Pt(this,_n,"f").label}get enabledField(){return Pt(this,_n,"f").enabled}get minimizedField(){return Pt(this,_n,"f").minimized}get host(){return Pt(this,_n,"f").host}deviceHost(){return Pt(this,ih,"f").boxAdapters.adapterFor(Pt(this,_n,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Pt(this,Ur,"f").terminate()}};Ei=ca,ih=new WeakMap,_n=new WeakMap,Ur=new WeakMap,V_=new WeakSet,bk=function(e){return{preSyncTimeLeft:Pt(this,Ur,"f").createParameter(e.preSyncTimeLeft,E.linearInteger(0,Ei.Fractions.length-1),Ei.FractionsStringMapping,"Pre Sync L"),preMillisTimeLeft:Pt(this,Ur,"f").createParameter(e.preMillisTimeLeft,E.powerByCenter(100,0,Ei.MAX_MILLIS_TIME),S.numeric({unit:"ms",fractionDigits:1}),"Pre MS L"),preSyncTimeRight:Pt(this,Ur,"f").createParameter(e.preSyncTimeRight,E.linearInteger(0,Ei.Fractions.length-1),Ei.FractionsStringMapping,"Pre Sync R"),preMillisTimeRight:Pt(this,Ur,"f").createParameter(e.preMillisTimeRight,E.powerByCenter(100,0,Ei.MAX_MILLIS_TIME),S.numeric({unit:"ms",fractionDigits:1}),"Pre MS R"),delay:Pt(this,Ur,"f").createParameter(e.delayMusical,E.linearInteger(0,Ei.Fractions.length-1),Ei.FractionsStringMapping,"Delay"),millisTime:Pt(this,Ur,"f").createParameter(e.delayMillis,E.powerByCenter(100,0,Ei.MAX_MILLIS_TIME),S.numeric({unit:"ms",fractionDigits:1}),"MS"),feedback:Pt(this,Ur,"f").createParameter(e.feedback,E.unipolar(),S.numeric({unit:"%",fractionDigits:0}),"Feedback"),cross:Pt(this,Ur,"f").createParameter(e.cross,E.unipolar(),S.numeric({unit:"%",fractionDigits:0}),"Cross"),lfoSpeed:Pt(this,Ur,"f").createParameter(e.lfoSpeed,E.exponential(Ei.LFO_SPEED_MIN,Ei.LFO_SPEED_MAX),S.numeric({unit:"Hz",fractionDigits:2}),"LFO Speed"),lfoDepth:Pt(this,Ur,"f").createParameter(e.lfoDepth,E.power(4,0,Ei.LFO_DEPTH_MAX),S.numeric({unit:"ms",fractionDigits:1}),"LFO Depth"),filter:Pt(this,Ur,"f").createParameter(e.filter,E.bipolar(),S.numeric({unit:"%",fractionDigits:0}),"Filter",.5),dry:Pt(this,Ur,"f").createParameter(e.dry,E.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Dry"),wet:Pt(this,Ur,"f").createParameter(e.wet,E.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Wet")}};ca.Fractions=Xo.builder().add([0,1]).add([1,128]).add([1,96]).add([1,64]).add([1,48]).add([1,32]).add([1,24]).add([3,64]).add([1,16]).add([1,12]).add([3,32]).add([1,8]).add([1,6]).add([3,16]).add([1,4]).add([5,16]).add([1,3]).add([3,8]).add([7,16]).add([1,2]).add([1,1]).asAscendingArray();ca.FractionsStringMapping=S.indices("",Ei.Fractions.map(([t,e])=>t===0?"Off":`${t}/${e}`));ca.MAX_MILLIS_TIME=1e3;ca.LFO_SPEED_MIN=.1;ca.LFO_SPEED_MAX=5;ca.LFO_DEPTH_MAX=50;A();var U_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Fr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},j_,nh,Fn,qa,_k,ay=class{constructor(e,r){j_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Reverb,nh.set(this,void 0),Fn.set(this,void 0),qa.set(this,void 0),U_(this,nh,e,"f"),U_(this,Fn,r,"f"),U_(this,qa,new ue(Fr(this,nh,"f")),"f"),this.namedParameter=Fr(this,j_,"m",_k).call(this,r)}get box(){return Fr(this,Fn,"f")}get uuid(){return Fr(this,Fn,"f").address.uuid}get address(){return Fr(this,Fn,"f").address}get indexField(){return Fr(this,Fn,"f").index}get labelField(){return Fr(this,Fn,"f").label}get enabledField(){return Fr(this,Fn,"f").enabled}get minimizedField(){return Fr(this,Fn,"f").minimized}get host(){return Fr(this,Fn,"f").host}deviceHost(){return Fr(this,nh,"f").boxAdapters.adapterFor(Fr(this,Fn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Fr(this,qa,"f").terminate()}};nh=new WeakMap,Fn=new WeakMap,qa=new WeakMap,j_=new WeakSet,_k=function(e){return{decay:Fr(this,qa,"f").createParameter(e.decay,E.unipolar(),S.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:Fr(this,qa,"f").createParameter(e.preDelay,E.exponential(.001,.5),S.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:Fr(this,qa,"f").createParameter(e.damp,E.unipolar(),S.numeric({unit:"%",fractionDigits:0}),"Damping"),filter:Fr(this,qa,"f").createParameter(e.filter,E.bipolar(),S.numeric({unit:"%",fractionDigits:0}),"Filter"),dry:Fr(this,qa,"f").createParameter(e.dry,E.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Dry"),wet:Fr(this,qa,"f").createParameter(e.wet,E.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Wet")}};A();var K_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},tr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},L_,ah,qi,ua,Ek,oy=class{constructor(e,r){L_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Revamp,ah.set(this,void 0),qi.set(this,void 0),ua.set(this,void 0),K_(this,ah,e,"f"),K_(this,qi,r,"f"),K_(this,ua,new ue(tr(this,ah,"f")),"f"),this.namedParameter=tr(this,L_,"m",Ek).call(this,r)}get box(){return tr(this,qi,"f")}get uuid(){return tr(this,qi,"f").address.uuid}get address(){return tr(this,qi,"f").address}get indexField(){return tr(this,qi,"f").index}get labelField(){return tr(this,qi,"f").label}get enabledField(){return tr(this,qi,"f").enabled}get minimizedField(){return tr(this,qi,"f").minimized}get host(){return tr(this,qi,"f").host}get spectrum(){return tr(this,qi,"f").address.append(4095)}deviceHost(){return tr(this,ah,"f").boxAdapters.adapterFor(tr(this,qi,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){tr(this,ua,"f").terminate()}};ah=new WeakMap,qi=new WeakMap,ua=new WeakMap,L_=new WeakSet,Ek=function(e){return{highPass:Fk(tr(this,ua,"f"),e.highPass,"High-Pass"),lowShelf:Ak(tr(this,ua,"f"),e.lowShelf,"Low-Shelf"),lowBell:W_(tr(this,ua,"f"),e.lowBell,"Low-Bell"),midBell:W_(tr(this,ua,"f"),e.midBell,"Mid-Bell"),highBell:W_(tr(this,ua,"f"),e.highBell,"High-Bell"),highShelf:Ak(tr(this,ua,"f"),e.highShelf,"High-Shelf"),lowPass:Fk(tr(this,ua,"f"),e.lowPass,"Low-Pass")}};var Z_=E.exponential(20,2e4),Sk=E.linear(-24,24),Pk=E.exponential(.01,10),Fk=(t,e,r)=>({enabled:t.createParameter(e.enabled,E.bool,S.bool,"Enabled"),frequency:t.createParameter(e.frequency,Z_,S.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),order:t.createParameter(e.order,E.linearInteger(0,3),S.indices("db",["12","24","36","48"]),`${r} Order`),q:t.createParameter(e.q,Pk,S.numeric({fractionDigits:3}),`${r} Q`)}),Ak=(t,e,r)=>({enabled:t.createParameter(e.enabled,E.bool,S.bool,"Enabled"),frequency:t.createParameter(e.frequency,Z_,S.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,Sk,S.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5)}),W_=(t,e,r)=>({enabled:t.createParameter(e.enabled,E.bool,S.bool,"Enabled"),frequency:t.createParameter(e.frequency,Z_,S.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,Sk,S.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5),q:t.createParameter(e.q,Pk,S.numeric({fractionDigits:3}),`${r} Q`)});A();A();rt();A();var Mk=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Si=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},sy,ly,Pi,Ss=class{constructor(e,r){this.type="marker-event",sy.set(this,new ae),ly.set(this,void 0),Pi.set(this,void 0),Mk(this,ly,e,"f"),Mk(this,Pi,r,"f"),Si(this,sy,"f").own(Si(this,Pi,"f").subscribe(Ke.Children,n=>{if(!this.trackAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackAdapter.unwrap();Si(this,Pi,"f").position.address.equals(n.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return Si(this,Pi,"f")}get uuid(){return Si(this,Pi,"f").address.uuid}get address(){return Si(this,Pi,"f").address}get position(){return Si(this,Pi,"f").position.getValue()}get plays(){return Si(this,Pi,"f").plays.getValue()}get hue(){return Si(this,Pi,"f").hue.getValue()}get label(){return Si(this,Pi,"f").label.getValue()}get trackAdapter(){return Si(this,Pi,"f").track.targetVertex.map(e=>Si(this,ly,"f").boxAdapters.adapterFor(e.box,Ja).markerTrack)}terminate(){Si(this,sy,"f").terminate()}toString(){return`{MarkerBoxAdapter ${k.toString(Si(this,Pi,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};sy=new WeakMap,ly=new WeakMap,Pi=new WeakMap;Ss.Comparator=(t,e)=>t.position-e.position;var oh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},An=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},sh,yd,lh,rc,cy,uy=class{constructor(e,r){sh.set(this,void 0),yd.set(this,void 0),lh.set(this,void 0),rc.set(this,void 0),cy.set(this,void 0),oh(this,sh,e,"f"),oh(this,yd,r,"f"),this.changeNotifier=new xe,oh(this,lh,k.newSet(n=>n.uuid),"f"),oh(this,rc,qr.create(Ss.Comparator),"f"),oh(this,cy,An(this,yd,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{if(n instanceof uu){let i=An(this,sh,"f").boxAdapters.adapterFor(n,Ss),a=An(this,lh,"f").add(i);ee(a,"Could not add adapter"),An(this,rc,"f").add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:n}}})=>{An(this,rc,"f").remove(An(this,lh,"f").removeByKey(n)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return An(this,sh,"f")}get enabled(){return An(this,yd,"f").enabled.getValue()}get events(){return An(this,rc,"f")}get object(){return An(this,yd,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){An(this,rc,"f").onIndexingChanged(),this.dispatchChange()}terminate(){An(this,cy,"f").terminate()}};sh=new WeakMap,yd=new WeakMap,lh=new WeakMap,rc=new WeakMap,cy=new WeakMap;A();rt();A();var Nk=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ji=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},dy,py,Yi,ic=class{constructor(e,r){this.type="signature-event",dy.set(this,new ae),py.set(this,void 0),Yi.set(this,void 0),Nk(this,py,e,"f"),Nk(this,Yi,r,"f"),Ji(this,dy,"f").own(Ji(this,Yi,"f").subscribe(Ke.Children,n=>this.trackAdapter.ifSome(i=>i.dispatchChange())))}get box(){return Ji(this,Yi,"f")}get uuid(){return Ji(this,Yi,"f").address.uuid}get address(){return Ji(this,Yi,"f").address}get index(){return Ji(this,Yi,"f").index.getValue()}get indexField(){return Ji(this,Yi,"f").index}get relativePosition(){return Ji(this,Yi,"f").relativePosition.getValue()}get nominator(){return Ji(this,Yi,"f").nominator.getValue()}get denominator(){return Ji(this,Yi,"f").denominator.getValue()}get trackAdapter(){return Ji(this,Yi,"f").events.targetVertex.map(e=>Ji(this,py,"f").boxAdapters.adapterFor(e.box,Ja).signatureTrack)}terminate(){Ji(this,dy,"f").terminate()}toString(){return`{SignatureEventBoxAdapter ${this.nominator}/${this.denominator}}`}};dy=new WeakMap,py=new WeakMap,Yi=new WeakMap;ic.Comparator=(t,e)=>t.index-e.index;var fy=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Mt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ps,ch,uh,nc,Co,Ms,$k,wd,hy=class{constructor(e,r,n){Ps.add(this),ch.set(this,new ae),uh.set(this,void 0),nc.set(this,void 0),Co.set(this,void 0),Ms.set(this,void 0),fy(this,uh,e,"f"),fy(this,nc,r,"f"),fy(this,Co,n,"f"),this.changeNotifier=new xe,fy(this,Ms,Mt(this,ch,"f").own(jt.create(Mt(this,Co,"f").events,i=>e.boxAdapters.adapterFor(i,ic),l.SignatureAutomation)),"f"),Mt(this,ch,"f").ownAll(Mt(this,nc,"f").subscribe(()=>this.dispatchChange()),Mt(this,Co,"f").enabled.subscribe(()=>this.dispatchChange()),Mt(this,Ms,"f").subscribe({onAdd:i=>this.changeNotifier.notify(),onRemove:i=>this.changeNotifier.notify(),onReorder:i=>this.changeNotifier.notify()}))}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return Mt(this,uh,"f")}get enabled(){return Mt(this,Co,"f").enabled.getValue()}get object(){return Mt(this,Co,"f")}get size(){return Mt(this,Ms,"f").size()}get storageSignature(){let{nominator:e,denominator:r}=Mt(this,nc,"f");return[e.getValue(),r.getValue()]}nonEmpty(){return Mt(this,Ms,"f").size()>0}dispatchChange(){this.changeNotifier.notify()}signatureAt(e){e=Math.max(0,e);let r=this.storageSignature;for(let{accumulatedPpqn:n,nominator:i,denominator:a}of this.iterateAll()){if(n>e)break;r=[i,a]}return r}*iterateAll(){let e=0,r=0,[n,i]=this.storageSignature;if(yield{index:-1,accumulatedPpqn:e,accumulatedBars:r,nominator:n,denominator:i},!!Mt(this,Co,"f").enabled.getValue())for(let a of Mt(this,Ms,"f").adapters())e+=Ve.fromSignature(n,i)*a.relativePosition,r+=a.relativePosition,n=a.nominator,i=a.denominator,yield{index:a.index,accumulatedPpqn:e,accumulatedBars:r,nominator:n,denominator:i}}changeSignature(e,r){let n=Array.from(this.iterateAll()).slice(1),i=n.map(c=>c.accumulatedPpqn);Mt(this,nc,"f").nominator.setValue(e),Mt(this,nc,"f").denominator.setValue(r);let a=0,o=0,s=Ve.fromSignature(e,r);for(let c=0;c<n.length;c++){let u=n[c],f=this.adapterAt(u.index);if(f.isEmpty())continue;let m=(i[c]-a)/s,w=Math.floor(m),y=m-w;o+=y;let P=w;o>=1&&(P++,o--),P=Math.max(1,P),f.unwrap().box.relativePosition.setValue(P),a+=P*s,s=Ve.fromSignature(u.nominator,u.denominator)}}deleteAdapter(e){let r=e.index,n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(w=>w.index===r);if(i===-1)return;let a=n.slice(i+1),o=a.map(w=>w.accumulatedPpqn),s=i>0?n[i-1]:null,[c,u]=s!==null?[s.nominator,s.denominator]:this.storageSignature,f=s!==null?s.accumulatedPpqn:0;e.box.delete();let v=f,m=Ve.fromSignature(c,u);for(let w=0;w<a.length;w++){let y=a[w],P=this.adapterAt(y.index);if(P.isEmpty())continue;let O=(o[w]-v)/m,C=Math.max(1,Math.round(O));P.unwrap().box.relativePosition.setValue(C),v+=C*m,m=Ve.fromSignature(y.nominator,y.denominator)}}createEvent(e,r,n){let i=Array.from(this.iterateAll()),a=i[0],o=0;for(let P=1;P<i.length&&!(i[P].accumulatedPpqn>e);P++)a=i[P],o=P;let s=Ve.fromSignature(a.nominator,a.denominator),c=(e-a.accumulatedPpqn)/s,u=Math.max(1,Math.round(c)),f=a.index+1,v=i.slice(o+1),m=a.accumulatedPpqn+u*s,w=Ve.fromSignature(r,n),y=v.map(P=>({event:P,adapter:this.adapterAt(P.index)})).filter(({adapter:P})=>P.nonEmpty()).map(({event:P,adapter:V})=>({event:P,adapter:V.unwrap()}));for(let P=0;P<y.length;P++){let{event:V,adapter:O}=y[P];if(O.box.index.setValue(V.index+1),P===0){let C=(V.accumulatedPpqn-m)/w;O.box.relativePosition.setValue(Math.max(1,Math.round(C)))}}au.create(Mt(this,uh,"f").boxGraph,k.generate(),P=>{P.index.setValue(f),P.relativePosition.setValue(u),P.nominator.setValue(r),P.denominator.setValue(n),P.events.refer(Mt(this,Co,"f").events)})}adapterAt(e){return Mt(this,Ms,"f").getAdapterByIndex(e)}moveEvent(e,r){let n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(m=>m.index===e.index);if(i===-1)return;let a=n[i];if(r===a.accumulatedPpqn)return;let o=n.map(m=>m.accumulatedBars),s=Mt(this,Ps,"m",$k).call(this,r,a.index);if(s===a.accumulatedBars)return;let c=[...o];c[i]=s;let u=c.map((m,w)=>({bar:m,i:w})).sort((m,w)=>m.bar-w.bar).map(m=>m.i),f=n.map(m=>this.adapterAt(m.index).unwrap("adapterAt"));for(let m=0;m<u.length;m++)f[u[m]].box.index.setValue(m);let v=0;for(let m=0;m<u.length;m++){let w=u[m],y=f[w],P=c[w],V=Math.max(1,P-v);y.box.relativePosition.setValue(V),v=P}}floorToBar(e){let{event:r,barPpqn:n}=Mt(this,Ps,"m",wd).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}ceilToBar(e){let{event:r,barPpqn:n}=Mt(this,Ps,"m",wd).call(this,e),i=Math.ceil((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}roundToBar(e){let{event:r,barPpqn:n}=Mt(this,Ps,"m",wd).call(this,e),i=Math.round((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}toParts(e){let{event:r}=Mt(this,Ps,"m",wd).call(this,e),n=Ve.toParts(e-r.accumulatedPpqn,r.nominator,r.denominator);return{...n,bars:n.bars+r.accumulatedBars}}barLengthAt(e){let[r,n]=this.signatureAt(e);return Ve.fromSignature(r,n)}getBarInterval(e){let{event:r,barPpqn:n}=Mt(this,Ps,"m",wd).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n),a=r.accumulatedPpqn+i*n;return{position:a,complete:a+n}}terminate(){Mt(this,ch,"f").terminate()}};ch=new WeakMap,uh=new WeakMap,nc=new WeakMap,Co=new WeakMap,Ms=new WeakMap,Ps=new WeakSet,$k=function(e,r){let n=null;for(let o of this.iterateAll())if(o.index!==r){if(o.accumulatedPpqn>e)break;n=o}if(cn(n)){let[o,s]=this.storageSignature,c=Ve.fromSignature(o,s);return Math.max(1,Math.round(e/c))}let i=Ve.fromSignature(n.nominator,n.denominator),a=Math.round((e-n.accumulatedPpqn)/i);return Math.max(1,n.accumulatedBars+a)},wd=function(e){let r=null;for(let n of this.iterateAll()){if(n.accumulatedPpqn>e)break;r=n}if(cn(r)){let[n,i]=this.storageSignature;return{event:{index:-1,accumulatedPpqn:0,accumulatedBars:0,nominator:n,denominator:i},barPpqn:Ve.fromSignature(n,i)}}return{event:r,barPpqn:Ve.fromSignature(r.nominator,r.denominator)}};rt();var dh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ht=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ph,Ya,my,gy,zo,fh,vy,Ja=class{constructor(e,r){ph.set(this,new ae),Ya.set(this,void 0),my.set(this,void 0),gy.set(this,void 0),zo.set(this,void 0),fh.set(this,void 0),vy.set(this,()=>{let{tempoTrack:{enabled:s}}=Ht(this,Ya,"f");return s.getValue()?Ht(this,zo,"f").isEmpty()?_.None:Ht(this,zo,"f").unwrap().events.isEmpty()?_.None:Ht(this,zo,"f"):_.None}),dh(this,Ya,r,"f"),dh(this,my,new uy(e,r.markerTrack),"f"),dh(this,gy,new hy(e,r.signature,r.signatureTrack),"f"),dh(this,zo,new Cr,"f"),dh(this,fh,new xe,"f");let n=Ht(this,ph,"f").own(new ae),i=()=>Ht(this,fh,"f").notify(Ht(this,vy,"f").call(this)),{tempoTrack:{events:a,enabled:o}}=r;Ht(this,ph,"f").own(a.catchupAndSubscribe(({targetVertex:s})=>{n.terminate(),s.match({none:()=>Ht(this,zo,"f").clear(),some:({box:c})=>{let u=e.boxAdapters.adapterFor(c,Or);Ht(this,zo,"f").wrap(u),n.ownAll(u.subscribeChange(i),o.subscribe(i))}})}))}catchupAndSubscribeTempoAutomation(e){return e(Ht(this,vy,"f").call(this)),Ht(this,fh,"f").subscribe(e)}get box(){return Ht(this,Ya,"f")}get uuid(){return Ht(this,Ya,"f").address.uuid}get address(){return Ht(this,Ya,"f").address}get markerTrack(){return Ht(this,my,"f")}get signatureTrack(){return Ht(this,gy,"f")}get tempoTrackEvents(){return Ht(this,zo,"f")}get signature(){let{nominator:e,denominator:r}=Ht(this,Ya,"f").signature;return[e.getValue(),r.getValue()]}get signatureDuration(){let{nominator:e,denominator:r}=Ht(this,Ya,"f").signature;return Ve.fromSignature(e.getValue(),r.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),Ht(this,Ya,"f").signature.subscribe(()=>e(this.signature))}terminate(){Ht(this,ph,"f").terminate()}};ph=new WeakMap,Ya=new WeakMap,my=new WeakMap,gy=new WeakMap,zo=new WeakMap,fh=new WeakMap,vy=new WeakMap;A();var tC=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},hh=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ns,$s=class{constructor(e,r){Ns.set(this,void 0),tC(this,Ns,r,"f")}get box(){return hh(this,Ns,"f")}get uuid(){return hh(this,Ns,"f").address.uuid}get address(){return hh(this,Ns,"f").address}get source(){return hh(this,Ns,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return hh(this,Ns,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};Ns=new WeakMap;A();A();A();var ac=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},En=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},xy,oc,sc,yy,wy,mh,Sn=class{constructor(e,r){xy.set(this,void 0),oc.set(this,void 0),sc.set(this,void 0),yy.set(this,void 0),wy.set(this,void 0),mh.set(this,!1),ac(this,xy,e,"f"),ac(this,oc,r,"f"),ac(this,sc,new ae,"f"),ac(this,yy,r.attributes,"f"),ac(this,wy,En(this,sc,"f").own(new ue(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return En(this,sc,"f").own(e)}ownAll(...e){En(this,sc,"f").ownAll(...e)}onSelected(){ac(this,mh,!0,"f")}onDeselected(){ac(this,mh,!1,"f")}isSelected(){return En(this,mh,"f")}get box(){return En(this,oc,"f")}get attributes(){return En(this,yy,"f")}get uuid(){return En(this,oc,"f").address.uuid}get address(){return En(this,oc,"f").address}get parameters(){return En(this,wy,"f")}get modular(){return En(this,xy,"f").boxAdapters.adapterFor(En(this,oc,"f").attributes.collection.targetVertex.unwrap("attributes.target").box,ks)}terminate(){En(this,sc,"f").terminate()}};xy=new WeakMap,oc=new WeakMap,sc=new WeakMap,yy=new WeakMap,wy=new WeakMap,mh=new WeakMap;A();var by=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Oo=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},_y,Is,gh,Fy,ei;(function(t){t.Input="input",t.Output="output"})(ei||(ei={}));var ti=class t{static create(e,r,n,i){return new t(e,r,n,i??r.fieldName)}constructor(e,r,n,i){_y.set(this,void 0),Is.set(this,void 0),gh.set(this,void 0),Fy.set(this,void 0),by(this,_y,e,"f"),by(this,Is,r,"f"),by(this,gh,n,"f"),by(this,Fy,i,"f")}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(r=>e.field.pointerRules.accepts.some(n=>n===r))}get connections(){return Oo(this,Is,"f").pointerHub.isEmpty()?ie.empty():Oo(this,Is,"f").pointerHub.filter(l.VoltageConnection).map(({box:e})=>Oo(this,_y,"f").adapterFor(e,$s))}get field(){return Oo(this,Is,"f")}get address(){return Oo(this,Is,"f").address}get direction(){return Oo(this,gh,"f")}get name(){return Oo(this,Fy,"f")}toString(){return`{ModuleConnectorAdapter address: ${Oo(this,Is,"f").address.toString()}, direction: ${Oo(this,gh,"f")}}`}};_y=new WeakMap,Is=new WeakMap,gh=new WeakMap,Fy=new WeakMap;var G_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},vh=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ay,xh,yh,bd=class extends Sn{constructor(e,r){super(e,r),Ay.set(this,void 0),xh.set(this,void 0),yh.set(this,void 0),G_(this,Ay,this.parameters.createParameter(r.time,E.exponential(1,1e4),S.numeric({unit:"ms"}),"Time"),"f"),G_(this,xh,ti.create(e.boxAdapters,r.voltageInput,ei.Input,"Input"),"f"),G_(this,yh,ti.create(e.boxAdapters,r.voltageOutput,ei.Output,"Output"),"f")}get parameterTime(){return vh(this,Ay,"f")}get voltageInput(){return vh(this,xh,"f")}get voltageOutput(){return vh(this,yh,"f")}get inputs(){return[vh(this,xh,"f")]}get outputs(){return[vh(this,yh,"f")]}};Ay=new WeakMap,xh=new WeakMap,yh=new WeakMap;A();var rC=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},kk=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},wh,_d=class extends Sn{constructor(e,r){super(e,r),wh.set(this,void 0),rC(this,wh,ti.create(e.boxAdapters,r.input,ei.Input,"Input"),"f")}get voltageInput(){return kk(this,wh,"f")}get inputs(){return[kk(this,wh,"f")]}get outputs(){return ie.empty()}};wh=new WeakMap;A();var H_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},bh=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ey,_h,Fh,Fd=class extends Sn{constructor(e,r){super(e,r),Ey.set(this,void 0),_h.set(this,void 0),Fh.set(this,void 0),H_(this,Ey,this.parameters.createParameter(r.gain,E.DefaultDecibel,S.numeric({unit:"db"}),"Gain"),"f"),H_(this,_h,ti.create(e.boxAdapters,r.voltageInput,ei.Input,"Input"),"f"),H_(this,Fh,ti.create(e.boxAdapters,r.voltageOutput,ei.Output,"Output"),"f")}get parameterGain(){return bh(this,Ey,"f")}get voltageInput(){return bh(this,_h,"f")}get voltageOutput(){return bh(this,Fh,"f")}get inputs(){return[bh(this,_h,"f")]}get outputs(){return[bh(this,Fh,"f")]}};Ey=new WeakMap,_h=new WeakMap,Fh=new WeakMap;var q_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},J_=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Sy,Py,My,Ad=class extends Sn{constructor(e,r){super(e,r),Sy.set(this,void 0),Py.set(this,void 0),My.set(this,void 0),q_(this,Sy,ti.create(e.boxAdapters,r.voltageInputX,ei.Input,"X"),"f"),q_(this,Py,ti.create(e.boxAdapters,r.voltageInputY,ei.Input,"Y"),"f"),q_(this,My,ti.create(e.boxAdapters,r.voltageOutput,ei.Output,"Result"),"f")}get inputs(){return[J_(this,Sy,"f"),J_(this,Py,"f")]}get outputs(){return[J_(this,My,"f")]}};Sy=new WeakMap,Py=new WeakMap,My=new WeakMap;A();var iC=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ik=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ah,Ed=class extends Sn{constructor(e,r){super(e,r),Ah.set(this,void 0),iC(this,Ah,ti.create(e.boxAdapters,r.output,ei.Output,"Output"),"f")}get voltageOutput(){return Ik(this,Ah,"f")}get inputs(){return ie.empty()}get outputs(){return[Ik(this,Ah,"f")]}};Ah=new WeakMap;var Sd;(function(t){t.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,t.adapterFor=(e,r)=>He(r.accept({visitModuleGainBox:n=>e.adapterFor(n,Fd),visitModuleDelayBox:n=>e.adapterFor(n,bd),visitModuleMultiplierBox:n=>e.adapterFor(n,Ad),visitModularAudioInputBox:n=>e.adapterFor(n,Ed),visitModularAudioOutputBox:n=>e.adapterFor(n,_d)}),`Could not find ModuleAdapter for ${r.name}`)})(Sd||(Sd={}));A();var Bk=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},lc=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ny,$y,cc,Y_,Pd=class{constructor(e,r){Ny.add(this),$y.set(this,void 0),cc.set(this,void 0),Bk(this,$y,e,"f"),Bk(this,cc,r,"f")}get box(){return lc(this,cc,"f")}get uuid(){return lc(this,cc,"f").address.uuid}get address(){return lc(this,cc,"f").address}get moduleAdapter(){return Sd.adapterFor(lc(this,$y,"f").boxAdapters,lc(this,Ny,"a",Y_).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(lc(this,Ny,"a",Y_).address)}terminate(){}};$y=new WeakMap,cc=new WeakMap,Ny=new WeakSet,Y_=function(){return lc(this,cc,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var Tk=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Mi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Md,Ni,Nd=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Modular,Md.set(this,void 0),Ni.set(this,void 0),Tk(this,Md,e,"f"),Tk(this,Ni,r,"f")}get box(){return Mi(this,Ni,"f")}get uuid(){return Mi(this,Ni,"f").address.uuid}get address(){return Mi(this,Ni,"f").address}get indexField(){return Mi(this,Ni,"f").index}get labelField(){return Mi(this,Ni,"f").label}get enabledField(){return Mi(this,Ni,"f").enabled}get minimizedField(){return Mi(this,Ni,"f").minimized}get host(){return Mi(this,Ni,"f").host}parameterAt(e){return W("Not yet implemented")}deviceHost(){return Mi(this,Md,"f").boxAdapters.adapterFor(Mi(this,Ni,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return Mi(this,Md,"f").boxAdapters.adapterFor(Mi(this,Ni,"f").modularSetup.targetVertex.unwrap("No Modular found").box,ks)}elements(){return Mi(this,Ni,"f").userInterface.elements.pointerHub.filter(l.DeviceUserInterface).map(e=>Mi(this,Md,"f").boxAdapters.adapterFor(e.box,Pd))}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){}};Md=new WeakMap,Ni=new WeakMap;var Eh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},dt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},$d,Bs,kd,Xi,uc,dc,ks=class{constructor(e,r){$d.set(this,new ae),Bs.set(this,void 0),kd.set(this,void 0),Xi.set(this,void 0),uc.set(this,void 0),dc.set(this,void 0),Eh(this,kd,e,"f"),Eh(this,Xi,r,"f"),Eh(this,Bs,dt(this,$d,"f").own(new dr),"f"),Eh(this,uc,k.newSet(s=>s.uuid),"f"),Eh(this,dc,k.newSet(s=>s.uuid),"f");let n=s=>{let c=Sd.adapterFor(dt(this,kd,"f").boxAdapters,s.box);dt(this,uc,"f").add(c)&&dt(this,Bs,"f").proxy.onModuleAdded(c)},i=s=>dt(this,Bs,"f").proxy.onModuleRemoved(dt(this,uc,"f").removeByKey(s.address.uuid)),a=s=>{let c=dt(this,kd,"f").boxAdapters.adapterFor(s.box,$s);dt(this,dc,"f").add(c)&&dt(this,Bs,"f").proxy.onConnectionAdded(c)},o=s=>dt(this,Bs,"f").proxy.onConnectionRemoved(dt(this,dc,"f").removeByKey(s.address.uuid));dt(this,Xi,"f").modules.pointerHub.filter(l.ModuleCollection).forEach(n),dt(this,Xi,"f").connections.pointerHub.filter(l.ConnectionCollection).forEach(a),dt(this,$d,"f").own(dt(this,Xi,"f").modules.pointerHub.subscribe({onAdded:n,onRemoved:i},l.ModuleCollection)),dt(this,$d,"f").own(dt(this,Xi,"f").connections.pointerHub.subscribe({onAdded:a,onRemoved:o},l.ConnectionCollection))}catchupAndSubscribe(e){return i_(e.onModuleAdded,r=>dt(this,uc,"f").forEach(n=>r(n))),i_(e.onConnectionAdded,r=>dt(this,dc,"f").forEach(n=>r(n))),dt(this,Bs,"f").subscribe(e)}get box(){return dt(this,Xi,"f")}get address(){return dt(this,Xi,"f").address}get uuid(){return dt(this,Xi,"f").address.uuid}get editingField(){return dt(this,Xi,"f").editing}get labelField(){return dt(this,Xi,"f").label}get modules(){return dt(this,uc,"f").values()}get connections(){return dt(this,dc,"f").values()}get device(){return dt(this,kd,"f").boxAdapters.adapterFor(He(dt(this,Xi,"f").device.pointerHub.incoming().at(0),"No device found").box,Nd)}terminate(){console.debug(`terminate ${this}`),dt(this,$d,"f").terminate()}};$d=new WeakMap,Bs=new WeakMap,kd=new WeakMap,Xi=new WeakMap,uc=new WeakMap,dc=new WeakMap;A();A();rt();var Sh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},fi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},X_,Bd,Ph,ky,Id,Nh,Iy,Mh,By,Dk,Xa=class{constructor(e,r){X_.add(this),this.type="groove-adapter",Ph.set(this,new ae),ky.set(this,void 0),Id.set(this,void 0),Nh.set(this,void 0),Iy.set(this,new Lg({duration:()=>fi(this,By,"f"),fx:n=>u_(n,fi(this,Mh,"f")),fy:n=>u_(n,1-fi(this,Mh,"f"))})),Mh.set(this,0),By.set(this,Ve.SemiQuaver*2),Sh(this,ky,e,"f"),Sh(this,Id,r,"f"),Sh(this,Nh,fi(this,Ph,"f").own(new ue(fi(this,ky,"f"))),"f"),this.namedParameter=fi(this,X_,"m",Dk).call(this,r),fi(this,Ph,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(n=>Sh(this,By,n.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(n=>Sh(this,Mh,JM(n.getValue(),.01),"f")))}unwarp(e){return fi(this,Iy,"f").unwarp(e)}warp(e){return fi(this,Iy,"f").warp(e)}get box(){return fi(this,Id,"f")}get uuid(){return fi(this,Id,"f").address.uuid}get address(){return fi(this,Id,"f").address}terminate(){fi(this,Ph,"f").terminate()}};Bd=Xa,Ph=new WeakMap,ky=new WeakMap,Id=new WeakMap,Nh=new WeakMap,Iy=new WeakMap,Mh=new WeakMap,By=new WeakMap,X_=new WeakSet,Dk=function(e){return{duration:fi(this,Nh,"f").createParameter(e.duration,E.values(Bd.DurationPPQNs),S.values("",Bd.DurationPPQNs,Bd.DurationStrings),"Duration"),amount:fi(this,Nh,"f").createParameter(e.amount,E.unipolar(),S.percent({fractionDigits:0}),"Amount")}};Xa.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];Xa.DurationPPQNs=Bd.Durations.map(([t,e])=>Ve.fromSignature(t,e));Xa.DurationStrings=Bd.Durations.map(([t,e])=>`${t}/${e}`);A();A();var Td=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Zt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Qa,Ts,Dd,Ty,Dy,$h,kh,Q_,Ds=class{constructor(e,r,n,i,a){Qa.set(this,void 0),Ts.set(this,void 0),Dd.set(this,void 0),Ty.set(this,void 0),Dy.set(this,void 0),$h.set(this,new ae),kh.set(this,void 0),Q_.set(this,_.None),Td(this,Qa,e,"f"),Td(this,Ts,r,"f"),Td(this,Dd,n,"f"),Td(this,Ty,i,"f"),Td(this,Dy,a??0,"f"),Td(this,kh,Zt(this,$h,"f").own(new xe),"f"),Zt(this,$h,"f").own(Zt(this,Qa,"f").subscribe(()=>Zt(this,kh,"f").notify(this))),e.getValue(),r.clamp(e.getValue())}get field(){return Zt(this,Qa,"f")}get valueMapping(){return Zt(this,Ts,"f")}get stringMapping(){return Zt(this,Dd,"f")}get name(){return Zt(this,Ty,"f")}get anchor(){return Zt(this,Dy,"f")}get type(){return Zt(this,Qa,"f").type}get address(){return Zt(this,Qa,"f").address}get track(){return Zt(this,Q_,"f")}subscribe(e){return Zt(this,kh,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return Zt(this,Qa,"f").getValue()}setValue(e){Zt(this,Qa,"f").setValue(Zt(this,Ts,"f").clamp(e))}setUnitValue(e){this.setValue(Zt(this,Ts,"f").y(e))}getUnitValue(){return Zt(this,Ts,"f").x(this.getValue())}getPrintValue(){return Zt(this,Dd,"f").x(this.getValue())}setPrintValue(e){let r=Zt(this,Dd,"f").y(e);r.type==="unitValue"?this.setUnitValue(Se(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(Zt(this,Ts,"f").clamp(Zt(this,Qa,"f").initValue))}terminate(){Zt(this,$h,"f").terminate()}};Qa=new WeakMap,Ts=new WeakMap,Dd=new WeakMap,Ty=new WeakMap,Dy=new WeakMap,$h=new WeakMap,kh=new WeakMap,Q_=new WeakMap;var Rd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},eo,Ry,Cy,zy,Oy,Vy,Uy=class{constructor(e){eo.set(this,void 0),Ry.set(this,void 0),Cy.set(this,void 0),zy.set(this,void 0),Oy.set(this,void 0),Vy.set(this,void 0),Rd(this,eo,e,"f"),Rd(this,Ry,new Ds(Pn(this,eo,"f").keyboard,E.values([88,76,61,49]),S.numeric({fractionDigits:1}),"Keyboard Type"),"f"),Rd(this,Cy,new Ds(Pn(this,eo,"f").timeRangeInQuarters,E.exponential(1,64),S.numeric({fractionDigits:1}),"Time-Range"),"f"),Rd(this,zy,new Ds(Pn(this,eo,"f").noteScale,E.exponential(.5,2),S.numeric({fractionDigits:1}),"Note Scale"),"f"),Rd(this,Oy,new Ds(Pn(this,eo,"f").noteLabels,E.bool,S.bool,"Note Labels"),"f"),Rd(this,Vy,new Ds(Pn(this,eo,"f").transpose,E.linearInteger(-48,48),S.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return Pn(this,eo,"f").box.subscribe(Ke.Children,()=>e(this))}get object(){return Pn(this,eo,"f")}get keyboard(){return Pn(this,Ry,"f")}get timeRangeInQuarters(){return Pn(this,Cy,"f")}get noteScale(){return Pn(this,zy,"f")}get noteLabels(){return Pn(this,Oy,"f")}get transpose(){return Pn(this,Vy,"f")}};eo=new WeakMap,Ry=new WeakMap,Cy=new WeakMap,zy=new WeakMap,Oy=new WeakMap,Vy=new WeakMap;var Ih=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},vr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},pc,Qi,fc,jy,Ky,Wy=class{constructor(e,r){pc.set(this,void 0),Qi.set(this,void 0),fc.set(this,void 0),jy.set(this,void 0),Ky.set(this,void 0),Ih(this,pc,e,"f"),Ih(this,Qi,r,"f"),Ih(this,fc,jt.create(vr(this,Qi,"f").audioUnits,n=>vr(this,pc,"f").boxAdapters.adapterFor(n,bn),l.AudioUnits),"f"),Ih(this,jy,new ny(vr(this,Qi,"f").audioBusses.pointerHub,n=>vr(this,pc,"f").boxAdapters.adapterFor(n,Wi),l.AudioBusses),"f"),Ih(this,Ky,new Uy(vr(this,Qi,"f").pianoMode),"f")}get uuid(){return vr(this,Qi,"f").address.uuid}get address(){return vr(this,Qi,"f").address}get box(){return vr(this,Qi,"f")}get audioBusses(){return vr(this,jy,"f")}get audioUnits(){return vr(this,fc,"f")}get clips(){return vr(this,fc,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return vr(this,pc,"f").boxAdapters.adapterFor(vr(this,Qi,"f").groove.targetVertex.unwrap("no groove").box,Xa)}get timeline(){return vr(this,pc,"f").boxAdapters.adapterFor(vr(this,Qi,"f").timeline.targetVertex.unwrap("no timeline").box,Ja)}get pianoMode(){return vr(this,Ky,"f")}get created(){return new Date(vr(this,Qi,"f").created.getValue())}get midiOutputDevices(){return vr(this,Qi,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>je(e,ss))}*labeledAudioOutputs(){for(let e of vr(this,fc,"f").adapters())yield{label:e.label,address:e.address,children:()=>_.wrap(e.labeledAudioOutputs())}}terminate(){vr(this,fc,"f").terminate()}};pc=new WeakMap,Qi=new WeakMap,fc=new WeakMap,jy=new WeakMap,Ky=new WeakMap;A();var e1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ri=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},t1,Bh,da,Rs,Rk,Ly=class{constructor(e,r){t1.add(this),this.type="instrument",this.accepts="audio",this.manualUrl=se.Tape,Bh.set(this,void 0),da.set(this,void 0),Rs.set(this,void 0),e1(this,Bh,e,"f"),e1(this,da,r,"f"),e1(this,Rs,new ue(ri(this,Bh,"f")),"f"),this.namedParameter=ri(this,t1,"m",Rk).call(this,r)}get box(){return ri(this,da,"f")}get uuid(){return ri(this,da,"f").address.uuid}get address(){return ri(this,da,"f").address}get labelField(){return ri(this,da,"f").label}get iconField(){return ri(this,da,"f").icon}get defaultTrackType(){return ye.Audio}get enabledField(){return ri(this,da,"f").enabled}get minimizedField(){return ri(this,da,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return ri(this,Bh,"f").boxAdapters.adapterFor(ri(this,da,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){ri(this,Rs,"f").terminate()}};Bh=new WeakMap,da=new WeakMap,Rs=new WeakMap,t1=new WeakSet,Rk=function(e){return{flutter:ri(this,Rs,"f").createParameter(e.flutter,E.unipolar(),S.percent(),"Flutter"),wow:ri(this,Rs,"f").createParameter(e.wow,E.unipolar(),S.percent(),"Wow"),noise:ri(this,Rs,"f").createParameter(e.noise,E.unipolar(),S.percent(),"Noise"),saturation:ri(this,Rs,"f").createParameter(e.saturation,E.unipolar(),S.percent(),"Saturation")}};A();A();rt();var hc=(()=>{let r=[1,2,3,4],n=["12","24","36","48"],i=[Sa.sine,Sa.triangle,Sa.saw,Sa.square],a=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:E.exponential(20,2e4),CUTOFF_STRING_MAPPING:S.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:r,FILTER_ORDER_STRINGS:n,FILTER_ORDER_VALUE_MAPPING:E.values(r),FILTER_ORDER_STRING_MAPPING:S.values("db",r,n),LFO_WAVEFORM_VALUES:i,LFO_WAVEFORM_STRINGS:a,LFO_WAVEFORM_VALUE_MAPPING:E.values(i),LFO_WAVEFORM_STRING_MAPPING:S.values("",i,a)}})();var r1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ye=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},i1,Th,pa,ct,Ck,Zy=class{constructor(e,r){i1.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=se.Vaporisateur,Th.set(this,void 0),pa.set(this,void 0),ct.set(this,void 0),r1(this,Th,e,"f"),r1(this,pa,r,"f"),r1(this,ct,new ue(Ye(this,Th,"f")),"f"),this.namedParameter=Ye(this,i1,"m",Ck).call(this,r)}get box(){return Ye(this,pa,"f")}get uuid(){return Ye(this,pa,"f").address.uuid}get address(){return Ye(this,pa,"f").address}get labelField(){return Ye(this,pa,"f").label}get iconField(){return Ye(this,pa,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return Ye(this,pa,"f").enabled}get minimizedField(){return Ye(this,pa,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ye(this,Th,"f").boxAdapters.adapterFor(Ye(this,pa,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Ye(this,ct,"f").terminate()}};Th=new WeakMap,pa=new WeakMap,ct=new WeakMap,i1=new WeakSet,Ck=function(e){let r=[Ma.Monophonic,Ma.Polyphonic];return{oscillators:e.oscillators.fields().map(n=>({waveform:Ye(this,ct,"f").createParameter(n.waveform,E.linearInteger(0,3),S.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:Ye(this,ct,"f").createParameter(n.volume,E.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:Ye(this,ct,"f").createParameter(n.octave,E.linearInteger(-3,3),S.numeric({unit:"oct"}),"Octave",.5),tune:Ye(this,ct,"f").createParameter(n.tune,E.linear(-1200,1200),S.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:Ye(this,ct,"f").createParameter(e.noise.volume,E.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:Ye(this,ct,"f").createParameter(e.noise.attack,E.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:Ye(this,ct,"f").createParameter(e.noise.hold,E.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Hold"),release:Ye(this,ct,"f").createParameter(e.noise.release,E.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:Ye(this,ct,"f").createParameter(e.filterOrder,hc.FILTER_ORDER_VALUE_MAPPING,hc.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:Ye(this,ct,"f").createParameter(e.cutoff,hc.CUTOFF_VALUE_MAPPING,hc.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:Ye(this,ct,"f").createParameter(e.resonance,E.exponential(.01,10),S.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:Ye(this,ct,"f").createParameter(e.attack,E.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:Ye(this,ct,"f").createParameter(e.decay,E.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:Ye(this,ct,"f").createParameter(e.sustain,E.unipolar(),S.percent({fractionDigits:1}),"Sustain"),release:Ye(this,ct,"f").createParameter(e.release,E.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:Ye(this,ct,"f").createParameter(e.filterEnvelope,E.bipolar(),S.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:Ye(this,ct,"f").createParameter(e.filterKeyboard,E.bipolar(),S.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:Ye(this,ct,"f").createParameter(e.voicingMode,E.values(r),S.values("",r,["mono","poly"]),"Play Mode",.5),glideTime:Ye(this,ct,"f").createParameter(e.glideTime,E.unipolar(),S.percent({fractionDigits:1}),"Glide time",0),unisonCount:Ye(this,ct,"f").createParameter(e.unisonCount,E.values([1,3,5]),S.values("#",[1,3,5],[1,3,5].map(n=>String(n))),"Unisono",0),unisonDetune:Ye(this,ct,"f").createParameter(e.unisonDetune,E.exponential(1,1200),S.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:Ye(this,ct,"f").createParameter(e.unisonStereo,E.unipolar(),S.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:Ye(this,ct,"f").createParameter(e.lfo.waveform,hc.LFO_WAVEFORM_VALUE_MAPPING,hc.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:Ye(this,ct,"f").createParameter(e.lfo.rate,E.exponential(1e-4,30),S.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:Ye(this,ct,"f").createParameter(e.lfo.targetTune,E.bipolar(),S.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:Ye(this,ct,"f").createParameter(e.lfo.targetVolume,E.bipolar(),S.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:Ye(this,ct,"f").createParameter(e.lfo.targetCutoff,E.bipolar(),S.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};rt();A();var n1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ar=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},a1,Gy,Dh,Mn,to,zk,mc=class{constructor(e,r){a1.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=se.Arpeggio,Dh.set(this,void 0),Mn.set(this,void 0),to.set(this,void 0),n1(this,Dh,e,"f"),n1(this,Mn,r,"f"),n1(this,to,new ue(Ar(this,Dh,"f")),"f"),this.namedParameter=Ar(this,a1,"m",zk).call(this,r)}get box(){return Ar(this,Mn,"f")}get uuid(){return Ar(this,Mn,"f").address.uuid}get address(){return Ar(this,Mn,"f").address}get indexField(){return Ar(this,Mn,"f").index}get labelField(){return Ar(this,Mn,"f").label}get enabledField(){return Ar(this,Mn,"f").enabled}get minimizedField(){return Ar(this,Mn,"f").minimized}get host(){return Ar(this,Mn,"f").host}deviceHost(){return Ar(this,Dh,"f").boxAdapters.adapterFor(Ar(this,Mn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Ar(this,to,"f").terminate()}};Gy=mc,Dh=new WeakMap,Mn=new WeakMap,to=new WeakMap,a1=new WeakSet,zk=function(e){return{modeIndex:Ar(this,to,"f").createParameter(e.modeIndex,E.linearInteger(0,2),S.indices("",["Up","Down","UpDown"]),"Mode"),numOctaves:Ar(this,to,"f").createParameter(e.numOctaves,E.linearInteger(1,5),S.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:Ar(this,to,"f").createParameter(e.rateIndex,E.linearInteger(0,Gy.RateFractions.length-1),Gy.RateStringMapping,"Rate"),gate:Ar(this,to,"f").createParameter(e.gate,E.linear(0,2),S.percent({fractionDigits:0}),"Gate"),repeat:Ar(this,to,"f").createParameter(e.repeat,E.linearInteger(1,16),S.numeric({fractionDigits:0}),"Repeat"),velocity:Ar(this,to,"f").createParameter(e.velocity,E.bipolar(),S.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};mc.RateFractions=Xo.builder().add([1,1]).add([1,2]).add([1,3]).add([1,4]).add([3,16]).add([1,6]).add([1,8]).add([3,32]).add([1,12]).add([1,16]).add([3,64]).add([1,24]).add([1,32]).add([1,48]).add([1,64]).add([1,96]).add([1,128]).asDescendingArray();mc.RateStringMapping=S.indices("",Gy.RateFractions.map(([t,e])=>`${t}/${e}`));A();var o1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ii=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},s1,Rh,Nn,gc,Ok,Hy=class{constructor(e,r){s1.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=se.Pitch,Rh.set(this,void 0),Nn.set(this,void 0),gc.set(this,void 0),o1(this,Rh,e,"f"),o1(this,Nn,r,"f"),o1(this,gc,new ue(ii(this,Rh,"f")),"f"),this.namedParameter=ii(this,s1,"m",Ok).call(this,r)}get box(){return ii(this,Nn,"f")}get uuid(){return ii(this,Nn,"f").address.uuid}get address(){return ii(this,Nn,"f").address}get indexField(){return ii(this,Nn,"f").index}get labelField(){return ii(this,Nn,"f").label}get enabledField(){return ii(this,Nn,"f").enabled}get minimizedField(){return ii(this,Nn,"f").minimized}get host(){return ii(this,Nn,"f").host}deviceHost(){return ii(this,Rh,"f").boxAdapters.adapterFor(ii(this,Nn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){ii(this,gc,"f").terminate()}};Rh=new WeakMap,Nn=new WeakMap,gc=new WeakMap,s1=new WeakSet,Ok=function(e){return{octaves:ii(this,gc,"f").createParameter(e.octaves,E.linearInteger(-7,7),S.numeric({unit:"oct",fractionDigits:0}),"Octaves"),semiTones:ii(this,gc,"f").createParameter(e.semiTones,E.linearInteger(-36,36),S.numeric({unit:"st",fractionDigits:0}),"Semi-Tones"),cent:ii(this,gc,"f").createParameter(e.cents,E.linear(-50,50),S.numeric({unit:"cents",fractionDigits:1}),"Cents")}};A();A();var nC=/^\/\/ @label .+$/m,Vk=/^\/\/ @param .+$/gm,Uk=/^\/\/ @sample .+$/gm;var jk=/^\/\/ @(group|param|sample) .+$/gm,Kk=/^\/\/ @(?:param|sample) \S+/gm,aC=/^\/\/ @no-pass\b(.*)$/m,Cd=1e-6,oC=["linear","exp","int","bool"],sC=new class{x(t){return{value:t>=.5?"On":"Off",unit:""}}y(t){let e=t.trim().toLowerCase();return{type:"explicit",value:e==="on"||e==="true"||e==="yes"?1:0}}},Wk=t=>{let e=t.replace(/^\/\/ @param\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(e.length===0)throw new Error(`Malformed @param: '${t}'`);let r=e[0];if(e.length===1)return{label:r,defaultValue:0,min:0,max:1,mapping:"unipolar",unit:""};let n=e[1];if(n==="true"||n==="false")return{label:r,defaultValue:n==="true"?1:0,min:0,max:1,mapping:"bool",unit:""};if(n==="bool")return{label:r,defaultValue:0,min:0,max:1,mapping:"bool",unit:""};let i=parseFloat(n);if(isNaN(i))throw new Error(`Malformed @param: '${t}' \u2014 '${n}' is not a valid number`);if(e.length===2)return{label:r,defaultValue:i,min:0,max:1,mapping:"unipolar",unit:""};if(e.length===3&&e[2]==="bool")return{label:r,defaultValue:i>=.5?1:0,min:0,max:1,mapping:"bool",unit:""};if(e.length===4){let u=parseFloat(e[2]),f=parseFloat(e[3]);if(isNaN(u)||isNaN(f))throw new Error(`Malformed @param: '${t}' \u2014 min/max must be numbers`);if(f-u<Cd)throw new Error(`Malformed @param: '${t}' \u2014 min (${u}) must be less than max (${f})`);if(i<u-Cd||i>f+Cd)throw new Error(`Malformed @param: '${t}' \u2014 default (${i}) must be within [${u}, ${f}]`);return{label:r,defaultValue:i,min:u,max:f,mapping:"linear",unit:""}}if(e.length<5)throw new Error(`Malformed @param: '${t}' \u2014 expected: // @param <name> <default> <min> <max> [type] [unit]`);let a=parseFloat(e[2]),o=parseFloat(e[3]),s=e[4],c=e.length>=6?e[5]:"";if(isNaN(a)||isNaN(o))throw new Error(`Malformed @param: '${t}' \u2014 min/max must be numbers`);if(!oC.includes(s))throw new Error(`Malformed @param: '${t}' \u2014 unknown mapping '${s}' (expected: linear, exp, int, bool)`);if(s!=="bool"&&o-a<Cd)throw new Error(`Malformed @param: '${t}' \u2014 min (${a}) must be less than max (${o})`);if(i<a-Cd||i>o+Cd)throw new Error(`Malformed @param: '${t}' \u2014 default (${i}) must be within [${a}, ${o}]`);return{label:r,defaultValue:i,min:a,max:o,mapping:s,unit:c}},Lk=(t,e)=>t.mapping===e.mapping&&t.min===e.min&&t.max===e.max&&t.unit===e.unit,lC=(t,e)=>Lk(t,e)&&Math.abs(t.defaultValue-e.defaultValue)<1e-6,Er;(function(t){t.isEqual=lC,t.parseLabel=e=>{let r=nC.exec(e);if(r===null)return _.None;let n=r[0].replace(/^\/\/ @label\s+/,"").trim();if(n.length===0)throw new Error("Malformed @label: expected: // @label <name>");return _.wrap(n)},t.parsePassThrough=e=>{let r=aC.exec(e);if(r===null)return!0;if(r[1].trim().length>0)throw new Error("Malformed @no-pass: expected: // @no-pass");return!1},t.parseParams=e=>{let r=[],n;for(Vk.lastIndex=0;(n=Vk.exec(e))!==null;)r.push(Wk(n[0]));return r},t.parseSamples=e=>{let r=[],n;for(Uk.lastIndex=0;(n=Uk.exec(e))!==null;){let i=n[0].replace(/^\/\/ @sample\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(i.length===0||i[0].length===0)throw new Error(`Malformed @sample: '${n[0]}' \u2014 expected: // @sample <name>`);if(i.length>1)throw new Error(`Malformed @sample: '${n[0]}' \u2014 expected: // @sample <name>`);r.push({label:i[0]})}return r},t.parseDeclarationOrder=e=>{let r=new Map,n;Kk.lastIndex=0;let i=0;for(;(n=Kk.exec(e))!==null;){let a=n[0].replace(/^\/\/ @(?:param|sample)\s+/,"").split(/\s+/)[0];r.has(a)||r.set(a,i++)}return r},t.parseGroups=e=>{let r=[],n=null,i=[];jk.lastIndex=0;let a;for(;(a=jk.exec(e))!==null;){let o=a[0],s=a[1];if(s==="group"){(i.length>0||n!==null)&&r.push({group:n,items:i});let c=o.replace(/^\/\/ @group\s+/,"").trim().split(/\s+/);n={label:c[0],color:c[1]??"dark"},i=[]}else if(s==="param")i.push({type:"param",declaration:Wk(o)});else if(s==="sample"){let c=o.replace(/^\/\/ @sample\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(c.length===0||c[0].length===0)throw new Error(`Malformed @sample: '${o}' \u2014 expected: // @sample <name>`);i.push({type:"sample",declaration:{label:c[0]}})}}return(i.length>0||n!==null)&&r.push({group:n,items:i}),r},t.resolveValueMapping=e=>{switch(e.mapping){case"unipolar":return E.unipolar();case"linear":return E.linear(e.min,e.max);case"exp":return E.exponential(e.min,e.max);case"int":return E.linearInteger(e.min,e.max);case"bool":return E.linearInteger(0,1)}},t.resolveStringMapping=e=>{switch(e.mapping){case"unipolar":return S.percent();case"linear":return S.numeric({unit:e.unit,fractionDigits:2});case"exp":return S.numeric({unit:e.unit,fractionDigits:2});case"int":return S.numeric({unit:e.unit,fractionDigits:0});case"bool":return sC}},t.resolveParamMappings=e=>({valueMapping:t.resolveValueMapping(e),stringMapping:t.resolveStringMapping(e)}),t.subscribeScriptParams=(e,r,n)=>{let i=new Map,a=new xe;return{terminable:ve.many(n.pointerHub.catchupAndSubscribe({onAdded:(({box:s})=>{let c=je(s,Da),u=c.label.getValue(),v=t.parseParams(r.getValue()).find(y=>y.label===u),{valueMapping:m,stringMapping:w}=K(v)?t.resolveParamMappings(v):{valueMapping:E.unipolar(),stringMapping:S.percent({fractionDigits:1})};e.createParameter(c.value,m,w,Kp.capitalize(u),void 0,c.defaultValue.getValue()),K(v)&&i.set(u,v)}),onRemoved:(({box:s})=>{let c=je(s,Da);i.delete(c.label.getValue()),e.removeParameter(c.value.address)})}),r.subscribe(()=>{let s=t.parseParams(r.getValue());for(let c of e.parameters()){let u=s.find(w=>Kp.capitalize(w.label)===c.name);if(!K(u))continue;let f=i.get(u.label);if(K(f)&&Lk(f,u))continue;let{valueMapping:v,stringMapping:m}=t.resolveParamMappings(u);c.updateMappings(v,m),i.set(u.label,u)}a.notify()}),a),codeChanged:a}}})(Er||(Er={}));var qy=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},jr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ch,zh,$n,Oh,Jy,Yy=class{constructor(e,r){Ch.set(this,new ae),this.type="midi-effect",this.accepts="midi",this.manualUrl=se.Spielwerk,zh.set(this,void 0),$n.set(this,void 0),Oh.set(this,void 0),Jy.set(this,void 0),qy(this,zh,e,"f"),qy(this,$n,r,"f"),qy(this,Oh,jr(this,Ch,"f").own(new ue(jr(this,zh,"f"))),"f");let{terminable:n,codeChanged:i}=Er.subscribeScriptParams(jr(this,Oh,"f"),r.code,r.parameters);jr(this,Ch,"f").own(n),qy(this,Jy,i,"f")}get box(){return jr(this,$n,"f")}get uuid(){return jr(this,$n,"f").address.uuid}get address(){return jr(this,$n,"f").address}get indexField(){return jr(this,$n,"f").index}get labelField(){return jr(this,$n,"f").label}get enabledField(){return jr(this,$n,"f").enabled}get minimizedField(){return jr(this,$n,"f").minimized}get host(){return jr(this,$n,"f").host}get parameters(){return jr(this,Oh,"f")}get codeChanged(){return jr(this,Jy,"f")}deviceHost(){return jr(this,zh,"f").boxAdapters.adapterFor(jr(this,$n,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){jr(this,Ch,"f").terminate()}};Ch=new WeakMap,zh=new WeakMap,$n=new WeakMap,Oh=new WeakMap,Jy=new WeakMap;A();var Xy=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ni=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Vh,Uh,fa,jh,Qy,ew=class{constructor(e,r){Vh.set(this,new ae),this.type="instrument",this.accepts="midi",this.manualUrl=se.Apparat,Uh.set(this,void 0),fa.set(this,void 0),jh.set(this,void 0),Qy.set(this,void 0),Xy(this,Uh,e,"f"),Xy(this,fa,r,"f"),Xy(this,jh,ni(this,Vh,"f").own(new ue(ni(this,Uh,"f"))),"f");let{terminable:n,codeChanged:i}=Er.subscribeScriptParams(ni(this,jh,"f"),r.code,r.parameters);ni(this,Vh,"f").own(n),Xy(this,Qy,i,"f")}get box(){return ni(this,fa,"f")}get uuid(){return ni(this,fa,"f").address.uuid}get address(){return ni(this,fa,"f").address}get labelField(){return ni(this,fa,"f").label}get iconField(){return ni(this,fa,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return ni(this,fa,"f").enabled}get minimizedField(){return ni(this,fa,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return ni(this,jh,"f")}get codeChanged(){return ni(this,Qy,"f")}deviceHost(){return ni(this,Uh,"f").boxAdapters.adapterFor(ni(this,fa,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){ni(this,Vh,"f").terminate()}};Vh=new WeakMap,Uh=new WeakMap,fa=new WeakMap,jh=new WeakMap,Qy=new WeakMap;A();var Vo;(function(t){t.DefaultNote=60,t.pack=e=>e.note&127|(e.active?1:0)<<7|(e.slide?1:0)<<8|(e.accent?1:0)<<9,t.unpack=e=>({note:e&127,active:(e>>7&1)===1,slide:(e>>8&1)===1,accent:(e>>9&1)===1})})(Vo||(Vo={}));A();rt();var Kh;(function(t){t.Contours=["free","walk","rise","fall"],t.Motifs=[0,2,3,4,8],t.Default={root:0,scale:Qc.StockScales[1],octave:1,octaves:3,density:.6,accent:.3,slide:.2,motif:0,contour:"free",rootFirst:!0};let e=r=>{let n=ie.create(i=>i,12).filter(i=>r.has(i));return n.length===0?[0]:n};t.steps=(r,n)=>{let i=e(r.scale),a=Math.max(1,r.octaves),o=i.length*a,s=(r.octave+2)*12+r.root,c=w=>{let y=Se(w,0,o-1);return Se(s+i[y%i.length]+Math.floor(y/i.length)*12,0,127)},u=r.motif>0?Math.min(r.motif,n):n,f=w=>Math.round((Math.random()*2-1)*w),v=new Array(u);for(let w=0;w<u;w++){let y=u<2?0:w/(u-1)*(o-1);v[w]=r.rootFirst&&w===0?0:Se(r.contour==="walk"?w===0?o>>1:v[w-1]+f(2):r.contour==="rise"?Math.round(y)+f(1):r.contour==="fall"?Math.round(o-1-y)+f(1):Math.floor(Math.random()*o),0,o-1)}let m=ie.create(w=>Vo.pack({note:c(v[w]),active:r.rootFirst&&w===0||Math.random()<r.density,slide:Math.random()<r.slide,accent:Math.random()<r.accent}),u);return ie.create(w=>m[w%u],n)}})(Kh||(Kh={}));var l1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Sr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},u1,Wh,en,Uo,Zk,c1=Vo.pack({note:Vo.DefaultNote,active:!1,slide:!1,accent:!1}),tw=class{constructor(e,r){u1.add(this),this.type="instrument",this.accepts="midi",this.manualUrl="manuals/devices/instruments/cubed",Wh.set(this,void 0),en.set(this,void 0),Uo.set(this,void 0),l1(this,Wh,e,"f"),l1(this,en,r,"f"),l1(this,Uo,new ue(Sr(this,Wh,"f")),"f"),this.namedParameter=Sr(this,u1,"m",Zk).call(this,r)}get box(){return Sr(this,en,"f")}get uuid(){return Sr(this,en,"f").address.uuid}get address(){return Sr(this,en,"f").address}get labelField(){return Sr(this,en,"f").label}get iconField(){return Sr(this,en,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return Sr(this,en,"f").enabled}get minimizedField(){return Sr(this,en,"f").minimized}get acceptsMidiEvents(){return!0}currentPattern(){return Sr(this,en,"f").patterns.getField(Sr(this,en,"f").patternIndex.getValue())}readCurrentPattern(){let e=this.currentPattern(),r=e.length.getValue();return{length:r,steps:e.steps.fields().slice(0,r).map(n=>Vo.unpack(n.getValue()))}}writeCurrentPattern({length:e,steps:r}){let n=this.currentPattern(),i=n.steps.fields(),a=Math.min(r.length,i.length);i.forEach((o,s)=>o.setValue(s<a?Vo.pack(r[s]):c1)),n.length.setValue(Se(e,1,i.length))}clearCurrentPattern(){this.currentPattern().steps.fields().forEach(e=>e.setValue(c1))}randomizeCurrentPattern(e=Kh.Default){let r=this.currentPattern(),n=r.length.getValue(),i=Kh.steps(e,n);r.steps.fields().forEach((a,o)=>a.setValue(o<n?i[o]:c1))}rotateCurrentPattern(e){let r=this.currentPattern(),n=r.length.getValue(),i=r.steps.fields().slice(0,n),a=i.map(o=>o.getValue());i.forEach((o,s)=>o.setValue(a[(s+e+n)%n]))}deviceHost(){return Sr(this,Wh,"f").boxAdapters.adapterFor(Sr(this,en,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Sr(this,Uo,"f").terminate()}};Wh=new WeakMap,en=new WeakMap,Uo=new WeakMap,u1=new WeakSet,Zk=function(e){let r=(n,i,a)=>Sr(this,Uo,"f").createParameter(n,E.unipolar(),S.percent({fractionDigits:0}),i,a);return{tuning:Sr(this,Uo,"f").createParameter(e.tuning,E.linear(-1200,1200),S.numeric({unit:"ct",fractionDigits:0}),"Tuning",.5),cutoff:r(e.cutoff,"Cutoff"),resonance:r(e.resonance,"Resonance"),envMod:r(e.envMod,"Env Mod"),decay:r(e.decay,"Decay"),accent:r(e.accent,"Accent"),volume:Sr(this,Uo,"f").createParameter(e.volume,E.DefaultDecibel,S.numeric({unit:"dB",fractionDigits:1}),"Volume"),waveform:Sr(this,Uo,"f").createParameter(e.waveform,E.linearInteger(0,1),S.indices("",["Sawtooth","Square"]),"Waveform",.5),patternIndex:Sr(this,Uo,"f").createParameter(e.patternIndex,E.linearInteger(0,e.patterns.fields().length-1),S.oneBasedIndex(),"Pattern")}};A();var d1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Nt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},p1,Lh,kn,Kr,Gk,Cs;(function(t){t.Waves=["Saw","Square","Pulse","Double Sine","Saw-Pulse","Res. Saw","Res. Triangle","Res. Trapezoid"],t.LineSelect=["1","2","1+1'","1+2'"],t.Modulation=["Off","Ring","Noise"],t.VibratoWaves=["Triangle","Saw Up","Saw Down","Square"],t.envelopeIndex=(e,r)=>e*3+(r==="pitch"?0:r==="dcw"?1:2)})(Cs||(Cs={}));var rw=class{constructor(e,r){p1.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=se.Neon,Lh.set(this,void 0),kn.set(this,void 0),Kr.set(this,void 0),d1(this,Lh,e,"f"),d1(this,kn,r,"f"),d1(this,Kr,new ue(Nt(this,Lh,"f")),"f"),this.namedParameter=Nt(this,p1,"m",Gk).call(this,r)}get box(){return Nt(this,kn,"f")}get uuid(){return Nt(this,kn,"f").address.uuid}get address(){return Nt(this,kn,"f").address}get labelField(){return Nt(this,kn,"f").label}get iconField(){return Nt(this,kn,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return Nt(this,kn,"f").enabled}get minimizedField(){return Nt(this,kn,"f").minimized}get acceptsMidiEvents(){return!0}envelope(e,r){return Nt(this,kn,"f").envelopes.fields()[Cs.envelopeIndex(e,r)]}deviceHost(){return Nt(this,Lh,"f").boxAdapters.adapterFor(Nt(this,kn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Nt(this,Kr,"f").terminate()}};Lh=new WeakMap,kn=new WeakMap,Kr=new WeakMap,p1=new WeakSet,Gk=function(e){let r=[Ma.Monophonic,Ma.Polyphonic],n=(i,a)=>Nt(this,Kr,"f").createParameter(i,E.linear(0,99),S.numeric({unit:"",fractionDigits:0}),a);return{lineSelect:Nt(this,Kr,"f").createParameter(e.lineSelect,E.linearInteger(0,3),S.indices("",Cs.LineSelect),"Line"),modulation:Nt(this,Kr,"f").createParameter(e.modulation,E.linearInteger(0,2),S.indices("",Cs.Modulation),"Mod"),octave:Nt(this,Kr,"f").createParameter(e.octave,E.linearInteger(-3,3),S.numeric({unit:"oct"}),"Octave",.5),detune:Nt(this,Kr,"f").createParameter(e.detune,E.linear(-4800,4800),S.numeric({unit:"ct",fractionDigits:0}),"Detune",.5),tune:Nt(this,Kr,"f").createParameter(e.tune,E.linear(-1200,1200),S.numeric({unit:"ct",fractionDigits:0}),"Tune",.5),glideTime:Nt(this,Kr,"f").createParameter(e.glideTime,E.unipolar(),S.percent({fractionDigits:1}),"Glide time",0),voicingMode:Nt(this,Kr,"f").createParameter(e.voicingMode,E.values(r),S.values("",r,["mono","poly"]),"Play Mode",.5),vibrato:{wave:Nt(this,Kr,"f").createParameter(e.vibrato.wave,E.linearInteger(0,3),S.indices("",Cs.VibratoWaves),"Vib. Wave"),delay:n(e.vibrato.delay,"Vib. Delay"),rate:n(e.vibrato.rate,"Vib. Rate"),depth:n(e.vibrato.depth,"Vib. Depth")},lines:e.lines.fields().map(i=>({wave1:Nt(this,Kr,"f").createParameter(i.wave1,E.linearInteger(0,7),S.indices("",Cs.Waves),"Wave 1"),wave2:Nt(this,Kr,"f").createParameter(i.wave2,E.linearInteger(0,8),S.indices("",["Off",...Cs.Waves]),"Wave 2"),dcwKeyFollow:Nt(this,Kr,"f").createParameter(i.dcwKeyFollow,E.linear(0,9),S.numeric({unit:"",fractionDigits:1}),"DCW Key Follow"),dcaKeyFollow:Nt(this,Kr,"f").createParameter(i.dcaKeyFollow,E.linear(0,9),S.numeric({unit:"",fractionDigits:1}),"DCA Key Follow")}))}};A();var f1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},$i=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},h1,Zh,ha,zd,Hk,iw=class{constructor(e,r){h1.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=se.Nano,Zh.set(this,void 0),ha.set(this,void 0),zd.set(this,void 0),f1(this,Zh,e,"f"),f1(this,ha,r,"f"),f1(this,zd,new ue($i(this,Zh,"f")),"f"),this.namedParameter=$i(this,h1,"m",Hk).call(this,r)}get box(){return $i(this,ha,"f")}get uuid(){return $i(this,ha,"f").address.uuid}get address(){return $i(this,ha,"f").address}get labelField(){return $i(this,ha,"f").label}get iconField(){return $i(this,ha,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return $i(this,ha,"f").enabled}get minimizedField(){return $i(this,ha,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return $i(this,Zh,"f").boxAdapters.adapterFor($i(this,ha,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){$i(this,zd,"f").terminate()}};Zh=new WeakMap,ha=new WeakMap,zd=new WeakMap,h1=new WeakSet,Hk=function(e){return{volume:$i(this,zd,"f").createParameter(e.volume,E.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Volume"),release:$i(this,zd,"f").createParameter(e.release,E.exponential(.001,8),S.numeric({unit:"s",fractionDigits:3}),"Release")}};A();A();var Od=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},de=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},m1,vc,zs,Be,nw,Gh,hi,xc,qk,Vd=class{constructor(e,r){m1.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",this.manualUrl="manuals/devices/instruments/playfield",vc.set(this,new ae),zs.set(this,void 0),Be.set(this,void 0),nw.set(this,void 0),Gh.set(this,void 0),hi.set(this,void 0),xc.set(this,_.None),Od(this,zs,e,"f"),Od(this,Be,r,"f"),Od(this,nw,de(this,vc,"f").own(jt.create(de(this,Be,"f").midiEffects,n=>de(this,zs,"f").boxAdapters.adapterFor(n,oe.isMidiEffect),l.MIDIEffectHost)),"f"),Od(this,Gh,de(this,vc,"f").own(jt.create(de(this,Be,"f").audioEffects,n=>de(this,zs,"f").boxAdapters.adapterFor(n,oe.isAudioEffect),l.AudioEffectHost)),"f"),Od(this,hi,de(this,vc,"f").own(new ue(de(this,zs,"f"))),"f"),this.namedParameter=de(this,m1,"m",qk).call(this,r),de(this,vc,"f").own(de(this,Be,"f").file.catchupAndSubscribe(n=>{Od(this,xc,n.targetVertex.map(({box:i})=>de(this,zs,"f").boxAdapters.adapterFor(i,ta)),"f"),de(this,xc,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return de(this,Be,"f")}get uuid(){return de(this,Be,"f").address.uuid}get address(){return de(this,Be,"f").address}get peakAddress(){return de(this,Be,"f").address.append(1001)}get indexField(){return de(this,Be,"f").index}get gate(){return de(this,Be,"f").gate.getValue()}get exclude(){return de(this,Be,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${de(this,xc,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get fileLabel(){return`${de(this,xc,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return de(this,Be,"f").icon}get defaultTrackType(){return ye.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return _.wrap(de(this,Be,"f").midiEffects)}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return _.wrap(de(this,Be,"f").audioEffects)}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}get hostsInstrument(){return!0}file(){return de(this,xc,"f")}fileUUID(){return de(this,Be,"f").file.targetAddress.unwrap("file.targetAddr").uuid}resetParameters(){de(this,Be,"f").mute.reset(),de(this,Be,"f").solo.reset(),de(this,Be,"f").exclude.reset(),de(this,Be,"f").polyphone.reset(),de(this,Be,"f").pitch.reset(),de(this,Be,"f").attack.reset(),de(this,Be,"f").release.reset(),de(this,Be,"f").sampleStart.reset(),de(this,Be,"f").sampleEnd.reset(),de(this,Be,"f").gate.reset(),de(this,Be,"f").volume.reset(),de(this,Be,"f").panning.reset()}copyToIndex(e){Ta.create(de(this,Be,"f").graph,k.generate(),r=>{r.file.refer(de(this,Be,"f").file.targetVertex.unwrap("file.target")),r.device.refer(de(this,Be,"f").device.targetVertex.unwrap("device.target")),r.index.setValue(e),r.mute.setValue(de(this,Be,"f").mute.getValue()),r.solo.setValue(de(this,Be,"f").solo.getValue()),r.sampleStart.setValue(de(this,Be,"f").sampleStart.getValue()),r.sampleEnd.setValue(de(this,Be,"f").sampleEnd.getValue()),r.attack.setValue(de(this,Be,"f").attack.getValue()),r.release.setValue(de(this,Be,"f").release.getValue()),r.pitch.setValue(de(this,Be,"f").pitch.getValue()),r.exclude.setValue(de(this,Be,"f").exclude.getValue()),r.gate.setValue(de(this,Be,"f").gate.getValue()),r.volume.setValue(de(this,Be,"f").volume.getValue()),r.panning.setValue(de(this,Be,"f").panning.getValue())})}get midiEffects(){return _.wrap(de(this,nw,"f"))}get inputAdapter(){return _.wrap(this)}get audioEffects(){return _.wrap(de(this,Gh,"f"))}get labelField(){return je(de(this,Be,"f").file.targetVertex.unwrap("file.target").box,dn).fileName}get enabledField(){return de(this,Be,"f").enabled}get minimizedField(){return de(this,Be,"f").minimized}device(){return de(this,zs,"f").boxAdapters.adapterFor(de(this,Be,"f").device.targetVertex.unwrap("device.target").box,Ud)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.fileLabel,children:()=>_.None};for(let e of de(this,Gh,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){de(this,vc,"f").terminate()}};vc=new WeakMap,zs=new WeakMap,Be=new WeakMap,nw=new WeakMap,Gh=new WeakMap,hi=new WeakMap,xc=new WeakMap,m1=new WeakSet,qk=function(e){return{gate:de(this,hi,"f").createParameter(e.gate,E.linearInteger(0,2),S.indices("",["Off","On","Loop"]),"Gate"),mute:de(this,hi,"f").createParameter(e.mute,E.bool,S.bool,"Mute"),solo:de(this,hi,"f").createParameter(e.solo,E.bool,S.bool,"Solo"),polyphone:de(this,hi,"f").createParameter(e.polyphone,E.bool,S.bool,"Polyphone"),exclude:de(this,hi,"f").createParameter(e.exclude,E.bool,S.bool,"Exclude"),pitch:de(this,hi,"f").createParameter(e.pitch,E.linear(-1200,1200),S.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:de(this,hi,"f").createParameter(e.sampleStart,E.unipolar(),S.percent(),"Start",0),sampleEnd:de(this,hi,"f").createParameter(e.sampleEnd,E.unipolar(),S.percent(),"End",1),attack:de(this,hi,"f").createParameter(e.attack,E.exponential(.001,5),S.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:de(this,hi,"f").createParameter(e.release,E.exponential(.001,5),S.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release"),volume:de(this,hi,"f").createParameter(e.volume,E.DefaultDecibel,S.numeric({unit:"dB",fractionDigits:1}),"Volume"),panning:de(this,hi,"f").createParameter(e.panning,E.bipolar(),S.panning,"Pan",.5)}};var aw=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Tr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},yc,In,wc,ow,Ud=class{constructor(e,r){this.type="instrument",this.accepts="midi",this.manualUrl=se.Playfield,yc.set(this,void 0),In.set(this,void 0),wc.set(this,void 0),ow.set(this,void 0),aw(this,yc,e,"f"),aw(this,In,r,"f"),aw(this,wc,jt.create(r.samples,n=>e.boxAdapters.adapterFor(n,Vd),l.Sample),"f"),aw(this,ow,new ue(Tr(this,yc,"f")),"f")}reset(){Tr(this,wc,"f").adapters().forEach(e=>e.box.delete())}chop({file:e,startKey:r,slices:n}){let i=r+n.length-1;Tr(this,wc,"f").adapters().filter(a=>{let o=a.box.index.getValue();return o>=r&&o<=i}).forEach(a=>a.box.delete()),n.forEach(({start:a,end:o},s)=>{Ta.create(Tr(this,yc,"f").boxGraph,k.generate(),c=>{c.file.refer(e),c.device.refer(Tr(this,In,"f").samples),c.index.setValue(r+s),c.sampleStart.setValue(a),c.sampleEnd.setValue(o),c.exclude.setValue(!0)})})}get box(){return Tr(this,In,"f")}get uuid(){return Tr(this,In,"f").address.uuid}get address(){return Tr(this,In,"f").address}get labelField(){return Tr(this,In,"f").label}get iconField(){return Tr(this,In,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return Tr(this,In,"f").enabled}get minimizedField(){return Tr(this,In,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return Tr(this,wc,"f")}get context(){return Tr(this,yc,"f")}deviceHost(){return Tr(this,yc,"f").boxAdapters.adapterFor(Tr(this,In,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None};for(let e of Tr(this,wc,"f").adapters())yield{address:e.address,label:e.fileLabel,children:()=>_.wrap(e.labeledAudioOutputs())}}terminate(){Tr(this,ow,"f").terminate()}};yc=new WeakMap,In=new WeakMap,wc=new WeakMap,ow=new WeakMap;A();var g1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},v1,Hh,Bn,ro,Jk,sw=class{constructor(e,r){v1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.StereoTool,Hh.set(this,void 0),Bn.set(this,void 0),ro.set(this,void 0),g1(this,Hh,e,"f"),g1(this,Bn,r,"f"),g1(this,ro,new ue(Pr(this,Hh,"f")),"f"),this.namedParameter=Pr(this,v1,"m",Jk).call(this,r)}get box(){return Pr(this,Bn,"f")}get uuid(){return Pr(this,Bn,"f").address.uuid}get address(){return Pr(this,Bn,"f").address}get indexField(){return Pr(this,Bn,"f").index}get labelField(){return Pr(this,Bn,"f").label}get enabledField(){return Pr(this,Bn,"f").enabled}get minimizedField(){return Pr(this,Bn,"f").minimized}get host(){return Pr(this,Bn,"f").host}deviceHost(){return Pr(this,Hh,"f").boxAdapters.adapterFor(Pr(this,Bn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Pr(this,ro,"f").terminate()}};Hh=new WeakMap,Bn=new WeakMap,ro=new WeakMap,v1=new WeakSet,Jk=function(e){return{volume:Pr(this,ro,"f").createParameter(e.volume,E.decibel(-72,0,12),S.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:Pr(this,ro,"f").createParameter(e.panning,E.bipolar(),S.panning,"Panning",.5),stereo:Pr(this,ro,"f").createParameter(e.stereo,E.bipolar(),S.numeric({unit:"%",fractionDigits:0}),"Stereo",.5),invertL:Pr(this,ro,"f").createParameter(e.invertL,E.bool,S.bool,"Invert Left"),invertR:Pr(this,ro,"f").createParameter(e.invertR,E.bool,S.bool,"Invert Right"),swap:Pr(this,ro,"f").createParameter(e.swap,E.bool,S.bool,"Swap")}};A();A();var lw=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},pt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},x1,qh,jd,xr,Jh,bc,Yk,Kd=class{constructor(e,r){x1.add(this),this.class="device-host",qh.set(this,new ae),jd.set(this,void 0),xr.set(this,void 0),Jh.set(this,void 0),bc.set(this,void 0),lw(this,jd,e,"f"),lw(this,xr,r,"f"),lw(this,Jh,pt(this,qh,"f").own(jt.create(pt(this,xr,"f").audioEffects,n=>pt(this,jd,"f").boxAdapters.adapterFor(n,oe.isAudioEffect),l.AudioEffectHost)),"f"),lw(this,bc,pt(this,qh,"f").own(new ue(pt(this,jd,"f"))),"f"),this.namedParameter=pt(this,x1,"m",Yk).call(this,r)}get box(){return pt(this,xr,"f")}get uuid(){return pt(this,xr,"f").address.uuid}get address(){return pt(this,xr,"f").address}get indexField(){return pt(this,xr,"f").index}get labelField(){return pt(this,xr,"f").label}get minimizedField(){return pt(this,xr,"f").minimized}get label(){return pt(this,xr,"f").label.getValue()}get audioEffects(){return _.wrap(pt(this,Jh,"f"))}get midiEffects(){return _.None}get audioEffectsField(){return _.wrap(pt(this,xr,"f").audioEffects)}get midiEffectsField(){return _.None}get inputAdapter(){return _.None}get hostsInstrument(){return!1}get isAudioUnit(){return!1}get inputField(){return this.audioUnitBoxAdapter().box.input}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}compositeDevice(){return pt(this,jd,"f").boxAdapters.adapterFor(pt(this,xr,"f").composite.targetVertex.unwrap("composite.target").box,io)}deviceHost(){return this.compositeDevice().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.label,children:()=>_.None};for(let e of pt(this,Jh,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){pt(this,qh,"f").terminate()}copyToIndex(e){Au.create(pt(this,xr,"f").graph,k.generate(),r=>{r.composite.refer(pt(this,xr,"f").composite.targetVertex.unwrap("composite.target")),r.index.setValue(e),r.label.setValue(pt(this,xr,"f").label.getValue()),r.gain.setValue(pt(this,xr,"f").gain.getValue()),r.pan.setValue(pt(this,xr,"f").pan.getValue()),r.mute.setValue(pt(this,xr,"f").mute.getValue()),r.solo.setValue(pt(this,xr,"f").solo.getValue())})}};qh=new WeakMap,jd=new WeakMap,xr=new WeakMap,Jh=new WeakMap,bc=new WeakMap,x1=new WeakSet,Yk=function(e){return{gain:pt(this,bc,"f").createParameter(e.gain,E.DefaultDecibel,S.numeric({unit:"dB",fractionDigits:1}),"Gain"),pan:pt(this,bc,"f").createParameter(e.pan,E.bipolar(),S.panning,"Pan",.5),mute:pt(this,bc,"f").createParameter(e.mute,E.bool,S.bool,"Mute"),solo:pt(this,bc,"f").createParameter(e.solo,E.bool,S.bool,"Solo")}};var cw=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},rr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},y1,Yh,Wd,ki,uw,Xh,Xk,io=class{constructor(e,r){y1.add(this),this.type="audio-effect",this.accepts="audio",Yh.set(this,new ae),Wd.set(this,void 0),ki.set(this,void 0),uw.set(this,void 0),Xh.set(this,void 0),cw(this,Wd,e,"f"),cw(this,ki,r,"f"),cw(this,uw,rr(this,Yh,"f").own(jt.create(rr(this,ki,"f").entries,n=>rr(this,Wd,"f").boxAdapters.adapterFor(n,Kd),l.AudioEffectCompositeCell)),"f"),cw(this,Xh,rr(this,Yh,"f").own(new ue(rr(this,Wd,"f"))),"f"),this.namedParameter=rr(this,y1,"m",Xk).call(this,r)}get box(){return rr(this,ki,"f")}get uuid(){return rr(this,ki,"f").address.uuid}get address(){return rr(this,ki,"f").address}get indexField(){return rr(this,ki,"f").index}get labelField(){return rr(this,ki,"f").label}get enabledField(){return rr(this,ki,"f").enabled}get minimizedField(){return rr(this,ki,"f").minimized}get host(){return rr(this,ki,"f").host}get entries(){return rr(this,uw,"f")}get inputField(){return rr(this,ki,"f").input}deviceHost(){return rr(this,Wd,"f").boxAdapters.adapterFor(rr(this,ki,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){rr(this,Yh,"f").terminate()}};Yh=new WeakMap,Wd=new WeakMap,ki=new WeakMap,uw=new WeakMap,Xh=new WeakMap,y1=new WeakSet,Xk=function(e){return{dry:rr(this,Xh,"f").createParameter(e.dry,E.DefaultDecibel,S.numeric({unit:"dB",fractionDigits:1}),"Dry"),wet:rr(this,Xh,"f").createParameter(e.wet,E.DefaultDecibel,S.numeric({unit:"dB",fractionDigits:1}),"Wet")}};var dw=class extends io{constructor(e,r){super(e,r)}get entriesFixed(){return!1}get manualUrl(){return se.AudioEffectComposite}};var pw=class extends io{constructor(e,r){super(e,r)}get entriesFixed(){return!0}get manualUrl(){return se.StereoComposite}};A();var cC=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},w1=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ld,b1=E.exponential(20,2e4),_1=S.numeric({unit:"Hz",fractionDigits:0}),Qh=class extends io{constructor(e,r){super(e,r),Ld.set(this,void 0),cC(this,Ld,new ue(e),"f"),this.crossover=[w1(this,Ld,"f").createParameter(r.crossover1,b1,_1,"Crossover 1"),w1(this,Ld,"f").createParameter(r.crossover2,b1,_1,"Crossover 2"),w1(this,Ld,"f").createParameter(r.crossover3,b1,_1,"Crossover 3")]}get crossoverCount(){return Math.max(0,this.entries.adapters().length-1)}get spectrum(){return this.address.append(4095)}get entriesFixed(){return!0}get manualUrl(){return se.FrequencySplit}};Ld=new WeakMap;Qh.MAX_BANDS=4;var em;(function(t){t.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(em||(em={}));var Qk=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ii=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Zd,Bi,fw=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl=se.Zeitgeist,Zd.set(this,void 0),Bi.set(this,void 0),Qk(this,Zd,e,"f"),Qk(this,Bi,r,"f"),this.groove()}get box(){return Ii(this,Bi,"f")}get uuid(){return Ii(this,Bi,"f").address.uuid}get address(){return Ii(this,Bi,"f").address}get indexField(){return Ii(this,Bi,"f").index}get labelField(){return Ii(this,Bi,"f").label}get enabledField(){return Ii(this,Bi,"f").enabled}get minimizedField(){return Ii(this,Bi,"f").minimized}get host(){return Ii(this,Bi,"f").host}deviceHost(){return Ii(this,Zd,"f").boxAdapters.adapterFor(Ii(this,Bi,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}groove(){return Ii(this,Zd,"f").boxAdapters.adapterFor(Ii(this,Bi,"f").groove.targetVertex.unwrap("no groove").box,em.checkType)}catchupAndSubscribeGroove(e){return Ii(this,Bi,"f").groove.catchupAndSubscribe(r=>e(Ii(this,Zd,"f").boxAdapters.adapterFor(r.targetVertex.unwrap("No groove found").box,em.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Zd=new WeakMap,Bi=new WeakMap;A();var eI=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ma=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},hw,tn,mw=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl="",hw.set(this,void 0),tn.set(this,void 0),eI(this,hw,e,"f"),eI(this,tn,r,"f")}get box(){return ma(this,tn,"f")}get uuid(){return ma(this,tn,"f").address.uuid}get address(){return ma(this,tn,"f").address}get indexField(){return ma(this,tn,"f").index}get labelField(){return ma(this,tn,"f").label}get enabledField(){return ma(this,tn,"f").enabled}get minimizedField(){return ma(this,tn,"f").minimized}get host(){return ma(this,tn,"f").host}get commentField(){return ma(this,tn,"f").comment}deviceHost(){return ma(this,hw,"f").boxAdapters.adapterFor(ma(this,tn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){}};hw=new WeakMap,tn=new WeakMap;var tI=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ga=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},gw,rn,vw=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl="",gw.set(this,void 0),rn.set(this,void 0),tI(this,gw,e,"f"),tI(this,rn,r,"f")}get box(){return ga(this,rn,"f")}get uuid(){return ga(this,rn,"f").address.uuid}get address(){return ga(this,rn,"f").address}get indexField(){return ga(this,rn,"f").index}get labelField(){return ga(this,rn,"f").label}get enabledField(){return ga(this,rn,"f").enabled}get minimizedField(){return ga(this,rn,"f").minimized}get host(){return ga(this,rn,"f").host}get commentField(){return ga(this,rn,"f").comment}deviceHost(){return ga(this,gw,"f").boxAdapters.adapterFor(ga(this,rn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};gw=new WeakMap,rn=new WeakMap;A();var Os=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Xe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},F1,A1,tm,Ti,xw,Gd,va,Tn,Hd,rI,E1,yw=class{constructor(e,r){F1.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=se.Soundfont,A1.set(this,new ae),tm.set(this,void 0),Ti.set(this,void 0),xw.set(this,void 0),Gd.set(this,void 0),va.set(this,void 0),Tn.set(this,void 0),Hd.set(this,ve.Empty),E1.set(this,n=>n.match({none:()=>{Xe(this,Tn,"f").clear(),Xe(this,va,"f").clear()},some:i=>i.soundfont.match({none:()=>{Xe(this,Tn,"f").clear(),Xe(this,va,"f").clear(),Xe(this,Hd,"f").terminate(),Os(this,Hd,i.subscribe(a=>{if(a.type==="loaded"){let o=i.soundfont.unwrap("soundfont");Xe(this,Tn,"f").wrap(o.presets[this.presetIndex]??o.presets[0]),Xe(this,va,"f").wrap(o)}else a.type==="error"?(Xe(this,Tn,"f").clear(),Xe(this,va,"f").clear()):a.type==="idle"&&(Xe(this,Tn,"f").clear(),Xe(this,va,"f").clear())}),"f")},some:a=>{Xe(this,va,"f").wrap(a),Xe(this,Tn,"f").wrap(a.presets[this.presetIndex]??a.presets[0])}})})),Os(this,tm,e,"f"),Os(this,Ti,r,"f"),Os(this,xw,new ue(Xe(this,tm,"f")),"f"),this.namedParameter=Xe(this,F1,"m",rI).call(this,r),Os(this,Gd,new Cr,"f"),Os(this,va,new Cr,"f"),Os(this,Tn,new Cr,"f"),Xe(this,A1,"f").ownAll(Xe(this,Gd,"f").subscribe(Xe(this,E1,"f")),Xe(this,Ti,"f").file.catchupAndSubscribe(({targetVertex:n})=>Xe(this,Gd,"f").wrapOption(n.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),Xe(this,Ti,"f").presetIndex.catchupAndSubscribe(n=>Xe(this,va,"f").match({none:()=>Xe(this,Tn,"f").clear(),some:i=>Xe(this,Tn,"f").wrap(i.presets[n.getValue()]??i.presets[0])})))}get loader(){return Xe(this,Gd,"f")}get soundfont(){return Xe(this,va,"f")}get preset(){return Xe(this,Tn,"f")}get presetIndex(){return Xe(this,Ti,"f").presetIndex.getValue()}get box(){return Xe(this,Ti,"f")}get uuid(){return Xe(this,Ti,"f").address.uuid}get address(){return Xe(this,Ti,"f").address}get labelField(){return Xe(this,Ti,"f").label}get iconField(){return Xe(this,Ti,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return Xe(this,Ti,"f").enabled}get minimizedField(){return Xe(this,Ti,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Xe(this,tm,"f").boxAdapters.adapterFor(Xe(this,Ti,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Xe(this,Hd,"f").terminate(),Os(this,Hd,ve.Empty,"f"),Xe(this,xw,"f").terminate()}};A1=new WeakMap,tm=new WeakMap,Ti=new WeakMap,xw=new WeakMap,Gd=new WeakMap,va=new WeakMap,Tn=new WeakMap,Hd=new WeakMap,E1=new WeakMap,F1=new WeakSet,rI=function(e){return{}};var iI=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},rm=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ww,_c,bw=class{constructor(e,r){ww.set(this,void 0),_c.set(this,void 0),iI(this,ww,e,"f"),iI(this,_c,r,"f")}get box(){return rm(this,_c,"f")}get uuid(){return rm(this,_c,"f").address.uuid}get address(){return rm(this,_c,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return rm(this,ww,"f").soundfontManager.getOrCreate(rm(this,_c,"f").address.uuid)}terminate(){}};ww=new WeakMap,_c=new WeakMap;A();var S1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Di=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},P1,im,Dn,nm,nI,_w=class{constructor(e,r){P1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Maximizer,im.set(this,void 0),Dn.set(this,void 0),nm.set(this,void 0),S1(this,im,e,"f"),S1(this,Dn,r,"f"),S1(this,nm,new ue(Di(this,im,"f")),"f"),this.namedParameter=Di(this,P1,"m",nI).call(this,r)}get box(){return Di(this,Dn,"f")}get uuid(){return Di(this,Dn,"f").address.uuid}get address(){return Di(this,Dn,"f").address}get indexField(){return Di(this,Dn,"f").index}get labelField(){return Di(this,Dn,"f").label}get enabledField(){return Di(this,Dn,"f").enabled}get minimizedField(){return Di(this,Dn,"f").minimized}get host(){return Di(this,Dn,"f").host}deviceHost(){return Di(this,im,"f").boxAdapters.adapterFor(Di(this,Dn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Di(this,nm,"f").terminate()}};im=new WeakMap,Dn=new WeakMap,nm=new WeakMap,P1=new WeakSet,nI=function(e){return{threshold:Di(this,nm,"f").createParameter(e.threshold,E.linear(-24,0),S.decible,"Threshold")}};A();var M1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},$t=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},N1,am,nn,ai,aI,Fw=class{constructor(e,r){N1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Compressor,am.set(this,void 0),nn.set(this,void 0),ai.set(this,void 0),M1(this,am,e,"f"),M1(this,nn,r,"f"),M1(this,ai,new ue($t(this,am,"f")),"f"),this.namedParameter=$t(this,N1,"m",aI).call(this,r)}get box(){return $t(this,nn,"f")}get uuid(){return $t(this,nn,"f").address.uuid}get address(){return $t(this,nn,"f").address}get indexField(){return $t(this,nn,"f").index}get labelField(){return $t(this,nn,"f").label}get enabledField(){return $t(this,nn,"f").enabled}get minimizedField(){return $t(this,nn,"f").minimized}get host(){return $t(this,nn,"f").host}get sideChain(){return $t(this,nn,"f").sideChain}deviceHost(){return $t(this,am,"f").boxAdapters.adapterFor($t(this,nn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){$t(this,ai,"f").terminate()}};am=new WeakMap,nn=new WeakMap,ai=new WeakMap,N1=new WeakSet,aI=function(e){return{lookahead:$t(this,ai,"f").createParameter(e.lookahead,E.bool,S.bool,"Lookahead"),automakeup:$t(this,ai,"f").createParameter(e.automakeup,E.bool,S.bool,"Auto Makeup"),autoattack:$t(this,ai,"f").createParameter(e.autoattack,E.bool,S.bool,"Auto Attack"),autorelease:$t(this,ai,"f").createParameter(e.autorelease,E.bool,S.bool,"Auto Release"),inputgain:$t(this,ai,"f").createParameter(e.inputgain,E.linear(-30,30),S.decible,"Input Gain"),threshold:$t(this,ai,"f").createParameter(e.threshold,E.linear(-60,0),S.decible,"Threshold"),ratio:$t(this,ai,"f").createParameter(e.ratio,E.exponential(1,24),S.numeric({fractionDigits:1}),"Ratio"),knee:$t(this,ai,"f").createParameter(e.knee,E.linear(0,24),S.decible,"Knee"),attack:$t(this,ai,"f").createParameter(e.attack,E.linear(0,100),S.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:$t(this,ai,"f").createParameter(e.release,E.linear(5,1500),S.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:$t(this,ai,"f").createParameter(e.makeup,E.linear(-40,40),S.decible,"Makeup Gain"),mix:$t(this,ai,"f").createParameter(e.mix,E.unipolar(),S.percent(),"Dry/Wet")}};A();var $1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ir=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},k1,om,an,xa,oI,Aw=class{constructor(e,r){k1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Gate,om.set(this,void 0),an.set(this,void 0),xa.set(this,void 0),$1(this,om,e,"f"),$1(this,an,r,"f"),$1(this,xa,new ue(ir(this,om,"f")),"f"),this.namedParameter=ir(this,k1,"m",oI).call(this,r)}get box(){return ir(this,an,"f")}get uuid(){return ir(this,an,"f").address.uuid}get address(){return ir(this,an,"f").address}get indexField(){return ir(this,an,"f").index}get labelField(){return ir(this,an,"f").label}get enabledField(){return ir(this,an,"f").enabled}get minimizedField(){return ir(this,an,"f").minimized}get host(){return ir(this,an,"f").host}get sideChain(){return ir(this,an,"f").sideChain}deviceHost(){return ir(this,om,"f").boxAdapters.adapterFor(ir(this,an,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){ir(this,xa,"f").terminate()}};om=new WeakMap,an=new WeakMap,xa=new WeakMap,k1=new WeakSet,oI=function(e){return{inverse:ir(this,xa,"f").createParameter(e.inverse,E.bool,S.bool,"Inverse"),threshold:ir(this,xa,"f").createParameter(e.threshold,E.linear(-80,0),S.decible,"Threshold"),return:ir(this,xa,"f").createParameter(e.return,E.linear(0,24),S.decible,"Return"),attack:ir(this,xa,"f").createParameter(e.attack,E.linear(0,1e3),S.numeric({unit:"ms",fractionDigits:1}),"Attack"),hold:ir(this,xa,"f").createParameter(e.hold,E.linear(0,500),S.numeric({unit:"ms",fractionDigits:1}),"Hold"),release:ir(this,xa,"f").createParameter(e.release,E.linear(1,2e3),S.numeric({unit:"ms",fractionDigits:1}),"Release"),floor:ir(this,xa,"f").createParameter(e.floor,E.decibel(-72,-12,0),S.decible,"Floor")}};A();var I1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Mr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},B1,sm,Rn,no,sI,Ew=class{constructor(e,r){B1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Autotune,sm.set(this,void 0),Rn.set(this,void 0),no.set(this,void 0),I1(this,sm,e,"f"),I1(this,Rn,r,"f"),I1(this,no,new ue(Mr(this,sm,"f")),"f"),this.namedParameter=Mr(this,B1,"m",sI).call(this,r)}get box(){return Mr(this,Rn,"f")}get uuid(){return Mr(this,Rn,"f").address.uuid}get address(){return Mr(this,Rn,"f").address}get indexField(){return Mr(this,Rn,"f").index}get labelField(){return Mr(this,Rn,"f").label}get enabledField(){return Mr(this,Rn,"f").enabled}get minimizedField(){return Mr(this,Rn,"f").minimized}get host(){return Mr(this,Rn,"f").host}deviceHost(){return Mr(this,sm,"f").boxAdapters.adapterFor(Mr(this,Rn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Mr(this,no,"f").terminate()}};sm=new WeakMap,Rn=new WeakMap,no=new WeakMap,B1=new WeakSet,sI=function(e){return{key:Mr(this,no,"f").createParameter(e.key,E.linearInteger(0,11),S.indices("",["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]),"Key"),scale:Mr(this,no,"f").createParameter(e.scale,E.linearInteger(0,7),S.indices("",["Chrom","Major","Minor","MajPent","MinPent","Blues","Dorian","Mixo"]),"Scale"),amount:Mr(this,no,"f").createParameter(e.amount,E.unipolar(),S.percent(),"Amount"),retune:Mr(this,no,"f").createParameter(e.retune,E.unipolar(),S.percent(),"Retune"),smooth:Mr(this,no,"f").createParameter(e.smooth,E.unipolar(),S.percent(),"Smooth"),shift:Mr(this,no,"f").createParameter(e.shift,E.linear(-12,12),S.numeric({unit:"st"}),"Shift")}};A();var T1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Wr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},D1,lm,Cn,Vs,lI,Sw=class{constructor(e,r){D1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Crusher,lm.set(this,void 0),Cn.set(this,void 0),Vs.set(this,void 0),T1(this,lm,e,"f"),T1(this,Cn,r,"f"),T1(this,Vs,new ue(Wr(this,lm,"f")),"f"),this.namedParameter=Wr(this,D1,"m",lI).call(this,r)}get box(){return Wr(this,Cn,"f")}get uuid(){return Wr(this,Cn,"f").address.uuid}get address(){return Wr(this,Cn,"f").address}get indexField(){return Wr(this,Cn,"f").index}get labelField(){return Wr(this,Cn,"f").label}get enabledField(){return Wr(this,Cn,"f").enabled}get minimizedField(){return Wr(this,Cn,"f").minimized}get host(){return Wr(this,Cn,"f").host}deviceHost(){return Wr(this,lm,"f").boxAdapters.adapterFor(Wr(this,Cn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Wr(this,Vs,"f").terminate()}};lm=new WeakMap,Cn=new WeakMap,Vs=new WeakMap,D1=new WeakSet,lI=function(e){return{crush:Wr(this,Vs,"f").createParameter(e.crush,E.unipolar(),S.percent(),"Crush"),bits:Wr(this,Vs,"f").createParameter(e.bits,E.linearInteger(1,16),S.numeric(),"Bits"),boost:Wr(this,Vs,"f").createParameter(e.boost,E.linear(0,24),S.decible,"Boost"),mix:Wr(this,Vs,"f").createParameter(e.mix,E.exponential(.001,1),S.percent(),"Mix")}};A();var R1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},mi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},C1,cm,zn,qd,cI,Pw=class{constructor(e,r){C1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Fold,cm.set(this,void 0),zn.set(this,void 0),qd.set(this,void 0),R1(this,cm,e,"f"),R1(this,zn,r,"f"),R1(this,qd,new ue(mi(this,cm,"f")),"f"),this.namedParameter=mi(this,C1,"m",cI).call(this,r)}get box(){return mi(this,zn,"f")}get uuid(){return mi(this,zn,"f").address.uuid}get address(){return mi(this,zn,"f").address}get indexField(){return mi(this,zn,"f").index}get labelField(){return mi(this,zn,"f").label}get enabledField(){return mi(this,zn,"f").enabled}get minimizedField(){return mi(this,zn,"f").minimized}get host(){return mi(this,zn,"f").host}deviceHost(){return mi(this,cm,"f").boxAdapters.adapterFor(mi(this,zn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){mi(this,qd,"f").terminate()}};cm=new WeakMap,zn=new WeakMap,qd=new WeakMap,C1=new WeakSet,cI=function(e){return{drive:mi(this,qd,"f").createParameter(e.drive,E.linear(0,30),S.decible,"Drive"),volume:mi(this,qd,"f").createParameter(e.volume,E.linear(-18,0),S.decible,"Volume")}};A();var Mw=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},yr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},um,dm,On,Jd,Yd,uC=t=>new class{getValue(){let e=t.label.getValue().trim(),r=t.controller.getValue();return e.length===0?String(r):`${e} ${r}`}subscribe(e){return ve.many(t.label.subscribe(()=>e(this)),t.controller.subscribe(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}},Nw=class{constructor(e,r){um.set(this,new ae),this.type="instrument",this.accepts="midi",this.manualUrl=se.MIDIOutput,dm.set(this,void 0),On.set(this,void 0),Jd.set(this,void 0),Yd.set(this,void 0),Mw(this,dm,e,"f"),Mw(this,On,r,"f"),Mw(this,Jd,new Cr,"f"),Mw(this,Yd,yr(this,um,"f").own(new ue(yr(this,dm,"f"))),"f"),yr(this,um,"f").ownAll(r.parameters.pointerHub.catchupAndSubscribe({onAdded:(({box:n})=>{let i=je(n,bl);yr(this,Yd,"f").createParameter(i.value,E.unipolar(),S.percent({fractionDigits:1}),uC(i),0)}),onRemoved:(({box:n})=>yr(this,Yd,"f").removeParameter(je(n,bl).value.address))}),yr(this,On,"f").device.catchupAndSubscribe(({targetVertex:n})=>n.match({none:()=>yr(this,Jd,"f").clear(),some:({box:i})=>yr(this,Jd,"f").wrap(je(i,ss))})))}get box(){return yr(this,On,"f")}get uuid(){return yr(this,On,"f").address.uuid}get address(){return yr(this,On,"f").address}get labelField(){return yr(this,On,"f").label}get iconField(){return yr(this,On,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return yr(this,On,"f").enabled}get minimizedField(){return yr(this,On,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return yr(this,Yd,"f")}get midiDevice(){return yr(this,Jd,"f")}deviceHost(){return yr(this,dm,"f").boxAdapters.adapterFor(yr(this,On,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){yr(this,um,"f").terminate()}};um=new WeakMap,dm=new WeakMap,On=new WeakMap,Jd=new WeakMap,Yd=new WeakMap;A();var $w=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},nr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},z1,pm,Vn,ao,fm,uI,kw=class{constructor(e,r){z1.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=se.Velocity,pm.set(this,void 0),Vn.set(this,void 0),ao.set(this,void 0),fm.set(this,void 0),$w(this,pm,e,"f"),$w(this,Vn,r,"f"),$w(this,ao,new ue(nr(this,pm,"f")),"f"),$w(this,fm,Tg.create(),"f"),this.namedParameter=nr(this,z1,"m",uI).call(this,r)}computeVelocity(e,r){let{magnetPosition:n,magnetStrength:i,randomSeed:a,randomAmount:o,offset:s,mix:c}=this.namedParameter;nr(this,fm,"f").setSeed(a.valueAt(e)+e);let u=r+(n.valueAt(e)-r)*i.valueAt(e),f=(nr(this,fm,"f").uniform()*2-1)*o.valueAt(e),v=s.valueAt(e),m=c.valueAt(e);return r*(1-m)+bg(u+f+v)*m}get box(){return nr(this,Vn,"f")}get uuid(){return nr(this,Vn,"f").address.uuid}get address(){return nr(this,Vn,"f").address}get indexField(){return nr(this,Vn,"f").index}get labelField(){return nr(this,Vn,"f").label}get enabledField(){return nr(this,Vn,"f").enabled}get minimizedField(){return nr(this,Vn,"f").minimized}get host(){return nr(this,Vn,"f").host}deviceHost(){return nr(this,pm,"f").boxAdapters.adapterFor(nr(this,Vn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){nr(this,ao,"f").terminate()}};pm=new WeakMap,Vn=new WeakMap,ao=new WeakMap,fm=new WeakMap,z1=new WeakSet,uI=function(e){return{magnetPosition:nr(this,ao,"f").createParameter(e.magnetPosition,E.unipolar(),S.percent(),"Position"),magnetStrength:nr(this,ao,"f").createParameter(e.magnetStrength,E.unipolar(),S.percent(),"Strength"),randomSeed:nr(this,ao,"f").createParameter(e.randomSeed,E.linearInteger(0,65535),S.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:nr(this,ao,"f").createParameter(e.randomAmount,E.unipolar(),S.percent(),"Amount"),offset:nr(this,ao,"f").createParameter(e.offset,E.bipolar(),S.percent(),"Offset"),mix:nr(this,ao,"f").createParameter(e.mix,E.unipolar(),S.percent(),"Mix")}};A();rt();var O1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Nr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},V1,U1,hm,Un,oo,dI,Fc=class{constructor(e,r){V1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Tidal,hm.set(this,void 0),Un.set(this,void 0),oo.set(this,void 0),O1(this,hm,e,"f"),O1(this,Un,r,"f"),O1(this,oo,new ue(Nr(this,hm,"f")),"f"),this.namedParameter=Nr(this,V1,"m",dI).call(this,r)}get box(){return Nr(this,Un,"f")}get uuid(){return Nr(this,Un,"f").address.uuid}get address(){return Nr(this,Un,"f").address}get indexField(){return Nr(this,Un,"f").index}get labelField(){return Nr(this,Un,"f").label}get enabledField(){return Nr(this,Un,"f").enabled}get minimizedField(){return Nr(this,Un,"f").minimized}get host(){return Nr(this,Un,"f").host}deviceHost(){return Nr(this,hm,"f").boxAdapters.adapterFor(Nr(this,Un,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Nr(this,oo,"f").terminate()}};U1=Fc,hm=new WeakMap,Un=new WeakMap,oo=new WeakMap,V1=new WeakSet,dI=function(e){let{RateFractions:r,RateStringMapping:n}=U1;return{slope:Nr(this,oo,"f").createParameter(e.slope,E.bipolar(),S.percent({fractionDigits:1}),"Slope",.5),symmetry:Nr(this,oo,"f").createParameter(e.symmetry,E.unipolar(),S.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:Nr(this,oo,"f").createParameter(e.rate,E.values(r.map((i,a)=>a)),n,"Rate",0),depth:Nr(this,oo,"f").createParameter(e.depth,E.unipolar(),S.percent({fractionDigits:1}),"Depth",0),offset:Nr(this,oo,"f").createParameter(e.offset,E.linear(-180,180),S.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:Nr(this,oo,"f").createParameter(e.channelOffset,E.linear(-180,180),S.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};Fc.RateFractions=Xo.builder().add([1,1]).add([1,2]).add([1,3]).add([1,4]).add([3,16]).add([1,6]).add([1,8]).add([3,32]).add([1,12]).add([1,16]).add([3,64]).add([1,24]).add([1,32]).add([1,48]).add([1,64]).add([1,96]).add([1,128]).asDescendingArray();Fc.RateStringMapping=S.indices("",U1.RateFractions.map(([t,e])=>`${t}/${e}`));A();var j1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},kt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},K1,mm,gi,Ri,pI,Iw=class{constructor(e,r){K1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Vocoder,mm.set(this,void 0),gi.set(this,void 0),Ri.set(this,void 0),j1(this,mm,e,"f"),j1(this,gi,r,"f"),j1(this,Ri,new ue(kt(this,mm,"f")),"f"),this.namedParameter=kt(this,K1,"m",pI).call(this,r)}get box(){return kt(this,gi,"f")}get uuid(){return kt(this,gi,"f").address.uuid}get address(){return kt(this,gi,"f").address}get indexField(){return kt(this,gi,"f").index}get labelField(){return kt(this,gi,"f").label}get enabledField(){return kt(this,gi,"f").enabled}get minimizedField(){return kt(this,gi,"f").minimized}get host(){return kt(this,gi,"f").host}get sideChain(){return kt(this,gi,"f").sideChain}get modulatorSpectrum(){return kt(this,gi,"f").address.append(4094)}get carrierSpectrum(){return kt(this,gi,"f").address.append(4095)}deviceHost(){return kt(this,mm,"f").boxAdapters.adapterFor(kt(this,gi,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){kt(this,Ri,"f").terminate()}};mm=new WeakMap,gi=new WeakMap,Ri=new WeakMap,K1=new WeakSet,pI=function(e){let r=E.exponential(20,2e4),n=S.numeric({unit:"Hz",fractionDigits:0}),i=E.exponential(1,60),a=S.numeric({fractionDigits:1});return{carrierMinFreq:kt(this,Ri,"f").createParameter(e.carrierMinFreq,r,n,"Carrier Min"),carrierMaxFreq:kt(this,Ri,"f").createParameter(e.carrierMaxFreq,r,n,"Carrier Max"),modulatorMinFreq:kt(this,Ri,"f").createParameter(e.modulatorMinFreq,r,n,"Mod Min"),modulatorMaxFreq:kt(this,Ri,"f").createParameter(e.modulatorMaxFreq,r,n,"Mod Max"),qStart:kt(this,Ri,"f").createParameter(e.qStart,i,a,"Q Start"),qEnd:kt(this,Ri,"f").createParameter(e.qEnd,i,a,"Q End"),envAttack:kt(this,Ri,"f").createParameter(e.envAttack,E.exponential(.1,100),S.numeric({unit:"ms",fractionDigits:1}),"Attack"),envRelease:kt(this,Ri,"f").createParameter(e.envRelease,E.exponential(1,1e3),S.numeric({unit:"ms",fractionDigits:0}),"Release"),gain:kt(this,Ri,"f").createParameter(e.gain,E.linear(-20,20),S.decible,"Gain"),mix:kt(this,Ri,"f").createParameter(e.mix,E.unipolar(),S.percent(),"Mix")}};A();var W1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Rt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},L1,gm,jn,oi,fI,Bw=class{constructor(e,r){L1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.DattorroReverb,gm.set(this,void 0),jn.set(this,void 0),oi.set(this,void 0),W1(this,gm,e,"f"),W1(this,jn,r,"f"),W1(this,oi,new ue(Rt(this,gm,"f")),"f"),this.namedParameter=Rt(this,L1,"m",fI).call(this,r)}get box(){return Rt(this,jn,"f")}get uuid(){return Rt(this,jn,"f").address.uuid}get address(){return Rt(this,jn,"f").address}get indexField(){return Rt(this,jn,"f").index}get labelField(){return Rt(this,jn,"f").label}get enabledField(){return Rt(this,jn,"f").enabled}get minimizedField(){return Rt(this,jn,"f").minimized}get host(){return Rt(this,jn,"f").host}deviceHost(){return Rt(this,gm,"f").boxAdapters.adapterFor(Rt(this,jn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Rt(this,oi,"f").terminate()}};gm=new WeakMap,jn=new WeakMap,oi=new WeakMap,L1=new WeakSet,fI=function(e){return{preDelay:Rt(this,oi,"f").createParameter(e.preDelay,E.linear(0,1e3),S.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:Rt(this,oi,"f").createParameter(e.bandwidth,E.unipolar(),S.percent(),"Bandwidth"),inputDiffusion1:Rt(this,oi,"f").createParameter(e.inputDiffusion1,E.unipolar(),S.percent(),"Tank 1"),inputDiffusion2:Rt(this,oi,"f").createParameter(e.inputDiffusion2,E.unipolar(),S.percent(),"Tank 2"),decay:Rt(this,oi,"f").createParameter(e.decay,E.unipolar(),S.percent(),"Decay"),decayDiffusion1:Rt(this,oi,"f").createParameter(e.decayDiffusion1,E.unipolar(),S.percent(),"Tank 1"),decayDiffusion2:Rt(this,oi,"f").createParameter(e.decayDiffusion2,E.unipolar(),S.percent(),"Tank 2"),damping:Rt(this,oi,"f").createParameter(e.damping,E.unipolar(),S.percent(),"Damping"),excursionRate:Rt(this,oi,"f").createParameter(e.excursionRate,E.unipolar(),S.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:Rt(this,oi,"f").createParameter(e.excursionDepth,E.unipolar(),S.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:Rt(this,oi,"f").createParameter(e.wet,E.DefaultDecibel,S.decible,"Wet"),dry:Rt(this,oi,"f").createParameter(e.dry,E.DefaultDecibel,S.decible,"Dry")}};A();var hI=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Xd=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Z1,jo,Qd=class{constructor(e,r){Z1.set(this,void 0),jo.set(this,void 0),hI(this,Z1,e,"f"),hI(this,jo,r,"f")}get box(){return Xd(this,jo,"f")}get uuid(){return Xd(this,jo,"f").address.uuid}get address(){return Xd(this,jo,"f").address}get labelField(){return Xd(this,jo,"f").label}get modelField(){return Xd(this,jo,"f").model}getModelJson(){return Xd(this,jo,"f").model.getValue()}terminate(){}};Z1=new WeakMap,jo=new WeakMap;var G1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},qt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},H1,ep,Lr,Ac,mI,Tw=class{constructor(e,r){H1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.NeuralAmp,ep.set(this,void 0),Lr.set(this,void 0),Ac.set(this,void 0),G1(this,ep,e,"f"),G1(this,Lr,r,"f"),G1(this,Ac,new ue(qt(this,ep,"f")),"f"),this.namedParameter=qt(this,H1,"m",mI).call(this,r)}get box(){return qt(this,Lr,"f")}get uuid(){return qt(this,Lr,"f").address.uuid}get address(){return qt(this,Lr,"f").address}get indexField(){return qt(this,Lr,"f").index}get labelField(){return qt(this,Lr,"f").label}get enabledField(){return qt(this,Lr,"f").enabled}get minimizedField(){return qt(this,Lr,"f").minimized}get host(){return qt(this,Lr,"f").host}get modelField(){return qt(this,Lr,"f").model}get monoField(){return qt(this,Lr,"f").mono}get spectrum(){return qt(this,Lr,"f").address.append(4095)}getModelAdapter(){let e=qt(this,Lr,"f").model.targetVertex;return e.isEmpty()?_.None:_.wrap(qt(this,ep,"f").boxAdapters.adapterFor(e.unwrap().box,Qd))}getModelJson(){let e=this.getModelAdapter();return e.nonEmpty()?e.unwrap().getModelJson():qt(this,Lr,"f").modelJson.getValue()}deviceHost(){return qt(this,ep,"f").boxAdapters.adapterFor(qt(this,Lr,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){qt(this,Ac,"f").terminate()}};ep=new WeakMap,Lr=new WeakMap,Ac=new WeakMap,H1=new WeakSet,mI=function(e){return{inputGain:qt(this,Ac,"f").createParameter(e.inputGain,E.decibel(-72,0,12),S.numeric({unit:"dB",fractionDigits:1}),"Input"),outputGain:qt(this,Ac,"f").createParameter(e.outputGain,E.decibel(-72,0,12),S.numeric({unit:"dB",fractionDigits:1}),"Output"),mix:qt(this,Ac,"f").createParameter(e.mix,E.linear(0,1),S.percent(),"Mix")}};A();var q1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},si=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},J1,vm,Kn,Ec,gI,Dw=class{constructor(e,r){J1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Waveshaper,vm.set(this,void 0),Kn.set(this,void 0),Ec.set(this,void 0),q1(this,vm,e,"f"),q1(this,Kn,r,"f"),q1(this,Ec,new ue(si(this,vm,"f")),"f"),this.namedParameter=si(this,J1,"m",gI).call(this,r)}get box(){return si(this,Kn,"f")}get uuid(){return si(this,Kn,"f").address.uuid}get address(){return si(this,Kn,"f").address}get indexField(){return si(this,Kn,"f").index}get labelField(){return si(this,Kn,"f").label}get enabledField(){return si(this,Kn,"f").enabled}get minimizedField(){return si(this,Kn,"f").minimized}get host(){return si(this,Kn,"f").host}deviceHost(){return si(this,vm,"f").boxAdapters.adapterFor(si(this,Kn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){si(this,Ec,"f").terminate()}};vm=new WeakMap,Kn=new WeakMap,Ec=new WeakMap,J1=new WeakSet,gI=function(e){return{inputGain:si(this,Ec,"f").createParameter(e.inputGain,E.linear(0,40),S.decible,"Input"),outputGain:si(this,Ec,"f").createParameter(e.outputGain,E.linear(-24,24),S.decible,"Output"),mix:si(this,Ec,"f").createParameter(e.mix,E.unipolar(),S.percent(),"Mix")}};A();var Rw=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Zr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},xm,ym,Wn,wm,Cw,zw=class{constructor(e,r){xm.set(this,new ae),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Werkstatt,ym.set(this,void 0),Wn.set(this,void 0),wm.set(this,void 0),Cw.set(this,void 0),Rw(this,ym,e,"f"),Rw(this,Wn,r,"f"),Rw(this,wm,Zr(this,xm,"f").own(new ue(Zr(this,ym,"f"))),"f");let{terminable:n,codeChanged:i}=Er.subscribeScriptParams(Zr(this,wm,"f"),r.code,r.parameters);Zr(this,xm,"f").own(n),Rw(this,Cw,i,"f")}get box(){return Zr(this,Wn,"f")}get uuid(){return Zr(this,Wn,"f").address.uuid}get address(){return Zr(this,Wn,"f").address}get indexField(){return Zr(this,Wn,"f").index}get labelField(){return Zr(this,Wn,"f").label}get enabledField(){return Zr(this,Wn,"f").enabled}get minimizedField(){return Zr(this,Wn,"f").minimized}get host(){return Zr(this,Wn,"f").host}get parameters(){return Zr(this,wm,"f")}get codeChanged(){return Zr(this,Cw,"f")}deviceHost(){return Zr(this,ym,"f").boxAdapters.adapterFor(Zr(this,Wn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Zr(this,xm,"f").terminate()}};xm=new WeakMap,ym=new WeakMap,Wn=new WeakMap,wm=new WeakMap,Cw=new WeakMap;var fe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},dC,pe,pC,fC,hC,mC;pe=new WeakMap,pC=new WeakMap,fC=new WeakMap,hC=new WeakMap,dC=new WeakSet,mC=function(e){return He(e.accept({visitArpeggioDeviceBox:r=>new mc(fe(this,pe,"f"),r),visitAudioBusBox:r=>new Wi(fe(this,pe,"f"),r),visitAudioClipBox:r=>new Ou(fe(this,pe,"f"),r),visitAudioFileBox:r=>new ta(fe(this,pe,"f"),r),visitAudioTimeStretchBox:r=>new Va(fe(this,pe,"f"),r),visitAudioPitchStretchBox:r=>new Oa(fe(this,pe,"f"),r),visitAudioSignalsmithBox:r=>new Ua(fe(this,pe,"f"),r),visitTransientMarkerBox:r=>new Nu(r),visitWarpMarkerBox:r=>new Ca(fe(this,pe,"f"),r),visitApparatDeviceBox:r=>new ew(fe(this,pe,"f"),r),visitCubedDeviceBox:r=>new tw(fe(this,pe,"f"),r),visitAudioRegionBox:r=>new td(fe(this,pe,"f"),r),visitAudioUnitBox:r=>new bn(fe(this,pe,"f"),r),visitAuxSendBox:r=>new hd(fe(this,pe,"f"),r),visitMaximizerDeviceBox:r=>new _w(fe(this,pe,"f"),r),visitCompressorDeviceBox:r=>new Fw(fe(this,pe,"f"),r),visitGateDeviceBox:r=>new Aw(fe(this,pe,"f"),r),visitAutotuneDeviceBox:r=>new Ew(fe(this,pe,"f"),r),visitCrusherDeviceBox:r=>new Sw(fe(this,pe,"f"),r),visitDattorroReverbDeviceBox:r=>new Bw(fe(this,pe,"f"),r),visitDelayDeviceBox:r=>new ca(fe(this,pe,"f"),r),visitDeviceInterfaceKnobBox:r=>new Pd(fe(this,pe,"f"),r),visitTidalDeviceBox:r=>new Fc(fe(this,pe,"f"),r),visitFoldDeviceBox:r=>new Pw(fe(this,pe,"f"),r),visitGrooveShuffleBox:r=>new Xa(fe(this,pe,"f"),r),visitMarkerBox:r=>new Ss(fe(this,pe,"f"),r),visitSignatureEventBox:r=>new ic(fe(this,pe,"f"),r),visitMIDIOutputDeviceBox:r=>new Nw(fe(this,pe,"f"),r),visitModularAudioInputBox:r=>new Ed(fe(this,pe,"f"),r),visitModularAudioOutputBox:r=>new _d(fe(this,pe,"f"),r),visitModularBox:r=>new ks(fe(this,pe,"f"),r),visitModularDeviceBox:r=>new Nd(fe(this,pe,"f"),r),visitModuleConnectionBox:r=>new $s(fe(this,pe,"f"),r),visitModuleDelayBox:r=>new bd(fe(this,pe,"f"),r),visitModuleGainBox:r=>new Fd(fe(this,pe,"f"),r),visitModuleMultiplierBox:r=>new Ad(fe(this,pe,"f"),r),visitNeonDeviceBox:r=>new rw(fe(this,pe,"f"),r),visitNanoDeviceBox:r=>new iw(fe(this,pe,"f"),r),visitNeuralAmpDeviceBox:r=>new Tw(fe(this,pe,"f"),r),visitNeuralAmpModelBox:r=>new Qd(fe(this,pe,"f"),r),visitNoteClipBox:r=>new Ku(fe(this,pe,"f"),r),visitNoteEventBox:r=>new Cl(fe(this,pe,"f"),r),visitNoteEventCollectionBox:r=>new gn(fe(this,pe,"f"),r),visitNoteRegionBox:r=>new id(fe(this,pe,"f"),r),visitPitchDeviceBox:r=>new Hy(fe(this,pe,"f"),r),visitPlayfieldDeviceBox:r=>new Ud(fe(this,pe,"f"),r),visitPlayfieldSampleBox:r=>new Vd(fe(this,pe,"f"),r),visitAudioEffectCompositeBox:r=>new dw(fe(this,pe,"f"),r),visitAudioEffectCompositeCellBox:r=>new Kd(fe(this,pe,"f"),r),visitStereoCompositeBox:r=>new pw(fe(this,pe,"f"),r),visitFrequencySplitBox:r=>new Qh(fe(this,pe,"f"),r),visitRevampDeviceBox:r=>new oy(fe(this,pe,"f"),r),visitReverbDeviceBox:r=>new ay(fe(this,pe,"f"),r),visitRootBox:r=>new Wy(fe(this,pe,"f"),r),visitSoundfontDeviceBox:r=>new yw(fe(this,pe,"f"),r),visitSoundfontFileBox:r=>new bw(fe(this,pe,"f"),r),visitSpielwerkDeviceBox:r=>new Yy(fe(this,pe,"f"),r),visitStereoToolDeviceBox:r=>new sw(fe(this,pe,"f"),r),visitTapeDeviceBox:r=>new Ly(fe(this,pe,"f"),r),visitTimelineBox:r=>new Ja(fe(this,pe,"f"),r),visitTrackBox:r=>new fr(fe(this,pe,"f"),r),visitUnknownAudioEffectDeviceBox:r=>new mw(fe(this,pe,"f"),r),visitUnknownMidiEffectDeviceBox:r=>new vw(fe(this,pe,"f"),r),visitValueClipBox:r=>new fs(fe(this,pe,"f"),r),visitValueEventBox:r=>new Ao(fe(this,pe,"f"),r),visitValueEventCollectionBox:r=>new Or(fe(this,pe,"f"),r),visitValueRegionBox:r=>new ko(fe(this,pe,"f"),r),visitVaporisateurDeviceBox:r=>new Zy(fe(this,pe,"f"),r),visitVocoderDeviceBox:r=>new Iw(fe(this,pe,"f"),r),visitWaveshaperDeviceBox:r=>new Dw(fe(this,pe,"f"),r),visitWerkstattDeviceBox:r=>new zw(fe(this,pe,"f"),r),visitVelocityDeviceBox:r=>new kw(fe(this,pe,"f"),r),visitZeitgeistDeviceBox:r=>new fw(fe(this,pe,"f"),r)}),`Could not find factory for ${e}`)};A();var tp;(function(t){t.PEAKS=ze.compose(k.Lowest).append(0),t.SPECTRUM=ze.compose(k.Lowest).append(1),t.WAVEFORM=ze.compose(k.Lowest).append(2),t.STEREO=ze.compose(k.Lowest).append(3),t.GONIO=ze.compose(k.Lowest).append(4),t.LOUDNESS=ze.compose(k.Lowest).append(5),t.HEAP=ze.compose(k.Lowest).append(6)})(tp||(tp={}));A();var Ow;(function(t){t.countStems=e=>e.match({none:()=>1,some:r=>K(r.stems)?Object.keys(r.stems).length+(K(r.metronome?.stem)?1:0):1}),t.isMetronomeAudible=e=>e.match({none:()=>!1,some:r=>K(r.stems)?K(r.metronome?.stem):r.metronome?.includeInMixdown===!0}),t.stemFileNames=e=>{let r=Object.values(e.stems??{}).map(({fileName:i})=>i),n=e.metronome?.stem;return K(n)&&r.push(n.fileName),r},t.sanitizeFileName=e=>e.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").trim(),t.sanitizeExportNamesInPlace=e=>{let r=e.metronome?.stem;if(!K(e.stems)&&!K(r))return;let n=e.stems??{},i=new Map,a=o=>{let s=i.get(o)??0,c=o;for(;i.has(c);)s++,c=`${o} ${s}`;return i.set(o,s),i.set(c,1),c};Object.keys(n).forEach(o=>{let s=n[o];s.fileName=a(t.sanitizeFileName(s.fileName))}),K(r)&&(r.fileName=a(t.sanitizeFileName(r.fileName)))}})(Ow||(Ow={}));A();var gC=512,vI=Vi.createBuilder({position:Vi.float,bpm:Vi.float,playbackTimestamp:Vi.float,countInBeatsRemaining:Vi.float,isPlaying:Vi.bool,isCountingIn:Vi.bool,isRecording:Vi.bool,perfIndex:Vi.int32,perfBuffer:Vi.floats(gC)});A();var xI;(function(t){t.store=(e,r,n)=>{if(n==="")return W("MetaData.store: origin must be unique to your app.");let i=e.pointerHub.filter(l.MetaData).map(({box:o})=>o).find(o=>o instanceof Yn&&o.origin.getValue()===n),a=o=>{o.target.refer(e),o.origin.setValue(n),o.value.setValue(JSON.stringify(r))};t_(i)?a(i):Yn.create(e.graph,k.generate(),a)},t.read=(e,r)=>{if(r==="")return W("MetaData.read: origin must be unique to your app.");let n=e.pointerHub.filter(l.MetaData).map(({box:i})=>i).find(i=>i instanceof Yn&&i.origin.getValue()===r);if(t_(n)){let{status:i,value:a,error:o}=sr(()=>JSON.parse(n.value.getValue()));if(i==="success")return a;console.warn(o)}return null},t.clear=(e,r)=>{if(r==="")return W("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(l.MetaData).map(({box:n})=>n).filter(n=>n instanceof Yn&&n.origin.getValue()===r).forEach(n=>n.delete())},t.catchupAndSubscribe=(e,r,n)=>{if(r==="")return W("MetaData.catchupAndSubscribe: origin must be unique to your app.");let i=k.newSet(s=>s.uuid),a=s=>{let{status:c,value:u,error:f}=sr(()=>JSON.parse(s.value.getValue()));c==="success"?n(_.wrap(u)):(console.warn(f),n(_.None))},o=e.pointerHub.catchupAndSubscribe({onAdded:({box:s})=>{if(!(s instanceof Yn)||s.origin.getValue()!==r)return;let c=s.value.catchupAndSubscribe(()=>a(s));i.add({uuid:s.address.uuid,subscription:c})},onRemoved:({box:s})=>{if(!(s instanceof Yn)||s.origin.getValue()!==r)return;i.removeByKey(s.address.uuid).subscription.terminate(),n(_.None)}},l.MetaData);return{terminate:()=>{o.terminate(),i.forEach(({subscription:s})=>s.terminate()),i.clear()}}}})(xI||(xI={}));var vC,xC,yC,wC;vC=new WeakMap,xC=new WeakMap,yC=new WeakMap,wC=new WeakMap;A();A();var Us;(function(t){let e;(function(r){r[r.NoteOn=144]="NoteOn",r[r.NoteOff=128]="NoteOff",r[r.PitchBend=224]="PitchBend",r[r.Controller=176]="Controller",r[r.Start=250]="Start",r[r.Continue=251]="Continue",r[r.Stop=252]="Stop",r[r.Clock=248]="Clock",r[r.Position=242]="Position"})(e=t.Command||(t.Command={})),t.readCommand=r=>r[0]&240,t.readChannel=r=>r[0]&15,t.readParam1=r=>r.length>1?r[1]&255:0,t.readParam2=r=>r.length>2?r[2]&255:0,t.readPitch=r=>r[1],t.readVelocity=r=>r[2]/127,t.isNoteOn=r=>t.readCommand(r)===e.NoteOn&&t.readVelocity(r)>0,t.isNoteOff=r=>t.readCommand(r)===e.NoteOff||t.readCommand(r)===e.NoteOn&&t.readVelocity(r)===0,t.isPitchWheel=r=>t.readCommand(r)===e.PitchBend,t.isController=r=>t.readCommand(r)===e.Controller,t.isClock=r=>r[0]===e.Clock,t.isStart=r=>r[0]===e.Start,t.isContinue=r=>r[0]===e.Continue,t.isStop=r=>r[0]===e.Stop,t.isPosition=r=>r[0]===e.Position,t.asPitchBend=r=>{let n=t.readParam1(r)&127,i=t.readParam2(r)&127,a=n|i<<7;return 8192>=a?a/8192-1:(a-8191)/8192},t.asValue=r=>{let n=t.readParam2(r);return n>64?.5+(n-63)/128:n<64?n/128:.5},t.Clock=new Uint8Array([e.Clock]),t.Start=new Uint8Array([e.Start]),t.Continue=new Uint8Array([e.Continue]),t.Stop=new Uint8Array([e.Stop]),t.noteOn=(r,n,i)=>new Uint8Array([e.NoteOn|r,n,i]),t.noteOff=(r,n)=>new Uint8Array([e.NoteOff|r,n,0]),t.control=(r,n,i)=>new Uint8Array([e.Controller|r,n&127,i&127]),t.position=(r,n)=>new Uint8Array([e.Position,r&127,n&127]),t.positionInPPQN=r=>{let n=Math.floor(r/96),i=n&127,a=n>>7&127;return new Uint8Array([e.Position,i,a])},t.accept=(r,n)=>{cn(r)||(t.isNoteOn(r)?$(n.noteOn,t.readPitch(r),t.readVelocity(r)):t.isNoteOff(r)?$(n.noteOff,t.readPitch(r)):t.isPitchWheel(r)?$(n.pitchBend,t.asPitchBend(r)):t.isController(r)?$(n.controller,t.readParam1(r),t.readParam2(r)/127):t.isClock(r)?$(n.clock):t.isStart(r)?$(n.start):t.isContinue(r)?$(n.continue):t.isStop(r)?$(n.stop):t.isPosition(r)&&$(n.songPos,t.readParam1(r)|t.readParam2(r)<<7))},t.debug=r=>r===null?"null":t.isNoteOn(r)?`NoteOn #${t.readChannel(r)} ${t.readPitch(r)} : ${t.readVelocity(r).toFixed(2)}`:t.isNoteOff(r)?`NoteOff #${t.readChannel(r)} ${t.readPitch(r)}`:t.isPitchWheel(r)?`PitchWheel #${t.readChannel(r)} ${t.asPitchBend(r)}`:t.isController(r)?`Control #${t.readChannel(r)} ${t.asValue(r)}`:t.isClock(r)?"Clock":t.isStart(r)?"Start":t.isContinue(r)?"Continue":t.isStop(r)?"Stop":t.isPosition(r)?`SongPosition ${t.readParam1(r)|t.readParam2(r)<<7}`:"Unknown"})(Us||(Us={}));var bm;(function(t){t.on=(e,r,n)=>({type:"note-on",uuid:e,pitch:r,velocity:n}),t.off=(e,r)=>({type:"note-off",uuid:e,pitch:r}),t.audition=(e,r,n,i)=>({type:"note-audition",uuid:e,pitch:r,duration:n,velocity:i}),t.isOn=e=>e.type==="note-on",t.isOff=e=>e.type==="note-off",t.isAudition=e=>e.type==="note-audition",t.fromEvent=(e,r)=>{let n=e.data;if(Us.isNoteOn(n)){let i=Us.readPitch(n),a=Us.readVelocity(n);return{type:"note-on",uuid:r,pitch:i,velocity:a}}else if(Us.isNoteOff(n)){let i=Us.readPitch(n);return{type:"note-off",uuid:r,pitch:i}}return W("Unknown MIDI event")}})(bm||(bm={}));var yI;(function(t){t.start=(e,r,n,i=1)=>{let a=!0;return e(bm.on(r,n,i)),{terminate:()=>{a&&(e(bm.off(r,n)),a=!1)}}}})(yI||(yI={}));var wI=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},bC,_C,bI,_I,FC,AC;_C=new WeakMap,bI=new WeakMap,_I=new WeakMap,FC=new WeakMap,bC=new WeakSet,AC=function(e,r){return e.subscribeIntegers(r,n=>{wI(this,bI,"f").replace(n.buffer)&&wI(this,_I,"f").notify(this)})};var EC,SC,PC,MC,NC,$C;EC=new WeakMap,SC=new WeakMap,PC=new WeakMap,MC=new WeakMap,NC=new WeakMap,$C=new WeakMap;A();A();var ya={isClipBox:t=>t.accept({visitNoteClipBox:e=>!0,visitAudioClipBox:e=>!0,visitValueClipBox:e=>!0})??!1,isRegionBox:t=>t.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1,asRegionBox:t=>t.accept({visitNoteRegionBox:e=>e,visitAudioRegionBox:e=>e,visitValueRegionBox:e=>e})??W("Could not cast to AnyRegionBox"),isLoopableRegionBox:t=>t.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};rt();var Vw={min:30,max:1e3,default:120};var Uw;(function(t){t.isTimeSignatureValid=(e,r)=>!Number.isInteger(e)||e<1||e>31?Dr.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(r)||r<1||r>32||(r&r-1)!==0?Dr.err("Denominator must be a power of two between 1 and 32"):Dr.ok([e,r]),t.clampBpm=e=>Number.isFinite(e)?Se(e,Vw.min,Vw.max):Vw.default,t.clampBaseFrequency=e=>Number.isFinite(e)?Se(e,ry.min,ry.max):ry.default,t.hasOverlappingRegions=e=>e.boxes().some(r=>r.accept({visitTrackBox:n=>{for(let[i,a]of ie.iterateAdjacent(n.regions.pointerHub.incoming().map(({box:o})=>ya.asRegionBox(o)).sort(({position:o},{position:s})=>o.getValue()-s.getValue()))){if(i instanceof os&&i.timeBase.getValue()===ui.Seconds)return!1;if(i.position.getValue()+i.duration.getValue()>a.position.getValue())return!0}return!1}})??!1)})(Uw||(Uw={}));var FI;(function(t){t.parseTimeSignature=e=>{let[r,n]=e.split("/"),i=parseInt(r,10),a=parseInt(n,10);return Uw.isTimeSignatureValid(i,a)}})(FI||(FI={}));A();var AI;(function(t){t.reader=(e,r)=>{let n=`
5
+ `),this));for(let n of r)n.defer();for(let n of e)n.unstage();this.unstage()}unstage(){this.graph.unstageBox(this)}isValid(){if(this.#i.mandatory&&this.pointerHub.incoming().length===0)return!1;let e=r=>r.every(n=>n.accept({visitPointerField:i=>!i.mandatory||i.nonEmpty(),visitArrayField:i=>e(i.fields()),visitObjectField:i=>e(i.fields()),visitPrimitiveField:i=>!0,visitField:i=>!0})??!0);return e(this.fields())}toString(){return`${this.constructor.name} ${this.address.toString()}`}};QR([Zc,rk("design:type",Pa),rk("design:paramtypes",[])],D.prototype,"pointerHub",null);var Hp;(function(t){t.clampInt32=(e,r)=>r,t.clampFloat32=(e,r)=>r})(Hp||(Hp={}));A();var Ke;(function(t){t[t.This=0]="This",t[t.Parent=1]="Parent",t[t.Children=2]="Children"})(Ke||(Ke={}));var Jg;(function(t){t.create=()=>new B_})(Jg||(Jg={}));var B_=class{#e=new qp(pl.equals);#t=new qp(pl.startsWith);#r=new qp(pl.endsWith);#i=[];#n=0;#a=!1;subscribe(e,r,n){let i=new T_(r,e,this.#n++,n);if(this.#a){let a=new D_(i,e);return this.#i.push(a),a}else return this.subscribeMonitor(i,e)}dispatch(e){this.#a=!0,[...this.#e.filter(e),...this.#t.filter(e),...this.#r.filter(e)].sort(({order:n},{order:i})=>n-i).forEach(n=>n.procedure(e)),this.#a=!1,this.#i.forEach(n=>n.subscribe(this)),this.#i.length=0}subscribeMonitor(e,r){switch(r){case Ke.This:return this.#e.subscribe(e);case Ke.Parent:return this.#t.subscribe(e);case Ke.Children:return this.#r.subscribe(e);default:return Aa(r)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},T_=class{address;propagation;order;procedure;constructor(e,r,n,i){this.address=e,this.propagation=r,this.order=n,this.procedure=i}toString(){return`{ Monitor address: ${this.address}, propagation: ${Ke[this.propagation]}, order: ${this.order} }`}},qp=class{filterStrategy;#e=[];#t=!0;constructor(e){this.filterStrategy=e}subscribe(e){return this.#e.push(e),this.#t=this.#e.length<2,{terminate:()=>{let r=this.#e.length;for(;--r>=0;)this.#e[r]===e&&this.#e.splice(r,1)}}}stations(){return this.#t||(this.#e.sort(pl.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},D_=class{monitor;propagation;#e=new ae;#t=!1;constructor(e,r){this.monitor=e,this.propagation=r}subscribe(e){this.#t||(this.#e.terminate(),this.#e.own(e.subscribeMonitor(this.monitor,this.propagation)))}terminate(){this.#t=!0,this.#e.terminate()}};A();var Bt;(function(t){t.Boolean="boolean",t.Float32="float32",t.Int32="int32",t.String="string",t.Bytes="bytes"})(Bt||(Bt={}));var vo={[Bt.Boolean]:{type:Bt.Boolean,encode:(t,e)=>t.writeBoolean(e),decode:t=>t.readBoolean()},[Bt.Float32]:{type:Bt.Float32,encode:(t,e)=>t.writeFloat(e),decode:t=>t.readFloat()},[Bt.Int32]:{type:Bt.Int32,encode:(t,e)=>t.writeInt(e),decode:t=>t.readInt()},[Bt.String]:{type:Bt.String,encode:(t,e)=>t.writeString(e),decode:t=>t.readString()},[Bt.Bytes]:{type:Bt.Bytes,encode:(t,e)=>{t.writeInt(e.length),t.writeBytes(e)},decode:t=>{let e=new Int8Array(t.readInt());return t.readBytes(e),e}}},fl=class extends Z{#e;#t;#r;constructor(e,r,n){super(e),this.#e=r,this.#t=n,this.#r=this.#t}accept(e){return $(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Ke.This,this.address,()=>e(this))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}get type(){return this.#e}get initValue(){return this.#t}setInitValue(e){ee(this.graph.constructingBox(),"Cannot change initial value at runtime"),this.setValue(this.#t=this.clamp(e))}getValue(){return this.#r}setValue(e){let r=this.#r,n=this.clamp(e);this.equals(n)||(this.#r=n,this.graph.onPrimitiveValueUpdate(this,r,n))}writeValue(e,r){ee(!this.deprecated,"PrimitiveField.write: deprecated field"),this.serialization().encode(e,r)}readValue(e){return this.serialization().decode(e)}toJSON(){if(this.deprecated)return;let e=this.getValue();return ArrayBuffer.isView(e)?W("not implemented"):e}fromJSON(e){return W("Type mismatch")}reset(){this.setValue(this.#t)}},B=class t extends fl{static create(e,r=!1){return new t(e,r)}constructor(e,r){super(e,Bt.Boolean,r)}toggle(){this.setValue(!this.getValue())}serialization(){return vo[Bt.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){ee(!this.deprecated,"BooleanField.write: deprecated field"),e.writeBoolean(this.getValue())}fromJSON(e){this.deprecated||(typeof e=="boolean"?this.setValue(e):console.warn("BooleanField Type mismatch",e,this.address.toString()))}},F=class t extends fl{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,Bt.Float32,i),this.#e=r,this.#t=n}serialization(){return vo[Bt.Float32]}equals(e){return this.getValue()===e}clamp(e){return Hp.clampFloat32(this.#e,ho.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){ee(!this.deprecated,"FLoat32Field.write: deprecated field"),e.writeFloat(this.getValue())}get unit(){return this.#t}get constraints(){return this.#e}fromJSON(e){this.deprecated||(typeof e=="number"?this.setValue(e):console.warn("Float32Field Type mismatch",e,this.address.toString()))}},N=class t extends fl{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,Bt.Int32,i),this.#e=r,this.#t=n}serialization(){return vo[Bt.Int32]}equals(e){return this.getValue()===e}clamp(e){return Hp.clampInt32(this.#e,Rr.toInt(e))}read(e){this.setValue(e.readInt())}write(e){ee(!this.deprecated,"Int32Field.write: deprecated field"),e.writeInt(this.getValue())}get unit(){return this.#t}get constraints(){return this.#e}fromJSON(e){this.deprecated||(typeof e=="number"&&e===Math.floor(e)&&e>=Rr.MIN_VALUE&&e<=Rr.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},T=class t extends fl{static create(e,r=""){return new t(e,r)}constructor(e,r){super(e,Bt.String,r)}serialization(){return vo[Bt.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){ee(!this.deprecated,"StringField.write: deprecated field"),e.writeString(this.getValue())}fromJSON(e){this.deprecated||(typeof e=="string"?this.setValue(e):console.warn("StringField Type mismatch",e,this.address.toString()))}},ik=class t extends fl{static create(e,r=this.#e){return new t(e,r)}static#e=Object.freeze(new Int8Array(0));constructor(e,r){super(e,Bt.Bytes,r)}serialization(){return vo[Bt.Bytes]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){let r=new Int8Array(e.readInt());e.readBytes(r),this.setValue(r)}write(e){ee(!this.deprecated,"ByteArrayField.write: deprecated field");let r=this.getValue();e.writeInt(r.length),e.writeBytes(r)}toJSON(){if(!this.deprecated)return Array.from(this.getValue().values())}fromJSON(e){this.deprecated||(Array.isArray(e)&&e.every(r=>typeof r=="number")?this.setValue(new Int8Array(e)):console.warn("ByteArrayField Type mismatch",e,this.address.toString()))}};A();var ak=t=>{let e=k.newSet(i=>i),r=k.newSet(i=>i);for(let i of t)i instanceof hl?e.add(i.uuid):i instanceof vl&&r.add(i.uuid);let n=k.newSet(i=>i);for(let i of e.values())r.hasKey(i)&&n.add(i);return n.isEmpty()?t:t.filter(i=>i instanceof hl||i instanceof vl?!n.hasKey(i.uuid):i instanceof gl||i instanceof ml?!n.hasKey(i.address.uuid):!0)},nk;(function(t){t.decode=e=>{let r=e.readInt();return ie.create(()=>{switch(e.readString()){case"new":{let i=k.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new hl(i,a,o.buffer)}case"pointer":{let i=ze.read(e),a=e.readBoolean()?_.wrap(ze.read(e)):_.None,o=e.readBoolean()?_.wrap(ze.read(e)):_.None;return new gl(i,a,o)}case"primitive":{let i=ze.read(e),a=e.readString(),o=vo[a],s=o.decode(e),c=o.decode(e);return new ml(i,o,s,c)}case"delete":{let i=k.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new vl(i,a,o.buffer)}}},r)}})(nk||(nk={}));var hl=class{type="new";#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.createBox(this.#t,this.#e,r=>r.read(new lt(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),k.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${k.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},ml=class{type="primitive";#e;#t;#r;#i;constructor(e,r,n,i){this.#e=e,this.#t=r,this.#r=n,this.#i=i}get address(){return this.#e}get serialization(){return this.#t}get oldValue(){return this.#r}get newValue(){return this.#i}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).setValue(this.#r)}forward(e){this.field(e).setValue(this.#i)}field(e){return e.findVertex(this.#e).unwrap(()=>`Could not find PrimitiveField at ${this.#e}`)}write(e){e.writeString(this.type),this.#e.write(e),e.writeString(this.#t.type),this.#t.encode(e,this.#r),this.#t.encode(e,this.#i)}toString(){return`{PrimitiveUpdate oldValue: ${this.#r}, newValue: ${this.#i}`}},gl=class{type="pointer";#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}get address(){return this.#e}get oldAddress(){return this.#t}get newAddress(){return this.#r}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).targetAddress=this.#t}forward(e){this.field(e).targetAddress=this.#r}field(e){return e.findVertex(this.#e).unwrap(()=>`Could not find PointerField at ${this.#e}`)}write(e){e.writeString(this.type),this.#e.write(e),this.#t.match({none:()=>e.writeBoolean(!1),some:r=>{e.writeBoolean(!0),r.write(e)}}),this.#r.match({none:()=>e.writeBoolean(!1),some:r=>{e.writeBoolean(!0),r.write(e)}})}toString(){return`{PointerUpdate oldValue: ${this.#t.unwrapOrNull()}, newValue: ${this.#r.unwrapOrNull()}`}},vl=class{type="delete";#e;#t;#r;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}inverse(e){e.createBox(this.#t,this.#e,r=>r.read(new lt(this.#r)))}write(e){e.writeString(this.type),k.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${k.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};A();A();A();var EL=Symbol("Unreferenceable"),I=class t extends Z{static create(e,r,n){return new t(e,r,n)}static encodeWith(e,r){ee(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=_.wrap(e);let n=sr(r);if(this.#e=_.None,n.status==="failure")throw n.error;return n.value}static decodeWith(e,r){ee(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=_.wrap(e);let n=sr(r);if(this.#t=_.None,n.status==="failure")throw n.error;return n.value}static#e=_.None;static#t=_.None;#r;#i;#n=_.None;#a=_.None;constructor(e,r,n){super(e),this.#r=r,this.#i=n,n&&this.graph.edges().watchVertex(this)}get pointerHub(){return W(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return $(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Ke.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}refer(e){this.targetVertex=_.wrap(e)}defer(){this.targetVertex=_.None}get targetVertex(){return this.graph.inTransaction()?this.#a.flatMap(e=>this.graph.findVertex(e)):this.#n}set targetVertex(e){if(e.nonEmpty()){let r=Pa.validate(this,e.unwrap());r.nonEmpty()&&W(r.unwrap())}this.targetAddress=e.map(r=>r.address)}get targetAddress(){return this.#a}set targetAddress(e){let r=this.#a;r.isEmpty()&&e.isEmpty()||(e.nonEmpty()&&r.unwrapOrNull()?.equals(e.unwrap()))===!0||(this.#a=e,this.graph.onPointerAddressUpdated(this,r,e))}isEmpty(){return this.targetAddress.isEmpty()}nonEmpty(){return this.targetAddress.nonEmpty()}ifVertex(e){this.targetVertex.nonEmpty()&&e(this.targetVertex.unwrap("targetVertex"))}resolvedTo(e){this.#n=e}read(e){let r=e.readBoolean()?_.wrap(ze.read(e)):_.None;this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}write(e){ee(!this.deprecated,"PointerField.write: deprecated field"),t.#e.match({none:()=>this.#a,some:r=>r.map(this)}).match({none:()=>e.writeBoolean(!1),some:r=>{e.writeBoolean(!0),r.write(e)}})}toJSON(){if(!this.deprecated)return t.#e.match({none:()=>this.#a,some:e=>e.map(this)}).match({none:()=>null,some:e=>e.toString()})}fromJSON(e){if(!this.deprecated)if(cn(e)||typeof e=="string"){let r=_.wrap(cn(e)?null:ze.decode(e));this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}else return W(`Pointer at (${this.address}) has type mismatch. value (${e}) must be a string, but is ${typeof e}.`)}};var Yg=class{#e;#t;#r;#i;#n;#a;constructor(){this.#e=ze.newSet(e=>e.address),this.#t=ze.newSet(e=>e.address),this.#r=ze.newSet(e=>e.address),this.#i=ze.newSet(([e])=>e),this.#n=ze.newSet(([e])=>e.address),this.#a=k.newSet(e=>e)}watchVertex(e){if(Ft(e,I)){if(!e.mandatory)return W("watchVertex called but has no edge requirement");this.#e.add(e)}else{let{mandatory:r,exclusive:n}=e.pointerRules;if(!r&&!n)return W("watchVertex called but has no edge requirement");r&&this.#t.add(e),n&&this.#r.add(e)}this.#a.add(e.address.uuid)}unwatchVerticesOf(...e){let r=({box:{address:{uuid:n}}})=>n;for(let{address:{uuid:n}}of e)this.#o(this.#e,n,r),this.#o(this.#t,n,r),this.#o(this.#r,n,r);for(let n of e){let i=this.outgoingEdgesOf(n);if(i.length>0)return W(`${n} has outgoing edges: ${i.map(([o,s])=>`[${o.toString()}, ${s.toString()}]`)}`);let a=this.incomingEdgesOf(n);if(a.length>0)return W(`${n} has incoming edges from: ${a.map(o=>o.toString())}`)}}forgetVerticesOf(e){let r=({box:{address:{uuid:i}}})=>i,{address:{uuid:n}}=e;this.#o(this.#e,n,r),this.#o(this.#t,n,r),this.#o(this.#r,n,r)}connect(e,r){this.#n.add([e,r]),this.#i.opt(r).match({none:()=>this.#i.add([r,[e]]),some:([,n])=>n.push(e)}),this.#a.add(e.address.uuid),this.#a.add(r.uuid)}disconnect(e){let[,r]=this.#n.removeByKey(e.address),[,n]=this.#i.get(r,"incoming by address");ie.remove(n,e),n.length===0&&this.#i.removeByKey(r),this.#a.add(e.address.uuid),this.#a.add(r.uuid)}isConnected(e,r){return this.#n.opt(e.address).mapOr(([,n])=>n.equals(r),!1)}outgoingEdgesOf(e){return this.#s(this.#n,e.address.uuid,([{box:{address:{uuid:r}}}])=>r)}incomingEdgesOf(e){return e.isBox()?this.#s(this.#i,e.address.uuid,([{uuid:r}])=>r).flatMap(([r,n])=>n):this.#i.opt(e.address).mapOr(([r,n])=>n,ie.empty())}unsatisfiedMandatoryPointers(){return this.#e.values().filter(e=>e.isEmpty())}clearAffected(){this.#a.clear()}tryValidateAffected(){let e=({box:{address:{uuid:r}}})=>r;for(let r of this.#a.values()){let n=this.#s(this.#e,r,e);for(let o of n)if(o.isEmpty())return this.#a.clear(),o.mandatory?_.wrap(new Error(`Pointer ${o.toString()} requires an edge.`)):_.wrap(new Error(`Illegal state: ${o} has no edge requirements.`));let i=this.#s(this.#t,r,e);for(let o of i)if(o.pointerHub.isEmpty())return this.#a.clear(),o.pointerRules.mandatory?_.wrap(new Error(`Target ${o.toString()} requires an edge.`)):_.wrap(new Error(`Illegal state: ${o} has no edge requirements.`));let a=this.#s(this.#r,r,e);for(let o of a){let s=o.pointerHub.size();if(s>1)return this.#a.clear(),_.wrap(new Error(`Target ${o.toString()} is exclusive but has ${s} incoming pointers.`))}}return this.#a.clear(),_.None}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?(console.warn(`[GraphEdges] Validation failed: Pointer ${e.toString()} requires an edge.`),W(`Pointer ${e.toString()} requires an edge.`)):W(`Illegal state: ${e} has no edge requirements.`)}),this.#t.forEach(e=>{if(e.pointerHub.isEmpty())return e.pointerRules.mandatory?(console.warn(e),console.warn(`[GraphEdges] Validation failed: Target ${e.toString()} requires an edge.`),W(`Target ${e.toString()} requires an edge.`)):W(`Illegal state: ${e} has no edge requirements.`)}),this.#r.forEach(e=>{let r=e.pointerHub.size();if(r>1)return console.warn(`[GraphEdges] Validation failed: Target ${e.toString()} is exclusive but has ${r} incoming pointers.`),W(`Target ${e.toString()} is exclusive but has ${r} incoming pointers.`)})}#s(e,r,n){let i=ze.boxRange(e,r,n);return K(i)?e.values().slice(i[0],i[1]):ie.empty()}#o(e,r,n){let i=ze.boxRange(e,r,n);K(i)&&e.removeRange(i[0],i[1])}};var xo=class{#e;#t;#r;#i;#n;#a;#s;#o;#c;#l;#u;#m;#v;#d=!1;#p=!1;#f=!1;constructor(e=_.None){this.#e=e,this.#t=k.newSet(r=>r.address.uuid),this.#r=[],this.#i=[],this.#n=[],this.#c=Jg.create(),this.#a=new dr,this.#s=new dr,this.#o=new dr,this.#l=new Yg,this.#u=ze.newSet(({pointer:r})=>r.address),this.#m=[],this.#v=k.newSet(r=>r.uuid)}beginTransaction(){ee(!this.#d,"Transaction already in progress"),this.#d=!0,this.#n.length=0,this.#o.proxy.onBeginTransaction()}abortTransaction(){ee(this.#d,"No transaction in progress"),this.#_(),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>this.#y(e,r)),this.#r.length=0),this.#g()}endTransaction(){ee(this.#d,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>{this.#n.push(r),this.#h(e,r)}),this.#r.length=0),!this.#f&&this.#e.nonEmpty()&&this.#l.tryValidateAffected().ifSome(e=>{throw this.#_(),this.#g(),e}),this.#x(),this.#g()}inTransaction(){return this.#d}constructingBox(){return this.#p}createBox(e,r,n){return this.#e.unwrap("No box-factory installed")(e,this,r,n)}stageBox(e,r){if(this.#w(),ee(!this.#p,"Cannot construct box while other box is constructing"),K(r)){this.#p=!0;let a=sr(()=>r(e));if(this.#p=!1,a.status==="failure")throw this.#F(e),a.error}if(!this.#t.add(e))return this.#F(e),W(`${e.name} ${e.address.toString()} already staged`);let i=new hl(e.address.uuid,e.name,e.toArrayBuffer());return this.#f||this.#n.push(i),this.#a.proxy.onUpdate(i),this.#s.proxy.onUpdate(i),e}subscribeTransaction(e){return this.#o.subscribe(e)}subscribeToAllUpdates(e){return this.#a.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#s.subscribe(e)}subscribeVertexUpdates(e,r,n){return this.#c.subscribe(e,r,n)}subscribeEndTransaction(e){this.#m.push(e)}subscribeDeletion(e,r){let n=this.#v.getOrCreate(e,()=>({uuid:e,listeners:new Set}));return n.listeners.add(r),{terminate:()=>{n.listeners.delete(r),n.listeners.size===0&&this.#v.removeByKeyIfExist(e)}}}unstageBox(e){this.#w();let r=this.#t.removeByKey(e.address.uuid);ee(r===e,`${e} could not be found to unstage`),this.#l.unwatchVerticesOf(e);let n=new vl(e.address.uuid,e.name,e.toArrayBuffer());this.#f||this.#n.push(n),this.#v.removeByKeyIfExist(e.address.uuid)?.listeners.forEach(i=>i()),this.#a.proxy.onUpdate(n),this.#s.proxy.onUpdate(n)}findBox(e){return this.#t.opt(e)}findVertex(e){return this.#t.opt(e.uuid).flatMap(r=>r.searchVertex(e.fieldKeys))}boxes(){return this.#t.values()}unresolvablePointers(){return this.#t.values().flatMap(e=>e.outgoingEdges().filter(([,r])=>this.findVertex(r).isEmpty()).map(([r])=>r))}clearUnresolvablePointers(){let e=this.unresolvablePointers();if(e.length===0)return 0;let r=this.#d;return r||this.beginTransaction(),e.forEach(n=>n.targetAddress=_.None),r||this.#b(),console.warn(`[BoxGraph] cleared ${e.length} pointer(s) whose target is missing`),e.length}edges(){return this.#l}checksum(){let e=new Sg;return this.boxes().forEach(r=>r.write(e)),e.result()}onPrimitiveValueUpdate(e,r,n){if(this.#w(),e.isAttached()&&!this.#p){let i=new ml(e.address,e.serialization(),r,n);this.#f||this.#n.push(i),this.#c.dispatch(i),this.#a.proxy.onUpdate(i),this.#s.proxy.onUpdate(i)}}onPointerAddressUpdated(e,r,n){this.#w(),r.nonEmpty()&&this.#l.disconnect(e),n.nonEmpty()&&this.#l.connect(e,n.unwrap());let i=new gl(e.address,r,n);this.#p?this.#r.push({pointerField:e,update:i}):(this.#f||this.#n.push(i),this.#y(e,i),this.#s.proxy.onUpdate(i))}#y(e,r){let{oldAddress:n,newAddress:i}=r;e.resolvedTo(i.flatMap(o=>this.findVertex(o))),this.#u.opt(e.address).match({none:()=>this.#u.add({pointer:e,initial:n,final:i,index:this.#u.size()}),some:o=>o.final=i}),this.#c.dispatch(r),this.#a.proxy.onUpdate(r)}#h(e,r){let{oldAddress:n,newAddress:i}=r;e.resolvedTo(i.flatMap(o=>this.findVertex(o))),this.#u.opt(e.address).match({none:()=>this.#u.add({pointer:e,initial:n,final:i,index:this.#u.size()}),some:o=>o.final=i}),this.#i.push({pointerField:e,update:r})}#x(){for(let{update:e}of this.#i)this.#c.dispatch(e),this.#a.proxy.onUpdate(e);this.#i.length=0}#g(){for(this.#u.values().toSorted((e,r)=>e.index-r.index).forEach(({pointer:e,initial:r,final:n})=>{r.equals(n)||(r.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onRemoved(e)),n.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#u.clear(),this.#d=!1;this.#m.length>0;)this.#m.splice(0).forEach(e=>e()),this.#m.length>0&&console.debug(`${this.#m.length} new observers while notifying`);this.#o.proxy.onEndTransaction(this.#f),this.#f=!1}#_(){this.#f=!0;for(let{update:r}of this.#r)this.#n.push(r);this.#r.length=0;let e=ak(this.#n.splice(0));for(let r=e.length-1;r>=0;r--){let n=e[r];if((n instanceof gl||n instanceof ml)&&this.findVertex(n.address).isEmpty()){console.warn(`[BoxGraph] rollback skips ${n.type}-update, vertex not found at ${n.address.toString()}`);continue}n.inverse(this)}this.#i.length=0,this.#l.clearAffected(),this.#u.clear(),this.#n.length=0}#F(e){for(let r=this.#r.length-1;r>=0;r--)this.#r[r].pointerField.box===e&&this.#r.splice(r,1);this.#l.outgoingEdgesOf(e).forEach(([r])=>this.#l.disconnect(r)),this.#l.forgetVerticesOf(e)}findOrphans(e){let r=this.#A(e);return this.boxes().filter(n=>!r.has(n))}#A(e){let r=new Set,n=[e];for(;n.length>0;){let i=n.pop();if(!r.has(i)){r.add(i),this.#E(i).forEach(a=>{a.targetAddress.ifSome(o=>{this.findBox(o.uuid).ifSome(s=>{r.has(s)||n.push(s)})})});for(let a of i.incomingEdges())r.has(a.box)||n.push(a.box)}}return r}#E(e){let r=[],n=i=>{for(let a of i)a.accept({visitPointerField:o=>r.push(o),visitObjectField:o=>n(o.fields()),visitArrayField:o=>n(o.fields())})};return n(e.fields()),r}dependenciesOf(e,r={}){let n=K(r.excludeBox)?r.excludeBox:qc.alwaysFalse,i=K(r.alwaysFollowMandatory)?r.alwaysFollowMandatory:!1,a=K(r.stopAtResources)?r.stopAtResources:!1,o=new Set,s=new Set,c=(f,v=!1)=>{if(!(o.has(f)||!v&&n(f))){if(o.add(f),a&&K(f.resource)){f.incomingEdges().forEach(m=>{s.add(m);let w=m.targetAddress.mapOr(y=>!y.isBox(),!1);if(m.mandatory&&w){if(f.resource==="shared"&&m.targetAddress.flatMap(P=>this.findVertex(P)).mapOr(P=>P.pointerRules.mandatory,!1))return;c(m.box)}});return}f.outgoingEdges().filter(([m])=>!s.has(m)).forEach(([m,w])=>{s.add(m),this.findVertex(w).match({none:()=>console.warn(`[BoxGraph] skipping dangling ${m.toString()} -> ${w.toString()}`),some:y=>{y.pointerRules.mandatory&&(i||y.pointerHub.incoming().filter(P=>P.targetAddress.mapOr(V=>V.equals(w),!1)).every(P=>s.has(P)))&&c(y.box)}})}),f.incomingEdges().forEach(m=>{s.add(m),m.mandatory&&c(m.box)})}},u=Array.isArray(e)?e:[e];return u.forEach(f=>c(f,!0)),u.forEach(f=>o.delete(f)),{boxes:o,pointers:Array.from(s).reverse()}}verifyPointers(){this.#l.validateRequirements();let e=0,r=n=>{for(let i of n.fields())i.accept({visitPointerField:a=>{if(a.targetAddress.nonEmpty()){let o=a.targetVertex.nonEmpty(),s=this.findVertex(a.targetAddress.unwrap()).nonEmpty();ee(o,`pointer ${a.address} is broken`),ee(s,`Cannot find target for pointer ${a.address}`),e++}},visitObjectField:a=>r(a)})};return this.#t.forEach(n=>r(n)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#t.values().reduce((e,r)=>(e[k.toString(r.address.uuid)]={class:r.name,"incoming links":r.incomingEdges().length,"outgoing links":r.outgoingEdges().length,"est. memory (bytes)":r.estimateMemory()},e),{}))}debugDependencies(){console.debug("Dependencies:"),this.boxes().forEach(e=>{console.debug(` ${e}`);for(let r of this.dependenciesOf(e).boxes)console.debug(` ${r}`)})}addressToDebugPath(e){return e.flatMap(r=>r.isBox()?this.findBox(r.uuid).map(n=>n.name):this.findBox(r.uuid).flatMap(n=>n.searchVertex(r.fieldKeys).map(i=>i.isField()?i.debugPath:W("Unknown address"))))}toArrayBuffer(){let e=Gt.create(),r=this.#t.values();return e.writeInt(r.length),r.forEach(n=>{let i=n.serialize();e.writeInt(i.byteLength),e.writeBytes(new Int8Array(i))}),e.toArrayBuffer()}fromArrayBuffer(e,r=!0){ee(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let n=new lt(e),i=n.readInt();this.beginTransaction();let a=[];for(let o=0;o<i;o++){let s=n.readInt(),c=new Int8Array(s);n.readBytes(c);let u=new lt(c.buffer),f=u.readInt(),v=u.readString(),m=k.fromDataInput(u);a.push({creationIndex:f,name:v,uuid:m,boxStream:u})}a.sort((o,s)=>o.creationIndex-s.creationIndex).forEach(({name:o,uuid:s,boxStream:c})=>this.createBox(o,s,u=>u.read(c))),r?this.endTransaction():this.#b()}toJSON(){let e={};for(let r of this.#t.values())e[r.address.toString()]={name:r.name,fields:He(r.toJSON())};return e}fromJSON(e,r=!0){if(typeof e!="object"||e===null||Array.isArray(e))return W("Expected object");this.beginTransaction();let n=Object.entries(e);for(let[i,{name:a,fields:o}]of n)this.createBox(a,k.parse(i),s=>{let c=sr(()=>s.fromJSON(o));c.status==="failure"&&console.warn(c.error)});r?this.endTransaction():this.#b()}#b(){this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>this.#y(e,r)),this.#r.length=0),this.#l.clearAffected(),this.#g()}#w(){ee(this.#d,()=>"Modification only prohibited in transaction mode.")}};A();var bi;(function(t){t.insertOrder=(e,r=Number.MAX_SAFE_INTEGER)=>{let n=t.collectIndexedBoxes(e),i=Se(r,0,n.length);if(i<n.length)for(let a=i;a<n.length;a++)n[a].index.setValue(a+1);return i},t.removeOrder=(e,r)=>{let n=t.collectIndexedBoxes(e);if(r<n.length)for(let i=r+1;i<n.length;i++)n[i].index.setValue(i-1)},t.moveIndex=(e,r,n)=>{let i=t.collectIndexedBoxes(e),a=i[r];if(n<0){let o=Se(r+n,0,i.length-1);for(let s=o;s<r;s++)i[s].index.setValue(s+1);a.index.setValue(o)}else if(n>1){let o=Se(r+(n-1),0,i.length-1);for(let s=r;s<o;s++)i[s+1].index.setValue(s);a.index.setValue(o)}else console.warn(`moveIndex had no effect: startIndex: ${r}, delta: ${n}`)},t.moveIndices=(e,r,n)=>{let i=t.collectIndexedBoxes(e),a=new Set(r),o=0;for(;o<r.length&&r[o]<n;)o++;let s=n-o,c=s,u=s+r.length,f=0,v=0,m=0;for(let w=0;w<i.length;w++){let y=i[w],P=a.has(w)?c+v++:w<n?f++:u+m++;y.index.setValue(P)}},t.isIndexedBox=e=>"index"in e&&e.index instanceof N,t.collectIndexedBoxes=(e,r)=>e.pointerHub.incoming().map(({box:n})=>t.isIndexedBox(n)&&(r===void 0||n instanceof r)?n:W(`${n} has no index field`)).sort((n,i)=>n.index.getValue()-i.index.getValue())})(bi||(bi={}));A();var De=class extends Z{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return $(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return He(this.#e[e])}optField(e){return _.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(Ke.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){Qo.readFields(e,this.#e)}write(e){Qo.writeFields(e,this.#e)}toJSON(){if(!this.deprecated)return Object.entries(this.#e).reduce((e,[r,n])=>(e[r]=n.toJSON(),e),{})}fromJSON(e){if(!this.deprecated)if(nl(e))Object.entries(e).forEach(([r,n])=>{let i=this.#e[parseInt(r)];K(n)&&i.fromJSON(n)});else return W("Type mismatch")}};var es;(function(t){t[t.Float=0]="Float",t[t.FloatArray=1]="FloatArray",t[t.Integer=2]="Integer",t[t.IntegerArray=3]="IntegerArray",t[t.ByteArray=4]="ByteArray"})(es||(es={}));var Jp;(function(t){t[t.WRITE=0]="WRITE",t[t.READ=1]="READ"})(Jp||(Jp={}));var ru;(function(t){t[t.ID=15793935]="ID",t[t.START=15790320]="START",t[t.END=986895]="END"})(ru||(ru={}));A();var Xg=class t{static create(e,r){return new t(e.channel(r))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#n=Gt.create(0);#a=_.None;#s=_.None;#o=_.None;#c=-1;#l=-1;#u=!1;#m=!1;#v=0;constructor(e){this.#i=Jo.sender(e,({dispatchAndForget:r})=>new class{sendShareLock(n){r(this.sendShareLock,n)}sendUpdateData(n){r(this.sendUpdateData,n)}sendUpdateStructure(n){r(this.sendUpdateStructure,n)}})}flush(){let e=this.#d();if(e.nonEmpty()){this.#m||(this.#i.sendShareLock(this.#t),this.#m=!0),this.#i.sendUpdateStructure(e.unwrap());let r=this.#e.length,n=this.#p(),i=r+n;if(this.#a.isEmpty()||this.#a.unwrap().byteLength<i||r!==this.#v){let o=_g(i),s=new SharedArrayBuffer(o);this.#s=_.wrap(new Uint8Array(s,0,r)),this.#n=Gt.use(s,r),this.#a=_.wrap(s),this.#v=r,this.#i.sendUpdateData(s)}}this.#a.isEmpty()||Atomics.load(this.#r,0)===Jp.WRITE&&(this.#f(this.#n),this.#n.position=0,Atomics.store(this.#r,0,Jp.READ))}broadcastFloat(e,r){return this.#h(new class{type=es.Float;address=e;capacity=8;put(n,i){n.writeFloat(r())}})}broadcastInteger(e,r){return this.#h(new class{type=es.Integer;address=e;capacity=8;put(n,i){n.writeInt(r())}})}broadcastFloats(e,r,n){return this.#h(new class{type=es.FloatArray;address=e;capacity=4+(r.byteLength<<2);put(i,a){n?.(a),i.writeInt(r.length);for(let o of r)i.writeFloat(o)}})}broadcastIntegers(e,r,n){return this.#h(new class{type=es.IntegerArray;address=e;capacity=4+(r.byteLength<<2);put(i,a){n(a),i.writeInt(r.length),r.forEach(o=>i.writeInt(o))}})}broadcastByteArray(e,r,n){return this.#h(new class{type=es.ByteArray;address=e;capacity=4+r.byteLength;put(i,a){n(a),i.writeInt(r.byteLength),i.writeBytes(r)}})}#d(){if(this.#u){try{this.#o=_.wrap(this.#g())}catch(e){throw e}this.#u=!1}if(this.#o.nonEmpty()){let e=this.#o;return this.#o=_.None,e}return _.None}#p(){return this.#l===-1&&(this.#l=this.#y()+12),this.#l}terminate(){ie.clear(this.#e),this.#o=_.None,this.#u=!1,this.#l=0}#f(e){ee(!this.#u&&this.#o.isEmpty(),"Cannot flush while update is available");let r=this.#p();ee(e.remaining>=r,"Insufficient data"),e.writeInt(this.#c),e.writeInt(ru.START);let n=this.#s;for(let i=0;i<this.#e.length;i++){let a=n.nonEmpty()&&n.unwrap()[i]!==0;this.#e[i].put(e,a)}e.writeInt(ru.END)}#y(){return this.#e.reduce((e,r)=>e+r.capacity,0)}#h(e){return this.#e.push(e),this.#x(),{terminate:()=>{ie.removeOpt(this.#e,e),this.#x()}}}#x(){this.#l=-1,this.#u=!0}#g(){let e=Gt.create();e.writeInt(ru.ID),e.writeInt(++this.#c),e.writeInt(this.#e.length);for(let{address:r,type:n}of this.#e)r.write(e),e.writeByte(n);return e.toArrayBuffer()}};A();var ok;(function(t){t.NoSync="nosync",t.Pitch="pitch",t.Timestretch="timestretch",t.AudioFit="audiofit"})(ok||(ok={}));var sk;(function(t){t[t.Pre=0]="Pre",t[t.Post=1]="Post"})(sk||(sk={}));var Tt;(function(t){t.Instrument="instrument",t.Bus="bus",t.Aux="aux",t.Output="output"})(Tt||(Tt={}));A();var ts={white:new lr(0,0,100),blue:new lr(189,100,65),green:new lr(150,77,69),yellow:new lr(60,100,84),cream:new lr(65,20,83),orange:new lr(31,100,73),red:new lr(354,100,65),purple:new lr(314,100,78),bright:new lr(197,5,95),gray:new lr(197,31,88),dark:new lr(197,15,70),shadow:new lr(197,10,55),black:new lr(197,10,25),background:new lr(197,8,9),panelBackground:new lr(197,14,12),panelBackgroundBright:new lr(197,13,19),panelBackgroundDark:new lr(197,14,11)};var We;(function(t){t[t.Add=0]="Add",t[t.Adsr=1]="Adsr",t[t.ArrowDown=2]="ArrowDown",t[t.ArrowLeft=3]="ArrowLeft",t[t.ArrowRight=4]="ArrowRight",t[t.ArrowUp=5]="ArrowUp",t[t.AudioBus=6]="AudioBus",t[t.AudioDevice=7]="AudioDevice",t[t.AudioFile=8]="AudioFile",t[t.AutoGain=9]="AutoGain",t[t.Automation=10]="Automation",t[t.BassGuitar=11]="BassGuitar",t[t.Book=12]="Book",t[t.Box=13]="Box",t[t.Browse=14]="Browse",t[t.Bug=15]="Bug",t[t.Capture=16]="Capture",t[t.Chain=17]="Chain",t[t.ChatEmpty=18]="ChatEmpty",t[t.ChatMessage=19]="ChatMessage",t[t.Copy=20]="Copy",t[t.Maximizer=21]="Maximizer",t[t.Fold=22]="Fold",t[t.Folder=23]="Folder",t[t.Charts=24]="Charts",t[t.Checkbox=25]="Checkbox",t[t.Clips=26]="Clips",t[t.Close=27]="Close",t[t.CloudFolder=28]="CloudFolder",t[t.Code=29]="Code",t[t.CollapseDown=30]="CollapseDown",t[t.Compressor=31]="Compressor",t[t.Connected=32]="Connected",t[t.Cube=33]="Cube",t[t.Cursor=34]="Cursor",t[t.Curve=35]="Curve",t[t.Dattorro=36]="Dattorro",t[t.Delete=37]="Delete",t[t.Dial=38]="Dial",t[t.DinSlot=39]="DinSlot",t[t.Disconnected=40]="Disconnected",t[t.Divide=41]="Divide",t[t.DragConnections=42]="DragConnections",t[t.Dropdown=43]="Dropdown",t[t.Dropbox=44]="Dropbox",t[t.DrumSet=45]="DrumSet",t[t.Tidal=46]="Tidal",t[t.Duration=47]="Duration",t[t.EditBox=48]="EditBox",t[t.Effects=49]="Effects",t[t.Embed=50]="Embed",t[t.EQ=51]="EQ",t[t.Eraser=52]="Eraser",t[t.Exclude=53]="Exclude",t[t.Exit=54]="Exit",t[t.ExpandWidth=55]="ExpandWidth",t[t.FileList=56]="FileList",t[t.Film=57]="Film",t[t.Flask=58]="Flask",t[t.Focus=59]="Focus",t[t.Fullscreen=60]="Fullscreen",t[t.Gate=61]="Gate",t[t.Generator=62]="Generator",t[t.GoogleDrive=63]="GoogleDrive",t[t.Nextcloud=64]="Nextcloud",t[t.Groove=65]="Groove",t[t.Guitar=66]="Guitar",t[t.GuitarTab=67]="GuitarTab",t[t.Headphone=68]="Headphone",t[t.Heart=69]="Heart",t[t.Help=70]="Help",t[t.HighPass=71]="HighPass",t[t.HighShelf=72]="HighShelf",t[t.Insert=73]="Insert",t[t.InsertDown=74]="InsertDown",t[t.Invert=75]="Invert",t[t.Info=76]="Info",t[t.Lock=77]="Lock",t[t.Loop=78]="Loop",t[t.LoopEnd=79]="LoopEnd",t[t.LoopStart=80]="LoopStart",t[t.LowPass=81]="LowPass",t[t.LowShelf=82]="LowShelf",t[t.Magnet=83]="Magnet",t[t.MainMenu=84]="MainMenu",t[t.Maximized=85]="Maximized",t[t.Menu=86]="Menu",t[t.Merge=87]="Merge",t[t.Metronome=88]="Metronome",t[t.Microphone=89]="Microphone",t[t.Midi=90]="Midi",t[t.Minimized=91]="Minimized",t[t.Mix=92]="Mix",t[t.Mixing=93]="Mixing",t[t.Mute=94]="Mute",t[t.NanoWave=95]="NanoWave",t[t.NeuralAmp=96]="NeuralAmp",t[t.New=97]="New",t[t.NoAudio=98]="NoAudio",t[t.Note=99]="Note",t[t.NotePad=100]="NotePad",t[t.Notification=101]="Notification",t[t.OpenDAW=102]="OpenDAW",t[t.Panel=103]="Panel",t[t.Paste=104]="Paste",t[t.Peak=105]="Peak",t[t.Pencil=106]="Pencil",t[t.Piano=107]="Piano",t[t.Play=108]="Play",t[t.Playfield=109]="Playfield",t[t.PlayOnce=110]="PlayOnce",t[t.PlayRepeat=111]="PlayRepeat",t[t.PlayAlternate=112]="PlayAlternate",t[t.Pointer=113]="Pointer",t[t.Popout=114]="Popout",t[t.Primary=115]="Primary",t[t.Random=116]="Random",t[t.Record=117]="Record",t[t.Rectangle=118]="Rectangle",t[t.Redo=119]="Redo",t[t.Region=120]="Region",t[t.Robot=121]="Robot",t[t.RoundDown=122]="RoundDown",t[t.RoundUp=123]="RoundUp",t[t.Run=124]="Run",t[t.Sawtooth=125]="Sawtooth",t[t.Saxophone=126]="Saxophone",t[t.Scissors=127]="Scissors",t[t.Search=128]="Search",t[t.Share=129]="Share",t[t.SelectDown=130]="SelectDown",t[t.SelectUp=131]="SelectUp",t[t.Shadertoy=132]="Shadertoy",t[t.Shutdown=133]="Shutdown",t[t.Signalsmith=134]="Signalsmith",t[t.Sine=135]="Sine",t[t.Solo=136]="Solo",t[t.SoundFont=137]="SoundFont",t[t.Speaker=138]="Speaker",t[t.SpeakerHeadphone=139]="SpeakerHeadphone",t[t.Square=140]="Square",t[t.Stack=141]="Stack",t[t.Start=142]="Start",t[t.Stereo=143]="Stereo",t[t.Stop=144]="Stop",t[t.Subtract=145]="Subtract",t[t.Sun=146]="Sun",t[t.Swap=147]="Swap",t[t.System=148]="System",t[t.Table=149]="Table",t[t.Tape=150]="Tape",t[t.TapeReel=151]="TapeReel",t[t.Time=152]="Time",t[t.Timeline=153]="Timeline",t[t.Tone3000=154]="Tone3000",t[t.Tool=155]="Tool",t[t.Triangle=156]="Triangle",t[t.Undo=157]="Undo",t[t.Unknown=158]="Unknown",t[t.UserFolder=159]="UserFolder",t[t.Velocity=160]="Velocity",t[t.Vinyl=161]="Vinyl",t[t.Vocoder=162]="Vocoder",t[t.Volume=163]="Volume",t[t.VUMeter=164]="VUMeter",t[t.Warning=165]="Warning",t[t.Waveform=166]="Waveform",t[t.Zeitgeist=167]="Zeitgeist",t[t.Github=168]="Github",t[t.Discord=169]="Discord",t[t.Instagram=170]="Instagram",t[t.LinkedIn=171]="LinkedIn",t[t.Neon=172]="Neon",t[t.Ring=173]="Ring",t[t.Noise=174]="Noise",t[t.Vaporisateur=175]="Vaporisateur",t[t.FolderOpen=176]="FolderOpen",t[t.FolderAdd=177]="FolderAdd"})(We||(We={}));(function(t){t.toName=e=>t[e],t.fromName=e=>t[e]??t.Rectangle})(We||(We={}));var l;(function(t){t[t.Deprecated=NaN]="Deprecated",t[t.MetaData=0]="MetaData",t[t.AudioBusses=1]="AudioBusses",t[t.AudioConnection=2]="AudioConnection",t[t.AudioEffectHost=3]="AudioEffectHost",t[t.AudioFile=4]="AudioFile",t[t.AudioOutput=5]="AudioOutput",t[t.AudioPlayMode=6]="AudioPlayMode",t[t.AudioUnit=7]="AudioUnit",t[t.AudioUnits=8]="AudioUnits",t[t.Automation=9]="Automation",t[t.AuxSend=10]="AuxSend",t[t.Capture=11]="Capture",t[t.ClipCollection=12]="ClipCollection",t[t.ConnectionCollection=13]="ConnectionCollection",t[t.Device=14]="Device",t[t.DeviceUserInterface=15]="DeviceUserInterface",t[t.Editing=16]="Editing",t[t.FileUploadState=17]="FileUploadState",t[t.Groove=18]="Groove",t[t.InstrumentHost=19]="InstrumentHost",t[t.MarkerEvents=20]="MarkerEvents",t[t.MarkerTrack=21]="MarkerTrack",t[t.MIDIControl=22]="MIDIControl",t[t.MIDIControllers=23]="MIDIControllers",t[t.MIDIDevice=24]="MIDIDevice",t[t.MIDIEffectHost=25]="MIDIEffectHost",t[t.ModularSetup=26]="ModularSetup",t[t.Modulation=27]="Modulation",t[t.ModuleCollection=28]="ModuleCollection",t[t.NoteEventCollection=29]="NoteEventCollection",t[t.NoteEventFeature=30]="NoteEventFeature",t[t.NoteEvents=31]="NoteEvents",t[t.NotesConnection=32]="NotesConnection",t[t.Parameter=33]="Parameter",t[t.ParameterController=34]="ParameterController",t[t.PianoMode=35]="PianoMode",t[t.ProjectMeta=36]="ProjectMeta",t[t.RegionCollection=37]="RegionCollection",t[t.Sample=38]="Sample",t[t.Selection=39]="Selection",t[t.Shadertoy=40]="Shadertoy",t[t.SideChain=41]="SideChain",t[t.SignatureAutomation=42]="SignatureAutomation",t[t.SoundfontFile=43]="SoundfontFile",t[t.StepAutomation=44]="StepAutomation",t[t.Timeline=45]="Timeline",t[t.TrackCollection=46]="TrackCollection",t[t.TransientMarkers=47]="TransientMarkers",t[t.User=48]="User",t[t.ValueEventCollection=49]="ValueEventCollection",t[t.ValueEvents=50]="ValueEvents",t[t.ValueInterpolation=51]="ValueInterpolation",t[t.VoltageConnection=52]="VoltageConnection",t[t.WarpMarkers=53]="WarpMarkers",t[t.NeuralAmpModel=54]="NeuralAmpModel",t[t.CompositeCell=55]="CompositeCell",t[t.AudioEffectCompositeCell=56]="AudioEffectCompositeCell",t[t.Pattern=57]="Pattern"})(l||(l={}));var Qg;(function(t){t[t.Once=0]="Once",t[t.Repeat=1]="Repeat",t[t.Pingpong=2]="Pingpong"})(Qg||(Qg={}));var Ma;(function(t){t[t.Monophonic=0]="Monophonic",t[t.Polyphonic=1]="Polyphonic"})(Ma||(Ma={}));A();rt();A();A();A();var lk=(t,e)=>{if(t===e)return 0;let r=t-e;return r===0?W(`Indices cannot be equal (${t}, ${e})`):r};var yo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},zr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ev,Jn,rs,tv,wo,jt=class t{static create(e,r,n){return new t(e,r,n)}constructor(e,r,n){ev.set(this,void 0),Jn.set(this,void 0),rs.set(this,void 0),tv.set(this,void 0),wo.set(this,null),yo(this,ev,e,"f"),yo(this,Jn,k.newSet(i=>i.adapter.uuid),"f"),yo(this,rs,new dr,"f"),yo(this,tv,e.pointerHub.catchupAndSubscribe({onAdded:i=>{yo(this,wo,null,"f");let a=r(i.box),o=a.indexField.subscribe(()=>{yo(this,wo,null,"f"),zr(this,rs,"f").proxy.onReorder(a)}),s=zr(this,Jn,"f").add({adapter:a,subscription:o});ee(s,`Could not add ${a}`),zr(this,rs,"f").proxy.onAdd(a)},onRemoved:i=>{yo(this,wo,null,"f");let a=i.box.address.uuid,{adapter:o,subscription:s}=zr(this,Jn,"f").removeByKey(a);s.terminate(),zr(this,rs,"f").proxy.onRemove(o)}},n),"f")}field(){return zr(this,ev,"f")}subscribe(e){return zr(this,rs,"f").subscribe(e)}catchupAndSubscribe(e){return zr(this,Jn,"f").forEach(({adapter:r})=>e.onAdd(r)),this.subscribe(e)}getAdapterByIndex(e){let r=vt.exactMapped(this.adapters(),e,lk,n=>n.indexField.getValue());return r===-1?_.None:_.wrap(this.adapters()[r])}getAdapterById(e){return zr(this,Jn,"f").opt(e).map(({adapter:r})=>r)}getMinFreeIndex(){let e=this.adapters();for(let r=0;r<e.length;r++)if(e[r].indexField.getValue()>r)return r;return e.length}adapters(){return zr(this,wo,"f")===null&&yo(this,wo,zr(this,Jn,"f").values().map(({adapter:e})=>e).filter(e=>e.box.isAttached()).sort((e,r)=>e.indexField.getValue()-r.indexField.getValue()),"f"),zr(this,wo,"f")}move(e,r){this.moveIndex(e.indexField.getValue(),r)}moveIndex(e,r){if(r===0)return;let n=this.adapters(),i=n[e],a=Se(e+r,0,n.length-1);if(a!==e){if(r<0)for(let o=a;o<e;o++)n[o].indexField.setValue(o+1);else for(let o=e;o<a;o++)n[o+1].indexField.setValue(o);i.indexField.setValue(a)}}size(){return zr(this,Jn,"f").size()}isEmpty(){return this.size()===0}terminate(){yo(this,wo,null,"f"),zr(this,Jn,"f").forEach(({subscription:e})=>e.terminate()),zr(this,Jn,"f").clear(),zr(this,rs,"f").terminate(),zr(this,tv,"f").terminate()}};ev=new WeakMap,Jn=new WeakMap,rs=new WeakMap,tv=new WeakMap,wo=new WeakMap;A();rt();A();A();var bo;(function(t){t.names=["MetaDataBox","ProjectMetaBox","RootBox","SelectionBox","UserInterfaceBox","UploadFileBox","ShadertoyBox","MIDIControllerBox","TimelineBox","TrackBox","NoteEventBox","NoteEventRepeatBox","NoteEventCollectionBox","NoteRegionBox","NoteClipBox","ValueEventBox","ValueEventCollectionBox","ValueEventCurveBox","ValueRegionBox","ValueClipBox","SignatureEventBox","AudioRegionBox","AudioClipBox","AudioPitchStretchBox","AudioTimeStretchBox","AudioSignalsmithBox","TransientMarkerBox","WarpMarkerBox","MarkerBox","AudioFileBox","SoundfontFileBox","NeuralAmpModelBox","AudioUnitBox","CaptureAudioBox","CaptureMidiBox","AudioBusBox","AuxSendBox","GrooveShuffleBox","UnknownAudioEffectDeviceBox","UnknownMidiEffectDeviceBox","DeviceInterfaceKnobBox","ModularDeviceBox","StereoToolDeviceBox","MaximizerDeviceBox","CompressorDeviceBox","GateDeviceBox","DelayDeviceBox","AutotuneDeviceBox","CrusherDeviceBox","DattorroReverbDeviceBox","VelocityDeviceBox","FoldDeviceBox","TidalDeviceBox","RevampDeviceBox","ReverbDeviceBox","VaporisateurDeviceBox","MIDIOutputDeviceBox","MIDIOutputBox","MIDIOutputParameterBox","SoundfontDeviceBox","NeonDeviceBox","NanoDeviceBox","PlayfieldDeviceBox","PlayfieldSampleBox","TapeDeviceBox","ArpeggioDeviceBox","PitchDeviceBox","ZeitgeistDeviceBox","NeuralAmpDeviceBox","VocoderDeviceBox","WaveshaperDeviceBox","WerkstattDeviceBox","WerkstattParameterBox","WerkstattSampleBox","SpielwerkDeviceBox","ApparatDeviceBox","CubedDeviceBox","NoopInstrumentBox","CompositeDeviceBox","CompositeCellBox","AudioEffectCompositeBox","AudioEffectCompositeCellBox","StereoCompositeBox","FrequencySplitBox","ModularBox","ModuleConnectionBox","ModularAudioInputBox","ModularAudioOutputBox","ModuleDelayBox","ModuleMultiplierBox","ModuleGainBox"],t.create=(e,r,n,i)=>{switch(e){case"MetaDataBox":return Yn.create(r,n,i);case"ProjectMetaBox":return rv.create(r,n,i);case"RootBox":return is.create(r,n,i);case"SelectionBox":return Na.create(r,n,i);case"UserInterfaceBox":return _o.create(r,n,i);case"UploadFileBox":return iv.create(r,n,i);case"ShadertoyBox":return nv.create(r,n,i);case"MIDIControllerBox":return av.create(r,n,i);case"TimelineBox":return xl.create(r,n,i);case"TrackBox":return _i.create(r,n,i);case"NoteEventBox":return ns.create(r,n,i);case"NoteEventRepeatBox":return ov.create(r,n,i);case"NoteEventCollectionBox":return Fo.create(r,n,i);case"NoteRegionBox":return yl.create(r,n,i);case"NoteClipBox":return iu.create(r,n,i);case"ValueEventBox":return Xn.create(r,n,i);case"ValueEventCollectionBox":return Qn.create(r,n,i);case"ValueEventCurveBox":return as.create(r,n,i);case"ValueRegionBox":return wl.create(r,n,i);case"ValueClipBox":return nu.create(r,n,i);case"SignatureEventBox":return au.create(r,n,i);case"AudioRegionBox":return os.create(r,n,i);case"AudioClipBox":return ou.create(r,n,i);case"AudioPitchStretchBox":return su.create(r,n,i);case"AudioTimeStretchBox":return lu.create(r,n,i);case"AudioSignalsmithBox":return cu.create(r,n,i);case"TransientMarkerBox":return sv.create(r,n,i);case"WarpMarkerBox":return $a.create(r,n,i);case"MarkerBox":return uu.create(r,n,i);case"AudioFileBox":return dn.create(r,n,i);case"SoundfontFileBox":return ka.create(r,n,i);case"NeuralAmpModelBox":return lv.create(r,n,i);case"AudioUnitBox":return it.create(r,n,i);case"CaptureAudioBox":return Ia.create(r,n,i);case"CaptureMidiBox":return Ba.create(r,n,i);case"AudioBusBox":return ea.create(r,n,i);case"AuxSendBox":return du.create(r,n,i);case"GrooveShuffleBox":return pu.create(r,n,i);case"UnknownAudioEffectDeviceBox":return cv.create(r,n,i);case"UnknownMidiEffectDeviceBox":return uv.create(r,n,i);case"DeviceInterfaceKnobBox":return dv.create(r,n,i);case"ModularDeviceBox":return pv.create(r,n,i);case"StereoToolDeviceBox":return fv.create(r,n,i);case"MaximizerDeviceBox":return fu.create(r,n,i);case"CompressorDeviceBox":return hv.create(r,n,i);case"GateDeviceBox":return mv.create(r,n,i);case"DelayDeviceBox":return gv.create(r,n,i);case"AutotuneDeviceBox":return vv.create(r,n,i);case"CrusherDeviceBox":return xv.create(r,n,i);case"DattorroReverbDeviceBox":return yv.create(r,n,i);case"VelocityDeviceBox":return wv.create(r,n,i);case"FoldDeviceBox":return bv.create(r,n,i);case"TidalDeviceBox":return _v.create(r,n,i);case"RevampDeviceBox":return Fv.create(r,n,i);case"ReverbDeviceBox":return Av.create(r,n,i);case"VaporisateurDeviceBox":return hu.create(r,n,i);case"MIDIOutputDeviceBox":return mu.create(r,n,i);case"MIDIOutputBox":return ss.create(r,n,i);case"MIDIOutputParameterBox":return bl.create(r,n,i);case"SoundfontDeviceBox":return gu.create(r,n,i);case"NeonDeviceBox":return vu.create(r,n,i);case"NanoDeviceBox":return xu.create(r,n,i);case"PlayfieldDeviceBox":return yu.create(r,n,i);case"PlayfieldSampleBox":return Ta.create(r,n,i);case"TapeDeviceBox":return wu.create(r,n,i);case"ArpeggioDeviceBox":return Ev.create(r,n,i);case"PitchDeviceBox":return Sv.create(r,n,i);case"ZeitgeistDeviceBox":return Pv.create(r,n,i);case"NeuralAmpDeviceBox":return Mv.create(r,n,i);case"VocoderDeviceBox":return Nv.create(r,n,i);case"WaveshaperDeviceBox":return $v.create(r,n,i);case"WerkstattDeviceBox":return kv.create(r,n,i);case"WerkstattParameterBox":return Da.create(r,n,i);case"WerkstattSampleBox":return _l.create(r,n,i);case"SpielwerkDeviceBox":return Iv.create(r,n,i);case"ApparatDeviceBox":return bu.create(r,n,i);case"CubedDeviceBox":return _u.create(r,n,i);case"NoopInstrumentBox":return Fu.create(r,n,i);case"CompositeDeviceBox":return Bv.create(r,n,i);case"CompositeCellBox":return Tv.create(r,n,i);case"AudioEffectCompositeBox":return Dv.create(r,n,i);case"AudioEffectCompositeCellBox":return Au.create(r,n,i);case"StereoCompositeBox":return Rv.create(r,n,i);case"FrequencySplitBox":return Cv.create(r,n,i);case"ModularBox":return zv.create(r,n,i);case"ModuleConnectionBox":return Ov.create(r,n,i);case"ModularAudioInputBox":return Vv.create(r,n,i);case"ModularAudioOutputBox":return Uv.create(r,n,i);case"ModuleDelayBox":return jv.create(r,n,i);case"ModuleMultiplierBox":return Kv.create(r,n,i);case"ModuleGainBox":return Wv.create(r,n,i);default:return W(`Unknown box class '${e}'`)}},t.deserialize=(e,r)=>{let n=new lt(r),i=n.readString(),a=k.fromDataInput(n),o=t.create(i,e,a);return o.read(n),o}})(bo||(bo={}));A();var Yn=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MetaDataBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="MetaDataBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMetaDataBox,this)}get tags(){return t.Tags}get target(){return this.getField(1)}get origin(){return this.getField(2)}get value(){return this.getField(3)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"target",deprecated:!1,pointerRules:p},l.MetaData,!0),2:T.create({parent:this,fieldKey:2,fieldName:"origin",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"value",deprecated:!1,pointerRules:p},"{}")}}};A();var rv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ProjectMetaBox",pointerRules:{accepts:[l.ProjectMeta],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ProjectMetaBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitProjectMetaBox,this)}get tags(){return t.Tags}get projectName(){return this.getField(1)}get artist(){return this.getField(2)}get description(){return this.getField(3)}get tagList(){return this.getField(4)}get notepad(){return this.getField(5)}get created(){return this.getField(6)}get modified(){return this.getField(7)}get coverId(){return this.getField(8)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"projectName",deprecated:!1,pointerRules:p}),2:T.create({parent:this,fieldKey:2,fieldName:"artist",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"description",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"tagList",deprecated:!1,pointerRules:p},"[]"),5:T.create({parent:this,fieldKey:5,fieldName:"notepad",deprecated:!1,pointerRules:p}),6:T.create({parent:this,fieldKey:6,fieldName:"created",deprecated:!1,pointerRules:p}),7:T.create({parent:this,fieldKey:7,fieldName:"modified",deprecated:!1,pointerRules:p}),8:T.create({parent:this,fieldKey:8,fieldName:"coverId",deprecated:!1,pointerRules:p})}}};A();var Lv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get keyboard(){return this.getField(1)}get timeRangeInQuarters(){return this.getField(2)}get noteScale(){return this.getField(3)}get noteLabels(){return this.getField(4)}get transpose(){return this.getField(5)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:p},{length:4},"",0),2:F.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:p},{min:1,max:64,scaling:"linear"},"",8),3:F.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:p},{min:.5,max:2,scaling:"linear"},"",1),4:B.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:p},!1),5:N.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-48,max:48},"st",0)}}};var is=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"RootBox",pointerRules:{accepts:[l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="RootBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitRootBox,this)}get tags(){return t.Tags}get timeline(){return this.getField(1)}get users(){return this.getField(2)}get created(){return this.getField(3)}get groove(){return this.getField(4)}get baseFrequency(){return this.getField(5)}get modularSetups(){return this.getField(10)}get audioUnits(){return this.getField(20)}get audioBusses(){return this.getField(21)}get outputDevice(){return this.getField(30)}get outputMidiDevices(){return this.getField(35)}get pianoMode(){return this.getField(40)}get shadertoy(){return this.getField(100)}get projectMeta(){return this.getField(101)}get editingChannel(){return this.getField(111)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:p},l.Timeline,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[l.User],mandatory:!1,exclusive:!1}}),3:T.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:p}),4:I.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0),5:F.create({parent:this,fieldKey:5,fieldName:"baseFrequency",deprecated:!1,pointerRules:p},{min:400,max:480,scaling:"linear"},"Hz",440),10:Z.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!1,exclusive:!1}}),20:Z.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[l.AudioUnits],mandatory:!1,exclusive:!1}}),21:Z.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[l.AudioBusses],mandatory:!1,exclusive:!1}}),30:Z.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!0,exclusive:!1}}),35:Z.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!1,exclusive:!1}}),40:Lv.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:p}),100:I.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:p},l.Shadertoy,!1),101:I.create({parent:this,fieldKey:101,fieldName:"projectMeta",deprecated:!1,pointerRules:p},l.ProjectMeta,!1),111:I.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:p},l.Editing,!1)}}};A();var Na=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SelectionBox",pointerRules:p,resource:void 0,ephemeral:!0}),n)}static ClassName="SelectionBox";static Resource=void 0;static Ephemeral=!0;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitSelectionBox,this)}get tags(){return t.Tags}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:p},l.Selection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:p},l.Selection,!0)}}};A();var _o=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UserInterfaceBox",pointerRules:{accepts:[l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="UserInterfaceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitUserInterfaceBox,this)}get tags(){return t.Tags}get root(){return this.getField(1)}get selection(){return this.getField(10)}get uploadStates(){return this.getField(11)}get editingDeviceChain(){return this.getField(21)}get editingTimelineRegion(){return this.getField(22)}get editingModularSystem(){return this.getField(23)}get midiControllers(){return this.getField(30)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.User,!0),10:Z.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[l.FileUploadState],mandatory:!1,exclusive:!1}}),21:I.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:p},l.Editing,!1),22:I.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:p},l.Editing,!1),23:I.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:p},l.Editing,!1),30:Z.hook({parent:this,fieldKey:30,fieldName:"midiControllers",deprecated:!1,pointerRules:{accepts:[l.MIDIControllers],mandatory:!1,exclusive:!1}})}}};A();var iv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UploadFileBox",pointerRules:p,resource:void 0,ephemeral:!0}),n)}static ClassName="UploadFileBox";static Resource=void 0;static Ephemeral=!0;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitUploadFileBox,this)}get tags(){return t.Tags}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:p},l.FileUploadState,!0),2:I.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.FileUploadState,!0)}}};A();var nv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ShadertoyBox",pointerRules:{accepts:[l.Shadertoy],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ShadertoyBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitShadertoyBox,this)}get tags(){return t.Tags}get shaderCode(){return this.getField(1)}get highres(){return this.getField(2)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"shaderCode",deprecated:!1,pointerRules:p}),2:B.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:p},!0)}}};A();var av=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIControllerBox",pointerRules:p,resource:void 0,ephemeral:!0}),n)}static ClassName="MIDIControllerBox";static Resource=void 0;static Ephemeral=!0;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMIDIControllerBox,this)}get tags(){return t.Tags}get controllers(){return this.getField(1)}get parameter(){return this.getField(2)}get deviceId(){return this.getField(3)}get deviceChannel(){return this.getField(4)}get controlId(){return this.getField(5)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"controllers",deprecated:!1,pointerRules:p},l.MIDIControllers,!0),2:I.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.MIDIControl,!0),3:T.create({parent:this,fieldKey:3,fieldName:"deviceId",deprecated:!1,pointerRules:p}),4:N.create({parent:this,fieldKey:4,fieldName:"deviceChannel",deprecated:!1,pointerRules:p},{min:0,max:127},""),5:N.create({parent:this,fieldKey:5,fieldName:"controlId",deprecated:!1,pointerRules:p},{min:0,max:127},"")}}};A();var Zv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get nominator(){return this.getField(1)}get denominator(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4),2:N.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4)}}};var Gv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get from(){return this.getField(2)}get to(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),2:N.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:p},"any","ppqn",0),3:N.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:p},"any","ppqn",15360)}}};var Hv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get markers(){return this.getField(1)}get index(){return this.getField(10)}get enabled(){return this.getField(20)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),10:N.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),20:B.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var qv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get events(){return this.getField(1)}get index(){return this.getField(10)}get minBpm(){return this.getField(15)}get maxBpm(){return this.getField(16)}get enabled(){return this.getField(20)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!1),10:N.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",2),15:N.create({parent:this,fieldKey:15,fieldName:"minBpm",deprecated:!1,pointerRules:p},{min:30,max:999},"bpm",60),16:N.create({parent:this,fieldKey:16,fieldName:"maxBpm",deprecated:!1,pointerRules:p},{min:31,max:1e3},"bpm",240),20:B.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var Jv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get events(){return this.getField(1)}get index(){return this.getField(10)}get enabled(){return this.getField(20)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.SignatureAutomation],mandatory:!1,exclusive:!1}}),10:N.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",1),20:B.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var xl=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TimelineBox",pointerRules:{accepts:[l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TimelineBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitTimelineBox,this)}get tags(){return t.Tags}get root(){return this.getField(1)}get signature(){return this.getField(10)}get loopArea(){return this.getField(11)}get deprecatedMarkerTrack(){return this.getField(20)}get markerTrack(){return this.getField(21)}get tempoTrack(){return this.getField(22)}get signatureTrack(){return this.getField(23)}get durationInPulses(){return this.getField(30)}get bpm(){return this.getField(31)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[l.Timeline],mandatory:!0,exclusive:!1}}),10:Zv.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:p}),11:Gv.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:p}),20:Z.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!0,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),21:Hv.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:p}),22:qv.create({parent:this,fieldKey:22,fieldName:"tempoTrack",deprecated:!1,pointerRules:p}),23:Jv.create({parent:this,fieldKey:23,fieldName:"signatureTrack",deprecated:!1,pointerRules:p}),30:N.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:p},"positive","ppqn",491520),31:F.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:p},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};A();var _i=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TrackBox",pointerRules:{accepts:[l.Selection,l.PianoMode,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TrackBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitTrackBox,this)}get tags(){return t.Tags}get tracks(){return this.getField(1)}get target(){return this.getField(2)}get regions(){return this.getField(3)}get clips(){return this.getField(4)}get index(){return this.getField(10)}get type(){return this.getField(11)}get enabled(){return this.getField(20)}get excludePianoMode(){return this.getField(30)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:p},l.TrackCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:p},l.Automation,!0),3:Z.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[l.RegionCollection],mandatory:!1,exclusive:!1}}),4:Z.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[l.ClipCollection],mandatory:!1,exclusive:!1}}),10:N.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),11:N.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:p},{values:[0,1,2,3]},""),20:B.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),30:B.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:p},!1)}}};A();var ns=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteEventBox",pointerRules:{accepts:[l.Selection,l.NoteEventFeature],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteEventBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteEventBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get pitch(){return this.getField(20)}get velocity(){return this.getField(21)}get playCount(){return this.getField(22)}get playCurve(){return this.getField(23)}get cent(){return this.getField(24)}get chance(){return this.getField(25)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEvents,!0),10:N.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:N.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn",240),20:N.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),21:F.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:p},"unipolar","%",.7874015748031497),22:N.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),23:F.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:p},"bipolar","%",0),24:F.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:p},{min:-50,max:50,scaling:"linear"},"ct",0),25:N.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:p},{min:0,max:100},"",100)}}};A();var ov=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteEventRepeatBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="NoteEventRepeatBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteEventRepeatBox,this)}get tags(){return t.Tags}get event(){return this.getField(1)}get count(){return this.getField(2)}get curve(){return this.getField(3)}get length(){return this.getField(4)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.NoteEventFeature,!0),2:N.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),3:F.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:p},"bipolar","%",0),4:F.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:p},"unipolar","%",1)}}};A();var Fo=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:"shared",ephemeral:!1}),n)}static ClassName="NoteEventCollectionBox";static Resource="shared";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.NoteEvents],mandatory:!1,exclusive:!1}}),2:Z.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.NoteEventCollection],mandatory:!0,exclusive:!1}})}}};A();var yl=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteRegionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteRegionBox,this)}get tags(){return t.Tags}get regions(){return this.getField(1)}get events(){return this.getField(2)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get eventOffset(){return this.getField(14)}get mute(){return this.getField(15)}get label(){return this.getField(16)}get hue(){return this.getField(17)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),10:N.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:N.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:N.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:N.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:N.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:p},"any","ppqn"),15:B.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:p}),16:T.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:p}),17:N.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};A();var ls=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get loop(){return this.getField(1)}get reverse(){return this.getField(2)}get mute(){return this.getField(3)}get speed(){return this.getField(4)}get quantise(){return this.getField(5)}get trigger(){return this.getField(6)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:p},!0),2:B.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:p}),3:B.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:p}),4:N.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:p},"non-negative",""),5:N.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:p},"non-negative",""),6:N.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:p},"non-negative","")}}};var iu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoteClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoteClipBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNoteClipBox,this)}get tags(){return t.Tags}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:ls.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:N.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:B.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:T.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:N.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};A();var Xn=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueEventBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueEventBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueEventBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get position(){return this.getField(10)}get index(){return this.getField(11)}get interpolation(){return this.getField(12)}get value(){return this.getField(13)}get slope(){return this.getField(14)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEvents,!0),10:N.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:N.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:N.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[l.ValueInterpolation],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),13:F.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:p},"any",""),14:F.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:p},"any","",NaN)}}};A();var Qn=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:"shared",ephemeral:!1}),n)}static ClassName="ValueEventCollectionBox";static Resource="shared";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.ValueEvents],mandatory:!1,exclusive:!1}}),2:Z.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.ValueEventCollection],mandatory:!0,exclusive:!1}})}}};A();var as=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueEventCurveBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="ValueEventCurveBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueEventCurveBox,this)}get tags(){return t.Tags}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.ValueInterpolation,!0),2:F.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:p},"unipolar","%",.5)}}};A();var wl=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueRegionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueRegionBox,this)}get tags(){return t.Tags}get regions(){return this.getField(1)}get events(){return this.getField(2)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get mute(){return this.getField(14)}get label(){return this.getField(15)}get hue(){return this.getField(16)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),10:N.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:N.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:N.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:N.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:B.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:T.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:N.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};A();var nu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ValueClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ValueClipBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitValueClipBox,this)}get tags(){return t.Tags}get clips(){return this.getField(1)}get events(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:ls.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:N.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:B.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:T.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:N.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};A();var au=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SignatureEventBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="SignatureEventBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitSignatureEventBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get index(){return this.getField(9)}get relativePosition(){return this.getField(10)}get nominator(){return this.getField(21)}get denominator(){return this.getField(22)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.SignatureAutomation,!0),9:N.create({parent:this,fieldKey:9,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),10:N.create({parent:this,fieldKey:10,fieldName:"relativePosition",deprecated:!1,pointerRules:p},"positive","bars",1),21:N.create({parent:this,fieldKey:21,fieldName:"nominator",deprecated:!1,pointerRules:p},"positive","",4),22:N.create({parent:this,fieldKey:22,fieldName:"denominator",deprecated:!1,pointerRules:p},"positive","",4)}}};A();var Yv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get in(){return this.getField(1)}get out(){return this.getField(2)}get inSlope(){return this.getField(3)}get outSlope(){return this.getField(4)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"in",deprecated:!1,pointerRules:p},"positive","ppqn",0),2:F.create({parent:this,fieldKey:2,fieldName:"out",deprecated:!1,pointerRules:p},"positive","ppqn",0),3:F.create({parent:this,fieldKey:3,fieldName:"inSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.75),4:F.create({parent:this,fieldKey:4,fieldName:"outSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.25)}}};var os=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioRegionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioRegionBox,this)}get tags(){return t.Tags}get regions(){return this.getField(1)}get file(){return this.getField(2)}get playback(){return this.getField(3)}get timeBase(){return this.getField(4)}get events(){return this.getField(5)}get warping(){return this.getField(6)}get waveformOffset(){return this.getField(7)}get playMode(){return this.getField(8)}get position(){return this.getField(10)}get duration(){return this.getField(11)}get loopOffset(){return this.getField(12)}get loopDuration(){return this.getField(13)}get mute(){return this.getField(14)}get label(){return this.getField(15)}get hue(){return this.getField(16)}get gain(){return this.getField(17)}get fading(){return this.getField(18)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:T.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:p},"musical"),5:I.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:I.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:F.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:I.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:N.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:F.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","mixed"),12:F.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","mixed"),13:F.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"any","mixed"),14:B.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:p}),15:T.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:p}),16:N.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),17:F.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),18:Yv.create({parent:this,fieldKey:18,fieldName:"fading",deprecated:!1,pointerRules:p})}}};A();var ou=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioClipBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioClipBox,this)}get tags(){return t.Tags}get clips(){return this.getField(1)}get file(){return this.getField(2)}get index(){return this.getField(3)}get triggerMode(){return this.getField(4)}get events(){return this.getField(5)}get warping(){return this.getField(6)}get waveformOffset(){return this.getField(7)}get playMode(){return this.getField(8)}get duration(){return this.getField(10)}get mute(){return this.getField(11)}get label(){return this.getField(12)}get hue(){return this.getField(13)}get gain(){return this.getField(14)}get playback(){return this.getField(20)}get timeBase(){return this.getField(21)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:ls.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),5:I.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:I.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:F.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:I.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:F.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"any","ppqn"),11:B.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:p}),12:T.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:p}),13:N.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),14:F.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),20:T.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!0,pointerRules:p}),21:T.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:p},"musical")}}};A();var su=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioPitchStretchBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioPitchStretchBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioPitchStretchBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}})}}};A();var lu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioTimeStretchBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioTimeStretchBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioTimeStretchBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}get transientPlayMode(){return this.getField(2)}get playbackRate(){return this.getField(3)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:N.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:p},"positive","enum",2),3:F.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:p},"positive","ratio",1)}}};A();var cu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioSignalsmithBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioSignalsmithBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioSignalsmithBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}get transpose(){return this.getField(2)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:F.create({parent:this,fieldKey:2,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-24,max:24,scaling:"linear"},"st",0)}}};A();var sv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TransientMarkerBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TransientMarkerBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitTransientMarkerBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get position(){return this.getField(2)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.TransientMarkers,!0),2:F.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};A();var $a=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WarpMarkerBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="WarpMarkerBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitWarpMarkerBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get position(){return this.getField(2)}get seconds(){return this.getField(3)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.WarpMarkers,!0),2:N.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:F.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};A();var uu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MarkerBox",pointerRules:{accepts:[l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="MarkerBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMarkerBox,this)}get tags(){return t.Tags}get track(){return this.getField(1)}get position(){return this.getField(2)}get plays(){return this.getField(3)}get label(){return this.getField(4)}get hue(){return this.getField(5)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:p},l.MarkerTrack,!0),2:N.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:N.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:p},"non-negative","",1),4:T.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:N.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};A();var dn=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioFileBox",pointerRules:{accepts:[l.AudioFile,l.FileUploadState,l.MetaData],mandatory:!0,exclusive:!1},resource:"preserved",ephemeral:!1}),n)}static ClassName="AudioFileBox";static Resource="preserved";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioFileBox,this)}get tags(){return t.Tags}get startInSeconds(){return this.getField(1)}get endInSeconds(){return this.getField(2)}get fileName(){return this.getField(3)}get transientMarkers(){return this.getField(10)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),2:F.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),3:T.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[l.TransientMarkers],mandatory:!1,exclusive:!1}})}}};A();var ka=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[l.SoundfontFile],mandatory:!0,exclusive:!1},resource:"preserved",ephemeral:!1}),n)}static ClassName="SoundfontFileBox";static Resource="preserved";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitSoundfontFileBox,this)}get tags(){return t.Tags}get fileName(){return this.getField(1)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:p})}}};A();var lv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NeuralAmpModelBox",pointerRules:{accepts:[l.NeuralAmpModel],mandatory:!0,exclusive:!1},resource:"preserved",ephemeral:!1}),n)}static ClassName="NeuralAmpModelBox";static Resource="preserved";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitNeuralAmpModelBox,this)}get tags(){return t.Tags}get label(){return this.getField(1)}get model(){return this.getField(2)}get packId(){return this.getField(3)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:p}),2:T.create({parent:this,fieldKey:2,fieldName:"model",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"packId",deprecated:!1,pointerRules:p})}}};A();var Xv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get automationCollapsed(){return this.getField(1)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"automationCollapsed",deprecated:!1,pointerRules:p})}}};var it=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[l.Selection,l.Automation,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioUnitBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioUnitBox,this)}get tags(){return t.Tags}get type(){return this.getField(1)}get collection(){return this.getField(2)}get editing(){return this.getField(3)}get index(){return this.getField(11)}get volume(){return this.getField(12)}get panning(){return this.getField(13)}get mute(){return this.getField(14)}get solo(){return this.getField(15)}get tracks(){return this.getField(20)}get midiEffects(){return this.getField(21)}get input(){return this.getField(22)}get audioEffects(){return this.getField(23)}get auxSends(){return this.getField(24)}get output(){return this.getField(25)}get capture(){return this.getField(26)}get userInterface(){return this.getField(30)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"type",deprecated:!1,pointerRules:p},"instrument"),2:I.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioUnits,!0),3:Z.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:N.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:F.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-96,mid:-9,max:6,scaling:"decibel"},"dB"),13:F.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),14:B.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:B.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:Z.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[l.TrackCollection],mandatory:!1,exclusive:!1}}),21:Z.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),22:Z.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost,l.AudioOutput],mandatory:!1,exclusive:!0}}),23:Z.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),24:Z.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[l.AuxSend],mandatory:!1,exclusive:!1}}),25:I.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!1),26:I.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:p},l.Capture,!1),30:Xv.create({parent:this,fieldKey:30,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};A();var Ia=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[l.Capture],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CaptureAudioBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitCaptureAudioBox,this)}get tags(){return t.Tags}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get requestChannels(){return this.getField(10)}get gainDb(){return this.getField(11)}get inputLatency(){return this.getField(12)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:p}),2:T.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:N.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:p},"any","",2),11:F.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:p},"decibel","dB",0),12:F.create({parent:this,fieldKey:12,fieldName:"inputLatency",deprecated:!1,pointerRules:p},"any","s",-2)}}};A();var Ba=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[l.Capture],mandatory:!0,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CaptureMidiBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitCaptureMidiBox,this)}get tags(){return t.Tags}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get channel(){return this.getField(10)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:p}),2:T.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:p},"normal"),10:N.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:p},"any","",-1)}}};A();var ea=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioBusBox",pointerRules:{accepts:[l.SideChain,l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioBusBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioBusBox,this)}get tags(){return t.Tags}get collection(){return this.getField(1)}get output(){return this.getField(2)}get input(){return this.getField(3)}get enabled(){return this.getField(4)}get icon(){return this.getField(5)}get label(){return this.getField(6)}get color(){return this.getField(7)}get minimized(){return this.getField(8)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioBusses,!0),2:I.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:Z.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!1,exclusive:!1}}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:T.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:p}),6:T.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:p}),7:T.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:p},"red"),8:B.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:p})}}};A();var du=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AuxSendBox",pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AuxSendBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAuxSendBox,this)}get tags(){return t.Tags}get audioUnit(){return this.getField(1)}get targetBus(){return this.getField(2)}get index(){return this.getField(3)}get routing(){return this.getField(4)}get sendGain(){return this.getField(5)}get sendPan(){return this.getField(6)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:p},l.AuxSend,!0),2:I.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:N.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:p},{values:[0,1]},"",1),5:F.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB"),6:F.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};A();var pu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[l.Groove],mandatory:!0,exclusive:!1},resource:"internal",ephemeral:!1}),n)}static ClassName="GrooveShuffleBox";static Resource="internal";static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitGrooveShuffleBox,this)}get tags(){return t.Tags}get label(){return this.getField(1)}get amount(){return this.getField(10)}get duration(){return this.getField(11)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:p}),10:F.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6),11:N.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"non-negative","ppqn",480)}}};A();var cv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="UnknownAudioEffectDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitUnknownAudioEffectDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get comment(){return this.getField(10)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};A();var uv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="UnknownMidiEffectDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitUnknownMidiEffectDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get comment(){return this.getField(10)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:p})}}};A();var dv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="DeviceInterfaceKnobBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitDeviceInterfaceKnobBox,this)}get tags(){return t.Tags}get userInterface(){return this.getField(1)}get parameter(){return this.getField(2)}get index(){return this.getField(3)}get anchor(){return this.getField(10)}get color(){return this.getField(11)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:p},l.DeviceUserInterface,!0),2:I.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.ParameterController,!0),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),10:F.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:p},"unipolar","%"),11:T.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:p})}}};A();var Qv=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:Z.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[l.DeviceUserInterface],mandatory:!1,exclusive:!1}})}}};var pv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModularDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitModularDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modularSetup(){return this.getField(10)}get userInterface(){return this.getField(11)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:p},l.ModularSetup,!0),11:Qv.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};A();var fv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="StereoToolDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitStereoToolDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get panning(){return this.getField(11)}get stereo(){return this.getField(12)}get invertL(){return this.getField(13)}get invertR(){return this.getField(14)}get swap(){return this.getField(15)}get panningMixing(){return this.getField(20)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-72,mid:0,max:12,scaling:"decibel"},"dB",0),11:F.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),12:F.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),13:B.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),14:B.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:B.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:N.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:p},{values:[0,1]},"",0)}}};A();var fu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MaximizerDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="MaximizerDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitMaximizerDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lookahead(){return this.getField(10)}get threshold(){return this.getField(11)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:p},!0),11:F.create({parent:this,fieldKey:11,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:0,scaling:"linear"},"dB",0)}}};A();var hv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CompressorDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitCompressorDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lookahead(){return this.getField(10)}get automakeup(){return this.getField(11)}get autoattack(){return this.getField(12)}get autorelease(){return this.getField(13)}get inputgain(){return this.getField(14)}get threshold(){return this.getField(15)}get ratio(){return this.getField(16)}get knee(){return this.getField(17)}get attack(){return this.getField(18)}get release(){return this.getField(19)}get makeup(){return this.getField(20)}get mix(){return this.getField(21)}get sideChain(){return this.getField(30)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:B.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),11:B.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!0),12:B.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),13:B.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),14:F.create({parent:this,fieldKey:14,fieldName:"inputgain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-30,max:30,scaling:"linear"},"dB",0),15:F.create({parent:this,fieldKey:15,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-60,max:0,scaling:"linear"},"dB",-10),16:F.create({parent:this,fieldKey:16,fieldName:"ratio",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:24,scaling:"exponential"},"",2),17:F.create({parent:this,fieldKey:17,fieldName:"knee",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),18:F.create({parent:this,fieldKey:18,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:100,scaling:"linear"},"ms",0),19:F.create({parent:this,fieldKey:19,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:5,max:1500,scaling:"linear"},"ms",25),20:F.create({parent:this,fieldKey:20,fieldName:"makeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-40,max:40,scaling:"linear"},"dB",0),21:F.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),30:I.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};A();var mv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"GateDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="GateDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitGateDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get threshold(){return this.getField(10)}get return(){return this.getField(11)}get attack(){return this.getField(12)}get hold(){return this.getField(13)}get release(){return this.getField(14)}get floor(){return this.getField(15)}get inverse(){return this.getField(16)}get sideChain(){return this.getField(30)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-80,max:0,scaling:"linear"},"dB",-6),11:F.create({parent:this,fieldKey:11,fieldName:"return",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),12:F.create({parent:this,fieldKey:12,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",1),13:F.create({parent:this,fieldKey:13,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:500,scaling:"linear"},"ms",50),14:F.create({parent:this,fieldKey:14,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:2e3,scaling:"linear"},"ms",100),15:F.create({parent:this,fieldKey:15,fieldName:"floor",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-72,max:0,scaling:"linear"},"dB",-72),16:B.create({parent:this,fieldKey:16,fieldName:"inverse",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),30:I.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};A();var gv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="DelayDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitDelayDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get delayMusical(){return this.getField(10)}get feedback(){return this.getField(11)}get cross(){return this.getField(12)}get filter(){return this.getField(13)}get wet(){return this.getField(14)}get dry(){return this.getField(15)}get preSyncTimeLeft(){return this.getField(16)}get preMillisTimeLeft(){return this.getField(17)}get preSyncTimeRight(){return this.getField(19)}get preMillisTimeRight(){return this.getField(20)}get delayMillis(){return this.getField(22)}get lfoSpeed(){return this.getField(23)}get lfoDepth(){return this.getField(24)}get version(){return this.getField(99)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"delayMusical",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",13),11:F.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),12:F.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:F.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:F.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),15:F.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),16:F.create({parent:this,fieldKey:16,fieldName:"preSyncTimeLeft",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",8),17:F.create({parent:this,fieldKey:17,fieldName:"preMillisTimeLeft",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),19:F.create({parent:this,fieldKey:19,fieldName:"preSyncTimeRight",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",0),20:F.create({parent:this,fieldKey:20,fieldName:"preMillisTimeRight",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),22:F.create({parent:this,fieldKey:22,fieldName:"delayMillis",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),23:F.create({parent:this,fieldKey:23,fieldName:"lfoSpeed",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.1,max:5,scaling:"exponential"},"Hz",.1),24:F.create({parent:this,fieldKey:24,fieldName:"lfoDepth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:50,scaling:"linear"},"ms",0),99:N.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};A();var vv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AutotuneDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AutotuneDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitAutotuneDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get key(){return this.getField(10)}get scale(){return this.getField(11)}get amount(){return this.getField(12)}get retune(){return this.getField(13)}get shift(){return this.getField(14)}get smooth(){return this.getField(15)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"key",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:11},"",0),11:N.create({parent:this,fieldKey:11,fieldName:"scale",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:7},"",1),12:F.create({parent:this,fieldKey:12,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:F.create({parent:this,fieldKey:13,fieldName:"retune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),14:F.create({parent:this,fieldKey:14,fieldName:"shift",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-12,max:12,scaling:"linear"},"st",0),15:F.create({parent:this,fieldKey:15,fieldName:"smooth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6)}}};A();var xv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CrusherDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitCrusherDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get crush(){return this.getField(10)}get bits(){return this.getField(11)}get boost(){return this.getField(12)}get mix(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),11:N.create({parent:this,fieldKey:11,fieldName:"bits",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:16},"bits",16),12:F.create({parent:this,fieldKey:12,fieldName:"boost",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:24,scaling:"linear"},"dB",0),13:F.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:1,scaling:"exponential"},"%",1)}}};A();var yv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"DattorroReverbDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="DattorroReverbDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitDattorroReverbDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get preDelay(){return this.getField(10)}get bandwidth(){return this.getField(11)}get inputDiffusion1(){return this.getField(12)}get inputDiffusion2(){return this.getField(13)}get decay(){return this.getField(14)}get decayDiffusion1(){return this.getField(15)}get decayDiffusion2(){return this.getField(16)}get damping(){return this.getField(17)}get excursionRate(){return this.getField(18)}get excursionDepth(){return this.getField(19)}get wet(){return this.getField(20)}get dry(){return this.getField(21)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),11:F.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.9999),12:F.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),13:F.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.625),14:F.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),15:F.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),16:F.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),17:F.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.005),18:F.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),19:F.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),20:F.create({parent:this,fieldKey:20,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),21:F.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};A();var wv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"VelocityDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="VelocityDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitVelocityDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get magnetPosition(){return this.getField(10)}get magnetStrength(){return this.getField(11)}get randomSeed(){return this.getField(12)}get randomAmount(){return this.getField(13)}get offset(){return this.getField(14)}get mix(){return this.getField(15)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:F.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:N.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",2048),13:F.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),14:F.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),15:F.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};A();var bv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="FoldDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitFoldDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get drive(){return this.getField(10)}get overSampling(){return this.getField(11)}get volume(){return this.getField(12)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"drive",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:30,scaling:"linear"},"dB",0),11:N.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:p},{length:3},"",0),12:F.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-18,max:0,scaling:"linear"},"dB",0)}}};A();var _v=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TidalDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TidalDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitTidalDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get slope(){return this.getField(10)}get symmetry(){return this.getField(11)}get rate(){return this.getField(20)}get depth(){return this.getField(21)}get offset(){return this.getField(22)}get channelOffset(){return this.getField(23)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",-.25),11:F.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),20:F.create({parent:this,fieldKey:20,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:16,scaling:"linear"},"",3),21:F.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","",1),22:F.create({parent:this,fieldKey:22,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0),23:F.create({parent:this,fieldKey:23,fieldName:"channelOffset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0)}}};A();var Yp=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get order(){return this.getField(11)}get q(){return this.getField(12)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:F.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:N.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},""),12:F.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Xp=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get gain(){return this.getField(11)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:F.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:F.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB")}}};var Eu=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get enabled(){return this.getField(1)}get frequency(){return this.getField(10)}get gain(){return this.getField(11)}get q(){return this.getField(12)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:F.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:F.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB"),12:F.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Fv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="RevampDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitRevampDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get highPass(){return this.getField(10)}get lowShelf(){return this.getField(11)}get lowBell(){return this.getField(12)}get midBell(){return this.getField(13)}get highBell(){return this.getField(14)}get highShelf(){return this.getField(15)}get lowPass(){return this.getField(16)}get gain(){return this.getField(17)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Yp.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:p}),11:Xp.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:p}),12:Eu.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:p}),13:Eu.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:p}),14:Eu.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:p}),15:Xp.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:p}),16:Yp.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:p}),17:F.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-18,max:18,scaling:"linear"},"db")}}};A();var Av=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ReverbDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitReverbDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get decay(){return this.getField(10)}get preDelay(){return this.getField(11)}get damp(){return this.getField(12)}get filter(){return this.getField(13)}get wet(){return this.getField(14)}get dry(){return this.getField(15)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:F.create({parent:this,fieldKey:11,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:.5,scaling:"exponential"},"s",0),12:F.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),13:F.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:F.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-3),15:F.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};A();var ex=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get waveform(){return this.getField(1)}get volume(){return this.getField(2)}get octave(){return this.getField(3)}get tune(){return this.getField(4)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1,2,3]},""),2:F.create({parent:this,fieldKey:2,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","db",-1/0),3:N.create({parent:this,fieldKey:3,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-3,max:3},"oct",0),4:F.create({parent:this,fieldKey:4,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct")}}};var tx=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get waveform(){return this.getField(1)}get rate(){return this.getField(2)}get sync(){return this.getField(3)}get targetTune(){return this.getField(10)}get targetCutoff(){return this.getField(11)}get targetVolume(){return this.getField(12)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1,2,3]},""),2:F.create({parent:this,fieldKey:2,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1e-4,max:30,scaling:"exponential"},"Hz",1e-4),3:B.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),10:F.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),11:F.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),12:F.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%")}}};var rx=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get attack(){return this.getField(1)}get hold(){return this.getField(2)}get release(){return this.getField(3)}get volume(){return this.getField(4)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),2:F.create({parent:this,fieldKey:2,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),3:F.create({parent:this,fieldKey:3,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),4:F.create({parent:this,fieldKey:4,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","db",.001)}}};var hu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="VaporisateurDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitVaporisateurDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get octave(){return this.getField(11)}get tune(){return this.getField(12)}get waveform(){return this.getField(13)}get cutoff(){return this.getField(14)}get resonance(){return this.getField(15)}get attack(){return this.getField(16)}get release(){return this.getField(17)}get filterEnvelope(){return this.getField(18)}get decay(){return this.getField(19)}get sustain(){return this.getField(20)}get glideTime(){return this.getField(21)}get voicingMode(){return this.getField(22)}get unisonCount(){return this.getField(23)}get unisonDetune(){return this.getField(24)}get unisonStereo(){return this.getField(25)}get filterOrder(){return this.getField(26)}get filterKeyboard(){return this.getField(27)}get lfo(){return this.getField(30)}get oscillators(){return this.getField(40)}get noise(){return this.getField(50)}get version(){return this.getField(99)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-6),11:N.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","oct"),12:F.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","ct"),13:N.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),14:F.create({parent:this,fieldKey:14,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),15:F.create({parent:this,fieldKey:15,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.01,max:10,scaling:"exponential"},"q"),16:F.create({parent:this,fieldKey:16,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s"),17:F.create({parent:this,fieldKey:17,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s"),18:F.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),19:F.create({parent:this,fieldKey:19,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),20:F.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),21:F.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),22:N.create({parent:this,fieldKey:22,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),23:N.create({parent:this,fieldKey:23,fieldName:"unisonCount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[1,3,5]},"",1),24:F.create({parent:this,fieldKey:24,fieldName:"unisonDetune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:1200,scaling:"exponential"},"ct",30),25:F.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),26:N.create({parent:this,fieldKey:26,fieldName:"filterOrder",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[1,2,3,4]},"",1),27:F.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),30:tx.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:p}),40:qn.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:p},e=>ex.create(e),2),50:rx.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:p}),99:N.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};A();var ix=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get id(){return this.getField(1)}get label(){return this.getField(2)}initializeFields(){return{1:T.create({parent:this,fieldKey:1,fieldName:"id",deprecated:!1,pointerRules:p}),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p})}}};var mu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIOutputDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="MIDIOutputDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitMIDIOutputDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get deprecatedDevice(){return this.getField(10)}get channel(){return this.getField(11)}get deprecatedDelay(){return this.getField(12)}get parameters(){return this.getField(13)}get device(){return this.getField(14)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:ix.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:p}),11:N.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:p},{min:0,max:15},"ch"),12:N.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:p},"any","ms",10),13:Z.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),14:I.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:p},l.MIDIDevice,!1)}}};A();var ss=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIOutputBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="MIDIOutputBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMIDIOutputBox,this)}get tags(){return t.Tags}get root(){return this.getField(1)}get device(){return this.getField(2)}get id(){return this.getField(3)}get label(){return this.getField(4)}get delayInMs(){return this.getField(5)}get sendTransportMessages(){return this.getField(6)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.MIDIDevice,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!0,exclusive:!1}}),3:T.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:p}),4:T.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:N.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:p},{min:0,max:500},"ms",10),6:B.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:p},!0)}}};A();var bl=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"MIDIOutputParameterBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="MIDIOutputParameterBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitMIDIOutputParameterBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get label(){return this.getField(2)}get controller(){return this.getField(3)}get value(){return this.getField(4)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Parameter,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:N.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:p},{min:0,max:127},"#",64),4:F.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!0,exclusive:!1}},"unipolar","%")}}};A();var gu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="SoundfontDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitSoundfontDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get file(){return this.getField(10)}get presetIndex(){return this.getField(11)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:p},l.SoundfontFile,!1),11:N.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:p},{min:0,max:65535},"")}}};A();var nx=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get wave1(){return this.getField(1)}get wave2(){return this.getField(2)}get dcwKeyFollow(){return this.getField(3)}get dcaKeyFollow(){return this.getField(4)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"wave1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:8},"",0),2:N.create({parent:this,fieldKey:2,fieldName:"wave2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:9},"",0),3:F.create({parent:this,fieldKey:3,fieldName:"dcwKeyFollow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:9,scaling:"linear"},"",0),4:F.create({parent:this,fieldKey:4,fieldName:"dcaKeyFollow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:9,scaling:"linear"},"",0)}}};var ax=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get rate1(){return this.getField(1)}get rate2(){return this.getField(2)}get rate3(){return this.getField(3)}get rate4(){return this.getField(4)}get rate5(){return this.getField(5)}get rate6(){return this.getField(6)}get rate7(){return this.getField(7)}get rate8(){return this.getField(8)}get level1(){return this.getField(11)}get level2(){return this.getField(12)}get level3(){return this.getField(13)}get level4(){return this.getField(14)}get level5(){return this.getField(15)}get level6(){return this.getField(16)}get level7(){return this.getField(17)}get level8(){return this.getField(18)}get sustain(){return this.getField(20)}get end(){return this.getField(21)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"rate1",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),2:F.create({parent:this,fieldKey:2,fieldName:"rate2",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),3:F.create({parent:this,fieldKey:3,fieldName:"rate3",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),4:F.create({parent:this,fieldKey:4,fieldName:"rate4",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),5:F.create({parent:this,fieldKey:5,fieldName:"rate5",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),6:F.create({parent:this,fieldKey:6,fieldName:"rate6",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),7:F.create({parent:this,fieldKey:7,fieldName:"rate7",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),8:F.create({parent:this,fieldKey:8,fieldName:"rate8",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),11:F.create({parent:this,fieldKey:11,fieldName:"level1",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),12:F.create({parent:this,fieldKey:12,fieldName:"level2",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),13:F.create({parent:this,fieldKey:13,fieldName:"level3",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),14:F.create({parent:this,fieldKey:14,fieldName:"level4",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),15:F.create({parent:this,fieldKey:15,fieldName:"level5",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),16:F.create({parent:this,fieldKey:16,fieldName:"level6",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),17:F.create({parent:this,fieldKey:17,fieldName:"level7",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),18:F.create({parent:this,fieldKey:18,fieldName:"level8",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),20:N.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:p},{min:0,max:8},"",0),21:N.create({parent:this,fieldKey:21,fieldName:"end",deprecated:!1,pointerRules:p},{min:1,max:8},"",1)}}};var ox=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get wave(){return this.getField(1)}get delay(){return this.getField(2)}get rate(){return this.getField(3)}get depth(){return this.getField(4)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"wave",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},"",0),2:F.create({parent:this,fieldKey:2,fieldName:"delay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:99,scaling:"linear"},"",0),3:F.create({parent:this,fieldKey:3,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:99,scaling:"linear"},"",0),4:F.create({parent:this,fieldKey:4,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:99,scaling:"linear"},"",0)}}};var vu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NeonDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NeonDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitNeonDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get lineSelect(){return this.getField(10)}get modulation(){return this.getField(11)}get octave(){return this.getField(12)}get detune(){return this.getField(13)}get glideTime(){return this.getField(15)}get tune(){return this.getField(16)}get voicingMode(){return this.getField(17)}get vibrato(){return this.getField(20)}get lines(){return this.getField(30)}get envelopes(){return this.getField(40)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"lineSelect",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},"",0),11:N.create({parent:this,fieldKey:11,fieldName:"modulation",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),12:N.create({parent:this,fieldKey:12,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-3,max:3},"oct",0),13:F.create({parent:this,fieldKey:13,fieldName:"detune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-4800,max:4800,scaling:"linear"},"ct",0),15:F.create({parent:this,fieldKey:15,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),16:F.create({parent:this,fieldKey:16,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct",0),17:N.create({parent:this,fieldKey:17,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),20:ox.create({parent:this,fieldKey:20,fieldName:"vibrato",deprecated:!1,pointerRules:p}),30:qn.create({parent:this,fieldKey:30,fieldName:"lines",deprecated:!1,pointerRules:p},e=>nx.create(e),2),40:qn.create({parent:this,fieldKey:40,fieldName:"envelopes",deprecated:!1,pointerRules:p},e=>ax.create(e),6)}}};A();var xu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NanoDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitNanoDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get volume(){return this.getField(10)}get file(){return this.getField(15)}get release(){return this.getField(20)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-3),15:I.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1),20:F.create({parent:this,fieldKey:20,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:8,scaling:"exponential"},"s",.1)}}};A();var yu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="PlayfieldDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitPlayfieldDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get samples(){return this.getField(10)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Z.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};A();var Ta=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[l.Editing,l.SideChain,l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="PlayfieldSampleBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes",copyable:!1});constructor(e){super(e)}accept(e){return $(e.visitPlayfieldSampleBox,this)}get tags(){return t.Tags}get device(){return this.getField(10)}get file(){return this.getField(11)}get midiEffects(){return this.getField(12)}get audioEffects(){return this.getField(13)}get index(){return this.getField(15)}get label(){return this.getField(20)}get icon(){return this.getField(21)}get enabled(){return this.getField(22)}get minimized(){return this.getField(23)}get mute(){return this.getField(40)}get solo(){return this.getField(41)}get exclude(){return this.getField(42)}get polyphone(){return this.getField(43)}get gate(){return this.getField(44)}get pitch(){return this.getField(45)}get sampleStart(){return this.getField(46)}get sampleEnd(){return this.getField(47)}get attack(){return this.getField(48)}get release(){return this.getField(49)}get volume(){return this.getField(50)}get panning(){return this.getField(51)}initializeFields(){return{10:I.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:p},l.Sample,!0),11:I.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),12:Z.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),13:Z.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),15:N.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),20:T.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!0,pointerRules:p}),21:T.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:p}),22:B.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),23:B.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:B.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),41:B.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),42:B.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),43:B.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),44:N.create({parent:this,fieldKey:44,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),45:F.create({parent:this,fieldKey:45,fieldName:"pitch",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct"),46:F.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),47:F.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),48:F.create({parent:this,fieldKey:48,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),49:F.create({parent:this,fieldKey:49,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.001,max:5,scaling:"exponential"},"s",.02),50:F.create({parent:this,fieldKey:50,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),51:F.create({parent:this,fieldKey:51,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};A();var wu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain,l.Automation],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="TapeDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"audio"});constructor(e){super(e)}accept(e){return $(e.visitTapeDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get flutter(){return this.getField(10)}get wow(){return this.getField(11)}get noise(){return this.getField(12)}get saturation(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),11:F.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:F.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),13:F.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%")}}};A();var Ev=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ArpeggioDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitArpeggioDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modeIndex(){return this.getField(10)}get numOctaves(){return this.getField(11)}get rateIndex(){return this.getField(12)}get gate(){return this.getField(13)}get repeat(){return this.getField(14)}get velocity(){return this.getField(15)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"modeIndex",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:3},"",0),11:N.create({parent:this,fieldKey:11,fieldName:"numOctaves",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:5},"oct",1),12:N.create({parent:this,fieldKey:12,fieldName:"rateIndex",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:17},"",9),13:F.create({parent:this,fieldKey:13,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:2,scaling:"linear"},"",1),14:N.create({parent:this,fieldKey:14,fieldName:"repeat",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:16},"",1),15:F.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","",0)}}};A();var Sv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="PitchDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitPitchDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get semiTones(){return this.getField(10)}get cents(){return this.getField(11)}get octaves(){return this.getField(12)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:N.create({parent:this,fieldKey:10,fieldName:"semiTones",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-36,max:36},"st",0),11:F.create({parent:this,fieldKey:11,fieldName:"cents",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-50,max:50,scaling:"linear"},"ct",0),12:N.create({parent:this,fieldKey:12,fieldName:"octaves",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-7,max:7},"oct",0)}}};A();var Pv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ZeitgeistDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitZeitgeistDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get groove(){return this.getField(10)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0)}}};A();var Mv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NeuralAmpDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NeuralAmpDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitNeuralAmpDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get modelJson(){return this.getField(10)}get inputGain(){return this.getField(11)}get outputGain(){return this.getField(12)}get mono(){return this.getField(13)}get mix(){return this.getField(14)}get model(){return this.getField(20)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"modelJson",deprecated:!0,pointerRules:p}),11:F.create({parent:this,fieldKey:11,fieldName:"inputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),12:F.create({parent:this,fieldKey:12,fieldName:"outputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),13:B.create({parent:this,fieldKey:13,fieldName:"mono",deprecated:!1,pointerRules:p},!0),14:F.create({parent:this,fieldKey:14,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:1,scaling:"linear"},"%",1),20:I.create({parent:this,fieldKey:20,fieldName:"model",deprecated:!1,pointerRules:p},l.NeuralAmpModel,!1)}}};A();var Nv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"VocoderDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="VocoderDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitVocoderDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get carrierMinFreq(){return this.getField(10)}get carrierMaxFreq(){return this.getField(11)}get modulatorMinFreq(){return this.getField(12)}get modulatorMaxFreq(){return this.getField(13)}get qEnd(){return this.getField(14)}get qStart(){return this.getField(15)}get envRelease(){return this.getField(16)}get mix(){return this.getField(17)}get bandCount(){return this.getField(18)}get modulatorSource(){return this.getField(19)}get envAttack(){return this.getField(20)}get gain(){return this.getField(21)}get sideChain(){return this.getField(30)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"carrierMinFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",100),11:F.create({parent:this,fieldKey:11,fieldName:"carrierMaxFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",12e3),12:F.create({parent:this,fieldKey:12,fieldName:"modulatorMinFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",100),13:F.create({parent:this,fieldKey:13,fieldName:"modulatorMaxFreq",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",12e3),14:F.create({parent:this,fieldKey:14,fieldName:"qEnd",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:60,scaling:"exponential"},"",2),15:F.create({parent:this,fieldKey:15,fieldName:"qStart",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:60,scaling:"exponential"},"",20),16:F.create({parent:this,fieldKey:16,fieldName:"envRelease",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",30),17:F.create({parent:this,fieldKey:17,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),18:N.create({parent:this,fieldKey:18,fieldName:"bandCount",deprecated:!1,pointerRules:p},{values:[8,12,16]},"",16),19:T.create({parent:this,fieldKey:19,fieldName:"modulatorSource",deprecated:!1,pointerRules:p},"noise-pink"),20:F.create({parent:this,fieldKey:20,fieldName:"envAttack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:.1,max:100,scaling:"exponential"},"ms",5),21:F.create({parent:this,fieldKey:21,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-20,max:20,scaling:"linear"},"dB",0),30:I.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};A();var $v=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WaveshaperDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="WaveshaperDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitWaveshaperDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get equation(){return this.getField(10)}get inputGain(){return this.getField(11)}get outputGain(){return this.getField(12)}get mix(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"equation",deprecated:!1,pointerRules:p},"hardclip"),11:F.create({parent:this,fieldKey:11,fieldName:"inputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:40,scaling:"linear"},"dB",0),12:F.create({parent:this,fieldKey:12,fieldName:"outputGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-24,max:24,scaling:"linear"},"dB",0),13:F.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};A();var kv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WerkstattDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="WerkstattDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitWerkstattDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get code(){return this.getField(10)}get parameters(){return this.getField(11)}get samples(){return this.getField(12)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:Z.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};A();var Da=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WerkstattParameterBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="WerkstattParameterBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitWerkstattParameterBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get label(){return this.getField(2)}get index(){return this.getField(3)}get value(){return this.getField(4)}get defaultValue(){return this.getField(5)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Parameter,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:F.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),5:F.create({parent:this,fieldKey:5,fieldName:"defaultValue",deprecated:!1,pointerRules:p},"any","")}}};A();var _l=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"WerkstattSampleBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="WerkstattSampleBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitWerkstattSampleBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get label(){return this.getField(2)}get index(){return this.getField(3)}get file(){return this.getField(4)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.Sample,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p},""),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:I.create({parent:this,fieldKey:4,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1)}}};A();var Iv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"SpielwerkDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="SpielwerkDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"midi-effect"});constructor(e){super(e)}accept(e){return $(e.visitSpielwerkDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get code(){return this.getField(10)}get parameters(){return this.getField(11)}get samples(){return this.getField(12)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:Z.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};A();var bu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ApparatDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ApparatDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitApparatDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get code(){return this.getField(10)}get parameters(){return this.getField(11)}get samples(){return this.getField(12)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:T.create({parent:this,fieldKey:10,fieldName:"code",deprecated:!1,pointerRules:p},""),11:Z.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};A();var sx=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get length(){return this.getField(1)}get steps(){return this.getField(2)}initializeFields(){return{1:N.create({parent:this,fieldKey:1,fieldName:"length",deprecated:!1,pointerRules:p},{min:1,max:64},"",16),2:qn.create({parent:this,fieldKey:2,fieldName:"steps",deprecated:!1,pointerRules:p},e=>N.create(e,"any","",60),64)}}};var _u=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CubedDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CubedDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitCubedDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get tuning(){return this.getField(10)}get cutoff(){return this.getField(11)}get resonance(){return this.getField(12)}get envMod(){return this.getField(13)}get decay(){return this.getField(14)}get accent(){return this.getField(15)}get volume(){return this.getField(16)}get waveform(){return this.getField(17)}get patternIndex(){return this.getField(20)}get patterns(){return this.getField(30)}get version(){return this.getField(99)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:F.create({parent:this,fieldKey:10,fieldName:"tuning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:-1200,max:1200,scaling:"linear"},"ct",0),11:F.create({parent:this,fieldKey:11,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),12:F.create({parent:this,fieldKey:12,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:F.create({parent:this,fieldKey:13,fieldName:"envMod",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),14:F.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),15:F.create({parent:this,fieldKey:15,fieldName:"accent",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),16:F.create({parent:this,fieldKey:16,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-12),17:N.create({parent:this,fieldKey:17,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{values:[0,1]},"",0),20:N.create({parent:this,fieldKey:20,fieldName:"patternIndex",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:0,max:15},"",0),30:qn.create({parent:this,fieldKey:30,fieldName:"patterns",deprecated:!1,pointerRules:p},e=>sx.create(e),16),99:N.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};A();var Fu=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"NoopInstrumentBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="NoopInstrumentBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"audio"});constructor(e){super(e)}accept(e){return $(e.visitNoopInstrumentBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1)}}};A();var Bv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CompositeDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CompositeDeviceBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"instrument",content:"notes"});constructor(e){super(e)}accept(e){return $(e.visitCompositeDeviceBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get label(){return this.getField(2)}get icon(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get cells(){return this.getField(10)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.InstrumentHost,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:T.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Z.hook({parent:this,fieldKey:10,fieldName:"cells",deprecated:!1,pointerRules:{accepts:[l.CompositeCell],mandatory:!1,exclusive:!1}})}}};A();var Tv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"CompositeCellBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="CompositeCellBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitCompositeCellBox,this)}get tags(){return t.Tags}get composite(){return this.getField(1)}get instrument(){return this.getField(2)}get midiEffects(){return this.getField(3)}get audioEffects(){return this.getField(4)}get index(){return this.getField(5)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"composite",deprecated:!1,pointerRules:p},l.CompositeCell,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"instrument",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost],mandatory:!0,exclusive:!1}}),3:Z.hook({parent:this,fieldKey:3,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),4:Z.hook({parent:this,fieldKey:4,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),5:N.create({parent:this,fieldKey:5,fieldName:"index",deprecated:!1,pointerRules:p},"index","")}}};A();var Dv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioEffectCompositeBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioEffectCompositeBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitAudioEffectCompositeBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get entries(){return this.getField(10)}get input(){return this.getField(11)}get dry(){return this.getField(12)}get wet(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Z.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:F.create({parent:this,fieldKey:12,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-1/0),13:F.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};A();var Au=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"AudioEffectCompositeCellBox",pointerRules:{accepts:[l.Editing,l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="AudioEffectCompositeCellBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitAudioEffectCompositeCellBox,this)}get tags(){return t.Tags}get composite(){return this.getField(1)}get audioEffects(){return this.getField(2)}get index(){return this.getField(3)}get label(){return this.getField(4)}get minimized(){return this.getField(5)}get gain(){return this.getField(40)}get mute(){return this.getField(41)}get solo(){return this.getField(42)}get pan(){return this.getField(43)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"composite",deprecated:!1,pointerRules:p},l.AudioEffectCompositeCell,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),3:N.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:T.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:p}),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:F.create({parent:this,fieldKey:40,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),41:B.create({parent:this,fieldKey:41,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),42:B.create({parent:this,fieldKey:42,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),43:F.create({parent:this,fieldKey:43,fieldName:"pan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};A();var Rv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"StereoCompositeBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="StereoCompositeBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitStereoCompositeBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get entries(){return this.getField(10)}get input(){return this.getField(11)}get dry(){return this.getField(12)}get wet(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Z.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:F.create({parent:this,fieldKey:12,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-1/0),13:F.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};A();var Cv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"FrequencySplitBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.SideChain],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="FrequencySplitBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({type:"device",deviceType:"audio-effect"});constructor(e){super(e)}accept(e){return $(e.visitFrequencySplitBox,this)}get tags(){return t.Tags}get host(){return this.getField(1)}get index(){return this.getField(2)}get label(){return this.getField(3)}get enabled(){return this.getField(4)}get minimized(){return this.getField(5)}get entries(){return this.getField(10)}get input(){return this.getField(11)}get dry(){return this.getField(12)}get wet(){return this.getField(13)}get crossover1(){return this.getField(14)}get crossover2(){return this.getField(15)}get crossover3(){return this.getField(16)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:N.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),3:T.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:p}),4:B.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:B.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Z.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:F.create({parent:this,fieldKey:12,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",-1/0),13:F.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0),14:F.create({parent:this,fieldKey:14,fieldName:"crossover1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",200),15:F.create({parent:this,fieldKey:15,fieldName:"crossover2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",1e3),16:F.create({parent:this,fieldKey:16,fieldName:"crossover3",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz",5e3)}}};A();var zv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="ModularBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModularBox,this)}get tags(){return t.Tags}get collection(){return this.getField(1)}get device(){return this.getField(2)}get editing(){return this.getField(3)}get modules(){return this.getField(11)}get connections(){return this.getField(12)}get label(){return this.getField(13)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModularSetup,!0),2:Z.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!0,exclusive:!1}}),3:Z.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[l.ModuleCollection],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[l.ConnectionCollection],mandatory:!1,exclusive:!1}}),13:T.create({parent:this,fieldKey:13,fieldName:"label",deprecated:!1,pointerRules:p})}}};A();var Ov=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleConnectionBox",pointerRules:p,resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleConnectionBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleConnectionBox,this)}get tags(){return t.Tags}get collection(){return this.getField(1)}get source(){return this.getField(2)}get target(){return this.getField(3)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ConnectionCollection,!0),2:I.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:p},l.VoltageConnection,!0),3:I.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:p},l.VoltageConnection,!0)}}};A();var pn=class t extends De{static create(e){return new t(e)}constructor(e){super(e)}get collection(){return this.getField(1)}get label(){return this.getField(2)}get x(){return this.getField(3)}get y(){return this.getField(4)}get collapsed(){return this.getField(5)}get removable(){return this.getField(6)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModuleCollection,!0),2:T.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:p}),3:N.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:p},"any","x"),4:N.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:p},"any","y"),5:B.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:p},!1),6:B.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:p},!0)}}};var Vv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModularAudioInputBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModularAudioInputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:pn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};A();var Uv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModularAudioOutputBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModularAudioOutputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:pn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};A();var jv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleDelayBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleDelayBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get voltageInput(){return this.getField(10)}get voltageOutput(){return this.getField(11)}get time(){return this.getField(20)}initializeFields(){return{1:pn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:F.create({parent:this,fieldKey:20,fieldName:"time",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1,exclusive:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",500)}}};A();var Kv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleMultiplierBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleMultiplierBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get voltageInputX(){return this.getField(10)}get voltageInputY(){return this.getField(11)}get voltageOutput(){return this.getField(12)}get multiplier(){return this.getField(20)}initializeFields(){return{1:pn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:Z.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:F.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:p},"unipolar","%")}}};A();var Wv=class t extends D{static create(e,r,n){return e.stageBox(new t({uuid:r,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1},resource:void 0,ephemeral:!1}),n)}static ClassName="ModuleGainBox";static Resource=void 0;static Ephemeral=!1;static Tags=Object.freeze({});constructor(e){super(e)}accept(e){return $(e.visitModuleGainBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get voltageInput(){return this.getField(10)}get voltageOutput(){return this.getField(12)}get gain(){return this.getField(20)}initializeFields(){return{1:pn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:Z.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:Z.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:F.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1,exclusive:!1}},"decibel","dB")}}};A();rt();A();rt();A();var Fi;(function(t){t.map=e=>e===Bt.Int32||e===Bt.Boolean?Jr.None:Jr.Linear,t.write=(e,r)=>{if(r.type==="none")e.disconnect(),e.setValue(0);else if(r.type==="linear")e.disconnect(),e.setValue(1);else if(r.type==="curve"){e.setValue(0);let n=e.pointerHub.filter(l.ValueInterpolation).at(0)?.box;K(n)?(n_(n,as),n.slope.setValue(r.slope)):as.create(e.box.graph,k.generate(),i=>{i.slope.setValue(r.slope),i.event.refer(e)})}},t.read=e=>{let r=e.pointerHub.incoming().at(0)?.box;return K(r)?(n_(r,as),{type:"curve",slope:r.slope.getValue()}):e.getValue()===0?Jr.None:e.getValue()===1?Jr.Linear:W("Unknown Interpolation value")}})(Fi||(Fi={}));var cs=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},at=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Qp,Su,Kt,ef,us,tf,Ao=class t{constructor(e,r){this.type="value-event",Qp.set(this,new ae),Su.set(this,void 0),Kt.set(this,void 0),ef.set(this,void 0),us.set(this,void 0),tf.set(this,!1),cs(this,Su,e,"f"),cs(this,Kt,r,"f"),cs(this,ef,at(this,Qp,"f").own(new wg(()=>Fi.read(at(this,Kt,"f").interpolation))),"f");let n=()=>{at(this,ef,"f").invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};at(this,Qp,"f").ownAll(at(this,Kt,"f").subscribe(Ke.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let a=this.collection.unwrap(),o=i.address.fieldKeys,s=ie.equals(at(this,Kt,"f").index.address.fieldKeys,o),c=ie.equals(at(this,Kt,"f").position.address.fieldKeys,o);s||c?a.requestSorting():a.onEventPropertyChanged()}}),at(this,Kt,"f").interpolation.subscribe(n),at(this,Kt,"f").interpolation.pointerHub.subscribe({onAdded:({box:i})=>{at(this,us,"f").terminate(),cs(this,us,i.subscribe(Ke.Children,n),"f"),n()},onRemoved:()=>{at(this,us,"f").terminate(),cs(this,us,ve.Empty,"f"),n()}})),cs(this,us,at(this,Kt,"f").interpolation.pointerHub.filter(l.ValueInterpolation).at(0)?.box.subscribe(Ke.Children,n)??ve.Empty,"f")}onSelected(){cs(this,tf,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){cs(this,tf,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){at(this,us,"f").terminate(),at(this,Qp,"f").terminate()}get box(){return at(this,Kt,"f")}get uuid(){return at(this,Kt,"f").address.uuid}get address(){return at(this,Kt,"f").address}get position(){return at(this,Kt,"f").position.getValue()}get index(){return at(this,Kt,"f").index.getValue()}set interpolation(e){Fi.write(at(this,Kt,"f").interpolation,e)}get interpolation(){return at(this,ef,"f").get()}get value(){return at(this,Kt,"f").value.getValue()}get isSelected(){return at(this,tf,"f")}get collection(){return at(this,Kt,"f").events.targetVertex.map(e=>at(this,Su,"f").boxAdapters.adapterFor(e.box,Or))}copyTo(e){let r=e?.position??this.position,n=e?.index??this.index,i=Xn.create(at(this,Su,"f").boxGraph,k.generate(),a=>{a.position.setValue(r),a.index.setValue(n),a.events.refer(e?.events??this.collection.unwrap("collection").box.events),a.value.setValue(e?.value??this.value)});return Fi.write(i.interpolation,e?.interpolation??this.interpolation),at(this,Su,"f").boxAdapters.adapterFor(i,t)}copyFrom(e){return at(this,Kt,"f").position.setValue(e?.position??this.position),at(this,Kt,"f").index.setValue(e?.index??this.index),at(this,Kt,"f").events.refer(e?.events??this.collection.unwrap("collection").box.events),at(this,Kt,"f").value.setValue(e?.value??this.value),Fi.write(at(this,Kt,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};Qp=new WeakMap,Su=new WeakMap,Kt=new WeakMap,ef=new WeakMap,us=new WeakMap,tf=new WeakMap;Ao.Comparator=(t,e)=>{if(t===e)return W(`${t} is equal to itself`);let r=t.position-e.position;if(r!==0)return r;let n=t.index-e.index;return n!==0?n:W(`${t} and ${e} are identical in terms of comparison`)};var rf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},nt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},nf,af,ds,fn,Fl,Pu,Eo,lx,Or=class t{constructor(e,r){nf.add(this),af.set(this,new ae),ds.set(this,void 0),fn.set(this,void 0),Fl.set(this,void 0),Pu.set(this,void 0),Eo.set(this,void 0),rf(this,ds,e,"f"),rf(this,fn,r,"f"),rf(this,Fl,new xe,"f"),rf(this,Pu,k.newSet(i=>i.uuid),"f"),rf(this,Eo,qr.create(Ao.Comparator),"f");let n=i=>{let a=He(i.accept({visitValueEventBox:o=>nt(this,ds,"f").boxAdapters.adapterFor(o,Ao)}),`Could not find adapter for ${i}`);nt(this,Pu,"f").add(a)&&(nt(this,Eo,"f").add(a),nt(this,nf,"m",lx).call(this))};nt(this,fn,"f").events.pointerHub.incoming().forEach(({box:i})=>n(i)),nt(this,af,"f").own(nt(this,fn,"f").events.pointerHub.subscribe({onAdded:({box:i})=>n(i),onRemoved:({box:{address:{uuid:i}}})=>{nt(this,Eo,"f").remove(nt(this,Pu,"f").removeByKey(i)),nt(this,nf,"m",lx).call(this)}})),nt(this,af,"f").own(nt(this,fn,"f").owners.pointerHub.subscribe({onAdded:()=>nt(this,Fl,"f").notify(this),onRemoved:()=>nt(this,Fl,"f").notify(this)}))}valueAt(e,r){return Hg.valueAt(nt(this,Eo,"f"),e,r)}copy(){let e=nt(this,ds,"f").boxGraph,r=Qn.create(e,k.generate());return nt(this,Eo,"f").asArray().forEach(n=>n.copyTo({events:r.events})),nt(this,ds,"f").boxAdapters.adapterFor(r,t)}cut(e,r=E.unipolar()){let n=this.events.lowerEqual(e),i=this.events.greaterEqual(e);if(i===null)return n===null?_.None:_.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n===null)return _.wrap(this.createEvent({position:e,value:i.value,index:i.index,interpolation:i.interpolation}));if(n.position===e)return _.wrap(n);if(i.position===e)return _.wrap(i);if(n.interpolation.type==="none")return _.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n.interpolation.type==="linear"){let{position:a}=n,{position:o}=i,s=r.x(n.value),c=r.x(i.value),u=YM(s,c,(e-a)/(o-a));return _.wrap(this.createEvent({position:e,value:r.y(u),index:0,interpolation:n.interpolation}))}if(n.interpolation.type==="curve"){let{position:a}=n,{position:o}=i,s=r.x(n.value),c=r.x(i.value),u=o-a,f=e-a,v=cr.byHalf(u,s,cr.valueAt({slope:n.interpolation.slope,steps:u,y0:s,y1:c},u*.5),c),m=cr.valueAt(v,f),w=cr.slopeByHalf(s,cr.valueAt(v,f*.5),m);return Fi.write(n.box.interpolation,Jr.Curve(w)),_.wrap(this.createEvent({position:e,value:r.y(m),index:0,interpolation:Jr.Curve(cr.slopeByHalf(m,cr.valueAt(v,(f+u)*.5),c))}))}return W("Unknown interpolation type")}subscribeChange(e){return nt(this,Fl,"f").subscribe(e)}createEvent({position:e,index:r,value:n,interpolation:i}){let a=Math.trunc(e),o=nt(this,Pu,"f").values().find(c=>c.position===a&&c.index===r);if(K(o)&&o.box.isAttached())return o.box.value.setValue(n),Fi.write(o.box.interpolation,i),o;let s=Xn.create(nt(this,ds,"f").boxGraph,k.generate(),c=>{c.position.setValue(e),c.index.setValue(r),c.value.setValue(n),c.events.refer(nt(this,fn,"f").events)});return Fi.write(s.interpolation,i),nt(this,ds,"f").boxAdapters.adapterFor(s,Ao)}requestSorting(){nt(this,Eo,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){nt(this,nf,"m",lx).call(this)}terminate(){nt(this,af,"f").terminate()}get box(){return nt(this,fn,"f")}get uuid(){return nt(this,fn,"f").address.uuid}get address(){return nt(this,fn,"f").address}get numOwners(){return nt(this,fn,"f").owners.pointerHub.filter(l.ValueEventCollection).length}get events(){return nt(this,Eo,"f")}toString(){return`{ValueEventCollectionBox ${k.toString(nt(this,fn,"f").address.uuid)}}`}};af=new WeakMap,ds=new WeakMap,fn=new WeakMap,Fl=new WeakMap,Pu=new WeakMap,Eo=new WeakMap,nf=new WeakSet,lx=function(){nt(this,Fl,"f").notify(this)};var Al=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ge=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},El,ps,Sl,pr,Pl,lf,of,sf,Mu,fs=class{constructor(e,r){El.add(this),this.type="value-clip",ps.set(this,new ae),Sl.set(this,void 0),pr.set(this,void 0),Pl.set(this,void 0),lf.set(this,void 0),of.set(this,void 0),sf.set(this,ve.Empty),Al(this,Sl,e,"f"),Al(this,pr,r,"f"),Al(this,of,!0,"f"),Al(this,Pl,Ge(this,ps,"f").own(new un(!1)),"f"),Al(this,lf,Ge(this,ps,"f").own(new xe),"f"),Ge(this,ps,"f").own(Ge(this,pr,"f").pointerHub.subscribe({onAdded:()=>Ge(this,El,"m",Mu).call(this),onRemoved:()=>Ge(this,El,"m",Mu).call(this)})),Ge(this,ps,"f").own(Ge(this,pr,"f").subscribe(Ke.Children,n=>Ge(this,El,"m",Mu).call(this))),Ge(this,ps,"f").own(Ge(this,pr,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ge(this,sf,"f").terminate(),Al(this,sf,n.match({none:()=>ve.Empty,some:({box:i})=>Ge(this,Sl,"f").boxAdapters.adapterFor(i,Or).subscribeChange(()=>Ge(this,El,"m",Mu).call(this))}),"f"),Ge(this,El,"m",Mu).call(this)})),Al(this,of,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(e%this.duration,r)}catchupAndSubscribeSelected(e){return Ge(this,Pl,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ge(this,lf,"f").subscribe(e)}accept(e){return $(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ge(this,pr,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:Ge(this,pr,"f").events.targetVertex.unwrap("events.target");nu.create(Ge(this,Sl,"f").boxGraph,k.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(Ge(this,pr,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){Ge(this,Pl,"f").setValue(!0)}onDeselected(){Ge(this,Pl,"f").setValue(!1)}get isSelected(){return Ge(this,Pl,"f").getValue()}terminate(){Ge(this,sf,"f").terminate(),Ge(this,ps,"f").terminate()}get box(){return Ge(this,pr,"f")}get uuid(){return Ge(this,pr,"f").address.uuid}get address(){return Ge(this,pr,"f").address}get indexField(){return Ge(this,pr,"f").index}get duration(){return Ge(this,pr,"f").duration.getValue()}get mute(){return Ge(this,pr,"f").mute.getValue()}get hue(){return Ge(this,pr,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Ge(this,pr,"f").events.targetVertex.map(e=>Ge(this,Sl,"f").boxAdapters.adapterFor(e.box,Or))}get label(){return Ge(this,pr,"f").label.getValue()}get trackBoxAdapter(){return Ge(this,of,"f")?_.None:Ge(this,pr,"f").clips.targetVertex.map(e=>Ge(this,Sl,"f").boxAdapters.adapterFor(e.box,fr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${k.toString(Ge(this,pr,"f").address.uuid)} d: ${Ve.toString(this.duration)}}`}};ps=new WeakMap,Sl=new WeakMap,pr=new WeakMap,Pl=new WeakMap,lf=new WeakMap,of=new WeakMap,sf=new WeakMap,El=new WeakSet,Mu=function(){Ge(this,lf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};rt();A();A();rt();A();var cx=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},hn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},cf,ux,Ml,df,uf,dx,Nu=class{constructor(e){cf.add(this),this.type="transient-marker",ux.set(this,new ae),Ml.set(this,void 0),df.set(this,void 0),uf.set(this,!1),cx(this,Ml,e,"f"),cx(this,df,new xe,"f"),hn(this,ux,"f").own(e.subscribe(Ke.Children,()=>hn(this,cf,"m",dx).call(this)))}onSelected(){cx(this,uf,!0,"f"),hn(this,cf,"m",dx).call(this)}onDeselected(){cx(this,uf,!1,"f"),hn(this,cf,"m",dx).call(this)}get box(){return hn(this,Ml,"f")}get uuid(){return hn(this,Ml,"f").address.uuid}get address(){return hn(this,Ml,"f").address}get position(){return hn(this,Ml,"f").position.getValue()}get isSelected(){return hn(this,uf,"f")}subscribe(e){return hn(this,df,"f").subscribe(e)}terminate(){hn(this,ux,"f").terminate()}};ux=new WeakMap,Ml=new WeakMap,df=new WeakMap,uf=new WeakMap,cf=new WeakSet,dx=function(){hn(this,df,"f").notify()};var pf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Vr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},px,ff,Ra,hf,$u,fx,ta=class t{constructor(e,r){px.set(this,new ae),ff.set(this,void 0),Ra.set(this,void 0),hf.set(this,void 0),$u.set(this,void 0),fx.set(this,void 0),pf(this,ff,e,"f"),pf(this,Ra,r,"f"),pf(this,hf,k.newSet(({uuid:n})=>n),"f"),pf(this,$u,qr.create(t.Comparator),"f"),pf(this,fx,zg.memoizeAsync(async()=>{if(this.data.nonEmpty())return this.data.unwrap();let{promise:n,resolve:i,reject:a}=Promise.withResolvers(),o=this.getOrCreateLoader(),s=o.subscribe(c=>{c.type==="loaded"?(queueMicrotask(()=>s.terminate()),i(o.data.unwrap("State mismatch"))):c.type==="error"&&(queueMicrotask(()=>s.terminate()),a(new Error(c.reason)))});return n}),"f"),Vr(this,px,"f").ownAll(r.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Vr(this,ff,"f").boxAdapters.adapterFor(n.box,Nu);Vr(this,hf,"f").add(i)&&Vr(this,$u,"f").add(i)},onRemoved:({box:{address:{uuid:n}}})=>{Vr(this,$u,"f").remove(Vr(this,hf,"f").removeByKey(n))}}))}get box(){return Vr(this,Ra,"f")}get uuid(){return Vr(this,Ra,"f").address.uuid}get address(){return Vr(this,Ra,"f").address}get startInSeconds(){return Vr(this,Ra,"f").startInSeconds.getValue()}get endInSeconds(){return Vr(this,Ra,"f").endInSeconds.getValue()}get transients(){return Vr(this,$u,"f")}get fileName(){return Vr(this,Ra,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return Vr(this,fx,"f").call(this)}getOrCreateLoader(){return Vr(this,ff,"f").sampleManager.getOrCreate(Vr(this,Ra,"f").address.uuid)}terminate(){Vr(this,px,"f").terminate()}};px=new WeakMap,ff=new WeakMap,Ra=new WeakMap,hf=new WeakMap,$u=new WeakMap,fx=new WeakMap;ta.Comparator=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),W("Events at the same position: "+t.position+", "+e.position)):r};A();rt();A();var mf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},di=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},gf,hx,mx,So,xf,vf,gx,Ca=class{constructor(e,r){gf.add(this),this.type="warp-marker",hx.set(this,new ae),mx.set(this,void 0),So.set(this,void 0),xf.set(this,void 0),vf.set(this,!1),mf(this,mx,e,"f"),mf(this,So,r,"f"),mf(this,xf,new xe,"f"),di(this,hx,"f").own(r.subscribe(Ke.Children,()=>di(this,gf,"m",gx).call(this)))}onSelected(){mf(this,vf,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),di(this,gf,"m",gx).call(this)}onDeselected(){mf(this,vf,!1,"f"),di(this,gf,"m",gx).call(this)}get box(){return di(this,So,"f")}get uuid(){return di(this,So,"f").address.uuid}get address(){return di(this,So,"f").address}get position(){return di(this,So,"f").position.getValue()}get seconds(){return di(this,So,"f").seconds.getValue()}get isSelected(){return di(this,vf,"f")}get optWarping(){return di(this,So,"f").owner.targetVertex.map(e=>di(this,mx,"f").boxAdapters.adapterFor(e.box,za.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return di(this,xf,"f").subscribe(e)}terminate(){di(this,hx,"f").terminate()}};hx=new WeakMap,mx=new WeakMap,So=new WeakMap,xf=new WeakMap,vf=new WeakMap,gf=new WeakSet,gx=function(){di(this,xf,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};A();var ku=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),W("Events at the same position: "+t.position+", "+e.position)):r};var yf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Yr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},vx,xx,Nl,$l,wf,Iu,Oa=class{constructor(e,r){vx.set(this,new ae),xx.set(this,void 0),Nl.set(this,void 0),$l.set(this,void 0),wf.set(this,void 0),Iu.set(this,void 0),yf(this,xx,e,"f"),yf(this,Nl,r,"f"),yf(this,$l,new xe,"f"),yf(this,wf,k.newSet(({uuid:n})=>n),"f"),yf(this,Iu,qr.create(ku),"f"),Yr(this,vx,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Yr(this,xx,"f").boxAdapters.adapterFor(n.box,Ca);Yr(this,wf,"f").add(i)&&(Yr(this,Iu,"f").add(i),Yr(this,$l,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Yr(this,Iu,"f").remove(Yr(this,wf,"f").removeByKey(n)),Yr(this,$l,"f").notify()}}))}get box(){return Yr(this,Nl,"f")}get uuid(){return Yr(this,Nl,"f").address.uuid}get address(){return Yr(this,Nl,"f").address}get warpMarkers(){return Yr(this,Iu,"f")}clone(){let e=su.create(Yr(this,Nl,"f").graph,k.generate());return this.warpMarkers.asArray().forEach(r=>$a.create(e.graph,k.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Yr(this,$l,"f").subscribe(e)}onChanged(){Yr(this,$l,"f").notify()}terminate(){Yr(this,vx,"f").terminate()}};vx=new WeakMap,xx=new WeakMap,Nl=new WeakMap,$l=new WeakMap,wf=new WeakMap,Iu=new WeakMap;A();rt();var bf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},hr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},yx,wx,ra,kl,_f,Bu,Va=class{constructor(e,r){yx.set(this,new ae),wx.set(this,void 0),ra.set(this,void 0),kl.set(this,void 0),_f.set(this,void 0),Bu.set(this,void 0),bf(this,wx,e,"f"),bf(this,ra,r,"f"),bf(this,kl,new xe,"f"),bf(this,_f,k.newSet(({uuid:n})=>n),"f"),bf(this,Bu,qr.create(ku),"f"),hr(this,yx,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=hr(this,wx,"f").boxAdapters.adapterFor(n.box,Ca);hr(this,_f,"f").add(i)&&(hr(this,Bu,"f").add(i),hr(this,kl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{hr(this,Bu,"f").remove(hr(this,_f,"f").removeByKey(n)),hr(this,kl,"f").notify()}}))}get box(){return hr(this,ra,"f")}get uuid(){return hr(this,ra,"f").address.uuid}get address(){return hr(this,ra,"f").address}get warpMarkers(){return hr(this,Bu,"f")}get playbackRate(){return hr(this,ra,"f").playbackRate.getValue()}get cents(){return Math.log2(hr(this,ra,"f").playbackRate.getValue())*1200}set cents(e){hr(this,ra,"f").playbackRate.setValue(Se(2**(e/1200),.5,2))}get transientPlayMode(){return fo(hr(this,ra,"f").transientPlayMode.getValue(),Qg)}clone(){let e=lu.create(hr(this,ra,"f").graph,k.generate(),r=>{r.transientPlayMode.setValue(this.transientPlayMode),r.playbackRate.setValue(this.playbackRate),r.warpMarkers});return this.warpMarkers.asArray().forEach(r=>$a.create(e.graph,k.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return hr(this,kl,"f").subscribe(e)}onChanged(){hr(this,kl,"f").notify()}terminate(){hr(this,yx,"f").terminate()}};yx=new WeakMap,wx=new WeakMap,ra=new WeakMap,kl=new WeakMap,_f=new WeakMap,Bu=new WeakMap;A();rt();var Ff=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Xt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},bx,_x,mn,Il,Af,Tu,Ua=class{constructor(e,r){bx.set(this,new ae),_x.set(this,void 0),mn.set(this,void 0),Il.set(this,void 0),Af.set(this,void 0),Tu.set(this,void 0),Ff(this,_x,e,"f"),Ff(this,mn,r,"f"),Ff(this,Il,new xe,"f"),Ff(this,Af,k.newSet(({uuid:n})=>n),"f"),Ff(this,Tu,qr.create(ku),"f"),Xt(this,bx,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Xt(this,_x,"f").boxAdapters.adapterFor(n.box,Ca);Xt(this,Af,"f").add(i)&&(Xt(this,Tu,"f").add(i),Xt(this,Il,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Xt(this,Tu,"f").remove(Xt(this,Af,"f").removeByKey(n)),Xt(this,Il,"f").notify()}}))}get box(){return Xt(this,mn,"f")}get uuid(){return Xt(this,mn,"f").address.uuid}get address(){return Xt(this,mn,"f").address}get warpMarkers(){return Xt(this,Tu,"f")}get transpose(){return Xt(this,mn,"f").transpose.getValue()}set transpose(e){Xt(this,mn,"f").transpose.setValue(e)}get cents(){return Xt(this,mn,"f").transpose.getValue()*100}set cents(e){Xt(this,mn,"f").transpose.setValue(e/100)}clone(){let e=cu.create(Xt(this,mn,"f").graph,k.generate());return e.transpose.setValue(Xt(this,mn,"f").transpose.getValue()),this.warpMarkers.asArray().forEach(r=>$a.create(e.graph,k.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Xt(this,Il,"f").subscribe(e)}onChanged(){Xt(this,Il,"f").notify()}terminate(){Xt(this,bx,"f").terminate()}};bx=new WeakMap,_x=new WeakMap,mn=new WeakMap,Il=new WeakMap,Af=new WeakMap,Tu=new WeakMap;var za;(function(t){t.isAudioPlayMode=e=>e instanceof Oa||e instanceof Va||e instanceof Ua})(za||(za={}));var Ui=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ae=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Bl,Du,Tl,Wt,Dl,Rl,Ef,Pf,Sf,hs,Ru,Cu,zu,Ou=class{constructor(e,r){Bl.add(this),this.type="audio-clip",Du.set(this,new ae),Tl.set(this,void 0),Wt.set(this,void 0),Dl.set(this,void 0),Rl.set(this,void 0),Ef.set(this,void 0),Pf.set(this,void 0),Sf.set(this,void 0),hs.set(this,_.None),Ru.set(this,_.None),Cu.set(this,ve.Empty),Ui(this,Tl,e,"f"),Ui(this,Wt,r,"f"),Ui(this,Sf,!0,"f"),Ui(this,Dl,new Cr,"f"),Ui(this,Rl,Ae(this,Du,"f").own(new un(!1)),"f"),Ui(this,Ef,dl.aware(e.tempoMap,r.timeBase,r.duration),"f"),Ui(this,Pf,Ae(this,Du,"f").own(new xe),"f"),Ae(this,Du,"f").ownAll(Ae(this,Wt,"f").pointerHub.subscribe({onAdded:()=>Ae(this,Bl,"m",zu).call(this),onRemoved:()=>Ae(this,Bl,"m",zu).call(this)}),Ae(this,Wt,"f").playMode.catchupAndSubscribe(({targetVertex:n})=>{Ae(this,Cu,"f").terminate(),n.match({none:()=>Ae(this,Dl,"f").clear(),some:({box:i})=>{let a=Ae(this,Tl,"f").boxAdapters.adapterFor(i,za.isAudioPlayMode);Ui(this,Cu,a.subscribe(()=>Ae(this,Bl,"m",zu).call(this)),"f"),Ae(this,Dl,"f").wrap(a)}})}),Ae(this,Wt,"f").file.catchupAndSubscribe(n=>{Ui(this,hs,n.targetVertex.map(i=>Ae(this,Tl,"f").boxAdapters.adapterFor(i.box,ta)),"f"),Ae(this,Ru,"f").ifSome(i=>i.terminate()),Ui(this,Ru,Ae(this,hs,"f").map(i=>i.getOrCreateLoader().subscribe(()=>Ae(this,Bl,"m",zu).call(this))),"f")}),Ae(this,Wt,"f").subscribe(Ke.Children,n=>Ae(this,Bl,"m",zu).call(this))),Ui(this,Sf,!1,"f")}catchupAndSubscribeSelected(e){return Ae(this,Rl,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ae(this,Pf,"f").subscribe(e)}accept(e){return $(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){let r=this.observableOptPlayMode.map(n=>n.clone());ou.create(Ae(this,Tl,"f").boxGraph,k.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.gain.setValue(this.gain.getValue()),n.timeBase.setValue(this.timeBase),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(Ae(this,Wt,"f").clips.targetVertex.unwrap("clips.target")),n.file.refer(Ae(this,Wt,"f").file.targetVertex.unwrap("file.target")),n.events.refer(Ae(this,Wt,"f").events.targetVertex.unwrap("events.target")),r.ifSome(i=>n.playMode.refer(i))})}onSelected(){Ae(this,Rl,"f").setValue(!0)}onDeselected(){Ae(this,Rl,"f").setValue(!1)}get isSelected(){return Ae(this,Rl,"f").getValue()}get box(){return Ae(this,Wt,"f")}get uuid(){return Ae(this,Wt,"f").address.uuid}get address(){return Ae(this,Wt,"f").address}get indexField(){return Ae(this,Wt,"f").index}get duration(){return Ae(this,Ef,"f").toPPQN(0)}set duration(e){Ae(this,Ef,"f").fromPPQN(e,0)}get mute(){return Ae(this,Wt,"f").mute.getValue()}get hue(){return Ae(this,Wt,"f").hue.getValue()}get gain(){return Ae(this,Wt,"f").gain}get file(){return Ae(this,hs,"f").unwrap("Cannot access file.")}get optFile(){return Ae(this,hs,"f")}get observableOptPlayMode(){return Ae(this,Dl,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return _.None}get timeBase(){return fo(Ae(this,Wt,"f").timeBase.getValue(),ui)}get waveformOffset(){return Ae(this,Wt,"f").waveformOffset}get isPlayModeNoStretch(){return Ae(this,Wt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>Ft(e,Oa)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Ft(e,Va)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>Ft(e,Ua)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>za.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(Ae(this,hs,"f").isEmpty())return"No Audio File";let e=Ae(this,hs,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):Ae(this,Wt,"f").label.getValue()}get trackBoxAdapter(){return Ae(this,Sf,"f")?_.None:Ae(this,Wt,"f").clips.targetVertex.map(e=>Ae(this,Tl,"f").boxAdapters.adapterFor(e.box,fr))}get isMirrowed(){return!1}get canMirror(){return!1}get canResize(){return Ae(this,Dl,"f").nonEmpty()}terminate(){Ae(this,Ru,"f").ifSome(e=>e.terminate()),Ui(this,Ru,_.None,"f"),Ae(this,Cu,"f").terminate(),Ui(this,Cu,ve.Empty,"f"),Ae(this,Du,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${k.toString(Ae(this,Wt,"f").address.uuid)} d: ${Ve.toString(this.duration)}}`}};Du=new WeakMap,Tl=new WeakMap,Wt=new WeakMap,Dl=new WeakMap,Rl=new WeakMap,Ef=new WeakMap,Pf=new WeakMap,Sf=new WeakMap,hs=new WeakMap,Ru=new WeakMap,Cu=new WeakMap,Bl=new WeakSet,zu=function(){Ae(this,Pf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};A();rt();A();rt();rt();A();var Mf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Qt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Vu,_r,Fx,Nf,Cl=class t{constructor(e,r){this.type="note-event",Vu.set(this,void 0),_r.set(this,void 0),Fx.set(this,void 0),Nf.set(this,!1),Mf(this,Vu,e,"f"),Mf(this,_r,r,"f"),Mf(this,Fx,Qt(this,_r,"f").subscribe(Ke.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.collection.unwrap(),a=n.address.fieldKeys,o=ie.equals(Qt(this,_r,"f").pitch.address.fieldKeys,a),s=ie.equals(Qt(this,_r,"f").position.address.fieldKeys,a);o||s?i.requestSorting():i.onEventPropertyChanged()}}),"f")}onSelected(){Mf(this,Nf,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Mf(this,Nf,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Qt(this,Fx,"f").terminate()}get box(){return Qt(this,_r,"f")}get uuid(){return Qt(this,_r,"f").address.uuid}get address(){return Qt(this,_r,"f").address}get position(){return Qt(this,_r,"f").position.getValue()}get duration(){return Qt(this,_r,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return Qt(this,_r,"f").velocity.getValue()}get pitch(){return Qt(this,_r,"f").pitch.getValue()}get cent(){return Qt(this,_r,"f").cent.getValue()}get chance(){return Qt(this,_r,"f").chance.getValue()}get playCount(){return Qt(this,_r,"f").playCount.getValue()}get playCurve(){return Qt(this,_r,"f").playCurve.getValue()}get isSelected(){return Qt(this,Nf,"f")}get collection(){return Qt(this,_r,"f").events.targetVertex.map(e=>Qt(this,Vu,"f").boxAdapters.adapterFor(e.box,gn))}normalizedPitch(){if(this.collection.isEmpty())return .5;let{minPitch:e,maxPitch:r}=this.collection.unwrap();return e===r?.5:1-(this.pitch-e)/(r-e)}copyAsNoteEvent(){return{type:"note-event",position:this.position,duration:this.duration,pitch:this.pitch,cent:this.cent,velocity:this.velocity}}copyTo(e){return Qt(this,Vu,"f").boxAdapters.adapterFor(ns.create(Qt(this,Vu,"f").boxGraph,k.generate(),r=>{r.position.setValue(e?.position??this.position),r.duration.setValue(e?.duration??this.duration),r.pitch.setValue(e?.pitch??this.pitch),r.playCount.setValue(e?.playCount??this.playCount),r.events.refer(e?.events??this.collection.unwrap("collection").box.events),r.velocity.setValue(this.velocity),r.cent.setValue(this.cent),r.chance.setValue(this.chance)}),t)}computeCurveValue(e){return eu.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,r=this.collection.unwrap("collection").box.events,n=ie.create(i=>{let a=Math.floor(this.computeCurveValue(i/e)*this.duration),o=Math.floor(this.computeCurveValue((i+1)/e)*this.duration);return this.copyTo({position:Math.floor(this.position+a),duration:Math.max(1,o-a),playCount:1,events:r})},e);return Qt(this,_r,"f").delete(),n}};Vu=new WeakMap,_r=new WeakMap,Fx=new WeakMap,Nf=new WeakMap;var ja=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ie=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Po,$f,ms,ia,zl,kf,Ai,Ex,Sx,Px,gs,Ax,If,gn=class t{constructor(e,r){Po.add(this),$f.set(this,new ae),ms.set(this,void 0),ia.set(this,void 0),zl.set(this,void 0),kf.set(this,void 0),Ai.set(this,void 0),Ex.set(this,60),Sx.set(this,60),Px.set(this,0),gs.set(this,!1),ja(this,ms,e,"f"),ja(this,ia,r,"f"),ja(this,zl,new xe,"f"),ja(this,kf,k.newSet(n=>n.uuid),"f"),ja(this,Ai,qr.create(eu.Comparator),"f"),Ie(this,$f,"f").own(Ie(this,ia,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=Ie(this,ms,"f").boxAdapters.adapterFor(n,Cl);Ie(this,kf,"f").add(i)&&(Ie(this,Ai,"f").add(i),Ie(this,Po,"m",Ax).call(this))},onRemoved:({box:{address:{uuid:n}}})=>{Ie(this,Ai,"f").remove(Ie(this,kf,"f").removeByKey(n)),Ie(this,Po,"m",Ax).call(this)}})),Ie(this,$f,"f").own(Ie(this,ia,"f").owners.pointerHub.subscribe({onAdded:()=>Ie(this,zl,"f").notify(this),onRemoved:()=>Ie(this,zl,"f").notify(this)}))}copy(){let e=Ie(this,ms,"f").boxGraph,r=Fo.create(e,k.generate());return Ie(this,Ai,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Ie(this,ms,"f").boxAdapters.adapterFor(r,t)}createEvent({position:e,duration:r,velocity:n,pitch:i,chance:a,playCount:o,cent:s}){return Ie(this,ms,"f").boxAdapters.adapterFor(ns.create(Ie(this,ms,"f").boxGraph,k.generate(),c=>{c.position.setValue(e),c.duration.setValue(r),c.velocity.setValue(n),c.pitch.setValue(i),c.chance.setValue(a),c.playCount.setValue(o),c.cent.setValue(s),c.events.refer(Ie(this,ia,"f").events)}),Cl)}subscribeChange(e){return Ie(this,zl,"f").subscribe(e)}selectable(){return Ie(this,Ai,"f").asArray()}selectableAt(e){for(let r of Ie(this,Ai,"f").asArray())if(r.position<=e.u&&e.u<r.complete&&r.pitch===e.v)return ur.one(r);return ur.empty()}selectablesBetween(e,r){let n=[],i=Ie(this,Ai,"f").asArray(),a=Ie(this,Ai,"f").ceilFirstIndex(r.u);for(let o=0;o<a;o++){let s=i[o];s.complete>e.u&&s.pitch>=e.v&&s.pitch<=r.v&&n.push(s)}return n}overlapping(e,r,n){let i=[];for(let a of Ie(this,Ai,"f").asArray())a.pitch===n&&a.complete>e&&a.position<r&&i.push(a);return i}requestSorting(){Ie(this,Ai,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Ie(this,Po,"m",Ax).call(this)}terminate(){Ie(this,$f,"f").terminate()}get box(){return Ie(this,ia,"f")}get uuid(){return Ie(this,ia,"f").address.uuid}get address(){return Ie(this,ia,"f").address}get numOwners(){return Ie(this,ia,"f").owners.pointerHub.filter(l.NoteEventCollection).length}get events(){return Ie(this,gs,"f")||Ie(this,Po,"m",If).call(this),Ie(this,Ai,"f")}get minPitch(){return Ie(this,gs,"f")||Ie(this,Po,"m",If).call(this),Ie(this,Ex,"f")}get maxPitch(){return Ie(this,gs,"f")||Ie(this,Po,"m",If).call(this),Ie(this,Sx,"f")}get maxDuration(){return Ie(this,gs,"f")||Ie(this,Po,"m",If).call(this),Ie(this,Px,"f")}toString(){return`{NoteEventCollectionBox ${k.toString(Ie(this,ia,"f").address.uuid)}}`}};$f=new WeakMap,ms=new WeakMap,ia=new WeakMap,zl=new WeakMap,kf=new WeakMap,Ai=new WeakMap,Ex=new WeakMap,Sx=new WeakMap,Px=new WeakMap,gs=new WeakMap,Po=new WeakSet,Ax=function(){ja(this,gs,!1,"f"),Ie(this,zl,"f").notify(this)},If=function(){let e=127,r=0,n=0;Ie(this,Ai,"f").asArray().forEach(({pitch:i,duration:a})=>{e=Math.min(e,i),r=Math.max(r,i),n=Math.max(n,a)}),ja(this,Ex,e,"f"),ja(this,Sx,r,"f"),ja(this,Px,n,"f"),ja(this,gs,!0,"f")};var Ol=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},qe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Vl,Uu,Ul,mr,jl,Df,Bf,Tf,ju,Ku=class{constructor(e,r){Vl.add(this),this.type="note-clip",Uu.set(this,new ae),Ul.set(this,void 0),mr.set(this,void 0),jl.set(this,void 0),Df.set(this,void 0),Bf.set(this,void 0),Tf.set(this,ve.Empty),Ol(this,Ul,e,"f"),Ol(this,mr,r,"f"),Ol(this,Bf,!0,"f"),Ol(this,jl,qe(this,Uu,"f").own(new un(!1)),"f"),Ol(this,Df,qe(this,Uu,"f").own(new xe),"f"),qe(this,Uu,"f").ownAll(qe(this,mr,"f").pointerHub.subscribe({onAdded:()=>qe(this,Vl,"m",ju).call(this),onRemoved:()=>qe(this,Vl,"m",ju).call(this)}),qe(this,mr,"f").subscribe(Ke.Children,n=>qe(this,Vl,"m",ju).call(this)),qe(this,mr,"f").events.catchupAndSubscribe(({targetVertex:n})=>{qe(this,Tf,"f").terminate(),Ol(this,Tf,n.match({none:()=>ve.Empty,some:({box:i})=>qe(this,Ul,"f").boxAdapters.adapterFor(i,gn).subscribeChange(()=>qe(this,Vl,"m",ju).call(this))}),"f"),qe(this,Vl,"m",ju).call(this)})),Ol(this,Bf,!1,"f")}catchupAndSubscribeSelected(e){return qe(this,jl,"f").catchupAndSubscribe(e)}subscribeChange(e){return qe(this,Df,"f").subscribe(e)}accept(e){return $(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&qe(this,mr,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:qe(this,mr,"f").events.targetVertex.unwrap("events.target");iu.create(qe(this,Ul,"f").boxGraph,k.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(qe(this,mr,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){qe(this,jl,"f").setValue(!0)}onDeselected(){qe(this,jl,"f").setValue(!1)}get isSelected(){return qe(this,jl,"f").getValue()}terminate(){qe(this,Tf,"f").terminate(),qe(this,Uu,"f").terminate()}get box(){return qe(this,mr,"f")}get uuid(){return qe(this,mr,"f").address.uuid}get address(){return qe(this,mr,"f").address}get indexField(){return qe(this,mr,"f").index}get duration(){return qe(this,mr,"f").duration.getValue()}get mute(){return qe(this,mr,"f").mute.getValue()}get hue(){return qe(this,mr,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return qe(this,mr,"f").events.targetVertex.map(e=>qe(this,Ul,"f").boxAdapters.adapterFor(e.box,gn))}get label(){return qe(this,mr,"f").label.getValue()}get trackBoxAdapter(){return qe(this,Bf,"f")?_.None:qe(this,mr,"f").clips.targetVertex.map(e=>qe(this,Ul,"f").boxAdapters.adapterFor(e.box,fr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${k.toString(qe(this,mr,"f").address.uuid)} d: ${Ve.toString(this.duration)}}`}};Uu=new WeakMap,Ul=new WeakMap,mr=new WeakMap,jl=new WeakMap,Df=new WeakMap,Bf=new WeakMap,Tf=new WeakMap,Vl=new WeakSet,ju=function(){qe(this,Df,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var ck={for:(t,e)=>He(e.accept({visitNoteClipBox:r=>t.adapterFor(r,Ku),visitValueClipBox:r=>t.adapterFor(r,fs),visitAudioClipBox:r=>t.adapterFor(r,Ou)}),"")};var Mx=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},vs=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Nx,Wu,Rf,Cf,$x=class{constructor(e,r){Nx.set(this,void 0),Wu.set(this,void 0),Rf.set(this,void 0),Cf.set(this,void 0),Mx(this,Nx,e,"f"),Mx(this,Wu,new ae,"f"),Mx(this,Rf,vs(this,Wu,"f").own(new xe),"f"),Mx(this,Cf,vs(this,Wu,"f").own(jt.create(e.box.clips,n=>ck.for(r,n),l.ClipCollection)),"f"),vs(this,Cf,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return vs(this,Nx,"f")}get collection(){return vs(this,Cf,"f")}dispatchChange(){vs(this,Rf,"f").notify()}subscribeChanges(e){return vs(this,Rf,"f").subscribe(e)}terminate(){vs(this,Wu,"f").terminate()}};Nx=new WeakMap,Wu=new WeakMap,Rf=new WeakMap,Cf=new WeakMap;rt();A();A();A();rt();rt();var eC=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},vn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},pi,kx=class{constructor(e){pi.set(this,void 0),eC(this,pi,e,"f")}get inField(){return vn(this,pi,"f").in}get outField(){return vn(this,pi,"f").out}get inSlopeField(){return vn(this,pi,"f").inSlope}get outSlopeField(){return vn(this,pi,"f").outSlope}get in(){return vn(this,pi,"f").in.getValue()}get out(){return vn(this,pi,"f").out.getValue()}get inSlope(){return vn(this,pi,"f").inSlope.getValue()}get outSlope(){return vn(this,pi,"f").outSlope.getValue()}get hasFading(){return Wg.hasFading(this)}copyTo(e){e.in.setValue(this.in),e.out.setValue(this.out),e.inSlope.setValue(this.inSlope),e.outSlope.setValue(this.outSlope)}reset(){vn(this,pi,"f").in.setValue(0),vn(this,pi,"f").out.setValue(0),vn(this,pi,"f").inSlope.setValue(.75),vn(this,pi,"f").outSlope.setValue(.25)}};pi=new WeakMap;var At=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ne=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ji,zf,xn,ot,Lu,Zu,Gu,Of,na,Vf,xs,Hu,qu,Ju,Yu,Xu,Qu,ed,yn,td=class t{constructor(e,r){ji.add(this),this.type="audio-region",zf.set(this,void 0),xn.set(this,void 0),ot.set(this,void 0),Lu.set(this,void 0),Zu.set(this,void 0),Gu.set(this,void 0),Of.set(this,void 0),na.set(this,void 0),Vf.set(this,void 0),xs.set(this,_.None),Hu.set(this,ve.Empty),qu.set(this,ve.Empty),Ju.set(this,ve.Empty),Yu.set(this,ve.Empty),Xu.set(this,void 0),Qu.set(this,Number.NaN),ed.set(this,Number.NaN),At(this,xn,e,"f"),At(this,ot,r,"f"),At(this,zf,new ae,"f");let{timeBase:n,duration:i,loopDuration:a}=r;At(this,Lu,dl.aware(e.tempoMap,n,i),"f"),At(this,Zu,dl.aware(e.tempoMap,n,a),"f"),At(this,Gu,new Cr,"f"),At(this,Of,new xe,"f"),At(this,na,new kx(r.fading),"f"),At(this,Xu,!1,"f"),At(this,Vf,!0,"f"),ne(this,zf,"f").ownAll(ne(this,ot,"f").pointerHub.subscribe({onAdded:()=>ne(this,ji,"m",yn).call(this),onRemoved:()=>ne(this,ji,"m",yn).call(this)}),ne(this,ot,"f").file.catchupAndSubscribe(o=>{At(this,xs,o.targetVertex.map(s=>ne(this,xn,"f").boxAdapters.adapterFor(s.box,ta)),"f"),ne(this,Hu,"f").terminate(),At(this,Hu,ne(this,xs,"f").mapOr(s=>s.getOrCreateLoader().subscribe(()=>ne(this,ji,"m",yn).call(this)),ve.Empty),"f")}),ne(this,ot,"f").playMode.catchupAndSubscribe(({targetVertex:o})=>{ne(this,qu,"f").terminate(),o.match({none:()=>ne(this,Gu,"f").clear(),some:({box:s})=>{let c=ne(this,xn,"f").boxAdapters.adapterFor(s,za.isAudioPlayMode);At(this,qu,c.subscribe(()=>ne(this,ji,"m",yn).call(this)),"f"),ne(this,Gu,"f").wrap(c)}})}),ne(this,ot,"f").timeBase.catchupAndSubscribe(o=>{ne(this,Ju,"f").terminate(),fo(o.getValue(),ui)===ui.Seconds&&At(this,Ju,e.tempoMap.subscribe(()=>ne(this,ji,"m",yn).call(this)),"f")}),ne(this,ot,"f").subscribe(Ke.Children,o=>{if(!this.trackBoxAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let s=this.trackBoxAdapter.unwrap();ne(this,ot,"f").position.address.equals(o.address)?(s.regions.onIndexingChanged(),ne(this,ji,"m",yn).call(this)):ne(this,ji,"m",yn).call(this)}}),ne(this,ot,"f").events.catchupAndSubscribe(({targetVertex:o})=>{ne(this,Yu,"f").terminate(),At(this,Yu,o.match({none:()=>ve.Empty,some:({box:s})=>ne(this,xn,"f").boxAdapters.adapterFor(s,Or).subscribeChange(()=>ne(this,ji,"m",yn).call(this))}),"f"),ne(this,ji,"m",yn).call(this)})),At(this,Vf,!1,"f")}subscribeChange(e){return ne(this,Of,"f").subscribe(e)}accept(e){return $(e.visitAudioRegionBoxAdapter,this)}onSelected(){At(this,Xu,!0,"f"),ne(this,ji,"m",yn).call(this)}onDeselected(){At(this,Xu,!1,"f"),ne(this,ji,"m",yn).call(this)}get isSelected(){return ne(this,Xu,"f")}get box(){return ne(this,ot,"f")}get uuid(){return ne(this,ot,"f").address.uuid}get address(){return ne(this,ot,"f").address}get position(){return ne(this,ot,"f").position.getValue()}get duration(){return Number.isNaN(ne(this,Qu,"f"))&&At(this,Qu,ne(this,Lu,"f").toPPQN(this.position),"f"),ne(this,Qu,"f")}get complete(){return this.position+this.duration}get loopOffset(){return ne(this,ot,"f").loopOffset.getValue()}get loopDuration(){return Number.isNaN(ne(this,ed,"f"))&&At(this,ed,ne(this,Zu,"f").toPPQN(this.position),"f"),ne(this,ed,"f")}isNoteRegion(){return!1}isAudioRegion(){return!0}isValueRegion(){return!1}resolveDuration(e){return ne(this,Lu,"f").toPPQN(e)}resolveComplete(e){return e+this.resolveDuration(e)}resolveLoopDuration(e){return ne(this,Zu,"f").toPPQN(e)}get offset(){return this.position-this.loopOffset}get mute(){return ne(this,ot,"f").mute.getValue()}get hue(){return ne(this,ot,"f").hue.getValue()}get gain(){return ne(this,ot,"f").gain}get fading(){return ne(this,na,"f")}get file(){return ne(this,xs,"f").unwrap("Cannot access file.")}get optFile(){return ne(this,xs,"f")}get observableOptPlayMode(){return ne(this,Gu,"f")}get timeBase(){return fo(ne(this,ot,"f").timeBase.getValue(),ui)}get waveformOffset(){return ne(this,ot,"f").waveformOffset}get isPlayModeNoStretch(){return ne(this,ot,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>Ft(e,Oa)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Ft(e,Va)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>Ft(e,Ua)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>za.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(ne(this,xs,"f").isEmpty())return"No Audio File";let e=ne(this,xs,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):ne(this,ot,"f").label.getValue()}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}get trackBoxAdapter(){return ne(this,ot,"f").regions.targetVertex.map(e=>ne(this,xn,"f").boxAdapters.adapterFor(e.box,fr))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return ne(this,ot,"f").events.targetVertex.map(e=>ne(this,xn,"f").boxAdapters.adapterFor(e.box,Or))}set position(e){ne(this,ot,"f").position.setValue(e)}set duration(e){ne(this,Lu,"f").fromPPQN(e,this.position);let r=ne(this,na,"f").in+ne(this,na,"f").out;if(r>e){let n=e/r;ne(this,na,"f").inField.setValue(ne(this,na,"f").in*n),ne(this,na,"f").outField.setValue(ne(this,na,"f").out*n)}}set loopOffset(e){ne(this,ot,"f").loopOffset.setValue(sl(e,this.loopDuration))}set loopDuration(e){ne(this,Zu,"f").fromPPQN(e,this.position)}moveContentStart(e){let r=this.position,n=r+e;if(this.position=n,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e,this.timeBase===ui.Seconds){let i=e>=0?ne(this,xn,"f").tempoMap.intervalToSeconds(r,n):-ne(this,xn,"f").tempoMap.intervalToSeconds(n,r);ne(this,ot,"f").waveformOffset.setValue(this.waveformOffset.getValue()+i)}else this.optWarpMarkers.ifSome(i=>i.asArray().forEach(a=>a.box.position.setValue(a.position-e)))}copyTo(e){let r=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?r.copy().box.owners:r.box.owners,i=this.observableOptPlayMode.map(o=>o.clone()),a=ne(this,xn,"f").boxAdapters.adapterFor(os.create(ne(this,xn,"f").boxGraph,k.generate(),o=>{o.timeBase.setValue(ne(this,ot,"f").timeBase.getValue()),o.position.setValue(e?.position??ne(this,ot,"f").position.getValue()),o.regions.refer(e?.target??ne(this,ot,"f").regions.targetVertex.unwrap("regions.target")),o.file.refer(ne(this,ot,"f").file.targetVertex.unwrap("file.target")),o.events.refer(n),o.mute.setValue(this.mute),o.hue.setValue(this.hue),o.label.setValue(this.label),o.gain.setValue(this.gain.getValue()),o.waveformOffset.setValue(this.waveformOffset.getValue()),i.ifSome(s=>o.playMode.refer(s)),ne(this,na,"f").copyTo(o.fading)}),t);return a.loopDuration=e?.loopDuration??this.resolveLoopDuration(a.position),a.loopOffset=e?.loopOffset??this.loopOffset,a.duration=e?.duration??this.resolveDuration(a.position),a}consolidate(){}canFlatten(e){return e.length>0&&ie.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){return _.None}terminate(){ne(this,Hu,"f").terminate(),At(this,Hu,ve.Empty,"f"),ne(this,Ju,"f").terminate(),At(this,Ju,ve.Empty,"f"),ne(this,qu,"f").terminate(),At(this,qu,ve.Empty,"f"),ne(this,Yu,"f").terminate(),At(this,Yu,ve.Empty,"f"),ne(this,zf,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${k.toString(ne(this,ot,"f").address.uuid)}}`}};zf=new WeakMap,xn=new WeakMap,ot=new WeakMap,Lu=new WeakMap,Zu=new WeakMap,Gu=new WeakMap,Of=new WeakMap,na=new WeakMap,Vf=new WeakMap,xs=new WeakMap,Hu=new WeakMap,qu=new WeakMap,Ju=new WeakMap,Yu=new WeakMap,Xu=new WeakMap,Qu=new WeakMap,ed=new WeakMap,ji=new WeakSet,yn=function(){At(this,Qu,Number.NaN,"f"),At(this,ed,Number.NaN,"f"),!ne(this,Vf,"f")&&(ne(this,Of,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};rt();A();var Mo=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Re=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ka,Ix,Wa,Et,Kf,Uf,rd,jf,No,id=class t{constructor(e,r){Ka.add(this),this.type="note-region",Ix.set(this,new ae),Wa.set(this,void 0),Et.set(this,void 0),Kf.set(this,void 0),Uf.set(this,void 0),rd.set(this,void 0),jf.set(this,ve.Empty),Mo(this,Wa,e,"f"),Mo(this,Et,r,"f"),Mo(this,Kf,new xe,"f"),Mo(this,rd,!1,"f"),Mo(this,Uf,!0,"f"),Re(this,Ix,"f").ownAll(Re(this,Et,"f").pointerHub.subscribe({onAdded:()=>Re(this,Ka,"m",No).call(this),onRemoved:()=>Re(this,Ka,"m",No).call(this)}),Re(this,Et,"f").subscribe(Ke.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Re(this,Et,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Re(this,Ka,"m",No).call(this)):Re(this,Ka,"m",No).call(this)}}),Re(this,Et,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Re(this,jf,"f").terminate(),Mo(this,jf,n.match({none:()=>ve.Empty,some:({box:i})=>Re(this,Wa,"f").boxAdapters.adapterFor(i,gn).subscribeChange(()=>Re(this,Ka,"m",No).call(this))}),"f"),Re(this,Ka,"m",No).call(this)})),Mo(this,Uf,!1,"f")}set position(e){Re(this,Et,"f").position.setValue(e)}set duration(e){Re(this,Et,"f").duration.setValue(e)}set loopOffset(e){Re(this,Et,"f").loopOffset.setValue(e)}set loopDuration(e){Re(this,Et,"f").loopDuration.setValue(e)}isNoteRegion(){return!0}isAudioRegion(){return!1}isValueRegion(){return!1}moveContentStart(e){this.optCollection.ifSome(r=>r.events.asArray().forEach(n=>n.box.position.setValue(n.position-e))),this.position=this.position+e,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e}subscribeChange(e){return Re(this,Kf,"f").subscribe(e)}accept(e){return $(e.visitNoteRegionBoxAdapter,this)}onSelected(){Mo(this,rd,!0,"f"),Re(this,Ka,"m",No).call(this)}onDeselected(){Mo(this,rd,!1,"f"),Re(this,Ka,"m",No).call(this)}get isSelected(){return Re(this,rd,"f")}*iterateActiveNotesAt(e){let r=this.optCollection;if(r.isEmpty())return;let n=r.unwrap(),i=go.globalToLocal(this,e);for(let a of n.events.iterateFrom(i-n.maxDuration)){if(i<a.position)return;i<a.complete&&(yield a.copyAsNoteEvent())}}terminate(){Re(this,jf,"f").terminate(),Re(this,Ix,"f").terminate()}get box(){return Re(this,Et,"f")}get uuid(){return Re(this,Et,"f").address.uuid}get address(){return Re(this,Et,"f").address}get position(){return Re(this,Et,"f").position.getValue()}get duration(){return Re(this,Et,"f").duration.getValue()}get loopOffset(){return Re(this,Et,"f").loopOffset.getValue()}get loopDuration(){return Re(this,Et,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}resolveDuration(e){return this.duration}resolveComplete(e){return e+this.duration}resolveLoopDuration(e){return this.loopDuration}get mute(){return Re(this,Et,"f").mute.getValue()}get hue(){return Re(this,Et,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Re(this,Et,"f").events.targetVertex.map(e=>Re(this,Wa,"f").boxAdapters.adapterFor(e.box,gn))}get label(){return Re(this,Et,"f").label.getValue()}get trackBoxAdapter(){return Re(this,Uf,"f")?_.None:Re(this,Et,"f").regions.targetVertex.map(e=>Re(this,Wa,"f").boxAdapters.adapterFor(e.box,fr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}copyTo(e){let r=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?r.copy().box.owners:r.box.owners;return Re(this,Wa,"f").boxAdapters.adapterFor(yl.create(Re(this,Wa,"f").boxGraph,k.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.target??Re(this,Et,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let r=Re(this,Wa,"f").boxGraph,n=Fo.create(r,k.generate());e.events.asArray().forEach(i=>i.copyTo({events:n.events})),Re(this,Et,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&ie.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){if(!this.canFlatten(e))return _.None;let r=Re(this,Wa,"f").boxGraph,n=e.toSorted(Yo.Comparator),i=ie.getFirst(n,"Internal error (no first)"),a=ie.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,c=i.trackBoxAdapter.unwrap("trackBoxAdapter"),u=Fo.create(r,k.generate()),f=Array.from(c.regions.collection.iterateRange(o,s));return f.filter(v=>v.isSelected).forEach(v=>{let m=v;for(let{resultStart:w,resultEnd:y,rawStart:P}of go.locateLoops(m,m.position,m.complete)){let V=Math.floor(w-P),O=Math.floor(y-P);for(let C of m.optCollection.unwrap("optCollection").events.iterateRange(V,O))C.copyTo({position:C.position+P-i.position,events:u.events})}}),f.forEach(({box:v})=>v.delete()),_.wrap(yl.create(r,k.generate(),v=>{v.position.setValue(o),v.duration.setValue(s-o),v.loopDuration.setValue(s-o),v.loopOffset.setValue(0),v.hue.setValue(this.hue),v.mute.setValue(this.mute),v.label.setValue(this.label),v.events.refer(u.owners),v.regions.refer(c.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${k.toString(Re(this,Et,"f").address.uuid)} p: ${Ve.toString(this.position)}, c: ${Ve.toString(this.complete)}}`}};Ix=new WeakMap,Wa=new WeakMap,Et=new WeakMap,Kf=new WeakMap,Uf=new WeakMap,rd=new WeakMap,jf=new WeakMap,Ka=new WeakSet,No=function(){Re(this,Kf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};rt();A();var $o=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},$e=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},aa,nd,La,St,Zf,ad,Wf,Lf,Za,ko=class t{constructor(e,r){aa.add(this),this.type="value-region",nd.set(this,new ae),La.set(this,void 0),St.set(this,void 0),Zf.set(this,void 0),ad.set(this,void 0),Wf.set(this,void 0),Lf.set(this,ve.Empty),$o(this,La,e,"f"),$o(this,St,r,"f"),$o(this,Wf,!0,"f"),$o(this,Zf,new xe,"f"),$o(this,ad,!1,"f"),$e(this,nd,"f").own($e(this,St,"f").pointerHub.subscribe({onAdded:()=>$e(this,aa,"m",Za).call(this),onRemoved:()=>$e(this,aa,"m",Za).call(this)})),$e(this,nd,"f").own($e(this,St,"f").subscribe(Ke.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();$e(this,St,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),$e(this,aa,"m",Za).call(this)):$e(this,aa,"m",Za).call(this)}})),$e(this,nd,"f").own($e(this,St,"f").events.catchupAndSubscribe(({targetVertex:n})=>{$e(this,Lf,"f").terminate(),$o(this,Lf,n.match({none:()=>ve.Empty,some:({box:i})=>$e(this,La,"f").boxAdapters.adapterFor(i,Or).subscribeChange(()=>$e(this,aa,"m",Za).call(this))}),"f"),$e(this,aa,"m",Za).call(this)})),$o(this,Wf,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(go.globalToLocal(this,e),r)}incomingValue(e){let r=this.optCollection;if(r.isEmpty())return e;let n=r.unwrap().events.greaterEqual(0);return K(n)&&n.position===0?n.value:this.valueAt(this.position,e)}outgoingValue(e){let r=this.optCollection;if(r.isEmpty())return e;let n=r.unwrap();return(this.complete-this.offset)%this.loopDuration===0?n.valueAt(this.loopDuration,e):n.valueAt(go.globalToLocal(this,this.complete),e)}subscribeChange(e){return $e(this,Zf,"f").subscribe(e)}accept(e){return $(e.visitValueRegionBoxAdapter,this)}onSelected(){$o(this,ad,!0,"f"),$e(this,aa,"m",Za).call(this)}onDeselected(){$o(this,ad,!1,"f"),$e(this,aa,"m",Za).call(this)}get isSelected(){return $e(this,ad,"f")}onValuesPropertyChanged(){$e(this,aa,"m",Za).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){$e(this,Lf,"f").terminate(),$e(this,nd,"f").terminate()}get box(){return $e(this,St,"f")}get uuid(){return $e(this,St,"f").address.uuid}get address(){return $e(this,St,"f").address}get position(){return $e(this,St,"f").position.getValue()}get duration(){return $e(this,St,"f").duration.getValue()}get loopOffset(){return $e(this,St,"f").loopOffset.getValue()}get loopDuration(){return $e(this,St,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}isNoteRegion(){return!1}isAudioRegion(){return!1}isValueRegion(){return!0}resolveDuration(e){return this.duration}resolveComplete(e){return e+this.duration}resolveLoopDuration(e){return this.loopDuration}get mute(){return $e(this,St,"f").mute.getValue()}get hue(){return $e(this,St,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return $e(this,St,"f").events.targetVertex.map(e=>$e(this,La,"f").boxAdapters.adapterFor(e.box,Or))}get label(){return $e(this,St,"f").label.getValue()}get trackBoxAdapter(){return $e(this,Wf,"f")?_.None:$e(this,St,"f").regions.targetVertex.map(e=>$e(this,La,"f").boxAdapters.adapterFor(e.box,fr))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}set position(e){$e(this,St,"f").position.setValue(e)}set duration(e){$e(this,St,"f").duration.setValue(e)}set loopOffset(e){$e(this,St,"f").loopOffset.setValue(e)}set loopDuration(e){$e(this,St,"f").loopDuration.setValue(e)}moveContentStart(e){this.optCollection.ifSome(r=>r.events.asArray().forEach(n=>n.box.position.setValue(n.position-e))),this.position=this.position+e,this.loopDuration=this.loopDuration-e,this.duration=this.duration-e}copyTo(e){let r=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?r.copy().box.owners:r.box.owners;return $e(this,La,"f").boxAdapters.adapterFor(wl.create($e(this,La,"f").boxGraph,k.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.target??$e(this,St,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let r=$e(this,La,"f").boxGraph,n=Qn.create(r,k.generate());e.asArray().forEach(i=>i.copyTo({events:n.events})),$e(this,St,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&ie.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){if(!this.canFlatten(e))return _.None;let r=$e(this,La,"f").boxGraph,n=e.toSorted(Yo.Comparator),i=ie.getFirst(n,"Internal error (no first)"),a=ie.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,c=i.trackBoxAdapter.unwrap("trackBoxAdapter"),u=Array.from(c.regions.collection.iterateRange(o,s)),f=[];u.filter(y=>y.isSelected).forEach(y=>{let P=y,V=P.optCollection.unwrap("optCollection"),O=V.events;for(let{rawStart:C,regionStart:G,regionEnd:Y}of go.locateLoops(P,P.position,P.complete)){let me=G-C,ge=Y-C,Ee=O.greaterEqual(me);if(!K(Ee)||Ee.position!==me){let Me=O.lowerEqual(me);K(Me)&&f.push({position:G-o,value:V.valueAt(me,0),interpolation:Me.interpolation})}let he=!1;for(let Me of O.iterateRange(me,Rr.MAX_VALUE)){let ke=Me.position+C;if(ke<Y)f.push({position:ke-o,value:Me.value,interpolation:Me.interpolation});else if(ke===Y){f.push({position:ke-o,value:Me.value,interpolation:Jr.None}),he=!0;break}else{f.push({position:Y-o,value:V.valueAt(ge,0),interpolation:Jr.None}),he=!0;break}}he||f.push({position:Y-o,value:V.valueAt(ge,0),interpolation:Jr.None})}});let v=[];for(let y of f){let P=v.length>0?v[v.length-1]:void 0;K(P)&&P.position===y.position&&P.value===y.value?v[v.length-1]=y:v.push(y)}let m=Qn.create(r,k.generate()),w=0;for(;w<v.length;){let y=w+1;for(;y<v.length&&v[y].position===v[w].position;)y++;let P=v[w],V=v[y-1],O=Xn.create(r,k.generate(),C=>{C.position.setValue(P.position),C.index.setValue(0),C.value.setValue(P.value),C.events.refer(m.events)});if(Fi.write(O.interpolation,y-w>1?Jr.None:P.interpolation),y-w>1){let C=Xn.create(r,k.generate(),G=>{G.position.setValue(V.position),G.index.setValue(1),G.value.setValue(V.value),G.events.refer(m.events)});Fi.write(C.interpolation,V.interpolation)}w=y}return u.forEach(({box:y})=>y.delete()),_.wrap(wl.create(r,k.generate(),y=>{y.position.setValue(o),y.duration.setValue(s-o),y.loopDuration.setValue(s-o),y.loopOffset.setValue(0),y.hue.setValue(this.hue),y.mute.setValue(this.mute),y.label.setValue(this.label),y.events.refer(m.owners),y.regions.refer(c.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${k.toString($e(this,St,"f").address.uuid)} p: ${Ve.toString(this.position)}, c: ${Ve.toString(this.complete)}}`}};nd=new WeakMap,La=new WeakMap,St=new WeakMap,Zf=new WeakMap,ad=new WeakMap,Wf=new WeakMap,Lf=new WeakMap,aa=new WeakSet,Za=function(){$e(this,Zf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var uk=(t,e)=>t.position-e.position,dk={for:(t,e)=>He(e.accept({visitNoteRegionBox:r=>t.adapterFor(r,id),visitAudioRegionBox:r=>t.adapterFor(r,td),visitValueRegionBox:r=>t.adapterFor(r,ko)}),"")};var od=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},gr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},sd,Kl,Gf,ld,ys,cd,Bx=class{constructor(e,r){sd.set(this,void 0),Kl.set(this,void 0),Gf.set(this,void 0),ld.set(this,void 0),ys.set(this,void 0),cd.set(this,void 0),od(this,sd,e,"f"),od(this,Kl,new ae,"f"),od(this,Gf,gr(this,Kl,"f").own(new xe),"f"),od(this,ld,gr(this,Kl,"f").own(new dr),"f"),od(this,ys,Yo.create(uk),"f"),od(this,cd,k.newSet(n=>n.uuid),"f"),gr(this,Kl,"f").ownAll(gr(this,sd,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=dk.for(r,n),a=gr(this,cd,"f").add(i);ee(a,`Cannot add ${n}`),gr(this,ys,"f").add(i);for(let o of gr(this,ys,"f").iterateRange(i.position,i.complete))if(o!==i&&o.position<i.complete&&o.complete>i.position){console.warn("[TrackRegions] Overlapping region added",{track:gr(this,sd,"f").listIndex,added:{p:i.position,d:i.duration,c:i.complete},existing:{p:o.position,d:o.duration,c:o.complete},stack:new Error().stack});break}gr(this,ld,"f").forEach(o=>o.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:n}}})=>{let i=gr(this,cd,"f").removeByKey(n);gr(this,ys,"f").remove(i),gr(this,ld,"f").forEach(a=>a.onRemoved(i)),this.dispatchChange()}},l.RegionCollection))}get trackBoxAdapter(){return gr(this,sd,"f")}get collection(){return gr(this,ys,"f")}get adapters(){return gr(this,cd,"f")}onIndexingChanged(){gr(this,ys,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),gr(this,ld,"f").subscribe(e)}subscribeChanges(e){return gr(this,Gf,"f").subscribe(e)}dispatchChange(){gr(this,Gf,"f").notify()}terminate(){gr(this,Kl,"f").terminate()}};sd=new WeakMap,Kl=new WeakMap,Gf=new WeakMap,ld=new WeakMap,ys=new WeakMap,cd=new WeakMap;A();A();var ye;(function(t){t[t.Undefined=0]="Undefined",t[t.Notes=1]="Notes",t[t.Audio=2]="Audio",t[t.Value=3]="Value"})(ye||(ye={}));(function(t){t.toLabelString=e=>{switch(e){case t.Audio:return"Audio";case t.Notes:return"Note";case t.Value:return"Automation";case t.Undefined:default:return"N/A"}},t.toIconSymbol=e=>{switch(e){case t.Audio:return We.Waveform;case t.Notes:return We.Piano;case t.Value:return We.Automation;case t.Undefined:return We.AudioBus;default:return We.Unknown}}})(ye||(ye={}));A();var Tx;(function(t){t.isDeviceBox=e=>e.tags.type==="device",t.isInstrumentDeviceBox=e=>t.isDeviceBox(e)&&e.tags.deviceType==="instrument",t.isEffectDeviceBox=e=>t.isDeviceBox(e)&&(e.tags.deviceType==="audio-effect"||e.tags.deviceType==="midi-effect"),t.isChainEffectOf=(e,r)=>t.isEffectDeviceBox(e)&&e.host.targetVertex.mapOr(n=>n.box===r,!1),t.lookupHostField=e=>K(e)&&"host"in e&&Ft(e.host,I)?e.host:W(`Could not find 'host' field in '${e?.name}'`),t.lookupLabelField=e=>K(e)&&"label"in e&&Ft(e.label,T)?e.label:W(`Could not find 'label' field in '${e?.name}'`),t.lookupEnabledField=e=>K(e)&&"enabled"in e&&Ft(e.enabled,B)?e.enabled:W(`Could not find 'enabled' field in '${e?.name}'`),t.lookupMinimizedField=e=>K(e)&&"minimized"in e&&Ft(e.minimized,B)?e.minimized:W(`Could not find 'minimized' field in '${e?.name}'`),t.lookupIndexField=e=>K(e)&&"index"in e&&Ft(e.index,N)?e.index:W(`Could not find 'index' field in '${e?.name}'`)})(Tx||(Tx={}));var pk;(function(t){t.toTrackType=e=>{switch(e){case"midi":return ye.Notes;case"audio":return ye.Audio;default:return W()}}})(pk||(pk={}));var R_;(function(t){t.chainOf=(e,r)=>r==="audio"?e.audioEffects:e.midiEffects,t.chainFieldOf=(e,r)=>r==="audio"?e.audioEffectsField:e.midiEffectsField,t.takesEffect=(e,r)=>t.chainFieldOf(e,r).nonEmpty()&&(r==="audio"||!e.hostsInstrument||e.inputAdapter.mapOr(n=>n.accepts==="midi",!1))})(R_||(R_={}));var oe;(function(t){t.isAny=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="bus"||e.type==="instrument"||e.type==="audio-effect"),t.isEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="audio-effect"),t.isInstrument=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="instrument",t.isMidiEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="midi-effect",t.isAudioEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="audio-effect",t.isHost=e=>e!==null&&typeof e=="object"&&"class"in e&&e.class==="device-host",t.deleteEffectDevices=e=>{if(e.length===0)return;ee(ie.satisfy(e,(a,o)=>a.deviceHost().address.equals(o.deviceHost().address)),"Devices are not connected to the same host");let r=e[0];R_.chainFieldOf(r.deviceHost(),r.accepts).unwrap(`host takes no ${r.accepts} effects`).pointerHub.filter(r.accepts==="audio"?l.AudioEffectHost:l.MIDIEffectHost).map(({box:a})=>Tx.lookupIndexField(a)).filter(a=>e.some(o=>k.Comparator(o.uuid,a.address.uuid)!==0)).sort((a,o)=>a.getValue()-o.getValue()).forEach((a,o)=>a.setValue(o)),e.forEach(a=>a.box.delete())}})(oe||(oe={}));A();var Dx=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Br=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ud,Rx,oa,Wl,Cx,zx=class{constructor(e,r){ud.set(this,void 0),Rx.set(this,new xe),oa.set(this,void 0),Wl.set(this,void 0),Cx.set(this,void 0),Dx(this,ud,e,"f"),Dx(this,oa,jt.create(e.box.tracks,n=>r.adapterFor(n,fr),l.TrackCollection),"f"),Dx(this,Wl,k.newSet(({uuid:n})=>n),"f"),Dx(this,Cx,Br(this,oa,"f").catchupAndSubscribe({onAdd:n=>Br(this,Wl,"f").add({uuid:n.uuid,subscription:n.regions.subscribeChanges(()=>Br(this,Rx,"f").notify())}),onRemove:({uuid:n})=>Br(this,Wl,"f").removeByKey(n).subscription.terminate(),onReorder:n=>{}}),"f")}create(e,r,n){let i=Br(this,ud,"f").box.graph,a=Br(this,ud,"f").box.tracks;_i.create(i,k.generate(),o=>{o.index.setValue(n??Br(this,oa,"f").getMinFreeIndex()),o.type.setValue(e),o.tracks.refer(a),o.target.refer(r)})}controls(e){return _.wrap(Br(this,oa,"f").adapters().find(r=>r.target.targetVertex.contains(e),!1))}delete(e){let r=Br(this,oa,"f").adapters(),n=r.indexOf(e);if(n===-1)return W(`Cannot delete ${e}. Does not exist.`);for(let i=n+1;i<r.length;i++)r[i].indexField.setValue(i-1);e.box.delete()}get audioUnitBox(){return Br(this,ud,"f").box}get collection(){return Br(this,oa,"f")}values(){return Br(this,oa,"f").adapters()}catchupAndSubscribe(e){return Br(this,oa,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return Br(this,Rx,"f").subscribe(e)}terminate(){Br(this,oa,"f").terminate(),Br(this,Cx,"f").terminate(),Br(this,Wl,"f").forEach(({subscription:e})=>e.terminate()),Br(this,Wl,"f").clear()}};ud=new WeakMap,Rx=new WeakMap,oa=new WeakMap,Wl=new WeakMap,Cx=new WeakMap;A();A();var se;(function(t){t.AudioBus="manuals/audio-bus",t.Arpeggio="manuals/devices/midi/arpeggio",t.Pitch="manuals/devices/midi/pitch",t.Spielwerk="manuals/devices/midi/spielwerk",t.Velocity="manuals/devices/midi/velocity",t.Zeitgeist="manuals/devices/midi/zeitgeist",t.Autotune="manuals/devices/audio/autotune",t.StereoTool="manuals/devices/audio/stereotool",t.Delay="manuals/devices/audio/delay",t.DattorroReverb="manuals/devices/audio/dattorro-reverb",t.Maximizer="manuals/devices/audio/maximizer",t.Compressor="manuals/devices/audio/compressor",t.Gate="manuals/devices/audio/gate",t.Reverb="manuals/devices/audio/reverb",t.Crusher="manuals/devices/audio/crusher",t.Fold="manuals/devices/audio/fold",t.Tidal="manuals/devices/audio/tidal",t.Revamp="manuals/devices/audio/revamp",t.Modular="manuals/devices/audio/modular",t.NeuralAmp="manuals/devices/audio/neural-amp",t.Vocoder="manuals/devices/audio/vocoder",t.Waveshaper="manuals/devices/audio/waveshaper",t.Werkstatt="manuals/devices/audio/werkstatt",t.AudioEffectComposite="manuals/devices/audio/effect-composite",t.StereoComposite="manuals/devices/audio/stereo-composite",t.Apparat="manuals/devices/instruments/apparat",t.Tape="manuals/devices/instruments/tape",t.Nano="manuals/devices/instruments/nano",t.Playfield="manuals/devices/instruments/playfield",t.Vaporisateur="manuals/devices/instruments/vaporisateur",t.Neon="manuals/devices/instruments/neon",t.MIDIOutput="manuals/devices/instruments/midioutput",t.Soundfont="manuals/devices/instruments/soundfont",t.FrequencySplit="manuals/devices/audio/frequency-split"})(se||(se={}));var fk=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},sa=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ox,Ki,Wi=class{constructor(e,r){this.type="bus",this.accepts="audio",this.manualUrl=se.AudioBus,Ox.set(this,void 0),Ki.set(this,void 0),fk(this,Ox,e,"f"),fk(this,Ki,r,"f")}catchupAndSubscribe(e){return e(this),sa(this,Ki,"f").subscribe(Ke.Children,()=>e(this))}get uuid(){return sa(this,Ki,"f").address.uuid}get address(){return sa(this,Ki,"f").address}get box(){return sa(this,Ki,"f")}get enabledField(){return sa(this,Ki,"f").enabled}get minimizedField(){return sa(this,Ki,"f").minimized}get iconField(){return sa(this,Ki,"f").icon}get labelField(){return sa(this,Ki,"f").label}get colorField(){return sa(this,Ki,"f").color}get iconSymbol(){return We.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return sa(this,Ox,"f").boxAdapters.adapterFor(sa(this,Ki,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){}toString(){return`{${this.constructor.name}}`}};Ox=new WeakMap,Ki=new WeakMap;var Hf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},zt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Io,dd,pd,Li,qf,Vx=class{constructor(e,r){Io.set(this,void 0),dd.set(this,void 0),pd.set(this,void 0),Li.set(this,void 0),qf.set(this,ve.Empty),Hf(this,Io,new ae,"f"),Hf(this,dd,zt(this,Io,"f").own(new xe),"f"),Hf(this,pd,zt(this,Io,"f").own(new un(We.Unknown)),"f"),Hf(this,Li,zt(this,Io,"f").own(new Cr),"f"),zt(this,Io,"f").own(zt(this,Li,"f").subscribe(n=>{zt(this,qf,"f").terminate(),Hf(this,qf,n.match({none:()=>(zt(this,dd,"f").notify(_.None),ve.Empty),some:({labelField:i,iconField:a})=>ve.many(a.catchupAndSubscribe(o=>zt(this,pd,"f").setValue(We.fromName(o.getValue()))),i.catchupAndSubscribe(o=>zt(this,dd,"f").notify(_.wrap(o.getValue()))))}),"f")})),zt(this,Io,"f").own(e.catchupAndSubscribe({onAdded:({box:n,pointerType:i})=>{if(zt(this,Li,"f").nonEmpty()){let o=zt(this,Li,"f").unwrap();W(`AudioUnitInput already has an input. Existing: ${o.box.name}@${o.box.address.toString()} (type: ${o.type}), Incoming: ${n.name}@${n.address.toString()} (pointerType: ${String(i)})`)}let a=n instanceof ea?r.adapterFor(n,Wi):r.adapterFor(n,oe.isInstrument);zt(this,Li,"f").unwrapOrNull()!==a&&zt(this,Li,"f").wrap(a)},onRemoved:({box:n})=>{ee(zt(this,Li,"f").unwrap("Cannot remove").box.address.equals(n.address),"Unexpected value to remove"),zt(this,Li,"f").clear()}},l.InstrumentHost,l.AudioOutput))}adapter(){return zt(this,Li,"f")}subscribe(e){return zt(this,Li,"f").subscribe(e)}catchupAndSubscribe(e){return e(zt(this,Li,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),zt(this,dd,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return zt(this,pd,"f").catchupAndSubscribe(e)}set label(e){this.adapter().ifSome(r=>r.labelField.setValue(e))}get label(){return this.adapter().map(e=>e.labelField.getValue())}set icon(e){this.adapter().ifSome(r=>r.iconField.setValue(We.toName(e)))}get icon(){return this.adapter().match({none:()=>We.Unknown,some:e=>We.fromName(e.iconField.getValue())})}get iconValue(){return zt(this,pd,"f")}terminate(){zt(this,Io,"f").terminate(),zt(this,qf,"f").terminate()}};Io=new WeakMap,dd=new WeakMap,pd=new WeakMap,Li=new WeakMap,qf=new WeakMap;A();var hk=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ll=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ux,Bo,ue=class{constructor(e){Ux.set(this,void 0),Bo.set(this,void 0),hk(this,Ux,e,"f"),hk(this,Bo,ze.newSet(r=>r.address),"f")}terminate(){Ll(this,Bo,"f").forEach(e=>e.terminate()),Ll(this,Bo,"f").clear()}parameters(){return Ll(this,Bo,"f").values()}parameterAt(e){return Ll(this,Bo,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,r,n,i,a,o){let s=new Zl(Ll(this,Ux,"f"),e,r,n,i,a,o),c=Ll(this,Bo,"f").add(s);return ee(c,`Could not add adapter for ${e}`),s}removeParameter(e){return Ll(this,Bo,"f").removeByKey(e)}};Ux=new WeakMap,Bo=new WeakMap;A();var Gl=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Dt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Hl,wn,ws,fd,jx,Kx,Jf,hd=class{constructor(e,r){Hl.set(this,void 0),wn.set(this,void 0),ws.set(this,void 0),fd.set(this,void 0),jx.set(this,void 0),Kx.set(this,void 0),Jf.set(this,ve.Empty),Gl(this,Hl,e,"f"),Gl(this,wn,r,"f"),Gl(this,ws,new ae,"f"),Gl(this,fd,Dt(this,ws,"f").own(new xe),"f"),Dt(this,ws,"f").own(r.targetBus.catchupAndSubscribe(()=>{Dt(this,Jf,"f").terminate(),Gl(this,Jf,this.optTargetBus.match({none:()=>(Dt(this,fd,"f").notify(_.None),ve.Empty),some:n=>n.catchupAndSubscribe(i=>Dt(this,fd,"f").notify(_.wrap(i)))}),"f")})),Gl(this,jx,Dt(this,ws,"f").own(new Zl(Dt(this,Hl,"f"),Dt(this,wn,"f").sendPan,E.bipolar(),S.percent({unit:"%",fractionDigits:0}),"panning")),"f"),Gl(this,Kx,Dt(this,ws,"f").own(new Zl(Dt(this,Hl,"f"),Dt(this,wn,"f").sendGain,E.DefaultDecibel,S.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),Dt(this,fd,"f").subscribe(e)}get uuid(){return Dt(this,wn,"f").address.uuid}get address(){return Dt(this,wn,"f").address}get box(){return Dt(this,wn,"f")}get indexField(){return Dt(this,wn,"f").index}get sendPan(){return Dt(this,jx,"f")}get sendGain(){return Dt(this,Kx,"f")}get targetBus(){return Dt(this,Hl,"f").boxAdapters.adapterFor(Dt(this,wn,"f").targetBus.targetVertex.unwrap("no audioUnit").box,Wi)}get optTargetBus(){return Dt(this,wn,"f").targetBus.targetVertex.flatMap(e=>_.wrap(e.box.accept({visitAudioBusBox:r=>Dt(this,Hl,"f").boxAdapters.adapterFor(r,Wi)})))}delete(){Dt(this,wn,"f").delete()}terminate(){Dt(this,ws,"f").terminate(),Dt(this,Jf,"f").terminate()}};Hl=new WeakMap,wn=new WeakMap,ws=new WeakMap,fd=new WeakMap,jx=new WeakMap,Kx=new WeakMap,Jf=new WeakMap;A();var Yf=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ga=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Wx,Lx,md,gd,Xf,Zx=class{constructor(e,r){Wx.set(this,void 0),Lx.set(this,void 0),md.set(this,void 0),gd.set(this,void 0),Xf.set(this,ve.Empty),Yf(this,Wx,e,"f"),Yf(this,Lx,r,"f"),Yf(this,md,new ae,"f"),Yf(this,gd,Ga(this,md,"f").own(new xe),"f"),Ga(this,md,"f").own(e.catchupAndSubscribe(()=>{Ga(this,Xf,"f").terminate(),Yf(this,Xf,this.adapter.match({none:()=>(Ga(this,gd,"f").notify(_.None),ve.Empty),some:n=>n.catchupAndSubscribe(i=>Ga(this,gd,"f").notify(_.wrap(i)))}),"f")}))}subscribe(e){return Ga(this,gd,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return Ga(this,Wx,"f").targetVertex.flatMap(e=>_.wrap(e.box.accept({visitAudioBusBox:r=>Ga(this,Lx,"f").adapterFor(r,Wi)})))}terminate(){Ga(this,md,"f").terminate(),Ga(this,Xf,"f").terminate()}};Wx=new WeakMap,Lx=new WeakMap,md=new WeakMap,gd=new WeakMap,Xf=new WeakMap;var To=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},be=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Gx,mk,Ha,Zi,Lt,Jl,vd,ql,Hx,Qf,qx,Jx,gk,vk,bn=class{constructor(e,r){Gx.add(this),this.class="device-host",Ha.set(this,new ae),Zi.set(this,void 0),Lt.set(this,void 0),Jl.set(this,void 0),vd.set(this,void 0),ql.set(this,void 0),Hx.set(this,void 0),Qf.set(this,void 0),qx.set(this,void 0),Jx.set(this,void 0),To(this,Zi,e,"f"),To(this,Lt,r,"f"),To(this,Jl,be(this,Ha,"f").own(new ue(be(this,Zi,"f"))),"f"),To(this,vd,be(this,Ha,"f").own(new zx(this,be(this,Zi,"f").boxAdapters)),"f"),To(this,ql,be(this,Ha,"f").own(new Vx(be(this,Lt,"f").input.pointerHub,be(this,Zi,"f").boxAdapters)),"f"),To(this,Hx,be(this,Ha,"f").own(jt.create(be(this,Lt,"f").midiEffects,n=>be(this,Zi,"f").boxAdapters.adapterFor(n,oe.isMidiEffect),l.MIDIEffectHost)),"f"),To(this,Qf,be(this,Ha,"f").own(jt.create(be(this,Lt,"f").audioEffects,n=>be(this,Zi,"f").boxAdapters.adapterFor(n,oe.isAudioEffect),l.AudioEffectHost)),"f"),To(this,qx,be(this,Ha,"f").own(jt.create(be(this,Lt,"f").auxSends,n=>be(this,Zi,"f").boxAdapters.adapterFor(n,hd),l.AuxSend)),"f"),To(this,Jx,be(this,Ha,"f").own(new Zx(be(this,Lt,"f").output,be(this,Zi,"f").boxAdapters)),"f"),this.namedParameter=be(this,Gx,"m",gk).call(this,r),be(this,Gx,"m",vk).call(this)}get box(){return be(this,Lt,"f")}get uuid(){return be(this,Lt,"f").address.uuid}get address(){return be(this,Lt,"f").address}get indexField(){return be(this,Lt,"f").index}get type(){return be(this,Lt,"f").type.getValue()}get captureBox(){return be(this,Lt,"f").capture.targetVertex}get tracks(){return be(this,vd,"f")}get input(){return be(this,ql,"f")}get midiEffects(){return _.wrap(be(this,Hx,"f"))}get audioEffects(){return _.wrap(be(this,Qf,"f"))}get inputAdapter(){return be(this,ql,"f").adapter()}get auxSends(){return be(this,qx,"f")}get output(){return be(this,Jx,"f")}get isBus(){return this.input.adapter().mapOr(e=>e.type==="bus",!1)}get isInstrument(){return this.input.adapter().mapOr(e=>e.type==="instrument",!1)}get isOutput(){return be(this,Lt,"f").output.targetVertex.mapOr(e=>e.box.address.equals(be(this,Zi,"f").rootBoxAdapter.address),!1)}get automationCollapsed(){return be(this,Lt,"f").userInterface.automationCollapsed}get midiEffectsField(){return _.wrap(be(this,Lt,"f").midiEffects)}get inputField(){return be(this,Lt,"f").input}get audioEffectsField(){return _.wrap(be(this,Lt,"f").audioEffects)}get tracksField(){return be(this,Lt,"f").tracks}get minimizedField(){return be(this,ql,"f").adapter().unwrap("input.adapter").minimizedField}get isAudioUnit(){return!0}get hostsInstrument(){return!0}get label(){return be(this,ql,"f").adapter().mapOr(e=>e.labelField.getValue(),"")}deviceHost(){return this}audioUnitBoxAdapter(){return this}*labeledAudioOutputs(){let e=this.input.adapter();e.nonEmpty()&&(yield*e.unwrap().labeledAudioOutputs());for(let r of be(this,Qf,"f").adapters())yield*r.labeledAudioOutputs();yield{address:this.address,label:"Channelstrip",children:()=>_.None}}indicesLimit(){let e=be(this,Zi,"f").rootBoxAdapter.audioUnits.adapters(),r=this.indexField.getValue(),n=this.type,i=r,a=r;for(;i>0&&e[i-1].type===n;)i--;for(;a<e.length-1&&e[a+1].type===n;)a++;return[i,a+1]}move(e){be(this,Zi,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,r){be(this,vd,"f").collection.move(e,r)}deleteTrack(e){be(this,vd,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){be(this,Ha,"f").terminate()}};mk=bn,Ha=new WeakMap,Zi=new WeakMap,Lt=new WeakMap,Jl=new WeakMap,vd=new WeakMap,ql=new WeakMap,Hx=new WeakMap,Qf=new WeakMap,qx=new WeakMap,Jx=new WeakMap,Gx=new WeakSet,gk=function(e){return{volume:be(this,Jl,"f").createParameter(e.volume,mk.VolumeMapper,S.decible,"Volume"),panning:be(this,Jl,"f").createParameter(e.panning,E.bipolar(),S.panning,"Panning",.5),mute:be(this,Jl,"f").createParameter(e.mute,E.bool,S.bool,"Mute"),solo:be(this,Jl,"f").createParameter(e.solo,E.bool,S.bool,"Solo")}},vk=function(){let e=this.address.toString(),r=be(this,Lt,"f").capture.targetAddress.unwrapOrUndefined(),n=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${be(this,Lt,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${r}`;ee(this.type!==Tt.Instrument||be(this,Lt,"f").capture.targetAddress.nonEmpty(),n)};bn.VolumeMapper=E.decibel(-96,-9,6);var xd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Je=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Xl,Qr,Xr,Yl,Yx,Xx,eh,xk,yk,Qx,fr=class{constructor(e,r){Xl.add(this),Qr.set(this,void 0),Xr.set(this,void 0),Yl.set(this,void 0),Yx.set(this,void 0),Xx.set(this,void 0),eh.set(this,void 0),xd(this,Qr,e,"f"),xd(this,Xr,r,"f"),xd(this,Yl,new ae,"f"),xd(this,eh,Je(this,Yl,"f").own(new un(-1)),"f"),xd(this,Yx,Je(this,Yl,"f").own(new $x(this,e.boxAdapters)),"f"),xd(this,Xx,Je(this,Yl,"f").own(new Bx(this,e.boxAdapters)),"f")}catchupAndSubscribePath(e){let r=[_.None,_.None],n=()=>{r.every(i=>i.nonEmpty())?e(_.wrap(r.map(i=>i.unwrap()))):e(_.None)};return ve.many(Je(this,Xl,"m",xk).call(this,i=>{r[0].equals(i)||(r[0]=i,n())}),Je(this,Xl,"m",yk).call(this,i=>{r[1].equals(i)||(r[1]=i,n())}))}get context(){return Je(this,Qr,"f")}set targetName(e){Je(this,Xr,"f").target.targetVertex.ifSome(r=>{let n=r.box;if(n instanceof it){Je(this,Qr,"f").boxAdapters.adapterFor(n,bn).input.adapter().ifSome(a=>a.labelField.setValue(e));return}Je(this,Qr,"f").boxAdapters.optAdapter(n).ifSome(i=>{"labelField"in i&&i.labelField instanceof T&&i.labelField.setValue(e)}),Je(this,Xl,"m",Qx).call(this,n).flatMap(i=>Je(this,Qr,"f").boxAdapters.optAdapter(i)).ifSome(i=>{"labelField"in i&&i.labelField instanceof T&&i.labelField.setValue(e)})})}get targetName(){return Je(this,Xr,"f").target.targetVertex.flatMap(e=>{let r=e.box;if(r instanceof it)return Je(this,Qr,"f").boxAdapters.adapterFor(r,bn).input.label;let n=Je(this,Qr,"f").boxAdapters.optAdapter(r);if(n.nonEmpty()){let a=n.unwrap();if("labelField"in a&&a.labelField instanceof T)return _.wrap(a.labelField.getValue())}let i=Je(this,Xl,"m",Qx).call(this,r).flatMap(a=>Je(this,Qr,"f").boxAdapters.optAdapter(a));if(i.nonEmpty()){let a=i.unwrap();if("labelField"in a&&a.labelField instanceof T)return _.wrap(a.labelField.getValue())}return _.wrap(r.name)})}terminate(){Je(this,Yl,"f").terminate()}get audioUnit(){return je(Je(this,Xr,"f").tracks.targetVertex.unwrap("track has no audioUnit").box,it)}get target(){return Je(this,Xr,"f").target}get clips(){return Je(this,Yx,"f")}get regions(){return Je(this,Xx,"f")}get enabled(){return Je(this,Xr,"f").enabled}get indexField(){return Je(this,Xr,"f").index}get type(){return Je(this,Xr,"f").type.getValue()}get box(){return Je(this,Xr,"f")}get uuid(){return Je(this,Xr,"f").address.uuid}get address(){return Je(this,Xr,"f").address}get listIndex(){return Je(this,eh,"f").getValue()}set listIndex(e){Je(this,eh,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===ye.Audio;case"note-clip":return this.type===ye.Notes;case"value-clip":return this.type===ye.Value;case"audio-region":return this.type===ye.Audio;case"note-region":return this.type===ye.Notes;case"value-region":return this.type===ye.Value}}valueAt(e,r){if(!this.enabled.getValue())return r;let n=r,i=Je(this,Qr,"f").clipSequencing.iterate(this.uuid,e,e+H$);for(let{optClip:a,sectionFrom:o}of i)n=a.match({none:()=>{let s=this.regions.collection.lowerEqual(e,c=>!c.mute);if(s===null){let c=this.regions.collection.optAt(0);return Ft(c,ko)?c.incomingValue(r):r}else if(Ft(s,ko))return e<s.complete?s.valueAt(e,r):s.outgoingValue(r);return r},some:s=>o===e&&Ft(s,fs)&&!s.mute?s.valueAt(e,r):r});return n}get targetControlName(){return this.type!==ye.Value?_.None:Je(this,Xr,"f").target.targetVertex.flatMap(e=>e.isField()?Je(this,Qr,"f").parameterFieldAdapters.opt(e.address).map(r=>r.name):e.isBox()?_.wrap(e.name):W("Illegal State. Vertex is not a field nor box."))}};Qr=new WeakMap,Xr=new WeakMap,Yl=new WeakMap,Yx=new WeakMap,Xx=new WeakMap,eh=new WeakMap,Xl=new WeakSet,xk=function(e){let r=Je(this,Xr,"f").target.targetVertex;if(r.nonEmpty()){let n=r.unwrap().box;if(n instanceof it)return Je(this,Qr,"f").boxAdapters.adapterFor(n,bn).input.catchupAndSubscribeLabelChange(s=>e(s));let i=Je(this,Qr,"f").boxAdapters.optAdapter(n);if(i.nonEmpty()){let o=i.unwrap();if("labelField"in o&&o.labelField instanceof T)return o.labelField.catchupAndSubscribe(s=>e(_.wrap(s.getValue())))}let a=Je(this,Xl,"m",Qx).call(this,n).flatMap(o=>Je(this,Qr,"f").boxAdapters.optAdapter(o));if(a.nonEmpty()){let o=a.unwrap();if("labelField"in o&&o.labelField instanceof T)return o.labelField.catchupAndSubscribe(s=>e(_.wrap(s.getValue())))}return e(_.wrap(n.name)),ve.Empty}return e(_.None),ve.Empty},yk=function(e){let r=this.type;switch(r){case ye.Audio:case ye.Notes:return e(_.wrap(ye[r])),ve.Empty;case ye.Value:{let n=Je(this,Xr,"f").target.targetVertex.flatMap(i=>i.isField()?Je(this,Qr,"f").parameterFieldAdapters.opt(i.address):_.None);return n.isEmpty()?(e(this.targetControlName),ve.Empty):n.unwrap().catchupAndSubscribeName(i=>e(_.wrap(i)))}case ye.Undefined:return e(_.wrap("")),ve.Empty;default:return e(_.None),ve.Empty}},Qx=function(e){for(let[r]of e.outgoingEdges())if(r.pointerType===l.Parameter)return r.targetVertex.map(n=>n.box);return _.None};var er=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},we=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Gi,Hi,th,ey,ty,Ql,Do,bs,_s,Fs,As,ec,Es,rh,wk=[l.Automation,l.Modulation,l.MIDIControl,l.ParameterController],Zl=class{constructor(e,r,n,i,a,o,s){Gi.set(this,void 0),Hi.set(this,void 0),th.set(this,void 0),ey.set(this,void 0),ty.set(this,void 0),Ql.set(this,new ae),Do.set(this,void 0),bs.set(this,void 0),_s.set(this,void 0),Fs.set(this,void 0),As.set(this,_.None),ec.set(this,_.None),Es.set(this,null),rh.set(this,!1),er(this,Gi,e,"f"),er(this,Hi,r,"f"),er(this,_s,n,"f"),er(this,Fs,i,"f"),er(this,th,typeof a=="string"?Ig.seal(a):a,"f"),er(this,ey,o??0,"f"),er(this,ty,_.wrap(s),"f"),we(this,Ql,"f").own(we(this,Gi,"f").parameterFieldAdapters.register(this)),er(this,Do,we(this,Ql,"f").own(new xe),"f"),er(this,bs,new dr,"f"),we(this,Ql,"f").own(we(this,Hi,"f").subscribe(()=>we(this,Do,"f").notify(this))),we(this,Ql,"f").own(we(this,Hi,"f").pointerHub.catchupAndSubscribe({onAdded:c=>{we(this,bs,"f").proxy.onControlSourceAdd(C_(c.pointerType)),c.box.accept({visitTrackBox:u=>{ee(we(this,As,"f").isEmpty(),"Already assigned");let f=we(this,Gi,"f").boxAdapters.adapterFor(u,fr);er(this,As,_.wrap(f),"f"),we(this,Gi,"f").isMainThread&&er(this,ec,_.wrap(we(this,Gi,"f").liveStreamReceiver.subscribeFloat(we(this,Hi,"f").address,v=>{if(isNaN(v)){if(cn(we(this,Es,"f")))return;er(this,Es,null,"f"),we(this,Do,"f").notify(this);return}we(this,Es,"f")!==v&&(er(this,Es,v,"f"),we(this,Do,"f").notify(this))})),"f")}})},onRemoved:c=>{we(this,bs,"f").proxy.onControlSourceRemove(C_(c.pointerType)),c.box.accept({visitTrackBox:u=>{ee(we(this,As,"f").unwrapOrNull()?.address?.equals(u.address)===!0,`Unknown ${u}`),er(this,As,_.None,"f"),we(this,Gi,"f").isMainThread&&(we(this,ec,"f").ifSome(f=>f.terminate()),er(this,ec,_.None,"f"),er(this,Es,null,"f"),we(this,Do,"f").notify(this))}})}},...wk)),r.getValue(),n.clamp(r.getValue())}registerMidiControl(){return we(this,bs,"f").proxy.onControlSourceAdd("midi"),er(this,rh,!0,"f"),{terminate:()=>{er(this,rh,!1,"f"),we(this,bs,"f").proxy.onControlSourceRemove("midi")}}}get field(){return we(this,Hi,"f")}get valueMapping(){return we(this,_s,"f")}get stringMapping(){return we(this,Fs,"f")}get name(){return we(this,th,"f").getValue()}get anchor(){return we(this,ey,"f")}get type(){return we(this,Hi,"f").type}get address(){return we(this,Hi,"f").address}get track(){return we(this,As,"f")}catchupAndSubscribeName(e){return we(this,th,"f").catchupAndSubscribe(r=>e(r.getValue()))}registerTracks(e){return we(this,Gi,"f").parameterFieldAdapters.registerTracks(this.address,e)}touchStart(){we(this,Gi,"f").parameterFieldAdapters.touchStart(this.address),we(this,Gi,"f").parameterFieldAdapters.notifyWrite(this,this.getUnitValue())}touchEnd(){we(this,Gi,"f").parameterFieldAdapters.touchEnd(this.address)}updateMappings(e,r){er(this,_s,e,"f"),er(this,Fs,r,"f"),we(this,Do,"f").notify(this)}valueAt(e){let r=we(this,As,"f");if(r.nonEmpty()){let n=r.unwrap();if(n.enabled)return this.valueMapping.y(n.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return we(this,Do,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return we(this,rh,"f")&&e.onControlSourceAdd("midi"),we(this,Hi,"f").pointerHub.filter(...wk).forEach(r=>e.onControlSourceAdd(C_(r.pointerType))),we(this,bs,"f").subscribe(e)}getValue(){return we(this,Hi,"f").getValue()}setValue(e){if(e===this.getValue())return;let r=this.getUnitValue();we(this,Hi,"f").setValue(e),we(this,Gi,"f").parameterFieldAdapters.notifyWrite(this,r)}setUnitValue(e){this.setValue(we(this,_s,"f").y(e))}getUnitValue(){return we(this,_s,"f").x(this.getValue())}getControlledValue(){return we(this,_s,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return we(this,Es,"f")??this.getUnitValue()}getControlledPrintValue(){return we(this,Fs,"f").x(this.getControlledValue())}getPrintValue(){return we(this,Fs,"f").x(this.getValue())}setPrintValue(e){let r=we(this,Fs,"f").y(e);r.type==="unitValue"?this.setUnitValue(Se(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(we(this,ty,"f").unwrapOrElse(we(this,Hi,"f").initValue))}terminate(){we(this,ec,"f").ifSome(e=>e.terminate()),er(this,ec,_.None,"f"),we(this,Ql,"f").terminate()}};Gi=new WeakMap,Hi=new WeakMap,th=new WeakMap,ey=new WeakMap,ty=new WeakMap,Ql=new WeakMap,Do=new WeakMap,bs=new WeakMap,_s=new WeakMap,Fs=new WeakMap,As=new WeakMap,ec=new WeakMap,Es=new WeakMap,rh=new WeakMap;var C_=t=>{switch(t){case l.Automation:return"automated";case l.Modulation:return"modulated";case l.MIDIControl:return"midi";case l.ParameterController:return"external";default:return W(`${t.toString()} is an unknown pointer type`)}};var ry={min:400,max:480,default:440};A();var z_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},la=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ro,tc,iy,ny=class{constructor(e,r,n){Ro.set(this,void 0),tc.set(this,void 0),iy.set(this,void 0),z_(this,Ro,k.newSet(i=>i.uuid),"f"),z_(this,tc,new dr,"f"),z_(this,iy,e.catchupAndSubscribe({onAdded:i=>{let a=r(i.box),o=la(this,Ro,"f").add(a);ee(o,`Could not add ${a}`),la(this,tc,"f").proxy.onAdd(a)},onRemoved:i=>{let a=i.box.address.uuid;la(this,tc,"f").proxy.onRemove(la(this,Ro,"f").removeByKey(a))}},n),"f")}subscribe(e){return la(this,tc,"f").subscribe(e)}catchupAndSubscribe(e){return la(this,Ro,"f").forEach(r=>e.onAdd(r)),this.subscribe(e)}adapters(){return la(this,Ro,"f").values()}size(){return la(this,Ro,"f").size()}isEmpty(){return this.size()===0}terminate(){la(this,Ro,"f").clear(),la(this,tc,"f").terminate(),la(this,iy,"f").terminate()}};Ro=new WeakMap,tc=new WeakMap,iy=new WeakMap;A();A();rt();var O_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},V_,Ei,ih,_n,Ur,bk,ca=class{constructor(e,r){V_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Delay,ih.set(this,void 0),_n.set(this,void 0),Ur.set(this,void 0),O_(this,ih,e,"f"),O_(this,_n,r,"f"),O_(this,Ur,new ue(Pt(this,ih,"f")),"f"),this.namedParameter=Pt(this,V_,"m",bk).call(this,r)}get box(){return Pt(this,_n,"f")}get uuid(){return Pt(this,_n,"f").address.uuid}get address(){return Pt(this,_n,"f").address}get indexField(){return Pt(this,_n,"f").index}get labelField(){return Pt(this,_n,"f").label}get enabledField(){return Pt(this,_n,"f").enabled}get minimizedField(){return Pt(this,_n,"f").minimized}get host(){return Pt(this,_n,"f").host}deviceHost(){return Pt(this,ih,"f").boxAdapters.adapterFor(Pt(this,_n,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Pt(this,Ur,"f").terminate()}};Ei=ca,ih=new WeakMap,_n=new WeakMap,Ur=new WeakMap,V_=new WeakSet,bk=function(e){return{preSyncTimeLeft:Pt(this,Ur,"f").createParameter(e.preSyncTimeLeft,E.linearInteger(0,Ei.Fractions.length-1),Ei.FractionsStringMapping,"Pre Sync L"),preMillisTimeLeft:Pt(this,Ur,"f").createParameter(e.preMillisTimeLeft,E.powerByCenter(100,0,Ei.MAX_MILLIS_TIME),S.numeric({unit:"ms",fractionDigits:1}),"Pre MS L"),preSyncTimeRight:Pt(this,Ur,"f").createParameter(e.preSyncTimeRight,E.linearInteger(0,Ei.Fractions.length-1),Ei.FractionsStringMapping,"Pre Sync R"),preMillisTimeRight:Pt(this,Ur,"f").createParameter(e.preMillisTimeRight,E.powerByCenter(100,0,Ei.MAX_MILLIS_TIME),S.numeric({unit:"ms",fractionDigits:1}),"Pre MS R"),delay:Pt(this,Ur,"f").createParameter(e.delayMusical,E.linearInteger(0,Ei.Fractions.length-1),Ei.FractionsStringMapping,"Delay"),millisTime:Pt(this,Ur,"f").createParameter(e.delayMillis,E.powerByCenter(100,0,Ei.MAX_MILLIS_TIME),S.numeric({unit:"ms",fractionDigits:1}),"MS"),feedback:Pt(this,Ur,"f").createParameter(e.feedback,E.unipolar(),S.numeric({unit:"%",fractionDigits:0}),"Feedback"),cross:Pt(this,Ur,"f").createParameter(e.cross,E.unipolar(),S.numeric({unit:"%",fractionDigits:0}),"Cross"),lfoSpeed:Pt(this,Ur,"f").createParameter(e.lfoSpeed,E.exponential(Ei.LFO_SPEED_MIN,Ei.LFO_SPEED_MAX),S.numeric({unit:"Hz",fractionDigits:2}),"LFO Speed"),lfoDepth:Pt(this,Ur,"f").createParameter(e.lfoDepth,E.power(4,0,Ei.LFO_DEPTH_MAX),S.numeric({unit:"ms",fractionDigits:1}),"LFO Depth"),filter:Pt(this,Ur,"f").createParameter(e.filter,E.bipolar(),S.numeric({unit:"%",fractionDigits:0}),"Filter",.5),dry:Pt(this,Ur,"f").createParameter(e.dry,E.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Dry"),wet:Pt(this,Ur,"f").createParameter(e.wet,E.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Wet")}};ca.Fractions=Xo.builder().add([0,1]).add([1,128]).add([1,96]).add([1,64]).add([1,48]).add([1,32]).add([1,24]).add([3,64]).add([1,16]).add([1,12]).add([3,32]).add([1,8]).add([1,6]).add([3,16]).add([1,4]).add([5,16]).add([1,3]).add([3,8]).add([7,16]).add([1,2]).add([1,1]).asAscendingArray();ca.FractionsStringMapping=S.indices("",Ei.Fractions.map(([t,e])=>t===0?"Off":`${t}/${e}`));ca.MAX_MILLIS_TIME=1e3;ca.LFO_SPEED_MIN=.1;ca.LFO_SPEED_MAX=5;ca.LFO_DEPTH_MAX=50;A();var U_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Fr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},j_,nh,Fn,qa,_k,ay=class{constructor(e,r){j_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Reverb,nh.set(this,void 0),Fn.set(this,void 0),qa.set(this,void 0),U_(this,nh,e,"f"),U_(this,Fn,r,"f"),U_(this,qa,new ue(Fr(this,nh,"f")),"f"),this.namedParameter=Fr(this,j_,"m",_k).call(this,r)}get box(){return Fr(this,Fn,"f")}get uuid(){return Fr(this,Fn,"f").address.uuid}get address(){return Fr(this,Fn,"f").address}get indexField(){return Fr(this,Fn,"f").index}get labelField(){return Fr(this,Fn,"f").label}get enabledField(){return Fr(this,Fn,"f").enabled}get minimizedField(){return Fr(this,Fn,"f").minimized}get host(){return Fr(this,Fn,"f").host}deviceHost(){return Fr(this,nh,"f").boxAdapters.adapterFor(Fr(this,Fn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Fr(this,qa,"f").terminate()}};nh=new WeakMap,Fn=new WeakMap,qa=new WeakMap,j_=new WeakSet,_k=function(e){return{decay:Fr(this,qa,"f").createParameter(e.decay,E.unipolar(),S.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:Fr(this,qa,"f").createParameter(e.preDelay,E.exponential(.001,.5),S.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:Fr(this,qa,"f").createParameter(e.damp,E.unipolar(),S.numeric({unit:"%",fractionDigits:0}),"Damping"),filter:Fr(this,qa,"f").createParameter(e.filter,E.bipolar(),S.numeric({unit:"%",fractionDigits:0}),"Filter"),dry:Fr(this,qa,"f").createParameter(e.dry,E.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Dry"),wet:Fr(this,qa,"f").createParameter(e.wet,E.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Wet")}};A();var K_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},tr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},L_,ah,qi,ua,Ek,oy=class{constructor(e,r){L_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Revamp,ah.set(this,void 0),qi.set(this,void 0),ua.set(this,void 0),K_(this,ah,e,"f"),K_(this,qi,r,"f"),K_(this,ua,new ue(tr(this,ah,"f")),"f"),this.namedParameter=tr(this,L_,"m",Ek).call(this,r)}get box(){return tr(this,qi,"f")}get uuid(){return tr(this,qi,"f").address.uuid}get address(){return tr(this,qi,"f").address}get indexField(){return tr(this,qi,"f").index}get labelField(){return tr(this,qi,"f").label}get enabledField(){return tr(this,qi,"f").enabled}get minimizedField(){return tr(this,qi,"f").minimized}get host(){return tr(this,qi,"f").host}get spectrum(){return tr(this,qi,"f").address.append(4095)}deviceHost(){return tr(this,ah,"f").boxAdapters.adapterFor(tr(this,qi,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){tr(this,ua,"f").terminate()}};ah=new WeakMap,qi=new WeakMap,ua=new WeakMap,L_=new WeakSet,Ek=function(e){return{highPass:Fk(tr(this,ua,"f"),e.highPass,"High-Pass"),lowShelf:Ak(tr(this,ua,"f"),e.lowShelf,"Low-Shelf"),lowBell:W_(tr(this,ua,"f"),e.lowBell,"Low-Bell"),midBell:W_(tr(this,ua,"f"),e.midBell,"Mid-Bell"),highBell:W_(tr(this,ua,"f"),e.highBell,"High-Bell"),highShelf:Ak(tr(this,ua,"f"),e.highShelf,"High-Shelf"),lowPass:Fk(tr(this,ua,"f"),e.lowPass,"Low-Pass")}};var Z_=E.exponential(20,2e4),Sk=E.linear(-24,24),Pk=E.exponential(.01,10),Fk=(t,e,r)=>({enabled:t.createParameter(e.enabled,E.bool,S.bool,"Enabled"),frequency:t.createParameter(e.frequency,Z_,S.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),order:t.createParameter(e.order,E.linearInteger(0,3),S.indices("db",["12","24","36","48"]),`${r} Order`),q:t.createParameter(e.q,Pk,S.numeric({fractionDigits:3}),`${r} Q`)}),Ak=(t,e,r)=>({enabled:t.createParameter(e.enabled,E.bool,S.bool,"Enabled"),frequency:t.createParameter(e.frequency,Z_,S.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,Sk,S.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5)}),W_=(t,e,r)=>({enabled:t.createParameter(e.enabled,E.bool,S.bool,"Enabled"),frequency:t.createParameter(e.frequency,Z_,S.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,Sk,S.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5),q:t.createParameter(e.q,Pk,S.numeric({fractionDigits:3}),`${r} Q`)});A();A();rt();A();var Mk=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Si=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},sy,ly,Pi,Ss=class{constructor(e,r){this.type="marker-event",sy.set(this,new ae),ly.set(this,void 0),Pi.set(this,void 0),Mk(this,ly,e,"f"),Mk(this,Pi,r,"f"),Si(this,sy,"f").own(Si(this,Pi,"f").subscribe(Ke.Children,n=>{if(!this.trackAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackAdapter.unwrap();Si(this,Pi,"f").position.address.equals(n.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return Si(this,Pi,"f")}get uuid(){return Si(this,Pi,"f").address.uuid}get address(){return Si(this,Pi,"f").address}get position(){return Si(this,Pi,"f").position.getValue()}get plays(){return Si(this,Pi,"f").plays.getValue()}get hue(){return Si(this,Pi,"f").hue.getValue()}get label(){return Si(this,Pi,"f").label.getValue()}get trackAdapter(){return Si(this,Pi,"f").track.targetVertex.map(e=>Si(this,ly,"f").boxAdapters.adapterFor(e.box,Ja).markerTrack)}terminate(){Si(this,sy,"f").terminate()}toString(){return`{MarkerBoxAdapter ${k.toString(Si(this,Pi,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};sy=new WeakMap,ly=new WeakMap,Pi=new WeakMap;Ss.Comparator=(t,e)=>t.position-e.position;var oh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},An=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},sh,yd,lh,rc,cy,uy=class{constructor(e,r){sh.set(this,void 0),yd.set(this,void 0),lh.set(this,void 0),rc.set(this,void 0),cy.set(this,void 0),oh(this,sh,e,"f"),oh(this,yd,r,"f"),this.changeNotifier=new xe,oh(this,lh,k.newSet(n=>n.uuid),"f"),oh(this,rc,qr.create(Ss.Comparator),"f"),oh(this,cy,An(this,yd,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{if(n instanceof uu){let i=An(this,sh,"f").boxAdapters.adapterFor(n,Ss),a=An(this,lh,"f").add(i);ee(a,"Could not add adapter"),An(this,rc,"f").add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:n}}})=>{An(this,rc,"f").remove(An(this,lh,"f").removeByKey(n)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return An(this,sh,"f")}get enabled(){return An(this,yd,"f").enabled.getValue()}get events(){return An(this,rc,"f")}get object(){return An(this,yd,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){An(this,rc,"f").onIndexingChanged(),this.dispatchChange()}terminate(){An(this,cy,"f").terminate()}};sh=new WeakMap,yd=new WeakMap,lh=new WeakMap,rc=new WeakMap,cy=new WeakMap;A();rt();A();var Nk=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ji=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},dy,py,Yi,ic=class{constructor(e,r){this.type="signature-event",dy.set(this,new ae),py.set(this,void 0),Yi.set(this,void 0),Nk(this,py,e,"f"),Nk(this,Yi,r,"f"),Ji(this,dy,"f").own(Ji(this,Yi,"f").subscribe(Ke.Children,n=>this.trackAdapter.ifSome(i=>i.dispatchChange())))}get box(){return Ji(this,Yi,"f")}get uuid(){return Ji(this,Yi,"f").address.uuid}get address(){return Ji(this,Yi,"f").address}get index(){return Ji(this,Yi,"f").index.getValue()}get indexField(){return Ji(this,Yi,"f").index}get relativePosition(){return Ji(this,Yi,"f").relativePosition.getValue()}get nominator(){return Ji(this,Yi,"f").nominator.getValue()}get denominator(){return Ji(this,Yi,"f").denominator.getValue()}get trackAdapter(){return Ji(this,Yi,"f").events.targetVertex.map(e=>Ji(this,py,"f").boxAdapters.adapterFor(e.box,Ja).signatureTrack)}terminate(){Ji(this,dy,"f").terminate()}toString(){return`{SignatureEventBoxAdapter ${this.nominator}/${this.denominator}}`}};dy=new WeakMap,py=new WeakMap,Yi=new WeakMap;ic.Comparator=(t,e)=>t.index-e.index;var fy=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Mt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ps,ch,uh,nc,Co,Ms,$k,wd,hy=class{constructor(e,r,n){Ps.add(this),ch.set(this,new ae),uh.set(this,void 0),nc.set(this,void 0),Co.set(this,void 0),Ms.set(this,void 0),fy(this,uh,e,"f"),fy(this,nc,r,"f"),fy(this,Co,n,"f"),this.changeNotifier=new xe,fy(this,Ms,Mt(this,ch,"f").own(jt.create(Mt(this,Co,"f").events,i=>e.boxAdapters.adapterFor(i,ic),l.SignatureAutomation)),"f"),Mt(this,ch,"f").ownAll(Mt(this,nc,"f").subscribe(()=>this.dispatchChange()),Mt(this,Co,"f").enabled.subscribe(()=>this.dispatchChange()),Mt(this,Ms,"f").subscribe({onAdd:i=>this.changeNotifier.notify(),onRemove:i=>this.changeNotifier.notify(),onReorder:i=>this.changeNotifier.notify()}))}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return Mt(this,uh,"f")}get enabled(){return Mt(this,Co,"f").enabled.getValue()}get object(){return Mt(this,Co,"f")}get size(){return Mt(this,Ms,"f").size()}get storageSignature(){let{nominator:e,denominator:r}=Mt(this,nc,"f");return[e.getValue(),r.getValue()]}nonEmpty(){return Mt(this,Ms,"f").size()>0}dispatchChange(){this.changeNotifier.notify()}signatureAt(e){e=Math.max(0,e);let r=this.storageSignature;for(let{accumulatedPpqn:n,nominator:i,denominator:a}of this.iterateAll()){if(n>e)break;r=[i,a]}return r}*iterateAll(){let e=0,r=0,[n,i]=this.storageSignature;if(yield{index:-1,accumulatedPpqn:e,accumulatedBars:r,nominator:n,denominator:i},!!Mt(this,Co,"f").enabled.getValue())for(let a of Mt(this,Ms,"f").adapters())e+=Ve.fromSignature(n,i)*a.relativePosition,r+=a.relativePosition,n=a.nominator,i=a.denominator,yield{index:a.index,accumulatedPpqn:e,accumulatedBars:r,nominator:n,denominator:i}}changeSignature(e,r){let n=Array.from(this.iterateAll()).slice(1),i=n.map(c=>c.accumulatedPpqn);Mt(this,nc,"f").nominator.setValue(e),Mt(this,nc,"f").denominator.setValue(r);let a=0,o=0,s=Ve.fromSignature(e,r);for(let c=0;c<n.length;c++){let u=n[c],f=this.adapterAt(u.index);if(f.isEmpty())continue;let m=(i[c]-a)/s,w=Math.floor(m),y=m-w;o+=y;let P=w;o>=1&&(P++,o--),P=Math.max(1,P),f.unwrap().box.relativePosition.setValue(P),a+=P*s,s=Ve.fromSignature(u.nominator,u.denominator)}}deleteAdapter(e){let r=e.index,n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(w=>w.index===r);if(i===-1)return;let a=n.slice(i+1),o=a.map(w=>w.accumulatedPpqn),s=i>0?n[i-1]:null,[c,u]=s!==null?[s.nominator,s.denominator]:this.storageSignature,f=s!==null?s.accumulatedPpqn:0;e.box.delete();let v=f,m=Ve.fromSignature(c,u);for(let w=0;w<a.length;w++){let y=a[w],P=this.adapterAt(y.index);if(P.isEmpty())continue;let O=(o[w]-v)/m,C=Math.max(1,Math.round(O));P.unwrap().box.relativePosition.setValue(C),v+=C*m,m=Ve.fromSignature(y.nominator,y.denominator)}}createEvent(e,r,n){let i=Array.from(this.iterateAll()),a=i[0],o=0;for(let P=1;P<i.length&&!(i[P].accumulatedPpqn>e);P++)a=i[P],o=P;let s=Ve.fromSignature(a.nominator,a.denominator),c=(e-a.accumulatedPpqn)/s,u=Math.max(1,Math.round(c)),f=a.index+1,v=i.slice(o+1),m=a.accumulatedPpqn+u*s,w=Ve.fromSignature(r,n),y=v.map(P=>({event:P,adapter:this.adapterAt(P.index)})).filter(({adapter:P})=>P.nonEmpty()).map(({event:P,adapter:V})=>({event:P,adapter:V.unwrap()}));for(let P=0;P<y.length;P++){let{event:V,adapter:O}=y[P];if(O.box.index.setValue(V.index+1),P===0){let C=(V.accumulatedPpqn-m)/w;O.box.relativePosition.setValue(Math.max(1,Math.round(C)))}}au.create(Mt(this,uh,"f").boxGraph,k.generate(),P=>{P.index.setValue(f),P.relativePosition.setValue(u),P.nominator.setValue(r),P.denominator.setValue(n),P.events.refer(Mt(this,Co,"f").events)})}adapterAt(e){return Mt(this,Ms,"f").getAdapterByIndex(e)}moveEvent(e,r){let n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(m=>m.index===e.index);if(i===-1)return;let a=n[i];if(r===a.accumulatedPpqn)return;let o=n.map(m=>m.accumulatedBars),s=Mt(this,Ps,"m",$k).call(this,r,a.index);if(s===a.accumulatedBars)return;let c=[...o];c[i]=s;let u=c.map((m,w)=>({bar:m,i:w})).sort((m,w)=>m.bar-w.bar).map(m=>m.i),f=n.map(m=>this.adapterAt(m.index).unwrap("adapterAt"));for(let m=0;m<u.length;m++)f[u[m]].box.index.setValue(m);let v=0;for(let m=0;m<u.length;m++){let w=u[m],y=f[w],P=c[w],V=Math.max(1,P-v);y.box.relativePosition.setValue(V),v=P}}floorToBar(e){let{event:r,barPpqn:n}=Mt(this,Ps,"m",wd).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}ceilToBar(e){let{event:r,barPpqn:n}=Mt(this,Ps,"m",wd).call(this,e),i=Math.ceil((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}roundToBar(e){let{event:r,barPpqn:n}=Mt(this,Ps,"m",wd).call(this,e),i=Math.round((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}toParts(e){let{event:r}=Mt(this,Ps,"m",wd).call(this,e),n=Ve.toParts(e-r.accumulatedPpqn,r.nominator,r.denominator);return{...n,bars:n.bars+r.accumulatedBars}}barLengthAt(e){let[r,n]=this.signatureAt(e);return Ve.fromSignature(r,n)}getBarInterval(e){let{event:r,barPpqn:n}=Mt(this,Ps,"m",wd).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n),a=r.accumulatedPpqn+i*n;return{position:a,complete:a+n}}terminate(){Mt(this,ch,"f").terminate()}};ch=new WeakMap,uh=new WeakMap,nc=new WeakMap,Co=new WeakMap,Ms=new WeakMap,Ps=new WeakSet,$k=function(e,r){let n=null;for(let o of this.iterateAll())if(o.index!==r){if(o.accumulatedPpqn>e)break;n=o}if(cn(n)){let[o,s]=this.storageSignature,c=Ve.fromSignature(o,s);return Math.max(1,Math.round(e/c))}let i=Ve.fromSignature(n.nominator,n.denominator),a=Math.round((e-n.accumulatedPpqn)/i);return Math.max(1,n.accumulatedBars+a)},wd=function(e){let r=null;for(let n of this.iterateAll()){if(n.accumulatedPpqn>e)break;r=n}if(cn(r)){let[n,i]=this.storageSignature;return{event:{index:-1,accumulatedPpqn:0,accumulatedBars:0,nominator:n,denominator:i},barPpqn:Ve.fromSignature(n,i)}}return{event:r,barPpqn:Ve.fromSignature(r.nominator,r.denominator)}};rt();var dh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ht=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ph,Ya,my,gy,zo,fh,vy,Ja=class{constructor(e,r){ph.set(this,new ae),Ya.set(this,void 0),my.set(this,void 0),gy.set(this,void 0),zo.set(this,void 0),fh.set(this,void 0),vy.set(this,()=>{let{tempoTrack:{enabled:s}}=Ht(this,Ya,"f");return s.getValue()?Ht(this,zo,"f").isEmpty()?_.None:Ht(this,zo,"f").unwrap().events.isEmpty()?_.None:Ht(this,zo,"f"):_.None}),dh(this,Ya,r,"f"),dh(this,my,new uy(e,r.markerTrack),"f"),dh(this,gy,new hy(e,r.signature,r.signatureTrack),"f"),dh(this,zo,new Cr,"f"),dh(this,fh,new xe,"f");let n=Ht(this,ph,"f").own(new ae),i=()=>Ht(this,fh,"f").notify(Ht(this,vy,"f").call(this)),{tempoTrack:{events:a,enabled:o}}=r;Ht(this,ph,"f").own(a.catchupAndSubscribe(({targetVertex:s})=>{n.terminate(),s.match({none:()=>Ht(this,zo,"f").clear(),some:({box:c})=>{let u=e.boxAdapters.adapterFor(c,Or);Ht(this,zo,"f").wrap(u),n.ownAll(u.subscribeChange(i),o.subscribe(i))}})}))}catchupAndSubscribeTempoAutomation(e){return e(Ht(this,vy,"f").call(this)),Ht(this,fh,"f").subscribe(e)}get box(){return Ht(this,Ya,"f")}get uuid(){return Ht(this,Ya,"f").address.uuid}get address(){return Ht(this,Ya,"f").address}get markerTrack(){return Ht(this,my,"f")}get signatureTrack(){return Ht(this,gy,"f")}get tempoTrackEvents(){return Ht(this,zo,"f")}get signature(){let{nominator:e,denominator:r}=Ht(this,Ya,"f").signature;return[e.getValue(),r.getValue()]}get signatureDuration(){let{nominator:e,denominator:r}=Ht(this,Ya,"f").signature;return Ve.fromSignature(e.getValue(),r.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),Ht(this,Ya,"f").signature.subscribe(()=>e(this.signature))}terminate(){Ht(this,ph,"f").terminate()}};ph=new WeakMap,Ya=new WeakMap,my=new WeakMap,gy=new WeakMap,zo=new WeakMap,fh=new WeakMap,vy=new WeakMap;A();var tC=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},hh=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ns,$s=class{constructor(e,r){Ns.set(this,void 0),tC(this,Ns,r,"f")}get box(){return hh(this,Ns,"f")}get uuid(){return hh(this,Ns,"f").address.uuid}get address(){return hh(this,Ns,"f").address}get source(){return hh(this,Ns,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return hh(this,Ns,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};Ns=new WeakMap;A();A();A();var ac=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},En=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},xy,oc,sc,yy,wy,mh,Sn=class{constructor(e,r){xy.set(this,void 0),oc.set(this,void 0),sc.set(this,void 0),yy.set(this,void 0),wy.set(this,void 0),mh.set(this,!1),ac(this,xy,e,"f"),ac(this,oc,r,"f"),ac(this,sc,new ae,"f"),ac(this,yy,r.attributes,"f"),ac(this,wy,En(this,sc,"f").own(new ue(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return En(this,sc,"f").own(e)}ownAll(...e){En(this,sc,"f").ownAll(...e)}onSelected(){ac(this,mh,!0,"f")}onDeselected(){ac(this,mh,!1,"f")}isSelected(){return En(this,mh,"f")}get box(){return En(this,oc,"f")}get attributes(){return En(this,yy,"f")}get uuid(){return En(this,oc,"f").address.uuid}get address(){return En(this,oc,"f").address}get parameters(){return En(this,wy,"f")}get modular(){return En(this,xy,"f").boxAdapters.adapterFor(En(this,oc,"f").attributes.collection.targetVertex.unwrap("attributes.target").box,ks)}terminate(){En(this,sc,"f").terminate()}};xy=new WeakMap,oc=new WeakMap,sc=new WeakMap,yy=new WeakMap,wy=new WeakMap,mh=new WeakMap;A();var by=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Oo=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},_y,Is,gh,Fy,ei;(function(t){t.Input="input",t.Output="output"})(ei||(ei={}));var ti=class t{static create(e,r,n,i){return new t(e,r,n,i??r.fieldName)}constructor(e,r,n,i){_y.set(this,void 0),Is.set(this,void 0),gh.set(this,void 0),Fy.set(this,void 0),by(this,_y,e,"f"),by(this,Is,r,"f"),by(this,gh,n,"f"),by(this,Fy,i,"f")}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(r=>e.field.pointerRules.accepts.some(n=>n===r))}get connections(){return Oo(this,Is,"f").pointerHub.isEmpty()?ie.empty():Oo(this,Is,"f").pointerHub.filter(l.VoltageConnection).map(({box:e})=>Oo(this,_y,"f").adapterFor(e,$s))}get field(){return Oo(this,Is,"f")}get address(){return Oo(this,Is,"f").address}get direction(){return Oo(this,gh,"f")}get name(){return Oo(this,Fy,"f")}toString(){return`{ModuleConnectorAdapter address: ${Oo(this,Is,"f").address.toString()}, direction: ${Oo(this,gh,"f")}}`}};_y=new WeakMap,Is=new WeakMap,gh=new WeakMap,Fy=new WeakMap;var G_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},vh=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ay,xh,yh,bd=class extends Sn{constructor(e,r){super(e,r),Ay.set(this,void 0),xh.set(this,void 0),yh.set(this,void 0),G_(this,Ay,this.parameters.createParameter(r.time,E.exponential(1,1e4),S.numeric({unit:"ms"}),"Time"),"f"),G_(this,xh,ti.create(e.boxAdapters,r.voltageInput,ei.Input,"Input"),"f"),G_(this,yh,ti.create(e.boxAdapters,r.voltageOutput,ei.Output,"Output"),"f")}get parameterTime(){return vh(this,Ay,"f")}get voltageInput(){return vh(this,xh,"f")}get voltageOutput(){return vh(this,yh,"f")}get inputs(){return[vh(this,xh,"f")]}get outputs(){return[vh(this,yh,"f")]}};Ay=new WeakMap,xh=new WeakMap,yh=new WeakMap;A();var rC=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},kk=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},wh,_d=class extends Sn{constructor(e,r){super(e,r),wh.set(this,void 0),rC(this,wh,ti.create(e.boxAdapters,r.input,ei.Input,"Input"),"f")}get voltageInput(){return kk(this,wh,"f")}get inputs(){return[kk(this,wh,"f")]}get outputs(){return ie.empty()}};wh=new WeakMap;A();var H_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},bh=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ey,_h,Fh,Fd=class extends Sn{constructor(e,r){super(e,r),Ey.set(this,void 0),_h.set(this,void 0),Fh.set(this,void 0),H_(this,Ey,this.parameters.createParameter(r.gain,E.DefaultDecibel,S.numeric({unit:"db"}),"Gain"),"f"),H_(this,_h,ti.create(e.boxAdapters,r.voltageInput,ei.Input,"Input"),"f"),H_(this,Fh,ti.create(e.boxAdapters,r.voltageOutput,ei.Output,"Output"),"f")}get parameterGain(){return bh(this,Ey,"f")}get voltageInput(){return bh(this,_h,"f")}get voltageOutput(){return bh(this,Fh,"f")}get inputs(){return[bh(this,_h,"f")]}get outputs(){return[bh(this,Fh,"f")]}};Ey=new WeakMap,_h=new WeakMap,Fh=new WeakMap;var q_=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},J_=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Sy,Py,My,Ad=class extends Sn{constructor(e,r){super(e,r),Sy.set(this,void 0),Py.set(this,void 0),My.set(this,void 0),q_(this,Sy,ti.create(e.boxAdapters,r.voltageInputX,ei.Input,"X"),"f"),q_(this,Py,ti.create(e.boxAdapters,r.voltageInputY,ei.Input,"Y"),"f"),q_(this,My,ti.create(e.boxAdapters,r.voltageOutput,ei.Output,"Result"),"f")}get inputs(){return[J_(this,Sy,"f"),J_(this,Py,"f")]}get outputs(){return[J_(this,My,"f")]}};Sy=new WeakMap,Py=new WeakMap,My=new WeakMap;A();var iC=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ik=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ah,Ed=class extends Sn{constructor(e,r){super(e,r),Ah.set(this,void 0),iC(this,Ah,ti.create(e.boxAdapters,r.output,ei.Output,"Output"),"f")}get voltageOutput(){return Ik(this,Ah,"f")}get inputs(){return ie.empty()}get outputs(){return[Ik(this,Ah,"f")]}};Ah=new WeakMap;var Sd;(function(t){t.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,t.adapterFor=(e,r)=>He(r.accept({visitModuleGainBox:n=>e.adapterFor(n,Fd),visitModuleDelayBox:n=>e.adapterFor(n,bd),visitModuleMultiplierBox:n=>e.adapterFor(n,Ad),visitModularAudioInputBox:n=>e.adapterFor(n,Ed),visitModularAudioOutputBox:n=>e.adapterFor(n,_d)}),`Could not find ModuleAdapter for ${r.name}`)})(Sd||(Sd={}));A();var Bk=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},lc=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ny,$y,cc,Y_,Pd=class{constructor(e,r){Ny.add(this),$y.set(this,void 0),cc.set(this,void 0),Bk(this,$y,e,"f"),Bk(this,cc,r,"f")}get box(){return lc(this,cc,"f")}get uuid(){return lc(this,cc,"f").address.uuid}get address(){return lc(this,cc,"f").address}get moduleAdapter(){return Sd.adapterFor(lc(this,$y,"f").boxAdapters,lc(this,Ny,"a",Y_).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(lc(this,Ny,"a",Y_).address)}terminate(){}};$y=new WeakMap,cc=new WeakMap,Ny=new WeakSet,Y_=function(){return lc(this,cc,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var Tk=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Mi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Md,Ni,Nd=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Modular,Md.set(this,void 0),Ni.set(this,void 0),Tk(this,Md,e,"f"),Tk(this,Ni,r,"f")}get box(){return Mi(this,Ni,"f")}get uuid(){return Mi(this,Ni,"f").address.uuid}get address(){return Mi(this,Ni,"f").address}get indexField(){return Mi(this,Ni,"f").index}get labelField(){return Mi(this,Ni,"f").label}get enabledField(){return Mi(this,Ni,"f").enabled}get minimizedField(){return Mi(this,Ni,"f").minimized}get host(){return Mi(this,Ni,"f").host}parameterAt(e){return W("Not yet implemented")}deviceHost(){return Mi(this,Md,"f").boxAdapters.adapterFor(Mi(this,Ni,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return Mi(this,Md,"f").boxAdapters.adapterFor(Mi(this,Ni,"f").modularSetup.targetVertex.unwrap("No Modular found").box,ks)}elements(){return Mi(this,Ni,"f").userInterface.elements.pointerHub.filter(l.DeviceUserInterface).map(e=>Mi(this,Md,"f").boxAdapters.adapterFor(e.box,Pd))}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){}};Md=new WeakMap,Ni=new WeakMap;var Eh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},dt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},$d,Bs,kd,Xi,uc,dc,ks=class{constructor(e,r){$d.set(this,new ae),Bs.set(this,void 0),kd.set(this,void 0),Xi.set(this,void 0),uc.set(this,void 0),dc.set(this,void 0),Eh(this,kd,e,"f"),Eh(this,Xi,r,"f"),Eh(this,Bs,dt(this,$d,"f").own(new dr),"f"),Eh(this,uc,k.newSet(s=>s.uuid),"f"),Eh(this,dc,k.newSet(s=>s.uuid),"f");let n=s=>{let c=Sd.adapterFor(dt(this,kd,"f").boxAdapters,s.box);dt(this,uc,"f").add(c)&&dt(this,Bs,"f").proxy.onModuleAdded(c)},i=s=>dt(this,Bs,"f").proxy.onModuleRemoved(dt(this,uc,"f").removeByKey(s.address.uuid)),a=s=>{let c=dt(this,kd,"f").boxAdapters.adapterFor(s.box,$s);dt(this,dc,"f").add(c)&&dt(this,Bs,"f").proxy.onConnectionAdded(c)},o=s=>dt(this,Bs,"f").proxy.onConnectionRemoved(dt(this,dc,"f").removeByKey(s.address.uuid));dt(this,Xi,"f").modules.pointerHub.filter(l.ModuleCollection).forEach(n),dt(this,Xi,"f").connections.pointerHub.filter(l.ConnectionCollection).forEach(a),dt(this,$d,"f").own(dt(this,Xi,"f").modules.pointerHub.subscribe({onAdded:n,onRemoved:i},l.ModuleCollection)),dt(this,$d,"f").own(dt(this,Xi,"f").connections.pointerHub.subscribe({onAdded:a,onRemoved:o},l.ConnectionCollection))}catchupAndSubscribe(e){return i_(e.onModuleAdded,r=>dt(this,uc,"f").forEach(n=>r(n))),i_(e.onConnectionAdded,r=>dt(this,dc,"f").forEach(n=>r(n))),dt(this,Bs,"f").subscribe(e)}get box(){return dt(this,Xi,"f")}get address(){return dt(this,Xi,"f").address}get uuid(){return dt(this,Xi,"f").address.uuid}get editingField(){return dt(this,Xi,"f").editing}get labelField(){return dt(this,Xi,"f").label}get modules(){return dt(this,uc,"f").values()}get connections(){return dt(this,dc,"f").values()}get device(){return dt(this,kd,"f").boxAdapters.adapterFor(He(dt(this,Xi,"f").device.pointerHub.incoming().at(0),"No device found").box,Nd)}terminate(){console.debug(`terminate ${this}`),dt(this,$d,"f").terminate()}};$d=new WeakMap,Bs=new WeakMap,kd=new WeakMap,Xi=new WeakMap,uc=new WeakMap,dc=new WeakMap;A();A();rt();var Sh=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},fi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},X_,Bd,Ph,ky,Id,Nh,Iy,Mh,By,Dk,Xa=class{constructor(e,r){X_.add(this),this.type="groove-adapter",Ph.set(this,new ae),ky.set(this,void 0),Id.set(this,void 0),Nh.set(this,void 0),Iy.set(this,new Lg({duration:()=>fi(this,By,"f"),fx:n=>u_(n,fi(this,Mh,"f")),fy:n=>u_(n,1-fi(this,Mh,"f"))})),Mh.set(this,0),By.set(this,Ve.SemiQuaver*2),Sh(this,ky,e,"f"),Sh(this,Id,r,"f"),Sh(this,Nh,fi(this,Ph,"f").own(new ue(fi(this,ky,"f"))),"f"),this.namedParameter=fi(this,X_,"m",Dk).call(this,r),fi(this,Ph,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(n=>Sh(this,By,n.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(n=>Sh(this,Mh,JM(n.getValue(),.01),"f")))}unwarp(e){return fi(this,Iy,"f").unwarp(e)}warp(e){return fi(this,Iy,"f").warp(e)}get box(){return fi(this,Id,"f")}get uuid(){return fi(this,Id,"f").address.uuid}get address(){return fi(this,Id,"f").address}terminate(){fi(this,Ph,"f").terminate()}};Bd=Xa,Ph=new WeakMap,ky=new WeakMap,Id=new WeakMap,Nh=new WeakMap,Iy=new WeakMap,Mh=new WeakMap,By=new WeakMap,X_=new WeakSet,Dk=function(e){return{duration:fi(this,Nh,"f").createParameter(e.duration,E.values(Bd.DurationPPQNs),S.values("",Bd.DurationPPQNs,Bd.DurationStrings),"Duration"),amount:fi(this,Nh,"f").createParameter(e.amount,E.unipolar(),S.percent({fractionDigits:0}),"Amount")}};Xa.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];Xa.DurationPPQNs=Bd.Durations.map(([t,e])=>Ve.fromSignature(t,e));Xa.DurationStrings=Bd.Durations.map(([t,e])=>`${t}/${e}`);A();A();var Td=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Zt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Qa,Ts,Dd,Ty,Dy,$h,kh,Q_,Ds=class{constructor(e,r,n,i,a){Qa.set(this,void 0),Ts.set(this,void 0),Dd.set(this,void 0),Ty.set(this,void 0),Dy.set(this,void 0),$h.set(this,new ae),kh.set(this,void 0),Q_.set(this,_.None),Td(this,Qa,e,"f"),Td(this,Ts,r,"f"),Td(this,Dd,n,"f"),Td(this,Ty,i,"f"),Td(this,Dy,a??0,"f"),Td(this,kh,Zt(this,$h,"f").own(new xe),"f"),Zt(this,$h,"f").own(Zt(this,Qa,"f").subscribe(()=>Zt(this,kh,"f").notify(this))),e.getValue(),r.clamp(e.getValue())}get field(){return Zt(this,Qa,"f")}get valueMapping(){return Zt(this,Ts,"f")}get stringMapping(){return Zt(this,Dd,"f")}get name(){return Zt(this,Ty,"f")}get anchor(){return Zt(this,Dy,"f")}get type(){return Zt(this,Qa,"f").type}get address(){return Zt(this,Qa,"f").address}get track(){return Zt(this,Q_,"f")}subscribe(e){return Zt(this,kh,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return Zt(this,Qa,"f").getValue()}setValue(e){Zt(this,Qa,"f").setValue(Zt(this,Ts,"f").clamp(e))}setUnitValue(e){this.setValue(Zt(this,Ts,"f").y(e))}getUnitValue(){return Zt(this,Ts,"f").x(this.getValue())}getPrintValue(){return Zt(this,Dd,"f").x(this.getValue())}setPrintValue(e){let r=Zt(this,Dd,"f").y(e);r.type==="unitValue"?this.setUnitValue(Se(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(Zt(this,Ts,"f").clamp(Zt(this,Qa,"f").initValue))}terminate(){Zt(this,$h,"f").terminate()}};Qa=new WeakMap,Ts=new WeakMap,Dd=new WeakMap,Ty=new WeakMap,Dy=new WeakMap,$h=new WeakMap,kh=new WeakMap,Q_=new WeakMap;var Rd=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pn=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},eo,Ry,Cy,zy,Oy,Vy,Uy=class{constructor(e){eo.set(this,void 0),Ry.set(this,void 0),Cy.set(this,void 0),zy.set(this,void 0),Oy.set(this,void 0),Vy.set(this,void 0),Rd(this,eo,e,"f"),Rd(this,Ry,new Ds(Pn(this,eo,"f").keyboard,E.values([88,76,61,49]),S.numeric({fractionDigits:1}),"Keyboard Type"),"f"),Rd(this,Cy,new Ds(Pn(this,eo,"f").timeRangeInQuarters,E.exponential(1,64),S.numeric({fractionDigits:1}),"Time-Range"),"f"),Rd(this,zy,new Ds(Pn(this,eo,"f").noteScale,E.exponential(.5,2),S.numeric({fractionDigits:1}),"Note Scale"),"f"),Rd(this,Oy,new Ds(Pn(this,eo,"f").noteLabels,E.bool,S.bool,"Note Labels"),"f"),Rd(this,Vy,new Ds(Pn(this,eo,"f").transpose,E.linearInteger(-48,48),S.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return Pn(this,eo,"f").box.subscribe(Ke.Children,()=>e(this))}get object(){return Pn(this,eo,"f")}get keyboard(){return Pn(this,Ry,"f")}get timeRangeInQuarters(){return Pn(this,Cy,"f")}get noteScale(){return Pn(this,zy,"f")}get noteLabels(){return Pn(this,Oy,"f")}get transpose(){return Pn(this,Vy,"f")}};eo=new WeakMap,Ry=new WeakMap,Cy=new WeakMap,zy=new WeakMap,Oy=new WeakMap,Vy=new WeakMap;var Ih=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},vr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},pc,Qi,fc,jy,Ky,Wy=class{constructor(e,r){pc.set(this,void 0),Qi.set(this,void 0),fc.set(this,void 0),jy.set(this,void 0),Ky.set(this,void 0),Ih(this,pc,e,"f"),Ih(this,Qi,r,"f"),Ih(this,fc,jt.create(vr(this,Qi,"f").audioUnits,n=>vr(this,pc,"f").boxAdapters.adapterFor(n,bn),l.AudioUnits),"f"),Ih(this,jy,new ny(vr(this,Qi,"f").audioBusses.pointerHub,n=>vr(this,pc,"f").boxAdapters.adapterFor(n,Wi),l.AudioBusses),"f"),Ih(this,Ky,new Uy(vr(this,Qi,"f").pianoMode),"f")}get uuid(){return vr(this,Qi,"f").address.uuid}get address(){return vr(this,Qi,"f").address}get box(){return vr(this,Qi,"f")}get audioBusses(){return vr(this,jy,"f")}get audioUnits(){return vr(this,fc,"f")}get clips(){return vr(this,fc,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return vr(this,pc,"f").boxAdapters.adapterFor(vr(this,Qi,"f").groove.targetVertex.unwrap("no groove").box,Xa)}get timeline(){return vr(this,pc,"f").boxAdapters.adapterFor(vr(this,Qi,"f").timeline.targetVertex.unwrap("no timeline").box,Ja)}get pianoMode(){return vr(this,Ky,"f")}get created(){return new Date(vr(this,Qi,"f").created.getValue())}get midiOutputDevices(){return vr(this,Qi,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>je(e,ss))}*labeledAudioOutputs(){for(let e of vr(this,fc,"f").adapters())yield{label:e.label,address:e.address,children:()=>_.wrap(e.labeledAudioOutputs())}}terminate(){vr(this,fc,"f").terminate()}};pc=new WeakMap,Qi=new WeakMap,fc=new WeakMap,jy=new WeakMap,Ky=new WeakMap;A();var e1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ri=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},t1,Bh,da,Rs,Rk,Ly=class{constructor(e,r){t1.add(this),this.type="instrument",this.accepts="audio",this.manualUrl=se.Tape,Bh.set(this,void 0),da.set(this,void 0),Rs.set(this,void 0),e1(this,Bh,e,"f"),e1(this,da,r,"f"),e1(this,Rs,new ue(ri(this,Bh,"f")),"f"),this.namedParameter=ri(this,t1,"m",Rk).call(this,r)}get box(){return ri(this,da,"f")}get uuid(){return ri(this,da,"f").address.uuid}get address(){return ri(this,da,"f").address}get labelField(){return ri(this,da,"f").label}get iconField(){return ri(this,da,"f").icon}get defaultTrackType(){return ye.Audio}get enabledField(){return ri(this,da,"f").enabled}get minimizedField(){return ri(this,da,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return ri(this,Bh,"f").boxAdapters.adapterFor(ri(this,da,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){ri(this,Rs,"f").terminate()}};Bh=new WeakMap,da=new WeakMap,Rs=new WeakMap,t1=new WeakSet,Rk=function(e){return{flutter:ri(this,Rs,"f").createParameter(e.flutter,E.unipolar(),S.percent(),"Flutter"),wow:ri(this,Rs,"f").createParameter(e.wow,E.unipolar(),S.percent(),"Wow"),noise:ri(this,Rs,"f").createParameter(e.noise,E.unipolar(),S.percent(),"Noise"),saturation:ri(this,Rs,"f").createParameter(e.saturation,E.unipolar(),S.percent(),"Saturation")}};A();A();rt();var hc=(()=>{let r=[1,2,3,4],n=["12","24","36","48"],i=[Sa.sine,Sa.triangle,Sa.saw,Sa.square],a=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:E.exponential(20,2e4),CUTOFF_STRING_MAPPING:S.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:r,FILTER_ORDER_STRINGS:n,FILTER_ORDER_VALUE_MAPPING:E.values(r),FILTER_ORDER_STRING_MAPPING:S.values("db",r,n),LFO_WAVEFORM_VALUES:i,LFO_WAVEFORM_STRINGS:a,LFO_WAVEFORM_VALUE_MAPPING:E.values(i),LFO_WAVEFORM_STRING_MAPPING:S.values("",i,a)}})();var r1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ye=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},i1,Th,pa,ct,Ck,Zy=class{constructor(e,r){i1.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=se.Vaporisateur,Th.set(this,void 0),pa.set(this,void 0),ct.set(this,void 0),r1(this,Th,e,"f"),r1(this,pa,r,"f"),r1(this,ct,new ue(Ye(this,Th,"f")),"f"),this.namedParameter=Ye(this,i1,"m",Ck).call(this,r)}get box(){return Ye(this,pa,"f")}get uuid(){return Ye(this,pa,"f").address.uuid}get address(){return Ye(this,pa,"f").address}get labelField(){return Ye(this,pa,"f").label}get iconField(){return Ye(this,pa,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return Ye(this,pa,"f").enabled}get minimizedField(){return Ye(this,pa,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ye(this,Th,"f").boxAdapters.adapterFor(Ye(this,pa,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Ye(this,ct,"f").terminate()}};Th=new WeakMap,pa=new WeakMap,ct=new WeakMap,i1=new WeakSet,Ck=function(e){let r=[Ma.Monophonic,Ma.Polyphonic];return{oscillators:e.oscillators.fields().map(n=>({waveform:Ye(this,ct,"f").createParameter(n.waveform,E.linearInteger(0,3),S.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:Ye(this,ct,"f").createParameter(n.volume,E.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:Ye(this,ct,"f").createParameter(n.octave,E.linearInteger(-3,3),S.numeric({unit:"oct"}),"Octave",.5),tune:Ye(this,ct,"f").createParameter(n.tune,E.linear(-1200,1200),S.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:Ye(this,ct,"f").createParameter(e.noise.volume,E.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:Ye(this,ct,"f").createParameter(e.noise.attack,E.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:Ye(this,ct,"f").createParameter(e.noise.hold,E.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Hold"),release:Ye(this,ct,"f").createParameter(e.noise.release,E.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:Ye(this,ct,"f").createParameter(e.filterOrder,hc.FILTER_ORDER_VALUE_MAPPING,hc.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:Ye(this,ct,"f").createParameter(e.cutoff,hc.CUTOFF_VALUE_MAPPING,hc.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:Ye(this,ct,"f").createParameter(e.resonance,E.exponential(.01,10),S.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:Ye(this,ct,"f").createParameter(e.attack,E.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:Ye(this,ct,"f").createParameter(e.decay,E.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:Ye(this,ct,"f").createParameter(e.sustain,E.unipolar(),S.percent({fractionDigits:1}),"Sustain"),release:Ye(this,ct,"f").createParameter(e.release,E.exponential(.001,5),S.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:Ye(this,ct,"f").createParameter(e.filterEnvelope,E.bipolar(),S.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:Ye(this,ct,"f").createParameter(e.filterKeyboard,E.bipolar(),S.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:Ye(this,ct,"f").createParameter(e.voicingMode,E.values(r),S.values("",r,["mono","poly"]),"Play Mode",.5),glideTime:Ye(this,ct,"f").createParameter(e.glideTime,E.unipolar(),S.percent({fractionDigits:1}),"Glide time",0),unisonCount:Ye(this,ct,"f").createParameter(e.unisonCount,E.values([1,3,5]),S.values("#",[1,3,5],[1,3,5].map(n=>String(n))),"Unisono",0),unisonDetune:Ye(this,ct,"f").createParameter(e.unisonDetune,E.exponential(1,1200),S.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:Ye(this,ct,"f").createParameter(e.unisonStereo,E.unipolar(),S.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:Ye(this,ct,"f").createParameter(e.lfo.waveform,hc.LFO_WAVEFORM_VALUE_MAPPING,hc.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:Ye(this,ct,"f").createParameter(e.lfo.rate,E.exponential(1e-4,30),S.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:Ye(this,ct,"f").createParameter(e.lfo.targetTune,E.bipolar(),S.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:Ye(this,ct,"f").createParameter(e.lfo.targetVolume,E.bipolar(),S.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:Ye(this,ct,"f").createParameter(e.lfo.targetCutoff,E.bipolar(),S.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};rt();A();var n1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ar=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},a1,Gy,Dh,Mn,to,zk,mc=class{constructor(e,r){a1.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=se.Arpeggio,Dh.set(this,void 0),Mn.set(this,void 0),to.set(this,void 0),n1(this,Dh,e,"f"),n1(this,Mn,r,"f"),n1(this,to,new ue(Ar(this,Dh,"f")),"f"),this.namedParameter=Ar(this,a1,"m",zk).call(this,r)}get box(){return Ar(this,Mn,"f")}get uuid(){return Ar(this,Mn,"f").address.uuid}get address(){return Ar(this,Mn,"f").address}get indexField(){return Ar(this,Mn,"f").index}get labelField(){return Ar(this,Mn,"f").label}get enabledField(){return Ar(this,Mn,"f").enabled}get minimizedField(){return Ar(this,Mn,"f").minimized}get host(){return Ar(this,Mn,"f").host}deviceHost(){return Ar(this,Dh,"f").boxAdapters.adapterFor(Ar(this,Mn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Ar(this,to,"f").terminate()}};Gy=mc,Dh=new WeakMap,Mn=new WeakMap,to=new WeakMap,a1=new WeakSet,zk=function(e){return{modeIndex:Ar(this,to,"f").createParameter(e.modeIndex,E.linearInteger(0,2),S.indices("",["Up","Down","UpDown"]),"Mode"),numOctaves:Ar(this,to,"f").createParameter(e.numOctaves,E.linearInteger(1,5),S.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:Ar(this,to,"f").createParameter(e.rateIndex,E.linearInteger(0,Gy.RateFractions.length-1),Gy.RateStringMapping,"Rate"),gate:Ar(this,to,"f").createParameter(e.gate,E.linear(0,2),S.percent({fractionDigits:0}),"Gate"),repeat:Ar(this,to,"f").createParameter(e.repeat,E.linearInteger(1,16),S.numeric({fractionDigits:0}),"Repeat"),velocity:Ar(this,to,"f").createParameter(e.velocity,E.bipolar(),S.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};mc.RateFractions=Xo.builder().add([1,1]).add([1,2]).add([1,3]).add([1,4]).add([3,16]).add([1,6]).add([1,8]).add([3,32]).add([1,12]).add([1,16]).add([3,64]).add([1,24]).add([1,32]).add([1,48]).add([1,64]).add([1,96]).add([1,128]).asDescendingArray();mc.RateStringMapping=S.indices("",Gy.RateFractions.map(([t,e])=>`${t}/${e}`));A();var o1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ii=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},s1,Rh,Nn,gc,Ok,Hy=class{constructor(e,r){s1.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=se.Pitch,Rh.set(this,void 0),Nn.set(this,void 0),gc.set(this,void 0),o1(this,Rh,e,"f"),o1(this,Nn,r,"f"),o1(this,gc,new ue(ii(this,Rh,"f")),"f"),this.namedParameter=ii(this,s1,"m",Ok).call(this,r)}get box(){return ii(this,Nn,"f")}get uuid(){return ii(this,Nn,"f").address.uuid}get address(){return ii(this,Nn,"f").address}get indexField(){return ii(this,Nn,"f").index}get labelField(){return ii(this,Nn,"f").label}get enabledField(){return ii(this,Nn,"f").enabled}get minimizedField(){return ii(this,Nn,"f").minimized}get host(){return ii(this,Nn,"f").host}deviceHost(){return ii(this,Rh,"f").boxAdapters.adapterFor(ii(this,Nn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){ii(this,gc,"f").terminate()}};Rh=new WeakMap,Nn=new WeakMap,gc=new WeakMap,s1=new WeakSet,Ok=function(e){return{octaves:ii(this,gc,"f").createParameter(e.octaves,E.linearInteger(-7,7),S.numeric({unit:"oct",fractionDigits:0}),"Octaves"),semiTones:ii(this,gc,"f").createParameter(e.semiTones,E.linearInteger(-36,36),S.numeric({unit:"st",fractionDigits:0}),"Semi-Tones"),cent:ii(this,gc,"f").createParameter(e.cents,E.linear(-50,50),S.numeric({unit:"cents",fractionDigits:1}),"Cents")}};A();A();var nC=/^\/\/ @label .+$/m,Vk=/^\/\/ @param .+$/gm,Uk=/^\/\/ @sample .+$/gm;var jk=/^\/\/ @(group|param|sample) .+$/gm,Kk=/^\/\/ @(?:param|sample) \S+/gm,aC=/^\/\/ @no-pass\b(.*)$/m,Cd=1e-6,oC=["linear","exp","int","bool"],sC=new class{x(t){return{value:t>=.5?"On":"Off",unit:""}}y(t){let e=t.trim().toLowerCase();return{type:"explicit",value:e==="on"||e==="true"||e==="yes"?1:0}}},Wk=t=>{let e=t.replace(/^\/\/ @param\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(e.length===0)throw new Error(`Malformed @param: '${t}'`);let r=e[0];if(e.length===1)return{label:r,defaultValue:0,min:0,max:1,mapping:"unipolar",unit:""};let n=e[1];if(n==="true"||n==="false")return{label:r,defaultValue:n==="true"?1:0,min:0,max:1,mapping:"bool",unit:""};if(n==="bool")return{label:r,defaultValue:0,min:0,max:1,mapping:"bool",unit:""};let i=parseFloat(n);if(isNaN(i))throw new Error(`Malformed @param: '${t}' \u2014 '${n}' is not a valid number`);if(e.length===2)return{label:r,defaultValue:i,min:0,max:1,mapping:"unipolar",unit:""};if(e.length===3&&e[2]==="bool")return{label:r,defaultValue:i>=.5?1:0,min:0,max:1,mapping:"bool",unit:""};if(e.length===4){let u=parseFloat(e[2]),f=parseFloat(e[3]);if(isNaN(u)||isNaN(f))throw new Error(`Malformed @param: '${t}' \u2014 min/max must be numbers`);if(f-u<Cd)throw new Error(`Malformed @param: '${t}' \u2014 min (${u}) must be less than max (${f})`);if(i<u-Cd||i>f+Cd)throw new Error(`Malformed @param: '${t}' \u2014 default (${i}) must be within [${u}, ${f}]`);return{label:r,defaultValue:i,min:u,max:f,mapping:"linear",unit:""}}if(e.length<5)throw new Error(`Malformed @param: '${t}' \u2014 expected: // @param <name> <default> <min> <max> [type] [unit]`);let a=parseFloat(e[2]),o=parseFloat(e[3]),s=e[4],c=e.length>=6?e[5]:"";if(isNaN(a)||isNaN(o))throw new Error(`Malformed @param: '${t}' \u2014 min/max must be numbers`);if(!oC.includes(s))throw new Error(`Malformed @param: '${t}' \u2014 unknown mapping '${s}' (expected: linear, exp, int, bool)`);if(s!=="bool"&&o-a<Cd)throw new Error(`Malformed @param: '${t}' \u2014 min (${a}) must be less than max (${o})`);if(i<a-Cd||i>o+Cd)throw new Error(`Malformed @param: '${t}' \u2014 default (${i}) must be within [${a}, ${o}]`);return{label:r,defaultValue:i,min:a,max:o,mapping:s,unit:c}},Lk=(t,e)=>t.mapping===e.mapping&&t.min===e.min&&t.max===e.max&&t.unit===e.unit,lC=(t,e)=>Lk(t,e)&&Math.abs(t.defaultValue-e.defaultValue)<1e-6,Er;(function(t){t.isEqual=lC,t.parseLabel=e=>{let r=nC.exec(e);if(r===null)return _.None;let n=r[0].replace(/^\/\/ @label\s+/,"").trim();if(n.length===0)throw new Error("Malformed @label: expected: // @label <name>");return _.wrap(n)},t.parsePassThrough=e=>{let r=aC.exec(e);if(r===null)return!0;if(r[1].trim().length>0)throw new Error("Malformed @no-pass: expected: // @no-pass");return!1},t.parseParams=e=>{let r=[],n;for(Vk.lastIndex=0;(n=Vk.exec(e))!==null;)r.push(Wk(n[0]));return r},t.parseSamples=e=>{let r=[],n;for(Uk.lastIndex=0;(n=Uk.exec(e))!==null;){let i=n[0].replace(/^\/\/ @sample\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(i.length===0||i[0].length===0)throw new Error(`Malformed @sample: '${n[0]}' \u2014 expected: // @sample <name>`);if(i.length>1)throw new Error(`Malformed @sample: '${n[0]}' \u2014 expected: // @sample <name>`);r.push({label:i[0]})}return r},t.parseDeclarationOrder=e=>{let r=new Map,n;Kk.lastIndex=0;let i=0;for(;(n=Kk.exec(e))!==null;){let a=n[0].replace(/^\/\/ @(?:param|sample)\s+/,"").split(/\s+/)[0];r.has(a)||r.set(a,i++)}return r},t.parseGroups=e=>{let r=[],n=null,i=[];jk.lastIndex=0;let a;for(;(a=jk.exec(e))!==null;){let o=a[0],s=a[1];if(s==="group"){(i.length>0||n!==null)&&r.push({group:n,items:i});let c=o.replace(/^\/\/ @group\s+/,"").trim().split(/\s+/);n={label:c[0],color:c[1]??"dark"},i=[]}else if(s==="param")i.push({type:"param",declaration:Wk(o)});else if(s==="sample"){let c=o.replace(/^\/\/ @sample\s+/,"").replace(/\s+\/\/.*$/,"").trim().split(/\s+/);if(c.length===0||c[0].length===0)throw new Error(`Malformed @sample: '${o}' \u2014 expected: // @sample <name>`);i.push({type:"sample",declaration:{label:c[0]}})}}return(i.length>0||n!==null)&&r.push({group:n,items:i}),r},t.resolveValueMapping=e=>{switch(e.mapping){case"unipolar":return E.unipolar();case"linear":return E.linear(e.min,e.max);case"exp":return E.exponential(e.min,e.max);case"int":return E.linearInteger(e.min,e.max);case"bool":return E.linearInteger(0,1)}},t.resolveStringMapping=e=>{switch(e.mapping){case"unipolar":return S.percent();case"linear":return S.numeric({unit:e.unit,fractionDigits:2});case"exp":return S.numeric({unit:e.unit,fractionDigits:2});case"int":return S.numeric({unit:e.unit,fractionDigits:0});case"bool":return sC}},t.resolveParamMappings=e=>({valueMapping:t.resolveValueMapping(e),stringMapping:t.resolveStringMapping(e)}),t.subscribeScriptParams=(e,r,n)=>{let i=new Map,a=new xe;return{terminable:ve.many(n.pointerHub.catchupAndSubscribe({onAdded:(({box:s})=>{let c=je(s,Da),u=c.label.getValue(),v=t.parseParams(r.getValue()).find(y=>y.label===u),{valueMapping:m,stringMapping:w}=K(v)?t.resolveParamMappings(v):{valueMapping:E.unipolar(),stringMapping:S.percent({fractionDigits:1})};e.createParameter(c.value,m,w,Kp.capitalize(u),void 0,c.defaultValue.getValue()),K(v)&&i.set(u,v)}),onRemoved:(({box:s})=>{let c=je(s,Da);i.delete(c.label.getValue()),e.removeParameter(c.value.address)})}),r.subscribe(()=>{let s=t.parseParams(r.getValue());for(let c of e.parameters()){let u=s.find(w=>Kp.capitalize(w.label)===c.name);if(!K(u))continue;let f=i.get(u.label);if(K(f)&&Lk(f,u))continue;let{valueMapping:v,stringMapping:m}=t.resolveParamMappings(u);c.updateMappings(v,m),i.set(u.label,u)}a.notify()}),a),codeChanged:a}}})(Er||(Er={}));var qy=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},jr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ch,zh,$n,Oh,Jy,Yy=class{constructor(e,r){Ch.set(this,new ae),this.type="midi-effect",this.accepts="midi",this.manualUrl=se.Spielwerk,zh.set(this,void 0),$n.set(this,void 0),Oh.set(this,void 0),Jy.set(this,void 0),qy(this,zh,e,"f"),qy(this,$n,r,"f"),qy(this,Oh,jr(this,Ch,"f").own(new ue(jr(this,zh,"f"))),"f");let{terminable:n,codeChanged:i}=Er.subscribeScriptParams(jr(this,Oh,"f"),r.code,r.parameters);jr(this,Ch,"f").own(n),qy(this,Jy,i,"f")}get box(){return jr(this,$n,"f")}get uuid(){return jr(this,$n,"f").address.uuid}get address(){return jr(this,$n,"f").address}get indexField(){return jr(this,$n,"f").index}get labelField(){return jr(this,$n,"f").label}get enabledField(){return jr(this,$n,"f").enabled}get minimizedField(){return jr(this,$n,"f").minimized}get host(){return jr(this,$n,"f").host}get parameters(){return jr(this,Oh,"f")}get codeChanged(){return jr(this,Jy,"f")}deviceHost(){return jr(this,zh,"f").boxAdapters.adapterFor(jr(this,$n,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){jr(this,Ch,"f").terminate()}};Ch=new WeakMap,zh=new WeakMap,$n=new WeakMap,Oh=new WeakMap,Jy=new WeakMap;A();var Xy=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ni=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Vh,Uh,fa,jh,Qy,ew=class{constructor(e,r){Vh.set(this,new ae),this.type="instrument",this.accepts="midi",this.manualUrl=se.Apparat,Uh.set(this,void 0),fa.set(this,void 0),jh.set(this,void 0),Qy.set(this,void 0),Xy(this,Uh,e,"f"),Xy(this,fa,r,"f"),Xy(this,jh,ni(this,Vh,"f").own(new ue(ni(this,Uh,"f"))),"f");let{terminable:n,codeChanged:i}=Er.subscribeScriptParams(ni(this,jh,"f"),r.code,r.parameters);ni(this,Vh,"f").own(n),Xy(this,Qy,i,"f")}get box(){return ni(this,fa,"f")}get uuid(){return ni(this,fa,"f").address.uuid}get address(){return ni(this,fa,"f").address}get labelField(){return ni(this,fa,"f").label}get iconField(){return ni(this,fa,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return ni(this,fa,"f").enabled}get minimizedField(){return ni(this,fa,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return ni(this,jh,"f")}get codeChanged(){return ni(this,Qy,"f")}deviceHost(){return ni(this,Uh,"f").boxAdapters.adapterFor(ni(this,fa,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){ni(this,Vh,"f").terminate()}};Vh=new WeakMap,Uh=new WeakMap,fa=new WeakMap,jh=new WeakMap,Qy=new WeakMap;A();var Vo;(function(t){t.DefaultNote=60,t.pack=e=>e.note&127|(e.active?1:0)<<7|(e.slide?1:0)<<8|(e.accent?1:0)<<9,t.unpack=e=>({note:e&127,active:(e>>7&1)===1,slide:(e>>8&1)===1,accent:(e>>9&1)===1})})(Vo||(Vo={}));A();rt();var Kh;(function(t){t.Contours=["free","walk","rise","fall"],t.Motifs=[0,2,3,4,8],t.Default={root:0,scale:Qc.StockScales[1],octave:1,octaves:3,density:.6,accent:.3,slide:.2,motif:0,contour:"free",rootFirst:!0};let e=r=>{let n=ie.create(i=>i,12).filter(i=>r.has(i));return n.length===0?[0]:n};t.steps=(r,n)=>{let i=e(r.scale),a=Math.max(1,r.octaves),o=i.length*a,s=(r.octave+2)*12+r.root,c=w=>{let y=Se(w,0,o-1);return Se(s+i[y%i.length]+Math.floor(y/i.length)*12,0,127)},u=r.motif>0?Math.min(r.motif,n):n,f=w=>Math.round((Math.random()*2-1)*w),v=new Array(u);for(let w=0;w<u;w++){let y=u<2?0:w/(u-1)*(o-1);v[w]=r.rootFirst&&w===0?0:Se(r.contour==="walk"?w===0?o>>1:v[w-1]+f(2):r.contour==="rise"?Math.round(y)+f(1):r.contour==="fall"?Math.round(o-1-y)+f(1):Math.floor(Math.random()*o),0,o-1)}let m=ie.create(w=>Vo.pack({note:c(v[w]),active:r.rootFirst&&w===0||Math.random()<r.density,slide:Math.random()<r.slide,accent:Math.random()<r.accent}),u);return ie.create(w=>m[w%u],n)}})(Kh||(Kh={}));var l1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Sr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},u1,Wh,en,Uo,Zk,c1=Vo.pack({note:Vo.DefaultNote,active:!1,slide:!1,accent:!1}),tw=class{constructor(e,r){u1.add(this),this.type="instrument",this.accepts="midi",this.manualUrl="manuals/devices/instruments/cubed",Wh.set(this,void 0),en.set(this,void 0),Uo.set(this,void 0),l1(this,Wh,e,"f"),l1(this,en,r,"f"),l1(this,Uo,new ue(Sr(this,Wh,"f")),"f"),this.namedParameter=Sr(this,u1,"m",Zk).call(this,r)}get box(){return Sr(this,en,"f")}get uuid(){return Sr(this,en,"f").address.uuid}get address(){return Sr(this,en,"f").address}get labelField(){return Sr(this,en,"f").label}get iconField(){return Sr(this,en,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return Sr(this,en,"f").enabled}get minimizedField(){return Sr(this,en,"f").minimized}get acceptsMidiEvents(){return!0}currentPattern(){return Sr(this,en,"f").patterns.getField(Sr(this,en,"f").patternIndex.getValue())}readCurrentPattern(){let e=this.currentPattern(),r=e.length.getValue();return{length:r,steps:e.steps.fields().slice(0,r).map(n=>Vo.unpack(n.getValue()))}}writeCurrentPattern({length:e,steps:r}){let n=this.currentPattern(),i=n.steps.fields(),a=Math.min(r.length,i.length);i.forEach((o,s)=>o.setValue(s<a?Vo.pack(r[s]):c1)),n.length.setValue(Se(e,1,i.length))}clearCurrentPattern(){this.currentPattern().steps.fields().forEach(e=>e.setValue(c1))}randomizeCurrentPattern(e=Kh.Default){let r=this.currentPattern(),n=r.length.getValue(),i=Kh.steps(e,n);r.steps.fields().forEach((a,o)=>a.setValue(o<n?i[o]:c1))}rotateCurrentPattern(e){let r=this.currentPattern(),n=r.length.getValue(),i=r.steps.fields().slice(0,n),a=i.map(o=>o.getValue());i.forEach((o,s)=>o.setValue(a[(s+e+n)%n]))}deviceHost(){return Sr(this,Wh,"f").boxAdapters.adapterFor(Sr(this,en,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Sr(this,Uo,"f").terminate()}};Wh=new WeakMap,en=new WeakMap,Uo=new WeakMap,u1=new WeakSet,Zk=function(e){let r=(n,i,a)=>Sr(this,Uo,"f").createParameter(n,E.unipolar(),S.percent({fractionDigits:0}),i,a);return{tuning:Sr(this,Uo,"f").createParameter(e.tuning,E.linear(-1200,1200),S.numeric({unit:"ct",fractionDigits:0}),"Tuning",.5),cutoff:r(e.cutoff,"Cutoff"),resonance:r(e.resonance,"Resonance"),envMod:r(e.envMod,"Env Mod"),decay:r(e.decay,"Decay"),accent:r(e.accent,"Accent"),volume:Sr(this,Uo,"f").createParameter(e.volume,E.DefaultDecibel,S.numeric({unit:"dB",fractionDigits:1}),"Volume"),waveform:Sr(this,Uo,"f").createParameter(e.waveform,E.linearInteger(0,1),S.indices("",["Sawtooth","Square"]),"Waveform",.5),patternIndex:Sr(this,Uo,"f").createParameter(e.patternIndex,E.linearInteger(0,e.patterns.fields().length-1),S.oneBasedIndex(),"Pattern")}};A();var d1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Nt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},p1,Lh,kn,Kr,Gk,Cs;(function(t){t.Waves=["Saw","Square","Pulse","Double Sine","Saw-Pulse","Res. Saw","Res. Triangle","Res. Trapezoid"],t.LineSelect=["1","2","1+1'","1+2'"],t.Modulation=["Off","Ring","Noise"],t.VibratoWaves=["Triangle","Saw Up","Saw Down","Square"],t.envelopeIndex=(e,r)=>e*3+(r==="pitch"?0:r==="dcw"?1:2)})(Cs||(Cs={}));var rw=class{constructor(e,r){p1.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=se.Neon,Lh.set(this,void 0),kn.set(this,void 0),Kr.set(this,void 0),d1(this,Lh,e,"f"),d1(this,kn,r,"f"),d1(this,Kr,new ue(Nt(this,Lh,"f")),"f"),this.namedParameter=Nt(this,p1,"m",Gk).call(this,r)}get box(){return Nt(this,kn,"f")}get uuid(){return Nt(this,kn,"f").address.uuid}get address(){return Nt(this,kn,"f").address}get labelField(){return Nt(this,kn,"f").label}get iconField(){return Nt(this,kn,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return Nt(this,kn,"f").enabled}get minimizedField(){return Nt(this,kn,"f").minimized}get acceptsMidiEvents(){return!0}envelope(e,r){return Nt(this,kn,"f").envelopes.fields()[Cs.envelopeIndex(e,r)]}deviceHost(){return Nt(this,Lh,"f").boxAdapters.adapterFor(Nt(this,kn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Nt(this,Kr,"f").terminate()}};Lh=new WeakMap,kn=new WeakMap,Kr=new WeakMap,p1=new WeakSet,Gk=function(e){let r=[Ma.Monophonic,Ma.Polyphonic],n=(i,a)=>Nt(this,Kr,"f").createParameter(i,E.linear(0,99),S.numeric({unit:"",fractionDigits:0}),a);return{lineSelect:Nt(this,Kr,"f").createParameter(e.lineSelect,E.linearInteger(0,3),S.indices("",Cs.LineSelect),"Line"),modulation:Nt(this,Kr,"f").createParameter(e.modulation,E.linearInteger(0,2),S.indices("",Cs.Modulation),"Mod"),octave:Nt(this,Kr,"f").createParameter(e.octave,E.linearInteger(-3,3),S.numeric({unit:"oct"}),"Octave",.5),detune:Nt(this,Kr,"f").createParameter(e.detune,E.linear(-4800,4800),S.numeric({unit:"ct",fractionDigits:0}),"Detune",.5),tune:Nt(this,Kr,"f").createParameter(e.tune,E.linear(-1200,1200),S.numeric({unit:"ct",fractionDigits:0}),"Tune",.5),glideTime:Nt(this,Kr,"f").createParameter(e.glideTime,E.unipolar(),S.percent({fractionDigits:1}),"Glide time",0),voicingMode:Nt(this,Kr,"f").createParameter(e.voicingMode,E.values(r),S.values("",r,["mono","poly"]),"Play Mode",.5),vibrato:{wave:Nt(this,Kr,"f").createParameter(e.vibrato.wave,E.linearInteger(0,3),S.indices("",Cs.VibratoWaves),"Vib. Wave"),delay:n(e.vibrato.delay,"Vib. Delay"),rate:n(e.vibrato.rate,"Vib. Rate"),depth:n(e.vibrato.depth,"Vib. Depth")},lines:e.lines.fields().map(i=>({wave1:Nt(this,Kr,"f").createParameter(i.wave1,E.linearInteger(0,7),S.indices("",Cs.Waves),"Wave 1"),wave2:Nt(this,Kr,"f").createParameter(i.wave2,E.linearInteger(0,8),S.indices("",["Off",...Cs.Waves]),"Wave 2"),dcwKeyFollow:Nt(this,Kr,"f").createParameter(i.dcwKeyFollow,E.linear(0,9),S.numeric({unit:"",fractionDigits:1}),"DCW Key Follow"),dcaKeyFollow:Nt(this,Kr,"f").createParameter(i.dcaKeyFollow,E.linear(0,9),S.numeric({unit:"",fractionDigits:1}),"DCA Key Follow")}))}};A();var f1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},$i=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},h1,Zh,ha,zd,Hk,iw=class{constructor(e,r){h1.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=se.Nano,Zh.set(this,void 0),ha.set(this,void 0),zd.set(this,void 0),f1(this,Zh,e,"f"),f1(this,ha,r,"f"),f1(this,zd,new ue($i(this,Zh,"f")),"f"),this.namedParameter=$i(this,h1,"m",Hk).call(this,r)}get box(){return $i(this,ha,"f")}get uuid(){return $i(this,ha,"f").address.uuid}get address(){return $i(this,ha,"f").address}get labelField(){return $i(this,ha,"f").label}get iconField(){return $i(this,ha,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return $i(this,ha,"f").enabled}get minimizedField(){return $i(this,ha,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return $i(this,Zh,"f").boxAdapters.adapterFor($i(this,ha,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){$i(this,zd,"f").terminate()}};Zh=new WeakMap,ha=new WeakMap,zd=new WeakMap,h1=new WeakSet,Hk=function(e){return{volume:$i(this,zd,"f").createParameter(e.volume,E.DefaultDecibel,S.numeric({unit:"db",fractionDigits:1}),"Volume"),release:$i(this,zd,"f").createParameter(e.release,E.exponential(.001,8),S.numeric({unit:"s",fractionDigits:3}),"Release")}};A();A();var Od=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},de=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},m1,vc,zs,Be,nw,Gh,hi,xc,qk,Vd=class{constructor(e,r){m1.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",this.manualUrl="manuals/devices/instruments/playfield",vc.set(this,new ae),zs.set(this,void 0),Be.set(this,void 0),nw.set(this,void 0),Gh.set(this,void 0),hi.set(this,void 0),xc.set(this,_.None),Od(this,zs,e,"f"),Od(this,Be,r,"f"),Od(this,nw,de(this,vc,"f").own(jt.create(de(this,Be,"f").midiEffects,n=>de(this,zs,"f").boxAdapters.adapterFor(n,oe.isMidiEffect),l.MIDIEffectHost)),"f"),Od(this,Gh,de(this,vc,"f").own(jt.create(de(this,Be,"f").audioEffects,n=>de(this,zs,"f").boxAdapters.adapterFor(n,oe.isAudioEffect),l.AudioEffectHost)),"f"),Od(this,hi,de(this,vc,"f").own(new ue(de(this,zs,"f"))),"f"),this.namedParameter=de(this,m1,"m",qk).call(this,r),de(this,vc,"f").own(de(this,Be,"f").file.catchupAndSubscribe(n=>{Od(this,xc,n.targetVertex.map(({box:i})=>de(this,zs,"f").boxAdapters.adapterFor(i,ta)),"f"),de(this,xc,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return de(this,Be,"f")}get uuid(){return de(this,Be,"f").address.uuid}get address(){return de(this,Be,"f").address}get peakAddress(){return de(this,Be,"f").address.append(1001)}get indexField(){return de(this,Be,"f").index}get gate(){return de(this,Be,"f").gate.getValue()}get exclude(){return de(this,Be,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${de(this,xc,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get fileLabel(){return`${de(this,xc,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return de(this,Be,"f").icon}get defaultTrackType(){return ye.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return _.wrap(de(this,Be,"f").midiEffects)}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return _.wrap(de(this,Be,"f").audioEffects)}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}get hostsInstrument(){return!0}file(){return de(this,xc,"f")}fileUUID(){return de(this,Be,"f").file.targetAddress.unwrap("file.targetAddr").uuid}resetParameters(){de(this,Be,"f").mute.reset(),de(this,Be,"f").solo.reset(),de(this,Be,"f").exclude.reset(),de(this,Be,"f").polyphone.reset(),de(this,Be,"f").pitch.reset(),de(this,Be,"f").attack.reset(),de(this,Be,"f").release.reset(),de(this,Be,"f").sampleStart.reset(),de(this,Be,"f").sampleEnd.reset(),de(this,Be,"f").gate.reset(),de(this,Be,"f").volume.reset(),de(this,Be,"f").panning.reset()}copyToIndex(e){Ta.create(de(this,Be,"f").graph,k.generate(),r=>{r.file.refer(de(this,Be,"f").file.targetVertex.unwrap("file.target")),r.device.refer(de(this,Be,"f").device.targetVertex.unwrap("device.target")),r.index.setValue(e),r.mute.setValue(de(this,Be,"f").mute.getValue()),r.solo.setValue(de(this,Be,"f").solo.getValue()),r.sampleStart.setValue(de(this,Be,"f").sampleStart.getValue()),r.sampleEnd.setValue(de(this,Be,"f").sampleEnd.getValue()),r.attack.setValue(de(this,Be,"f").attack.getValue()),r.release.setValue(de(this,Be,"f").release.getValue()),r.pitch.setValue(de(this,Be,"f").pitch.getValue()),r.exclude.setValue(de(this,Be,"f").exclude.getValue()),r.gate.setValue(de(this,Be,"f").gate.getValue()),r.volume.setValue(de(this,Be,"f").volume.getValue()),r.panning.setValue(de(this,Be,"f").panning.getValue())})}get midiEffects(){return _.wrap(de(this,nw,"f"))}get inputAdapter(){return _.wrap(this)}get audioEffects(){return _.wrap(de(this,Gh,"f"))}get labelField(){return je(de(this,Be,"f").file.targetVertex.unwrap("file.target").box,dn).fileName}get enabledField(){return de(this,Be,"f").enabled}get minimizedField(){return de(this,Be,"f").minimized}device(){return de(this,zs,"f").boxAdapters.adapterFor(de(this,Be,"f").device.targetVertex.unwrap("device.target").box,Ud)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.fileLabel,children:()=>_.None};for(let e of de(this,Gh,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){de(this,vc,"f").terminate()}};vc=new WeakMap,zs=new WeakMap,Be=new WeakMap,nw=new WeakMap,Gh=new WeakMap,hi=new WeakMap,xc=new WeakMap,m1=new WeakSet,qk=function(e){return{gate:de(this,hi,"f").createParameter(e.gate,E.linearInteger(0,2),S.indices("",["Off","On","Loop"]),"Gate"),mute:de(this,hi,"f").createParameter(e.mute,E.bool,S.bool,"Mute"),solo:de(this,hi,"f").createParameter(e.solo,E.bool,S.bool,"Solo"),polyphone:de(this,hi,"f").createParameter(e.polyphone,E.bool,S.bool,"Polyphone"),exclude:de(this,hi,"f").createParameter(e.exclude,E.bool,S.bool,"Exclude"),pitch:de(this,hi,"f").createParameter(e.pitch,E.linear(-1200,1200),S.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:de(this,hi,"f").createParameter(e.sampleStart,E.unipolar(),S.percent(),"Start",0),sampleEnd:de(this,hi,"f").createParameter(e.sampleEnd,E.unipolar(),S.percent(),"End",1),attack:de(this,hi,"f").createParameter(e.attack,E.exponential(.001,5),S.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:de(this,hi,"f").createParameter(e.release,E.exponential(.001,5),S.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release"),volume:de(this,hi,"f").createParameter(e.volume,E.DefaultDecibel,S.numeric({unit:"dB",fractionDigits:1}),"Volume"),panning:de(this,hi,"f").createParameter(e.panning,E.bipolar(),S.panning,"Pan",.5)}};var aw=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Tr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},yc,In,wc,ow,Ud=class{constructor(e,r){this.type="instrument",this.accepts="midi",this.manualUrl=se.Playfield,yc.set(this,void 0),In.set(this,void 0),wc.set(this,void 0),ow.set(this,void 0),aw(this,yc,e,"f"),aw(this,In,r,"f"),aw(this,wc,jt.create(r.samples,n=>e.boxAdapters.adapterFor(n,Vd),l.Sample),"f"),aw(this,ow,new ue(Tr(this,yc,"f")),"f")}reset(){Tr(this,wc,"f").adapters().forEach(e=>e.box.delete())}chop({file:e,startKey:r,slices:n}){let i=r+n.length-1;Tr(this,wc,"f").adapters().filter(a=>{let o=a.box.index.getValue();return o>=r&&o<=i}).forEach(a=>a.box.delete()),n.forEach(({start:a,end:o},s)=>{Ta.create(Tr(this,yc,"f").boxGraph,k.generate(),c=>{c.file.refer(e),c.device.refer(Tr(this,In,"f").samples),c.index.setValue(r+s),c.sampleStart.setValue(a),c.sampleEnd.setValue(o),c.exclude.setValue(!0)})})}get box(){return Tr(this,In,"f")}get uuid(){return Tr(this,In,"f").address.uuid}get address(){return Tr(this,In,"f").address}get labelField(){return Tr(this,In,"f").label}get iconField(){return Tr(this,In,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return Tr(this,In,"f").enabled}get minimizedField(){return Tr(this,In,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return Tr(this,wc,"f")}get context(){return Tr(this,yc,"f")}deviceHost(){return Tr(this,yc,"f").boxAdapters.adapterFor(Tr(this,In,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None};for(let e of Tr(this,wc,"f").adapters())yield{address:e.address,label:e.fileLabel,children:()=>_.wrap(e.labeledAudioOutputs())}}terminate(){Tr(this,ow,"f").terminate()}};yc=new WeakMap,In=new WeakMap,wc=new WeakMap,ow=new WeakMap;A();var g1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Pr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},v1,Hh,Bn,ro,Jk,sw=class{constructor(e,r){v1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.StereoTool,Hh.set(this,void 0),Bn.set(this,void 0),ro.set(this,void 0),g1(this,Hh,e,"f"),g1(this,Bn,r,"f"),g1(this,ro,new ue(Pr(this,Hh,"f")),"f"),this.namedParameter=Pr(this,v1,"m",Jk).call(this,r)}get box(){return Pr(this,Bn,"f")}get uuid(){return Pr(this,Bn,"f").address.uuid}get address(){return Pr(this,Bn,"f").address}get indexField(){return Pr(this,Bn,"f").index}get labelField(){return Pr(this,Bn,"f").label}get enabledField(){return Pr(this,Bn,"f").enabled}get minimizedField(){return Pr(this,Bn,"f").minimized}get host(){return Pr(this,Bn,"f").host}deviceHost(){return Pr(this,Hh,"f").boxAdapters.adapterFor(Pr(this,Bn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Pr(this,ro,"f").terminate()}};Hh=new WeakMap,Bn=new WeakMap,ro=new WeakMap,v1=new WeakSet,Jk=function(e){return{volume:Pr(this,ro,"f").createParameter(e.volume,E.decibel(-72,0,12),S.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:Pr(this,ro,"f").createParameter(e.panning,E.bipolar(),S.panning,"Panning",.5),stereo:Pr(this,ro,"f").createParameter(e.stereo,E.bipolar(),S.numeric({unit:"%",fractionDigits:0}),"Stereo",.5),invertL:Pr(this,ro,"f").createParameter(e.invertL,E.bool,S.bool,"Invert Left"),invertR:Pr(this,ro,"f").createParameter(e.invertR,E.bool,S.bool,"Invert Right"),swap:Pr(this,ro,"f").createParameter(e.swap,E.bool,S.bool,"Swap")}};A();A();var lw=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},pt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},x1,qh,jd,xr,Jh,bc,Yk,Kd=class{constructor(e,r){x1.add(this),this.class="device-host",qh.set(this,new ae),jd.set(this,void 0),xr.set(this,void 0),Jh.set(this,void 0),bc.set(this,void 0),lw(this,jd,e,"f"),lw(this,xr,r,"f"),lw(this,Jh,pt(this,qh,"f").own(jt.create(pt(this,xr,"f").audioEffects,n=>pt(this,jd,"f").boxAdapters.adapterFor(n,oe.isAudioEffect),l.AudioEffectHost)),"f"),lw(this,bc,pt(this,qh,"f").own(new ue(pt(this,jd,"f"))),"f"),this.namedParameter=pt(this,x1,"m",Yk).call(this,r)}get box(){return pt(this,xr,"f")}get uuid(){return pt(this,xr,"f").address.uuid}get address(){return pt(this,xr,"f").address}get indexField(){return pt(this,xr,"f").index}get labelField(){return pt(this,xr,"f").label}get minimizedField(){return pt(this,xr,"f").minimized}get label(){return pt(this,xr,"f").label.getValue()}get audioEffects(){return _.wrap(pt(this,Jh,"f"))}get midiEffects(){return _.None}get audioEffectsField(){return _.wrap(pt(this,xr,"f").audioEffects)}get midiEffectsField(){return _.None}get inputAdapter(){return _.None}get hostsInstrument(){return!1}get isAudioUnit(){return!1}get inputField(){return this.audioUnitBoxAdapter().box.input}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}compositeDevice(){return pt(this,jd,"f").boxAdapters.adapterFor(pt(this,xr,"f").composite.targetVertex.unwrap("composite.target").box,io)}deviceHost(){return this.compositeDevice().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.label,children:()=>_.None};for(let e of pt(this,Jh,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){pt(this,qh,"f").terminate()}copyToIndex(e){Au.create(pt(this,xr,"f").graph,k.generate(),r=>{r.composite.refer(pt(this,xr,"f").composite.targetVertex.unwrap("composite.target")),r.index.setValue(e),r.label.setValue(pt(this,xr,"f").label.getValue()),r.gain.setValue(pt(this,xr,"f").gain.getValue()),r.pan.setValue(pt(this,xr,"f").pan.getValue()),r.mute.setValue(pt(this,xr,"f").mute.getValue()),r.solo.setValue(pt(this,xr,"f").solo.getValue())})}};qh=new WeakMap,jd=new WeakMap,xr=new WeakMap,Jh=new WeakMap,bc=new WeakMap,x1=new WeakSet,Yk=function(e){return{gain:pt(this,bc,"f").createParameter(e.gain,E.DefaultDecibel,S.numeric({unit:"dB",fractionDigits:1}),"Gain"),pan:pt(this,bc,"f").createParameter(e.pan,E.bipolar(),S.panning,"Pan",.5),mute:pt(this,bc,"f").createParameter(e.mute,E.bool,S.bool,"Mute"),solo:pt(this,bc,"f").createParameter(e.solo,E.bool,S.bool,"Solo")}};var cw=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},rr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},y1,Yh,Wd,ki,uw,Xh,Xk,io=class{constructor(e,r){y1.add(this),this.type="audio-effect",this.accepts="audio",Yh.set(this,new ae),Wd.set(this,void 0),ki.set(this,void 0),uw.set(this,void 0),Xh.set(this,void 0),cw(this,Wd,e,"f"),cw(this,ki,r,"f"),cw(this,uw,rr(this,Yh,"f").own(jt.create(rr(this,ki,"f").entries,n=>rr(this,Wd,"f").boxAdapters.adapterFor(n,Kd),l.AudioEffectCompositeCell)),"f"),cw(this,Xh,rr(this,Yh,"f").own(new ue(rr(this,Wd,"f"))),"f"),this.namedParameter=rr(this,y1,"m",Xk).call(this,r)}get box(){return rr(this,ki,"f")}get uuid(){return rr(this,ki,"f").address.uuid}get address(){return rr(this,ki,"f").address}get indexField(){return rr(this,ki,"f").index}get labelField(){return rr(this,ki,"f").label}get enabledField(){return rr(this,ki,"f").enabled}get minimizedField(){return rr(this,ki,"f").minimized}get host(){return rr(this,ki,"f").host}get entries(){return rr(this,uw,"f")}get inputField(){return rr(this,ki,"f").input}deviceHost(){return rr(this,Wd,"f").boxAdapters.adapterFor(rr(this,ki,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){rr(this,Yh,"f").terminate()}};Yh=new WeakMap,Wd=new WeakMap,ki=new WeakMap,uw=new WeakMap,Xh=new WeakMap,y1=new WeakSet,Xk=function(e){return{dry:rr(this,Xh,"f").createParameter(e.dry,E.DefaultDecibel,S.numeric({unit:"dB",fractionDigits:1}),"Dry"),wet:rr(this,Xh,"f").createParameter(e.wet,E.DefaultDecibel,S.numeric({unit:"dB",fractionDigits:1}),"Wet")}};var dw=class extends io{constructor(e,r){super(e,r)}get entriesFixed(){return!1}get manualUrl(){return se.AudioEffectComposite}};var pw=class extends io{constructor(e,r){super(e,r)}get entriesFixed(){return!0}get manualUrl(){return se.StereoComposite}};A();var cC=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},w1=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ld,b1=E.exponential(20,2e4),_1=S.numeric({unit:"Hz",fractionDigits:0}),Qh=class extends io{constructor(e,r){super(e,r),Ld.set(this,void 0),cC(this,Ld,new ue(e),"f"),this.crossover=[w1(this,Ld,"f").createParameter(r.crossover1,b1,_1,"Crossover 1"),w1(this,Ld,"f").createParameter(r.crossover2,b1,_1,"Crossover 2"),w1(this,Ld,"f").createParameter(r.crossover3,b1,_1,"Crossover 3")]}get crossoverCount(){return Math.max(0,this.entries.adapters().length-1)}get spectrum(){return this.address.append(4095)}get entriesFixed(){return!0}get manualUrl(){return se.FrequencySplit}};Ld=new WeakMap;Qh.MAX_BANDS=4;var em;(function(t){t.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(em||(em={}));var Qk=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Ii=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Zd,Bi,fw=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl=se.Zeitgeist,Zd.set(this,void 0),Bi.set(this,void 0),Qk(this,Zd,e,"f"),Qk(this,Bi,r,"f"),this.groove()}get box(){return Ii(this,Bi,"f")}get uuid(){return Ii(this,Bi,"f").address.uuid}get address(){return Ii(this,Bi,"f").address}get indexField(){return Ii(this,Bi,"f").index}get labelField(){return Ii(this,Bi,"f").label}get enabledField(){return Ii(this,Bi,"f").enabled}get minimizedField(){return Ii(this,Bi,"f").minimized}get host(){return Ii(this,Bi,"f").host}deviceHost(){return Ii(this,Zd,"f").boxAdapters.adapterFor(Ii(this,Bi,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}groove(){return Ii(this,Zd,"f").boxAdapters.adapterFor(Ii(this,Bi,"f").groove.targetVertex.unwrap("no groove").box,em.checkType)}catchupAndSubscribeGroove(e){return Ii(this,Bi,"f").groove.catchupAndSubscribe(r=>e(Ii(this,Zd,"f").boxAdapters.adapterFor(r.targetVertex.unwrap("No groove found").box,em.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Zd=new WeakMap,Bi=new WeakMap;A();var eI=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ma=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},hw,tn,mw=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl="",hw.set(this,void 0),tn.set(this,void 0),eI(this,hw,e,"f"),eI(this,tn,r,"f")}get box(){return ma(this,tn,"f")}get uuid(){return ma(this,tn,"f").address.uuid}get address(){return ma(this,tn,"f").address}get indexField(){return ma(this,tn,"f").index}get labelField(){return ma(this,tn,"f").label}get enabledField(){return ma(this,tn,"f").enabled}get minimizedField(){return ma(this,tn,"f").minimized}get host(){return ma(this,tn,"f").host}get commentField(){return ma(this,tn,"f").comment}deviceHost(){return ma(this,hw,"f").boxAdapters.adapterFor(ma(this,tn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){}};hw=new WeakMap,tn=new WeakMap;var tI=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ga=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},gw,rn,vw=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl="",gw.set(this,void 0),rn.set(this,void 0),tI(this,gw,e,"f"),tI(this,rn,r,"f")}get box(){return ga(this,rn,"f")}get uuid(){return ga(this,rn,"f").address.uuid}get address(){return ga(this,rn,"f").address}get indexField(){return ga(this,rn,"f").index}get labelField(){return ga(this,rn,"f").label}get enabledField(){return ga(this,rn,"f").enabled}get minimizedField(){return ga(this,rn,"f").minimized}get host(){return ga(this,rn,"f").host}get commentField(){return ga(this,rn,"f").comment}deviceHost(){return ga(this,gw,"f").boxAdapters.adapterFor(ga(this,rn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};gw=new WeakMap,rn=new WeakMap;A();var Os=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Xe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},F1,A1,tm,Ti,xw,Gd,va,Tn,Hd,rI,E1,yw=class{constructor(e,r){F1.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=se.Soundfont,A1.set(this,new ae),tm.set(this,void 0),Ti.set(this,void 0),xw.set(this,void 0),Gd.set(this,void 0),va.set(this,void 0),Tn.set(this,void 0),Hd.set(this,ve.Empty),E1.set(this,n=>n.match({none:()=>{Xe(this,Tn,"f").clear(),Xe(this,va,"f").clear()},some:i=>i.soundfont.match({none:()=>{Xe(this,Tn,"f").clear(),Xe(this,va,"f").clear(),Xe(this,Hd,"f").terminate(),Os(this,Hd,i.subscribe(a=>{if(a.type==="loaded"){let o=i.soundfont.unwrap("soundfont");Xe(this,Tn,"f").wrap(o.presets[this.presetIndex]??o.presets[0]),Xe(this,va,"f").wrap(o)}else a.type==="error"?(Xe(this,Tn,"f").clear(),Xe(this,va,"f").clear()):a.type==="idle"&&(Xe(this,Tn,"f").clear(),Xe(this,va,"f").clear())}),"f")},some:a=>{Xe(this,va,"f").wrap(a),Xe(this,Tn,"f").wrap(a.presets[this.presetIndex]??a.presets[0])}})})),Os(this,tm,e,"f"),Os(this,Ti,r,"f"),Os(this,xw,new ue(Xe(this,tm,"f")),"f"),this.namedParameter=Xe(this,F1,"m",rI).call(this,r),Os(this,Gd,new Cr,"f"),Os(this,va,new Cr,"f"),Os(this,Tn,new Cr,"f"),Xe(this,A1,"f").ownAll(Xe(this,Gd,"f").subscribe(Xe(this,E1,"f")),Xe(this,Ti,"f").file.catchupAndSubscribe(({targetVertex:n})=>Xe(this,Gd,"f").wrapOption(n.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),Xe(this,Ti,"f").presetIndex.catchupAndSubscribe(n=>Xe(this,va,"f").match({none:()=>Xe(this,Tn,"f").clear(),some:i=>Xe(this,Tn,"f").wrap(i.presets[n.getValue()]??i.presets[0])})))}get loader(){return Xe(this,Gd,"f")}get soundfont(){return Xe(this,va,"f")}get preset(){return Xe(this,Tn,"f")}get presetIndex(){return Xe(this,Ti,"f").presetIndex.getValue()}get box(){return Xe(this,Ti,"f")}get uuid(){return Xe(this,Ti,"f").address.uuid}get address(){return Xe(this,Ti,"f").address}get labelField(){return Xe(this,Ti,"f").label}get iconField(){return Xe(this,Ti,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return Xe(this,Ti,"f").enabled}get minimizedField(){return Xe(this,Ti,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Xe(this,tm,"f").boxAdapters.adapterFor(Xe(this,Ti,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Xe(this,Hd,"f").terminate(),Os(this,Hd,ve.Empty,"f"),Xe(this,xw,"f").terminate()}};A1=new WeakMap,tm=new WeakMap,Ti=new WeakMap,xw=new WeakMap,Gd=new WeakMap,va=new WeakMap,Tn=new WeakMap,Hd=new WeakMap,E1=new WeakMap,F1=new WeakSet,rI=function(e){return{}};var iI=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},rm=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ww,_c,bw=class{constructor(e,r){ww.set(this,void 0),_c.set(this,void 0),iI(this,ww,e,"f"),iI(this,_c,r,"f")}get box(){return rm(this,_c,"f")}get uuid(){return rm(this,_c,"f").address.uuid}get address(){return rm(this,_c,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return rm(this,ww,"f").soundfontManager.getOrCreate(rm(this,_c,"f").address.uuid)}terminate(){}};ww=new WeakMap,_c=new WeakMap;A();var S1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Di=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},P1,im,Dn,nm,nI,_w=class{constructor(e,r){P1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Maximizer,im.set(this,void 0),Dn.set(this,void 0),nm.set(this,void 0),S1(this,im,e,"f"),S1(this,Dn,r,"f"),S1(this,nm,new ue(Di(this,im,"f")),"f"),this.namedParameter=Di(this,P1,"m",nI).call(this,r)}get box(){return Di(this,Dn,"f")}get uuid(){return Di(this,Dn,"f").address.uuid}get address(){return Di(this,Dn,"f").address}get indexField(){return Di(this,Dn,"f").index}get labelField(){return Di(this,Dn,"f").label}get enabledField(){return Di(this,Dn,"f").enabled}get minimizedField(){return Di(this,Dn,"f").minimized}get host(){return Di(this,Dn,"f").host}deviceHost(){return Di(this,im,"f").boxAdapters.adapterFor(Di(this,Dn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Di(this,nm,"f").terminate()}};im=new WeakMap,Dn=new WeakMap,nm=new WeakMap,P1=new WeakSet,nI=function(e){return{threshold:Di(this,nm,"f").createParameter(e.threshold,E.linear(-24,0),S.decible,"Threshold")}};A();var M1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},$t=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},N1,am,nn,ai,aI,Fw=class{constructor(e,r){N1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Compressor,am.set(this,void 0),nn.set(this,void 0),ai.set(this,void 0),M1(this,am,e,"f"),M1(this,nn,r,"f"),M1(this,ai,new ue($t(this,am,"f")),"f"),this.namedParameter=$t(this,N1,"m",aI).call(this,r)}get box(){return $t(this,nn,"f")}get uuid(){return $t(this,nn,"f").address.uuid}get address(){return $t(this,nn,"f").address}get indexField(){return $t(this,nn,"f").index}get labelField(){return $t(this,nn,"f").label}get enabledField(){return $t(this,nn,"f").enabled}get minimizedField(){return $t(this,nn,"f").minimized}get host(){return $t(this,nn,"f").host}get sideChain(){return $t(this,nn,"f").sideChain}deviceHost(){return $t(this,am,"f").boxAdapters.adapterFor($t(this,nn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){$t(this,ai,"f").terminate()}};am=new WeakMap,nn=new WeakMap,ai=new WeakMap,N1=new WeakSet,aI=function(e){return{lookahead:$t(this,ai,"f").createParameter(e.lookahead,E.bool,S.bool,"Lookahead"),automakeup:$t(this,ai,"f").createParameter(e.automakeup,E.bool,S.bool,"Auto Makeup"),autoattack:$t(this,ai,"f").createParameter(e.autoattack,E.bool,S.bool,"Auto Attack"),autorelease:$t(this,ai,"f").createParameter(e.autorelease,E.bool,S.bool,"Auto Release"),inputgain:$t(this,ai,"f").createParameter(e.inputgain,E.linear(-30,30),S.decible,"Input Gain"),threshold:$t(this,ai,"f").createParameter(e.threshold,E.linear(-60,0),S.decible,"Threshold"),ratio:$t(this,ai,"f").createParameter(e.ratio,E.exponential(1,24),S.numeric({fractionDigits:1}),"Ratio"),knee:$t(this,ai,"f").createParameter(e.knee,E.linear(0,24),S.decible,"Knee"),attack:$t(this,ai,"f").createParameter(e.attack,E.linear(0,100),S.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:$t(this,ai,"f").createParameter(e.release,E.linear(5,1500),S.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:$t(this,ai,"f").createParameter(e.makeup,E.linear(-40,40),S.decible,"Makeup Gain"),mix:$t(this,ai,"f").createParameter(e.mix,E.unipolar(),S.percent(),"Dry/Wet")}};A();var $1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ir=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},k1,om,an,xa,oI,Aw=class{constructor(e,r){k1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Gate,om.set(this,void 0),an.set(this,void 0),xa.set(this,void 0),$1(this,om,e,"f"),$1(this,an,r,"f"),$1(this,xa,new ue(ir(this,om,"f")),"f"),this.namedParameter=ir(this,k1,"m",oI).call(this,r)}get box(){return ir(this,an,"f")}get uuid(){return ir(this,an,"f").address.uuid}get address(){return ir(this,an,"f").address}get indexField(){return ir(this,an,"f").index}get labelField(){return ir(this,an,"f").label}get enabledField(){return ir(this,an,"f").enabled}get minimizedField(){return ir(this,an,"f").minimized}get host(){return ir(this,an,"f").host}get sideChain(){return ir(this,an,"f").sideChain}deviceHost(){return ir(this,om,"f").boxAdapters.adapterFor(ir(this,an,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){ir(this,xa,"f").terminate()}};om=new WeakMap,an=new WeakMap,xa=new WeakMap,k1=new WeakSet,oI=function(e){return{inverse:ir(this,xa,"f").createParameter(e.inverse,E.bool,S.bool,"Inverse"),threshold:ir(this,xa,"f").createParameter(e.threshold,E.linear(-80,0),S.decible,"Threshold"),return:ir(this,xa,"f").createParameter(e.return,E.linear(0,24),S.decible,"Return"),attack:ir(this,xa,"f").createParameter(e.attack,E.linear(0,1e3),S.numeric({unit:"ms",fractionDigits:1}),"Attack"),hold:ir(this,xa,"f").createParameter(e.hold,E.linear(0,500),S.numeric({unit:"ms",fractionDigits:1}),"Hold"),release:ir(this,xa,"f").createParameter(e.release,E.linear(1,2e3),S.numeric({unit:"ms",fractionDigits:1}),"Release"),floor:ir(this,xa,"f").createParameter(e.floor,E.decibel(-72,-12,0),S.decible,"Floor")}};A();var I1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Mr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},B1,sm,Rn,no,sI,Ew=class{constructor(e,r){B1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Autotune,sm.set(this,void 0),Rn.set(this,void 0),no.set(this,void 0),I1(this,sm,e,"f"),I1(this,Rn,r,"f"),I1(this,no,new ue(Mr(this,sm,"f")),"f"),this.namedParameter=Mr(this,B1,"m",sI).call(this,r)}get box(){return Mr(this,Rn,"f")}get uuid(){return Mr(this,Rn,"f").address.uuid}get address(){return Mr(this,Rn,"f").address}get indexField(){return Mr(this,Rn,"f").index}get labelField(){return Mr(this,Rn,"f").label}get enabledField(){return Mr(this,Rn,"f").enabled}get minimizedField(){return Mr(this,Rn,"f").minimized}get host(){return Mr(this,Rn,"f").host}deviceHost(){return Mr(this,sm,"f").boxAdapters.adapterFor(Mr(this,Rn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Mr(this,no,"f").terminate()}};sm=new WeakMap,Rn=new WeakMap,no=new WeakMap,B1=new WeakSet,sI=function(e){return{key:Mr(this,no,"f").createParameter(e.key,E.linearInteger(0,11),S.indices("",["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]),"Key"),scale:Mr(this,no,"f").createParameter(e.scale,E.linearInteger(0,7),S.indices("",["Chrom","Major","Minor","MajPent","MinPent","Blues","Dorian","Mixo"]),"Scale"),amount:Mr(this,no,"f").createParameter(e.amount,E.unipolar(),S.percent(),"Amount"),retune:Mr(this,no,"f").createParameter(e.retune,E.unipolar(),S.percent(),"Retune"),smooth:Mr(this,no,"f").createParameter(e.smooth,E.unipolar(),S.percent(),"Smooth"),shift:Mr(this,no,"f").createParameter(e.shift,E.linear(-12,12),S.numeric({unit:"st"}),"Shift")}};A();var T1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Wr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},D1,lm,Cn,Vs,lI,Sw=class{constructor(e,r){D1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Crusher,lm.set(this,void 0),Cn.set(this,void 0),Vs.set(this,void 0),T1(this,lm,e,"f"),T1(this,Cn,r,"f"),T1(this,Vs,new ue(Wr(this,lm,"f")),"f"),this.namedParameter=Wr(this,D1,"m",lI).call(this,r)}get box(){return Wr(this,Cn,"f")}get uuid(){return Wr(this,Cn,"f").address.uuid}get address(){return Wr(this,Cn,"f").address}get indexField(){return Wr(this,Cn,"f").index}get labelField(){return Wr(this,Cn,"f").label}get enabledField(){return Wr(this,Cn,"f").enabled}get minimizedField(){return Wr(this,Cn,"f").minimized}get host(){return Wr(this,Cn,"f").host}deviceHost(){return Wr(this,lm,"f").boxAdapters.adapterFor(Wr(this,Cn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Wr(this,Vs,"f").terminate()}};lm=new WeakMap,Cn=new WeakMap,Vs=new WeakMap,D1=new WeakSet,lI=function(e){return{crush:Wr(this,Vs,"f").createParameter(e.crush,E.unipolar(),S.percent(),"Crush"),bits:Wr(this,Vs,"f").createParameter(e.bits,E.linearInteger(1,16),S.numeric(),"Bits"),boost:Wr(this,Vs,"f").createParameter(e.boost,E.linear(0,24),S.decible,"Boost"),mix:Wr(this,Vs,"f").createParameter(e.mix,E.exponential(.001,1),S.percent(),"Mix")}};A();var R1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},mi=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},C1,cm,zn,qd,cI,Pw=class{constructor(e,r){C1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Fold,cm.set(this,void 0),zn.set(this,void 0),qd.set(this,void 0),R1(this,cm,e,"f"),R1(this,zn,r,"f"),R1(this,qd,new ue(mi(this,cm,"f")),"f"),this.namedParameter=mi(this,C1,"m",cI).call(this,r)}get box(){return mi(this,zn,"f")}get uuid(){return mi(this,zn,"f").address.uuid}get address(){return mi(this,zn,"f").address}get indexField(){return mi(this,zn,"f").index}get labelField(){return mi(this,zn,"f").label}get enabledField(){return mi(this,zn,"f").enabled}get minimizedField(){return mi(this,zn,"f").minimized}get host(){return mi(this,zn,"f").host}deviceHost(){return mi(this,cm,"f").boxAdapters.adapterFor(mi(this,zn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){mi(this,qd,"f").terminate()}};cm=new WeakMap,zn=new WeakMap,qd=new WeakMap,C1=new WeakSet,cI=function(e){return{drive:mi(this,qd,"f").createParameter(e.drive,E.linear(0,30),S.decible,"Drive"),volume:mi(this,qd,"f").createParameter(e.volume,E.linear(-18,0),S.decible,"Volume")}};A();var Mw=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},yr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},um,dm,On,Jd,Yd,uC=t=>new class{getValue(){let e=t.label.getValue().trim(),r=t.controller.getValue();return e.length===0?String(r):`${e} ${r}`}subscribe(e){return ve.many(t.label.subscribe(()=>e(this)),t.controller.subscribe(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}},Nw=class{constructor(e,r){um.set(this,new ae),this.type="instrument",this.accepts="midi",this.manualUrl=se.MIDIOutput,dm.set(this,void 0),On.set(this,void 0),Jd.set(this,void 0),Yd.set(this,void 0),Mw(this,dm,e,"f"),Mw(this,On,r,"f"),Mw(this,Jd,new Cr,"f"),Mw(this,Yd,yr(this,um,"f").own(new ue(yr(this,dm,"f"))),"f"),yr(this,um,"f").ownAll(r.parameters.pointerHub.catchupAndSubscribe({onAdded:(({box:n})=>{let i=je(n,bl);yr(this,Yd,"f").createParameter(i.value,E.unipolar(),S.percent({fractionDigits:1}),uC(i),0)}),onRemoved:(({box:n})=>yr(this,Yd,"f").removeParameter(je(n,bl).value.address))}),yr(this,On,"f").device.catchupAndSubscribe(({targetVertex:n})=>n.match({none:()=>yr(this,Jd,"f").clear(),some:({box:i})=>yr(this,Jd,"f").wrap(je(i,ss))})))}get box(){return yr(this,On,"f")}get uuid(){return yr(this,On,"f").address.uuid}get address(){return yr(this,On,"f").address}get labelField(){return yr(this,On,"f").label}get iconField(){return yr(this,On,"f").icon}get defaultTrackType(){return ye.Notes}get enabledField(){return yr(this,On,"f").enabled}get minimizedField(){return yr(this,On,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return yr(this,Yd,"f")}get midiDevice(){return yr(this,Jd,"f")}deviceHost(){return yr(this,dm,"f").boxAdapters.adapterFor(yr(this,On,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){yr(this,um,"f").terminate()}};um=new WeakMap,dm=new WeakMap,On=new WeakMap,Jd=new WeakMap,Yd=new WeakMap;A();var $w=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},nr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},z1,pm,Vn,ao,fm,uI,kw=class{constructor(e,r){z1.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=se.Velocity,pm.set(this,void 0),Vn.set(this,void 0),ao.set(this,void 0),fm.set(this,void 0),$w(this,pm,e,"f"),$w(this,Vn,r,"f"),$w(this,ao,new ue(nr(this,pm,"f")),"f"),$w(this,fm,Tg.create(),"f"),this.namedParameter=nr(this,z1,"m",uI).call(this,r)}computeVelocity(e,r){let{magnetPosition:n,magnetStrength:i,randomSeed:a,randomAmount:o,offset:s,mix:c}=this.namedParameter;nr(this,fm,"f").setSeed(a.valueAt(e)+e);let u=r+(n.valueAt(e)-r)*i.valueAt(e),f=(nr(this,fm,"f").uniform()*2-1)*o.valueAt(e),v=s.valueAt(e),m=c.valueAt(e);return r*(1-m)+bg(u+f+v)*m}get box(){return nr(this,Vn,"f")}get uuid(){return nr(this,Vn,"f").address.uuid}get address(){return nr(this,Vn,"f").address}get indexField(){return nr(this,Vn,"f").index}get labelField(){return nr(this,Vn,"f").label}get enabledField(){return nr(this,Vn,"f").enabled}get minimizedField(){return nr(this,Vn,"f").minimized}get host(){return nr(this,Vn,"f").host}deviceHost(){return nr(this,pm,"f").boxAdapters.adapterFor(nr(this,Vn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){nr(this,ao,"f").terminate()}};pm=new WeakMap,Vn=new WeakMap,ao=new WeakMap,fm=new WeakMap,z1=new WeakSet,uI=function(e){return{magnetPosition:nr(this,ao,"f").createParameter(e.magnetPosition,E.unipolar(),S.percent(),"Position"),magnetStrength:nr(this,ao,"f").createParameter(e.magnetStrength,E.unipolar(),S.percent(),"Strength"),randomSeed:nr(this,ao,"f").createParameter(e.randomSeed,E.linearInteger(0,65535),S.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:nr(this,ao,"f").createParameter(e.randomAmount,E.unipolar(),S.percent(),"Amount"),offset:nr(this,ao,"f").createParameter(e.offset,E.bipolar(),S.percent(),"Offset"),mix:nr(this,ao,"f").createParameter(e.mix,E.unipolar(),S.percent(),"Mix")}};A();rt();var O1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Nr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},V1,U1,hm,Un,oo,dI,Fc=class{constructor(e,r){V1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Tidal,hm.set(this,void 0),Un.set(this,void 0),oo.set(this,void 0),O1(this,hm,e,"f"),O1(this,Un,r,"f"),O1(this,oo,new ue(Nr(this,hm,"f")),"f"),this.namedParameter=Nr(this,V1,"m",dI).call(this,r)}get box(){return Nr(this,Un,"f")}get uuid(){return Nr(this,Un,"f").address.uuid}get address(){return Nr(this,Un,"f").address}get indexField(){return Nr(this,Un,"f").index}get labelField(){return Nr(this,Un,"f").label}get enabledField(){return Nr(this,Un,"f").enabled}get minimizedField(){return Nr(this,Un,"f").minimized}get host(){return Nr(this,Un,"f").host}deviceHost(){return Nr(this,hm,"f").boxAdapters.adapterFor(Nr(this,Un,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Nr(this,oo,"f").terminate()}};U1=Fc,hm=new WeakMap,Un=new WeakMap,oo=new WeakMap,V1=new WeakSet,dI=function(e){let{RateFractions:r,RateStringMapping:n}=U1;return{slope:Nr(this,oo,"f").createParameter(e.slope,E.bipolar(),S.percent({fractionDigits:1}),"Slope",.5),symmetry:Nr(this,oo,"f").createParameter(e.symmetry,E.unipolar(),S.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:Nr(this,oo,"f").createParameter(e.rate,E.values(r.map((i,a)=>a)),n,"Rate",0),depth:Nr(this,oo,"f").createParameter(e.depth,E.unipolar(),S.percent({fractionDigits:1}),"Depth",0),offset:Nr(this,oo,"f").createParameter(e.offset,E.linear(-180,180),S.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:Nr(this,oo,"f").createParameter(e.channelOffset,E.linear(-180,180),S.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};Fc.RateFractions=Xo.builder().add([1,1]).add([1,2]).add([1,3]).add([1,4]).add([3,16]).add([1,6]).add([1,8]).add([3,32]).add([1,12]).add([1,16]).add([3,64]).add([1,24]).add([1,32]).add([1,48]).add([1,64]).add([1,96]).add([1,128]).asDescendingArray();Fc.RateStringMapping=S.indices("",U1.RateFractions.map(([t,e])=>`${t}/${e}`));A();var j1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},kt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},K1,mm,gi,Ri,pI,Iw=class{constructor(e,r){K1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Vocoder,mm.set(this,void 0),gi.set(this,void 0),Ri.set(this,void 0),j1(this,mm,e,"f"),j1(this,gi,r,"f"),j1(this,Ri,new ue(kt(this,mm,"f")),"f"),this.namedParameter=kt(this,K1,"m",pI).call(this,r)}get box(){return kt(this,gi,"f")}get uuid(){return kt(this,gi,"f").address.uuid}get address(){return kt(this,gi,"f").address}get indexField(){return kt(this,gi,"f").index}get labelField(){return kt(this,gi,"f").label}get enabledField(){return kt(this,gi,"f").enabled}get minimizedField(){return kt(this,gi,"f").minimized}get host(){return kt(this,gi,"f").host}get sideChain(){return kt(this,gi,"f").sideChain}get modulatorSpectrum(){return kt(this,gi,"f").address.append(4094)}get carrierSpectrum(){return kt(this,gi,"f").address.append(4095)}deviceHost(){return kt(this,mm,"f").boxAdapters.adapterFor(kt(this,gi,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){kt(this,Ri,"f").terminate()}};mm=new WeakMap,gi=new WeakMap,Ri=new WeakMap,K1=new WeakSet,pI=function(e){let r=E.exponential(20,2e4),n=S.numeric({unit:"Hz",fractionDigits:0}),i=E.exponential(1,60),a=S.numeric({fractionDigits:1});return{carrierMinFreq:kt(this,Ri,"f").createParameter(e.carrierMinFreq,r,n,"Carrier Min"),carrierMaxFreq:kt(this,Ri,"f").createParameter(e.carrierMaxFreq,r,n,"Carrier Max"),modulatorMinFreq:kt(this,Ri,"f").createParameter(e.modulatorMinFreq,r,n,"Mod Min"),modulatorMaxFreq:kt(this,Ri,"f").createParameter(e.modulatorMaxFreq,r,n,"Mod Max"),qStart:kt(this,Ri,"f").createParameter(e.qStart,i,a,"Q Start"),qEnd:kt(this,Ri,"f").createParameter(e.qEnd,i,a,"Q End"),envAttack:kt(this,Ri,"f").createParameter(e.envAttack,E.exponential(.1,100),S.numeric({unit:"ms",fractionDigits:1}),"Attack"),envRelease:kt(this,Ri,"f").createParameter(e.envRelease,E.exponential(1,1e3),S.numeric({unit:"ms",fractionDigits:0}),"Release"),gain:kt(this,Ri,"f").createParameter(e.gain,E.linear(-20,20),S.decible,"Gain"),mix:kt(this,Ri,"f").createParameter(e.mix,E.unipolar(),S.percent(),"Mix")}};A();var W1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Rt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},L1,gm,jn,oi,fI,Bw=class{constructor(e,r){L1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.DattorroReverb,gm.set(this,void 0),jn.set(this,void 0),oi.set(this,void 0),W1(this,gm,e,"f"),W1(this,jn,r,"f"),W1(this,oi,new ue(Rt(this,gm,"f")),"f"),this.namedParameter=Rt(this,L1,"m",fI).call(this,r)}get box(){return Rt(this,jn,"f")}get uuid(){return Rt(this,jn,"f").address.uuid}get address(){return Rt(this,jn,"f").address}get indexField(){return Rt(this,jn,"f").index}get labelField(){return Rt(this,jn,"f").label}get enabledField(){return Rt(this,jn,"f").enabled}get minimizedField(){return Rt(this,jn,"f").minimized}get host(){return Rt(this,jn,"f").host}deviceHost(){return Rt(this,gm,"f").boxAdapters.adapterFor(Rt(this,jn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Rt(this,oi,"f").terminate()}};gm=new WeakMap,jn=new WeakMap,oi=new WeakMap,L1=new WeakSet,fI=function(e){return{preDelay:Rt(this,oi,"f").createParameter(e.preDelay,E.linear(0,1e3),S.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:Rt(this,oi,"f").createParameter(e.bandwidth,E.unipolar(),S.percent(),"Bandwidth"),inputDiffusion1:Rt(this,oi,"f").createParameter(e.inputDiffusion1,E.unipolar(),S.percent(),"Tank 1"),inputDiffusion2:Rt(this,oi,"f").createParameter(e.inputDiffusion2,E.unipolar(),S.percent(),"Tank 2"),decay:Rt(this,oi,"f").createParameter(e.decay,E.unipolar(),S.percent(),"Decay"),decayDiffusion1:Rt(this,oi,"f").createParameter(e.decayDiffusion1,E.unipolar(),S.percent(),"Tank 1"),decayDiffusion2:Rt(this,oi,"f").createParameter(e.decayDiffusion2,E.unipolar(),S.percent(),"Tank 2"),damping:Rt(this,oi,"f").createParameter(e.damping,E.unipolar(),S.percent(),"Damping"),excursionRate:Rt(this,oi,"f").createParameter(e.excursionRate,E.unipolar(),S.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:Rt(this,oi,"f").createParameter(e.excursionDepth,E.unipolar(),S.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:Rt(this,oi,"f").createParameter(e.wet,E.DefaultDecibel,S.decible,"Wet"),dry:Rt(this,oi,"f").createParameter(e.dry,E.DefaultDecibel,S.decible,"Dry")}};A();var hI=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Xd=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Z1,jo,Qd=class{constructor(e,r){Z1.set(this,void 0),jo.set(this,void 0),hI(this,Z1,e,"f"),hI(this,jo,r,"f")}get box(){return Xd(this,jo,"f")}get uuid(){return Xd(this,jo,"f").address.uuid}get address(){return Xd(this,jo,"f").address}get labelField(){return Xd(this,jo,"f").label}get modelField(){return Xd(this,jo,"f").model}getModelJson(){return Xd(this,jo,"f").model.getValue()}terminate(){}};Z1=new WeakMap,jo=new WeakMap;var G1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},qt=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},H1,ep,Lr,Ac,mI,Tw=class{constructor(e,r){H1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.NeuralAmp,ep.set(this,void 0),Lr.set(this,void 0),Ac.set(this,void 0),G1(this,ep,e,"f"),G1(this,Lr,r,"f"),G1(this,Ac,new ue(qt(this,ep,"f")),"f"),this.namedParameter=qt(this,H1,"m",mI).call(this,r)}get box(){return qt(this,Lr,"f")}get uuid(){return qt(this,Lr,"f").address.uuid}get address(){return qt(this,Lr,"f").address}get indexField(){return qt(this,Lr,"f").index}get labelField(){return qt(this,Lr,"f").label}get enabledField(){return qt(this,Lr,"f").enabled}get minimizedField(){return qt(this,Lr,"f").minimized}get host(){return qt(this,Lr,"f").host}get modelField(){return qt(this,Lr,"f").model}get monoField(){return qt(this,Lr,"f").mono}get spectrum(){return qt(this,Lr,"f").address.append(4095)}getModelAdapter(){let e=qt(this,Lr,"f").model.targetVertex;return e.isEmpty()?_.None:_.wrap(qt(this,ep,"f").boxAdapters.adapterFor(e.unwrap().box,Qd))}getModelJson(){let e=this.getModelAdapter();return e.nonEmpty()?e.unwrap().getModelJson():qt(this,Lr,"f").modelJson.getValue()}deviceHost(){return qt(this,ep,"f").boxAdapters.adapterFor(qt(this,Lr,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){qt(this,Ac,"f").terminate()}};ep=new WeakMap,Lr=new WeakMap,Ac=new WeakMap,H1=new WeakSet,mI=function(e){return{inputGain:qt(this,Ac,"f").createParameter(e.inputGain,E.decibel(-72,0,12),S.numeric({unit:"dB",fractionDigits:1}),"Input"),outputGain:qt(this,Ac,"f").createParameter(e.outputGain,E.decibel(-72,0,12),S.numeric({unit:"dB",fractionDigits:1}),"Output"),mix:qt(this,Ac,"f").createParameter(e.mix,E.linear(0,1),S.percent(),"Mix")}};A();var q1=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},si=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},J1,vm,Kn,Ec,gI,Dw=class{constructor(e,r){J1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Waveshaper,vm.set(this,void 0),Kn.set(this,void 0),Ec.set(this,void 0),q1(this,vm,e,"f"),q1(this,Kn,r,"f"),q1(this,Ec,new ue(si(this,vm,"f")),"f"),this.namedParameter=si(this,J1,"m",gI).call(this,r)}get box(){return si(this,Kn,"f")}get uuid(){return si(this,Kn,"f").address.uuid}get address(){return si(this,Kn,"f").address}get indexField(){return si(this,Kn,"f").index}get labelField(){return si(this,Kn,"f").label}get enabledField(){return si(this,Kn,"f").enabled}get minimizedField(){return si(this,Kn,"f").minimized}get host(){return si(this,Kn,"f").host}deviceHost(){return si(this,vm,"f").boxAdapters.adapterFor(si(this,Kn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){si(this,Ec,"f").terminate()}};vm=new WeakMap,Kn=new WeakMap,Ec=new WeakMap,J1=new WeakSet,gI=function(e){return{inputGain:si(this,Ec,"f").createParameter(e.inputGain,E.linear(0,40),S.decible,"Input"),outputGain:si(this,Ec,"f").createParameter(e.outputGain,E.linear(-24,24),S.decible,"Output"),mix:si(this,Ec,"f").createParameter(e.mix,E.unipolar(),S.percent(),"Mix")}};A();var Rw=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Zr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},xm,ym,Wn,wm,Cw,zw=class{constructor(e,r){xm.set(this,new ae),this.type="audio-effect",this.accepts="audio",this.manualUrl=se.Werkstatt,ym.set(this,void 0),Wn.set(this,void 0),wm.set(this,void 0),Cw.set(this,void 0),Rw(this,ym,e,"f"),Rw(this,Wn,r,"f"),Rw(this,wm,Zr(this,xm,"f").own(new ue(Zr(this,ym,"f"))),"f");let{terminable:n,codeChanged:i}=Er.subscribeScriptParams(Zr(this,wm,"f"),r.code,r.parameters);Zr(this,xm,"f").own(n),Rw(this,Cw,i,"f")}get box(){return Zr(this,Wn,"f")}get uuid(){return Zr(this,Wn,"f").address.uuid}get address(){return Zr(this,Wn,"f").address}get indexField(){return Zr(this,Wn,"f").index}get labelField(){return Zr(this,Wn,"f").label}get enabledField(){return Zr(this,Wn,"f").enabled}get minimizedField(){return Zr(this,Wn,"f").minimized}get host(){return Zr(this,Wn,"f").host}get parameters(){return Zr(this,wm,"f")}get codeChanged(){return Zr(this,Cw,"f")}deviceHost(){return Zr(this,ym,"f").boxAdapters.adapterFor(Zr(this,Wn,"f").host.targetVertex.unwrap("no device-host").box,oe.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>_.None}}terminate(){Zr(this,xm,"f").terminate()}};xm=new WeakMap,ym=new WeakMap,Wn=new WeakMap,wm=new WeakMap,Cw=new WeakMap;var fe=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},dC,pe,pC,fC,hC,mC;pe=new WeakMap,pC=new WeakMap,fC=new WeakMap,hC=new WeakMap,dC=new WeakSet,mC=function(e){return He(e.accept({visitArpeggioDeviceBox:r=>new mc(fe(this,pe,"f"),r),visitAudioBusBox:r=>new Wi(fe(this,pe,"f"),r),visitAudioClipBox:r=>new Ou(fe(this,pe,"f"),r),visitAudioFileBox:r=>new ta(fe(this,pe,"f"),r),visitAudioTimeStretchBox:r=>new Va(fe(this,pe,"f"),r),visitAudioPitchStretchBox:r=>new Oa(fe(this,pe,"f"),r),visitAudioSignalsmithBox:r=>new Ua(fe(this,pe,"f"),r),visitTransientMarkerBox:r=>new Nu(r),visitWarpMarkerBox:r=>new Ca(fe(this,pe,"f"),r),visitApparatDeviceBox:r=>new ew(fe(this,pe,"f"),r),visitCubedDeviceBox:r=>new tw(fe(this,pe,"f"),r),visitAudioRegionBox:r=>new td(fe(this,pe,"f"),r),visitAudioUnitBox:r=>new bn(fe(this,pe,"f"),r),visitAuxSendBox:r=>new hd(fe(this,pe,"f"),r),visitMaximizerDeviceBox:r=>new _w(fe(this,pe,"f"),r),visitCompressorDeviceBox:r=>new Fw(fe(this,pe,"f"),r),visitGateDeviceBox:r=>new Aw(fe(this,pe,"f"),r),visitAutotuneDeviceBox:r=>new Ew(fe(this,pe,"f"),r),visitCrusherDeviceBox:r=>new Sw(fe(this,pe,"f"),r),visitDattorroReverbDeviceBox:r=>new Bw(fe(this,pe,"f"),r),visitDelayDeviceBox:r=>new ca(fe(this,pe,"f"),r),visitDeviceInterfaceKnobBox:r=>new Pd(fe(this,pe,"f"),r),visitTidalDeviceBox:r=>new Fc(fe(this,pe,"f"),r),visitFoldDeviceBox:r=>new Pw(fe(this,pe,"f"),r),visitGrooveShuffleBox:r=>new Xa(fe(this,pe,"f"),r),visitMarkerBox:r=>new Ss(fe(this,pe,"f"),r),visitSignatureEventBox:r=>new ic(fe(this,pe,"f"),r),visitMIDIOutputDeviceBox:r=>new Nw(fe(this,pe,"f"),r),visitModularAudioInputBox:r=>new Ed(fe(this,pe,"f"),r),visitModularAudioOutputBox:r=>new _d(fe(this,pe,"f"),r),visitModularBox:r=>new ks(fe(this,pe,"f"),r),visitModularDeviceBox:r=>new Nd(fe(this,pe,"f"),r),visitModuleConnectionBox:r=>new $s(fe(this,pe,"f"),r),visitModuleDelayBox:r=>new bd(fe(this,pe,"f"),r),visitModuleGainBox:r=>new Fd(fe(this,pe,"f"),r),visitModuleMultiplierBox:r=>new Ad(fe(this,pe,"f"),r),visitNeonDeviceBox:r=>new rw(fe(this,pe,"f"),r),visitNanoDeviceBox:r=>new iw(fe(this,pe,"f"),r),visitNeuralAmpDeviceBox:r=>new Tw(fe(this,pe,"f"),r),visitNeuralAmpModelBox:r=>new Qd(fe(this,pe,"f"),r),visitNoteClipBox:r=>new Ku(fe(this,pe,"f"),r),visitNoteEventBox:r=>new Cl(fe(this,pe,"f"),r),visitNoteEventCollectionBox:r=>new gn(fe(this,pe,"f"),r),visitNoteRegionBox:r=>new id(fe(this,pe,"f"),r),visitPitchDeviceBox:r=>new Hy(fe(this,pe,"f"),r),visitPlayfieldDeviceBox:r=>new Ud(fe(this,pe,"f"),r),visitPlayfieldSampleBox:r=>new Vd(fe(this,pe,"f"),r),visitAudioEffectCompositeBox:r=>new dw(fe(this,pe,"f"),r),visitAudioEffectCompositeCellBox:r=>new Kd(fe(this,pe,"f"),r),visitStereoCompositeBox:r=>new pw(fe(this,pe,"f"),r),visitFrequencySplitBox:r=>new Qh(fe(this,pe,"f"),r),visitRevampDeviceBox:r=>new oy(fe(this,pe,"f"),r),visitReverbDeviceBox:r=>new ay(fe(this,pe,"f"),r),visitRootBox:r=>new Wy(fe(this,pe,"f"),r),visitSoundfontDeviceBox:r=>new yw(fe(this,pe,"f"),r),visitSoundfontFileBox:r=>new bw(fe(this,pe,"f"),r),visitSpielwerkDeviceBox:r=>new Yy(fe(this,pe,"f"),r),visitStereoToolDeviceBox:r=>new sw(fe(this,pe,"f"),r),visitTapeDeviceBox:r=>new Ly(fe(this,pe,"f"),r),visitTimelineBox:r=>new Ja(fe(this,pe,"f"),r),visitTrackBox:r=>new fr(fe(this,pe,"f"),r),visitUnknownAudioEffectDeviceBox:r=>new mw(fe(this,pe,"f"),r),visitUnknownMidiEffectDeviceBox:r=>new vw(fe(this,pe,"f"),r),visitValueClipBox:r=>new fs(fe(this,pe,"f"),r),visitValueEventBox:r=>new Ao(fe(this,pe,"f"),r),visitValueEventCollectionBox:r=>new Or(fe(this,pe,"f"),r),visitValueRegionBox:r=>new ko(fe(this,pe,"f"),r),visitVaporisateurDeviceBox:r=>new Zy(fe(this,pe,"f"),r),visitVocoderDeviceBox:r=>new Iw(fe(this,pe,"f"),r),visitWaveshaperDeviceBox:r=>new Dw(fe(this,pe,"f"),r),visitWerkstattDeviceBox:r=>new zw(fe(this,pe,"f"),r),visitVelocityDeviceBox:r=>new kw(fe(this,pe,"f"),r),visitZeitgeistDeviceBox:r=>new fw(fe(this,pe,"f"),r)}),`Could not find factory for ${e}`)};A();var tp;(function(t){t.PEAKS=ze.compose(k.Lowest).append(0),t.SPECTRUM=ze.compose(k.Lowest).append(1),t.WAVEFORM=ze.compose(k.Lowest).append(2),t.STEREO=ze.compose(k.Lowest).append(3),t.GONIO=ze.compose(k.Lowest).append(4),t.LOUDNESS=ze.compose(k.Lowest).append(5),t.HEAP=ze.compose(k.Lowest).append(6)})(tp||(tp={}));A();var Ow;(function(t){t.countStems=e=>e.match({none:()=>1,some:r=>K(r.stems)?Object.keys(r.stems).length+(K(r.metronome?.stem)?1:0):1}),t.isMetronomeAudible=e=>e.match({none:()=>!1,some:r=>K(r.stems)?K(r.metronome?.stem):r.metronome?.includeInMixdown===!0}),t.stemFileNames=e=>{let r=Object.values(e.stems??{}).map(({fileName:i})=>i),n=e.metronome?.stem;return K(n)&&r.push(n.fileName),r},t.sanitizeFileName=e=>e.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").trim(),t.sanitizeExportNamesInPlace=e=>{let r=e.metronome?.stem;if(!K(e.stems)&&!K(r))return;let n=e.stems??{},i=new Map,a=o=>{let s=i.get(o)??0,c=o;for(;i.has(c);)s++,c=`${o} ${s}`;return i.set(o,s),i.set(c,1),c};Object.keys(n).forEach(o=>{let s=n[o];s.fileName=a(t.sanitizeFileName(s.fileName))}),K(r)&&(r.fileName=a(t.sanitizeFileName(r.fileName)))}})(Ow||(Ow={}));A();var gC=512,vI=Vi.createBuilder({position:Vi.float,bpm:Vi.float,playbackTimestamp:Vi.float,countInBeatsRemaining:Vi.float,isPlaying:Vi.bool,isCountingIn:Vi.bool,isRecording:Vi.bool,perfIndex:Vi.int32,perfBuffer:Vi.floats(gC)});A();var xI;(function(t){t.store=(e,r,n)=>{if(n==="")return W("MetaData.store: origin must be unique to your app.");let i=e.pointerHub.filter(l.MetaData).map(({box:o})=>o).find(o=>o instanceof Yn&&o.origin.getValue()===n),a=o=>{o.target.refer(e),o.origin.setValue(n),o.value.setValue(JSON.stringify(r))};t_(i)?a(i):Yn.create(e.graph,k.generate(),a)},t.read=(e,r)=>{if(r==="")return W("MetaData.read: origin must be unique to your app.");let n=e.pointerHub.filter(l.MetaData).map(({box:i})=>i).find(i=>i instanceof Yn&&i.origin.getValue()===r);if(t_(n)){let{status:i,value:a,error:o}=sr(()=>JSON.parse(n.value.getValue()));if(i==="success")return a;console.warn(o)}return null},t.clear=(e,r)=>{if(r==="")return W("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(l.MetaData).map(({box:n})=>n).filter(n=>n instanceof Yn&&n.origin.getValue()===r).forEach(n=>n.delete())},t.catchupAndSubscribe=(e,r,n)=>{if(r==="")return W("MetaData.catchupAndSubscribe: origin must be unique to your app.");let i=k.newSet(s=>s.uuid),a=s=>{let{status:c,value:u,error:f}=sr(()=>JSON.parse(s.value.getValue()));c==="success"?n(_.wrap(u)):(console.warn(f),n(_.None))},o=e.pointerHub.catchupAndSubscribe({onAdded:({box:s})=>{if(!(s instanceof Yn)||s.origin.getValue()!==r)return;let c=s.value.catchupAndSubscribe(()=>a(s));i.add({uuid:s.address.uuid,subscription:c})},onRemoved:({box:s})=>{if(!(s instanceof Yn)||s.origin.getValue()!==r)return;i.removeByKey(s.address.uuid).subscription.terminate(),n(_.None)}},l.MetaData);return{terminate:()=>{o.terminate(),i.forEach(({subscription:s})=>s.terminate()),i.clear()}}}})(xI||(xI={}));var vC,xC,yC,wC;vC=new WeakMap,xC=new WeakMap,yC=new WeakMap,wC=new WeakMap;A();A();var Us;(function(t){let e;(function(r){r[r.NoteOn=144]="NoteOn",r[r.NoteOff=128]="NoteOff",r[r.PitchBend=224]="PitchBend",r[r.Controller=176]="Controller",r[r.Start=250]="Start",r[r.Continue=251]="Continue",r[r.Stop=252]="Stop",r[r.Clock=248]="Clock",r[r.Position=242]="Position"})(e=t.Command||(t.Command={})),t.readCommand=r=>r[0]&240,t.readChannel=r=>r[0]&15,t.readParam1=r=>r.length>1?r[1]&255:0,t.readParam2=r=>r.length>2?r[2]&255:0,t.readPitch=r=>r[1],t.readVelocity=r=>r[2]/127,t.isNoteOn=r=>t.readCommand(r)===e.NoteOn&&t.readVelocity(r)>0,t.isNoteOff=r=>t.readCommand(r)===e.NoteOff||t.readCommand(r)===e.NoteOn&&t.readVelocity(r)===0,t.isPitchWheel=r=>t.readCommand(r)===e.PitchBend,t.isController=r=>t.readCommand(r)===e.Controller,t.isClock=r=>r[0]===e.Clock,t.isStart=r=>r[0]===e.Start,t.isContinue=r=>r[0]===e.Continue,t.isStop=r=>r[0]===e.Stop,t.isPosition=r=>r[0]===e.Position,t.asPitchBend=r=>{let n=t.readParam1(r)&127,i=t.readParam2(r)&127,a=n|i<<7;return 8192>=a?a/8192-1:(a-8191)/8192},t.asValue=r=>{let n=t.readParam2(r);return n>64?.5+(n-63)/128:n<64?n/128:.5},t.Clock=new Uint8Array([e.Clock]),t.Start=new Uint8Array([e.Start]),t.Continue=new Uint8Array([e.Continue]),t.Stop=new Uint8Array([e.Stop]),t.noteOn=(r,n,i)=>new Uint8Array([e.NoteOn|r,n,i]),t.noteOff=(r,n)=>new Uint8Array([e.NoteOff|r,n,0]),t.control=(r,n,i)=>new Uint8Array([e.Controller|r,n&127,i&127]),t.position=(r,n)=>new Uint8Array([e.Position,r&127,n&127]),t.positionInPPQN=r=>{let n=Math.floor(r/96),i=n&127,a=n>>7&127;return new Uint8Array([e.Position,i,a])},t.accept=(r,n)=>{cn(r)||(t.isNoteOn(r)?$(n.noteOn,t.readPitch(r),t.readVelocity(r)):t.isNoteOff(r)?$(n.noteOff,t.readPitch(r)):t.isPitchWheel(r)?$(n.pitchBend,t.asPitchBend(r)):t.isController(r)?$(n.controller,t.readParam1(r),t.readParam2(r)/127):t.isClock(r)?$(n.clock):t.isStart(r)?$(n.start):t.isContinue(r)?$(n.continue):t.isStop(r)?$(n.stop):t.isPosition(r)&&$(n.songPos,t.readParam1(r)|t.readParam2(r)<<7))},t.debug=r=>r===null?"null":t.isNoteOn(r)?`NoteOn #${t.readChannel(r)} ${t.readPitch(r)} : ${t.readVelocity(r).toFixed(2)}`:t.isNoteOff(r)?`NoteOff #${t.readChannel(r)} ${t.readPitch(r)}`:t.isPitchWheel(r)?`PitchWheel #${t.readChannel(r)} ${t.asPitchBend(r)}`:t.isController(r)?`Control #${t.readChannel(r)} ${t.asValue(r)}`:t.isClock(r)?"Clock":t.isStart(r)?"Start":t.isContinue(r)?"Continue":t.isStop(r)?"Stop":t.isPosition(r)?`SongPosition ${t.readParam1(r)|t.readParam2(r)<<7}`:"Unknown"})(Us||(Us={}));var bm;(function(t){t.on=(e,r,n)=>({type:"note-on",uuid:e,pitch:r,velocity:n}),t.off=(e,r)=>({type:"note-off",uuid:e,pitch:r}),t.audition=(e,r,n,i)=>({type:"note-audition",uuid:e,pitch:r,duration:n,velocity:i}),t.isOn=e=>e.type==="note-on",t.isOff=e=>e.type==="note-off",t.isAudition=e=>e.type==="note-audition",t.fromEvent=(e,r)=>{let n=e.data;if(Us.isNoteOn(n)){let i=Us.readPitch(n),a=Us.readVelocity(n);return{type:"note-on",uuid:r,pitch:i,velocity:a}}else if(Us.isNoteOff(n)){let i=Us.readPitch(n);return{type:"note-off",uuid:r,pitch:i}}return W("Unknown MIDI event")}})(bm||(bm={}));var yI;(function(t){t.start=(e,r,n,i=1)=>{let a=!0;return e(bm.on(r,n,i)),{terminate:()=>{a&&(e(bm.off(r,n)),a=!1)}}}})(yI||(yI={}));var wI=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},bC,_C,bI,_I,FC,AC;_C=new WeakMap,bI=new WeakMap,_I=new WeakMap,FC=new WeakMap,bC=new WeakSet,AC=function(e,r){return e.subscribeIntegers(r,n=>{wI(this,bI,"f").replace(n.buffer)&&wI(this,_I,"f").notify(this)})};var EC,SC,PC,MC,NC,$C;EC=new WeakMap,SC=new WeakMap,PC=new WeakMap,MC=new WeakMap,NC=new WeakMap,$C=new WeakMap;A();A();var ya={isClipBox:t=>t.accept({visitNoteClipBox:e=>!0,visitAudioClipBox:e=>!0,visitValueClipBox:e=>!0})??!1,isRegionBox:t=>t.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1,asRegionBox:t=>t.accept({visitNoteRegionBox:e=>e,visitAudioRegionBox:e=>e,visitValueRegionBox:e=>e})??W("Could not cast to AnyRegionBox"),isLoopableRegionBox:t=>t.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};rt();var Vw={min:30,max:1e3,default:120};var Uw;(function(t){t.isTimeSignatureValid=(e,r)=>!Number.isInteger(e)||e<1||e>31?Dr.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(r)||r<1||r>32||(r&r-1)!==0?Dr.err("Denominator must be a power of two between 1 and 32"):Dr.ok([e,r]),t.clampBpm=e=>Number.isFinite(e)?Se(e,Vw.min,Vw.max):Vw.default,t.clampBaseFrequency=e=>Number.isFinite(e)?Se(e,ry.min,ry.max):ry.default,t.hasOverlappingRegions=e=>e.boxes().some(r=>r.accept({visitTrackBox:n=>{for(let[i,a]of ie.iterateAdjacent(n.regions.pointerHub.incoming().map(({box:o})=>ya.asRegionBox(o)).sort(({position:o},{position:s})=>o.getValue()-s.getValue()))){if(i instanceof os&&i.timeBase.getValue()===ui.Seconds)return!1;if(i.position.getValue()+i.duration.getValue()>a.position.getValue())return!0}return!1}})??!1)})(Uw||(Uw={}));var FI;(function(t){t.parseTimeSignature=e=>{let[r,n]=e.split("/"),i=parseInt(r,10),a=parseInt(n,10);return Uw.isTimeSignatureValid(i,a)}})(FI||(FI={}));A();var AI;(function(t){t.reader=(e,r)=>{let n=`
6
6
  onmessage = (event) => {
7
7
  const {sab, numChunks, numberOfChannels, bufferSize} = event.data
8
8
  const pointers = new Int32Array(sab, 0, 2)
@@ -112,10 +112,10 @@ var UR=Object.defineProperty;var H=(t,e)=>()=>(t&&(e=t(t=0)),e);var _a=(t,e)=>{f
112
112
 
113
113
  `)}w.write("payload.value = newResult;"),w.write("return payload;");let C=w.compile();return(G,Y)=>C(m,G,Y)},a,o=Ic,s=!kc.jitless,u=s&&dF.value,f=e.catchall,v;t._zod.parse=(m,w)=>{v??(v=n.value);let y=m.value;return o(y)?s&&u&&w?.async===!1&&w.jitless!==!0?(a||(a=i(e.shape)),m=a(m,w),f?FB([],y,m,w,v,t):m):r(m,w):(m.issues.push({expected:"object",code:"invalid_type",input:y,inst:t}),m)}});function sB(t,e,r,n){for(let a of t)if(a.issues.length===0)return e.value=a.value,e;let i=t.filter(a=>!Gs(a));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(a=>a.issues.map(o=>xi(o,n,Jt())))}),e)}var zm=R("$ZodUnion",(t,e)=>{Ce.init(t,e),Qe(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Qe(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Qe(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),Qe(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>Pm(i.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1,o=[];for(let s of e.options){let c=s._zod.run({value:n.value,issues:[]},i);if(c instanceof Promise)o.push(c),a=!0;else{if(c.issues.length===0)return c;o.push(c)}}return a?Promise.all(o).then(s=>sB(s,n,t,i)):sB(o,n,t,i)}});function lB(t,e,r,n){let i=t.filter(a=>a.issues.length===0);return i.length===1?(e.value=i[0].value,e):(i.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(a=>a.issues.map(o=>xi(o,n,Jt())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var tE=R("$ZodXor",(t,e)=>{zm.init(t,e),e.inclusive=!1;let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,i)=>{if(r)return r(n,i);let a=!1,o=[];for(let s of e.options){let c=s._zod.run({value:n.value,issues:[]},i);c instanceof Promise?(o.push(c),a=!0):o.push(c)}return a?Promise.all(o).then(s=>lB(s,n,t,i)):lB(o,n,t,i)}}),rE=R("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,zm.init(t,e);let r=t._zod.parse;Qe(t._zod,"propValues",()=>{let i={};for(let a of e.options){let o=a._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let[s,c]of Object.entries(o)){i[s]||(i[s]=new Set);for(let u of c)i[s].add(u)}}return i});let n=ip(()=>{let i=e.options,a=new Map;for(let o of i){let s=o._zod.propValues?.[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let c of s){if(a.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);a.set(c,o)}}return a});t._zod.parse=(i,a)=>{let o=i.value;if(!Ic(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),i;let s=n.value.get(o?.[e.discriminator]);return s?s._zod.run(i,a):e.unionFallback||a.direction==="backward"?r(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:o,path:[e.discriminator],inst:t}),i)}}),iE=R("$ZodIntersection",(t,e)=>{Ce.init(t,e),t._zod.parse=(r,n)=>{let i=r.value,a=e.left._zod.run({value:i,issues:[]},n),o=e.right._zod.run({value:i,issues:[]},n);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([c,u])=>cB(r,c,u)):cB(r,a,o)}});function gA(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Zs(t)&&Zs(e)){let r=Object.keys(e),n=Object.keys(t).filter(a=>r.indexOf(a)!==-1),i={...t,...e};for(let a of n){let o=gA(t[a],e[a]);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};i[a]=o.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<t.length;n++){let i=t[n],a=e[n],o=gA(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};r.push(o.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function cB(t,e,r){let n=new Map,i;for(let s of e.issues)if(s.code==="unrecognized_keys"){i??(i=s);for(let c of s.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else t.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let c of s.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else t.issues.push(s);let a=[...n].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(a.length&&i&&t.issues.push({...i,keys:a}),Gs(t))return t;let o=gA(e.value,r.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return t.value=o.data,t}var h0=R("$ZodTuple",(t,e)=>{Ce.init(t,e);let r=e.items;t._zod.parse=(n,i)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({input:a,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=[];let o=[],s=uB(r,"optin"),c=uB(r,"optout");if(!e.rest){if(a.length<s)return n.issues.push({code:"too_small",minimum:s,inclusive:!0,input:a,inst:t,origin:"array"}),n;a.length>r.length&&n.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:a,inst:t,origin:"array"})}let u=new Array(r.length);for(let f=0;f<r.length;f++){let v=r[f]._zod.run({value:a[f],issues:[]},i);v instanceof Promise?o.push(v.then(m=>{u[f]=m})):u[f]=v}if(e.rest){let f=r.length-1,v=a.slice(r.length);for(let m of v){f++;let w=e.rest._zod.run({value:m,issues:[]},i);w instanceof Promise?o.push(w.then(y=>dB(y,n,f))):dB(w,n,f)}}return o.length?Promise.all(o).then(()=>pB(u,n,r,a,c)):pB(u,n,r,a,c)}});function uB(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]._zod[e]!=="optional")return r+1;return 0}function dB(t,e,r){t.issues.length&&e.issues.push(...Ci(r,t.issues)),e.value[r]=t.value}function pB(t,e,r,n,i){for(let a=0;a<r.length;a++){let o=t[a],s=a<n.length;if(o.issues.length){if(!s&&a>=i){e.value.length=a;break}e.issues.push(...Ci(a,o.issues))}e.value[a]=o.value}for(let a=e.value.length-1;a>=n.length&&(r[a]._zod.optout==="optional"&&e.value[a]===void 0);a--)e.value.length=a;return e}var nE=R("$ZodRecord",(t,e)=>{Ce.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Zs(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let a=[],o=e.keyType._zod.values;if(o){r.value={};let s=new Set;for(let u of o)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){s.add(typeof u=="number"?u.toString():u);let f=e.keyType._zod.run({value:u,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(f.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(w=>xi(w,n,Jt())),input:u,path:[u],inst:t});continue}let v=f.value,m=e.valueType._zod.run({value:i[u],issues:[]},n);m instanceof Promise?a.push(m.then(w=>{w.issues.length&&r.issues.push(...Ci(u,w.issues)),r.value[v]=w.value})):(m.issues.length&&r.issues.push(...Ci(u,m.issues)),r.value[v]=m.value)}let c;for(let u in i)s.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:c})}else{r.value={};for(let s of Reflect.ownKeys(i)){if(s==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,s))continue;let c=e.keyType._zod.run({value:s,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&a0.test(s)&&c.issues.length){let v=e.keyType._zod.run({value:Number(s),issues:[]},n);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");v.issues.length===0&&(c=v)}if(c.issues.length){e.mode==="loose"?r.value[s]=i[s]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(v=>xi(v,n,Jt())),input:s,path:[s],inst:t});continue}let f=e.valueType._zod.run({value:i[s],issues:[]},n);f instanceof Promise?a.push(f.then(v=>{v.issues.length&&r.issues.push(...Ci(s,v.issues)),r.value[c.value]=v.value})):(f.issues.length&&r.issues.push(...Ci(s,f.issues)),r.value[c.value]=f.value)}}return a.length?Promise.all(a).then(()=>r):r}}),aE=R("$ZodMap",(t,e)=>{Ce.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:t}),r;let a=[];r.value=new Map;for(let[o,s]of i){let c=e.keyType._zod.run({value:o,issues:[]},n),u=e.valueType._zod.run({value:s,issues:[]},n);c instanceof Promise||u instanceof Promise?a.push(Promise.all([c,u]).then(([f,v])=>{fB(f,v,r,o,i,t,n)})):fB(c,u,r,o,i,t,n)}return a.length?Promise.all(a).then(()=>r):r}});function fB(t,e,r,n,i,a,o){t.issues.length&&(Mm.has(typeof n)?r.issues.push(...Ci(n,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:a,issues:t.issues.map(s=>xi(s,o,Jt()))})),e.issues.length&&(Mm.has(typeof n)?r.issues.push(...Ci(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:a,key:n,issues:e.issues.map(s=>xi(s,o,Jt()))})),r.value.set(t.value,e.value)}var oE=R("$ZodSet",(t,e)=>{Ce.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:t,expected:"set",code:"invalid_type"}),r;let a=[];r.value=new Set;for(let o of i){let s=e.valueType._zod.run({value:o,issues:[]},n);s instanceof Promise?a.push(s.then(c=>hB(c,r))):hB(s,r)}return a.length?Promise.all(a).then(()=>r):r}});function hB(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var sE=R("$ZodEnum",(t,e)=>{Ce.init(t,e);let r=Sm(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>Mm.has(typeof i)).map(i=>typeof i=="string"?Ln(i):i.toString()).join("|")})$`),t._zod.parse=(i,a)=>{let o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:r,input:o,inst:t}),i}}),lE=R("$ZodLiteral",(t,e)=>{if(Ce.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Ln(n):n?Ln(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:e.values,input:a,inst:t}),n}}),cE=R("$ZodFile",(t,e)=>{Ce.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return i instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:i,inst:t}),r}}),uE=R("$ZodTransform",(t,e)=>{Ce.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ks(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(r.value=o,r.fallback=!0,r));if(i instanceof Promise)throw new wa;return r.value=i,r.fallback=!0,r}});function mB(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var m0=R("$ZodOptional",(t,e)=>{Ce.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Qe(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Qe(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Pm(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=r.value,a=e.innerType._zod.run(r,n);return a instanceof Promise?a.then(o=>mB(o,i)):mB(a,i)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),dE=R("$ZodExactOptional",(t,e)=>{m0.init(t,e),Qe(t._zod,"values",()=>e.innerType._zod.values),Qe(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),pE=R("$ZodNullable",(t,e)=>{Ce.init(t,e),Qe(t._zod,"optin",()=>e.innerType._zod.optin),Qe(t._zod,"optout",()=>e.innerType._zod.optout),Qe(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Pm(r.source)}|null)$`):void 0}),Qe(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),fE=R("$ZodDefault",(t,e)=>{Ce.init(t,e),t._zod.optin="optional",Qe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>gB(a,e)):gB(i,e)}});function gB(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var hE=R("$ZodPrefault",(t,e)=>{Ce.init(t,e),t._zod.optin="optional",Qe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),mE=R("$ZodNonOptional",(t,e)=>{Ce.init(t,e),Qe(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>vB(a,t)):vB(i,t)}});function vB(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var gE=R("$ZodSuccess",(t,e)=>{Ce.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ks("ZodSuccess");let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>(r.value=a.issues.length===0,r)):(r.value=i.issues.length===0,r)}}),vE=R("$ZodCatch",(t,e)=>{Ce.init(t,e),t._zod.optin="optional",Qe(t._zod,"optout",()=>e.innerType._zod.optout),Qe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(a=>(r.value=a.value,a.issues.length&&(r.value=e.catchValue({...r,error:{issues:a.issues.map(o=>xi(o,n,Jt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(a=>xi(a,n,Jt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),xE=R("$ZodNaN",(t,e)=>{Ce.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),g0=R("$ZodPipe",(t,e)=>{Ce.init(t,e),Qe(t._zod,"values",()=>e.in._zod.values),Qe(t._zod,"optin",()=>e.in._zod.optin),Qe(t._zod,"optout",()=>e.out._zod.optout),Qe(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let a=e.out._zod.run(r,n);return a instanceof Promise?a.then(o=>l0(o,e.in,n)):l0(a,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(a=>l0(a,e.out,n)):l0(i,e.out,n)}});function l0(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}var Om=R("$ZodCodec",(t,e)=>{Ce.init(t,e),Qe(t._zod,"values",()=>e.in._zod.values),Qe(t._zod,"optin",()=>e.in._zod.optin),Qe(t._zod,"optout",()=>e.out._zod.optout),Qe(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if((n.direction||"forward")==="forward"){let a=e.in._zod.run(r,n);return a instanceof Promise?a.then(o=>c0(o,e,n)):c0(a,e,n)}else{let a=e.out._zod.run(r,n);return a instanceof Promise?a.then(o=>c0(o,e,n)):c0(a,e,n)}}});function c0(t,e,r){if(t.issues.length)return t.aborted=!0,t;if((r.direction||"forward")==="forward"){let i=e.transform(t.value,t);return i instanceof Promise?i.then(a=>u0(t,a,e.out,r)):u0(t,i,e.out,r)}else{let i=e.reverseTransform(t.value,t);return i instanceof Promise?i.then(a=>u0(t,a,e.in,r)):u0(t,i,e.in,r)}}function u0(t,e,r,n){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},n)}var yE=R("$ZodPreprocess",(t,e)=>{g0.init(t,e)}),wE=R("$ZodReadonly",(t,e)=>{Ce.init(t,e),Qe(t._zod,"propValues",()=>e.innerType._zod.propValues),Qe(t._zod,"values",()=>e.innerType._zod.values),Qe(t._zod,"optin",()=>e.innerType?._zod?.optin),Qe(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(xB):xB(i)}});function xB(t){return t.value=Object.freeze(t.value),t}var bE=R("$ZodTemplateLiteral",(t,e)=>{Ce.init(t,e);let r=[];for(let n of e.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let i=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let a=i.startsWith("^")?1:0,o=i.endsWith("$")?i.length-1:i.length;r.push(i.slice(a,o))}else if(n===null||fF.has(typeof n))r.push(Ln(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,i)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"string",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),n)}),_E=R("$ZodFunction",(t,e)=>(Ce.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...n){let i=t._def.input?Hw(t._def.input,n):n,a=Reflect.apply(r,this,i);return t._def.output?Hw(t._def.output,a):a}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...n){let i=t._def.input?await qw(t._def.input,n):n,a=await Reflect.apply(r,this,i);return t._def.output?await qw(t._def.output,a):a}},t._zod.parse=(r,n)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let n=t.constructor;return Array.isArray(r[0])?new n({type:"function",input:new h0({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new n({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let n=t.constructor;return new n({type:"function",input:t._def.input,output:r})},t)),FE=R("$ZodPromise",(t,e)=>{Ce.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(i=>e.innerType._zod.run({value:i,issues:[]},n))}),AE=R("$ZodLazy",(t,e)=>{Ce.init(t,e),Qe(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),Qe(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),Qe(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),Qe(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),Qe(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),EE=R("$ZodCustom",(t,e)=>{_t.init(t,e),Ce.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(a=>yB(a,r,n,t));yB(i,r,n,t)}});function yB(t,e,r,n){if(!t){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(np(i))}}var Um={};_a(Um,{ar:()=>EB,az:()=>SB,be:()=>MB,bg:()=>NB,ca:()=>$B,cs:()=>kB,da:()=>IB,de:()=>BB,el:()=>TB,en:()=>v0,eo:()=>DB,es:()=>RB,fa:()=>CB,fi:()=>zB,fr:()=>OB,frCA:()=>VB,he:()=>UB,hr:()=>jB,hu:()=>KB,hy:()=>LB,id:()=>ZB,is:()=>GB,it:()=>HB,ja:()=>qB,ka:()=>JB,kh:()=>YB,km:()=>x0,ko:()=>XB,lt:()=>eT,mk:()=>tT,ms:()=>rT,nl:()=>iT,no:()=>nT,ota:()=>aT,pl:()=>sT,ps:()=>oT,pt:()=>lT,ro:()=>cT,ru:()=>dT,sl:()=>pT,sv:()=>fT,ta:()=>hT,th:()=>mT,tr:()=>gT,ua:()=>vT,uk:()=>y0,ur:()=>xT,uz:()=>yT,vi:()=>wT,yo:()=>FT,zhCN:()=>bT,zhTW:()=>_T});var gO=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(i){return t[i]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${i.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${a}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return i.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${q(i.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${a} ${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${a} ${i.minimum.toString()} ${o.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${i.prefix}"`:a.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${a.suffix}"`:a.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${a.includes}"`:a.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${a.pattern}`:`${r[a.format]??i.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${i.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${i.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${i.keys.length>1?"\u0629":""}: ${j(i.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function EB(){return{localeError:gO()}}var vO=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(i){return t[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${i.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${a}, daxil olan ${s}`}case"invalid_value":return i.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${q(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${a}${i.maximum.toString()} ${o.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${a}${i.minimum.toString()} ${o.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${a.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:a.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${a.suffix}" il\u0259 bitm\u0259lidir`:a.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${a.includes}" daxil olmal\u0131d\u0131r`:a.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${a.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[a.format]??i.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${i.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${i.keys.length>1?"lar":""}: ${j(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${i.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function SB(){return{localeError:vO()}}function PB(t,e,r,n){let i=Math.abs(t),a=i%10,o=i%100;return o>=11&&o<=19?n:a===1?e:a>=2&&a<=4?r:n}var xO=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(i){return t[i]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},n={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${i.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${a}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${q(i.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);if(o){let s=Number(i.maximum),c=PB(s,o.unit.one,o.unit.few,o.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${o.verb} ${a}${i.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);if(o){let s=Number(i.minimum),c=PB(s,o.unit.one,o.unit.few,o.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${o.verb} ${a}${i.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${a.includes}"`:a.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${i.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${j(i.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${i.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function MB(){return{localeError:xO()}}var yO=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${a}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${q(i.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${a}${i.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${a}${i.minimum.toString()} ${o.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${i.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;if(a.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${a.prefix}"`;if(a.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${a.suffix}"`;if(a.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${a.includes}"`;if(a.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${a.pattern}`;let o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return a.format==="emoji"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="datetime"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="date"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),a.format==="time"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),a.format==="duration"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${o} ${r[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${i.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u043E\u0432\u0435":""}: ${j(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function NB(){return{localeError:yO()}}var wO=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(i){return t[i]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${i.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${a}, s'ha rebut ${s}`}case"invalid_value":return i.values.length===1?`Valor inv\xE0lid: s'esperava ${q(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${j(i.values," o ")}`;case"too_big":{let a=i.inclusive?"com a m\xE0xim":"menys de",o=e(i.origin);return o?`Massa gran: s'esperava que ${i.origin??"el valor"} contingu\xE9s ${a} ${i.maximum.toString()} ${o.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"com a m\xEDnim":"m\xE9s de",o=e(i.origin);return o?`Massa petit: s'esperava que ${i.origin} contingu\xE9s ${a} ${i.minimum.toString()} ${o.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${a.prefix}"`:a.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${a.suffix}"`:a.format==="includes"?`Format inv\xE0lid: ha d'incloure "${a.includes}"`:a.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${a.pattern}`:`Format inv\xE0lid per a ${r[a.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${j(i.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${i.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${i.origin}`;default:return"Entrada inv\xE0lida"}}};function $B(){return{localeError:wO()}}var bO=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(i){return t[i]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},n={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${i.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${a}, obdr\u017Eeno ${s}`}case"invalid_value":return i.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${q(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${a}${i.maximum.toString()} ${o.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${a}${i.minimum.toString()} ${o.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${a.prefix}"`:a.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${a.suffix}"`:a.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${a.includes}"`:a.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${a.pattern}`:`Neplatn\xFD form\xE1t ${r[a.format]??i.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${i.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${j(i.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${i.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${i.origin}`;default:return"Neplatn\xFD vstup"}}};function kB(){return{localeError:bO()}}var _O=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(i){return t[i]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ugyldigt input: forventede instanceof ${i.expected}, fik ${s}`:`Ugyldigt input: forventede ${a}, fik ${s}`}case"invalid_value":return i.values.length===1?`Ugyldig v\xE6rdi: forventede ${q(i.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin),s=n[i.origin]??i.origin;return o?`For stor: forventede ${s??"value"} ${o.verb} ${a} ${i.maximum.toString()} ${o.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin),s=n[i.origin]??i.origin;return o?`For lille: forventede ${s} ${o.verb} ${a} ${i.minimum.toString()} ${o.unit}`:`For lille: forventede ${s} havde ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ugyldig streng: skal starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: skal ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: skal indeholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${a.pattern}`:`Ugyldig ${r[a.format]??i.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${j(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${i.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${i.origin}`;default:return"Ugyldigt input"}}};function IB(){return{localeError:_O()}}var FO=()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(i){return t[i]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},n={nan:"NaN",number:"Zahl",array:"Array"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${i.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${a}, erhalten ${s}`}case"invalid_value":return i.values.length===1?`Ung\xFCltige Eingabe: erwartet ${q(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${a}${i.maximum.toString()} ${o.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${a}${i.maximum.toString()} ist`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Zu klein: erwartet, dass ${i.origin} ${a}${i.minimum.toString()} ${o.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${a}${i.minimum.toString()} ist`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ung\xFCltiger String: muss mit "${a.prefix}" beginnen`:a.format==="ends_with"?`Ung\xFCltiger String: muss mit "${a.suffix}" enden`:a.format==="includes"?`Ung\xFCltiger String: muss "${a.includes}" enthalten`:a.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${a.pattern} entsprechen`:`Ung\xFCltig: ${r[a.format]??i.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${j(i.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${i.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${i.origin}`;default:return"Ung\xFCltige Eingabe"}}};function BB(){return{localeError:FO()}}var AO=()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(i){return t[i]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return typeof i.expected=="string"&&/^[A-Z]/.test(i.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${i.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${a}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${s}`}case"invalid_value":return i.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${q(i.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${a}${i.maximum.toString()} ${o.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${a}${i.minimum.toString()} ${o.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${a.prefix}"`:a.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${a.suffix}"`:a.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${a.includes}"`:a.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${a.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[a.format]??i.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${i.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${i.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${i.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${j(i.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${i.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${i.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function TB(){return{localeError:AO()}}var EO=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(i){return t[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return`Invalid input: expected ${a}, received ${s}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${q(i.values[0])}`:`Invalid option: expected one of ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Too big: expected ${i.origin??"value"} to have ${a}${i.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Too small: expected ${i.origin} to have ${a}${i.minimum.toString()} ${o.unit}`:`Too small: expected ${i.origin} to be ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Invalid string: must start with "${a.prefix}"`:a.format==="ends_with"?`Invalid string: must end with "${a.suffix}"`:a.format==="includes"?`Invalid string: must include "${a.includes}"`:a.format==="regex"?`Invalid string: must match pattern ${a.pattern}`:`Invalid ${r[a.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${j(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(o=>`'${o}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function v0(){return{localeError:EO()}}var SO=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(i){return t[i]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},n={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${i.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${a}, ricevi\u011Dis ${s}`}case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${q(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${a}${i.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${a}${i.minimum.toString()} ${o.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${a.prefix}"`:a.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${a.suffix}"`:a.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${a.includes}"`:a.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${a.pattern}`:`Nevalida ${r[a.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} \u015Dlosilo${i.keys.length>1?"j":""}: ${j(i.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function DB(){return{localeError:SO()}}var PO=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(i){return t[i]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${i.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${a}, recibido ${s}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: se esperaba ${q(i.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin),s=n[i.origin]??i.origin;return o?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${a}${i.maximum.toString()} ${o.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin),s=n[i.origin]??i.origin;return o?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${a}${i.minimum.toString()} ${o.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${a.prefix}"`:a.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${a.suffix}"`:a.format==="includes"?`Cadena inv\xE1lida: debe incluir "${a.includes}"`:a.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${a.pattern}`:`Inv\xE1lido ${r[a.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${j(i.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n[i.origin]??i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n[i.origin]??i.origin}`;default:return"Entrada inv\xE1lida"}}};function RB(){return{localeError:PO()}}var MO=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(i){return t[i]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${i.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${a} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return i.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${q(i.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${j(i.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} ${o.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:a.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${a.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:a.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${a.includes}" \u0628\u0627\u0634\u062F`:a.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${a.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[a.format]??i.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${i.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${i.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${j(i.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${i.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${i.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function CB(){return{localeError:MO()}}var NO=()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(i){return t[i]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Virheellinen tyyppi: odotettiin instanceof ${i.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${a}, oli ${s}`}case"invalid_value":return i.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${q(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Liian suuri: ${o.subject} t\xE4ytyy olla ${a}${i.maximum.toString()} ${o.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Liian pieni: ${o.subject} t\xE4ytyy olla ${a}${i.minimum.toString()} ${o.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${a.prefix}"`:a.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${a.suffix}"`:a.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${a.includes}"`:a.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${a.pattern}`:`Virheellinen ${r[a.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${j(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function zB(){return{localeError:NO()}}var $O=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(i){return t[i]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : instanceof ${i.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${a} attendu, ${s} re\xE7u`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : ${q(i.values[0])} attendu`:`Option invalide : une valeur parmi ${j(i.values,"|")} attendue`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Trop grand : ${n[i.origin]??"valeur"} doit ${o.verb} ${a}${i.maximum.toString()} ${o.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n[i.origin]??"valeur"} doit \xEAtre ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Trop petit : ${n[i.origin]??"valeur"} doit ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`Trop petit : ${n[i.origin]??"valeur"} doit \xEAtre ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Cha\xEEne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${a.pattern}`:`${r[a.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${j(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function OB(){return{localeError:$O()}}var kO=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(i){return t[i]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : attendu instanceof ${i.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${a}, re\xE7u ${s}`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : attendu ${q(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"\u2264":"<",o=e(i.origin);return o?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${a}${i.maximum.toString()} ${o.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"\u2265":">",o=e(i.origin);return o?`Trop petit : attendu que ${i.origin} ait ${a}${i.minimum.toString()} ${o.unit}`:`Trop petit : attendu que ${i.origin} soit ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${a.prefix}"`:a.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${a.suffix}"`:a.format==="includes"?`Cha\xEEne invalide : doit inclure "${a.includes}"`:a.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${a.pattern}`:`${r[a.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${j(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function VB(){return{localeError:kO()}}var IO=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=u=>u?t[u]:void 0,n=u=>{let f=r(u);return f?f.label:u??t.unknown.label},i=u=>`\u05D4${n(u)}`,a=u=>(r(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",o=u=>u?e[u]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let f=u.expected,v=c[f??""]??n(f),m=J(u.input),w=c[m]??t[m]?.label??m;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${w}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${v}, \u05D4\u05EA\u05E7\u05D1\u05DC ${w}`}case"invalid_value":{if(u.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${q(u.values[0])}`;let f=u.values.map(w=>q(w));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${f[0]} \u05D0\u05D5 ${f[1]}`;let v=f[f.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${f.slice(0,-1).join(", ")} \u05D0\u05D5 ${v}`}case"too_big":{let f=o(u.origin),v=i(u.origin??"value");if(u.origin==="string")return`${f?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${v} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${f?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let y=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${v} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${y}`}if(u.origin==="array"||u.origin==="set"){let y=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",P=u.inclusive?`${u.maximum} ${f?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${f?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${v} ${y} \u05DC\u05D4\u05DB\u05D9\u05DC ${P}`.trim()}let m=u.inclusive?"<=":"<",w=a(u.origin??"value");return f?.unit?`${f.longLabel} \u05DE\u05D3\u05D9: ${v} ${w} ${m}${u.maximum.toString()} ${f.unit}`:`${f?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${v} ${w} ${m}${u.maximum.toString()}`}case"too_small":{let f=o(u.origin),v=i(u.origin??"value");if(u.origin==="string")return`${f?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${v} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${f?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let y=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${v} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${y}`}if(u.origin==="array"||u.origin==="set"){let y=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let V=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${v} ${y} \u05DC\u05D4\u05DB\u05D9\u05DC ${V}`}let P=u.inclusive?`${u.minimum} ${f?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${f?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${v} ${y} \u05DC\u05D4\u05DB\u05D9\u05DC ${P}`.trim()}let m=u.inclusive?">=":">",w=a(u.origin??"value");return f?.unit?`${f.shortLabel} \u05DE\u05D3\u05D9: ${v} ${w} ${m}${u.minimum.toString()} ${f.unit}`:`${f?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${v} ${w} ${m}${u.minimum.toString()}`}case"invalid_format":{let f=u;if(f.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${f.prefix}"`;if(f.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${f.suffix}"`;if(f.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${f.includes}"`;if(f.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${f.pattern}`;let v=s[f.format],m=v?.label??f.format,y=(v?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${y}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${j(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function UB(){return{localeError:IO()}}var BO=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(i){return t[i]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},n={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${i.expected}, a primljeno je ${s}`:`Neispravan unos: o\u010Dekuje se ${a}, a primljeno je ${s}`}case"invalid_value":return i.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${q(i.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin),s=n[i.origin]??i.origin;return o?`Preveliko: o\u010Dekivano da ${s??"vrijednost"} ima ${a}${i.maximum.toString()} ${o.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${s??"vrijednost"} bude ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin),s=n[i.origin]??i.origin;return o?`Premalo: o\u010Dekivano da ${s} ima ${a}${i.minimum.toString()} ${o.unit}`:`Premalo: o\u010Dekivano da ${s} bude ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${a.prefix}"`:a.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${a.suffix}"`:a.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${a.includes}"`:a.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${a.pattern}`:`Neispravna ${r[a.format]??i.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${i.divisor}`;case"unrecognized_keys":return`Neprepoznat${i.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${j(i.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${n[i.origin]??i.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${n[i.origin]??i.origin}`;default:return"Neispravan unos"}}};function jB(){return{localeError:BO()}}var TO=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(i){return t[i]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},n={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${i.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${a}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return i.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${q(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`T\xFAl nagy: ${i.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${a}${i.maximum.toString()} ${o.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${i.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} m\xE9rete t\xFAl kicsi ${a}${i.minimum.toString()} ${o.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} t\xFAl kicsi ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\xC9rv\xE9nytelen string: "${a.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:a.format==="ends_with"?`\xC9rv\xE9nytelen string: "${a.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:a.format==="includes"?`\xC9rv\xE9nytelen string: "${a.includes}" \xE9rt\xE9ket kell tartalmaznia`:a.format==="regex"?`\xC9rv\xE9nytelen string: ${a.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[a.format]??i.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${i.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${j(i.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${i.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${i.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function KB(){return{localeError:TO()}}function WB(t,e,r){return Math.abs(t)===1?e:r}function up(t){if(!t)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}var DO=()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(i){return t[i]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},n={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${i.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${a}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return i.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${q(i.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);if(o){let s=Number(i.maximum),c=WB(s,o.unit.one,o.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${up(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${a}${i.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${up(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);if(o){let s=Number(i.minimum),c=WB(s,o.unit.one,o.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${up(i.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${a}${i.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${up(i.origin)} \u056C\u056B\u0576\u056B ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${a.prefix}"-\u0578\u057E`:a.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${a.suffix}"-\u0578\u057E`:a.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${a.includes}"`:a.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${a.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[a.format]??i.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${i.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${i.keys.length>1?"\u0576\u0565\u0580":""}. ${j(i.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${up(i.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${up(i.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function LB(){return{localeError:DO()}}var RO=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(i){return t[i]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Input tidak valid: diharapkan instanceof ${i.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${a}, diterima ${s}`}case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${q(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${a}${i.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Terlalu kecil: diharapkan ${i.origin} memiliki ${a}${i.minimum.toString()} ${o.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`String tidak valid: harus dimulai dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak valid: harus berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak valid: harus menyertakan "${a.includes}"`:a.format==="regex"?`String tidak valid: harus sesuai pola ${a.pattern}`:`${r[a.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${j(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}};function ZB(){return{localeError:RO()}}var CO=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(i){return t[i]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},n={nan:"NaN",number:"n\xFAmer",array:"fylki"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${i.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${a}`}case"invalid_value":return i.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${q(i.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} hafi ${a}${i.maximum.toString()} ${o.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} s\xE9 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} hafi ${a}${i.minimum.toString()} ${o.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} s\xE9 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${a.prefix}"`:a.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${a.suffix}"`:a.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${a.includes}"`:a.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${a.pattern}`:`Rangt ${r[a.format]??i.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${j(i.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${i.origin}`;default:return"Rangt gildi"}}};function GB(){return{localeError:CO()}}var zO=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(i){return t[i]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"numero",array:"vettore"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Input non valido: atteso instanceof ${i.expected}, ricevuto ${s}`:`Input non valido: atteso ${a}, ricevuto ${s}`}case"invalid_value":return i.values.length===1?`Input non valido: atteso ${q(i.values[0])}`:`Opzione non valida: atteso uno tra ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Troppo grande: ${i.origin??"valore"} deve avere ${a}${i.maximum.toString()} ${o.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Troppo piccolo: ${i.origin} deve avere ${a}${i.minimum.toString()} ${o.unit}`:`Troppo piccolo: ${i.origin} deve essere ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Stringa non valida: deve iniziare con "${a.prefix}"`:a.format==="ends_with"?`Stringa non valida: deve terminare con "${a.suffix}"`:a.format==="includes"?`Stringa non valida: deve includere "${a.includes}"`:a.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${a.pattern}`:`Input non valido: ${r[a.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${j(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}};function HB(){return{localeError:zO()}}var OO=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(i){return t[i]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},n={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${i.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${a}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return i.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${q(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${j(i.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let a=i.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",o=e(i.origin);return o?`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${o.unit??"\u8981\u7D20"}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let a=i.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",o=e(i.origin);return o?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${o.unit}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${a}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${a.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:a.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${a.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[a.format]??i.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${i.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${i.keys.length>1?"\u7FA4":""}: ${j(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function qB(){return{localeError:OO()}}var VO=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(i){return t[i]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},n={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${i.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${a}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return i.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${q(i.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${j(i.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${o.verb} ${a}${i.maximum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i.origin} \u10D8\u10E7\u10DD\u10E1 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${a.prefix}"-\u10D8\u10D7`:a.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${a.suffix}"-\u10D8\u10D7`:a.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${a.includes}"-\u10E1`:a.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${a.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${i.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${i.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${j(i.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${i.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${i.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function JB(){return{localeError:VO()}}var UO=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(i){return t[i]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},n={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${i.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${a} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return i.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${q(i.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${a} ${i.maximum.toString()} ${o.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${a} ${i.minimum.toString()} ${o.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${a.prefix}"`:a.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${a.suffix}"`:a.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${a.includes}"`:a.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${a.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${i.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${j(i.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function x0(){return{localeError:UO()}}function YB(){return x0()}var jO=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(i){return t[i]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${i.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${a}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return i.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${q(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${j(i.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let a=i.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",o=a==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(i.origin),c=s?.unit??"\uC694\uC18C";return s?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()}${c} ${a}${o}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()} ${a}${o}`}case"too_small":{let a=i.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",o=a==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(i.origin),c=s?.unit??"\uC694\uC18C";return s?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()}${c} ${a}${o}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()} ${a}${o}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:a.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:a.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${a.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:a.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${a.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[a.format]??i.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${i.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${j(i.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${i.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${i.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function XB(){return{localeError:jO()}}var Vm=t=>t.charAt(0).toUpperCase()+t.slice(1);function QB(t){let e=Math.abs(t),r=e%10,n=e%100;return n>=11&&n<=19||r===0?"many":r===1?"one":"few"}var KO=()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(i,a,o,s){let c=t[i]??null;return c===null?c:{unit:c.unit[a],verb:c.verb[s][o?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},n={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${i.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${a}`}case"invalid_value":return i.values.length===1?`Privalo b\u016Bti ${q(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${j(i.values,"|")} pasirinkim\u0173`;case"too_big":{let a=n[i.origin]??i.origin,o=e(i.origin,QB(Number(i.maximum)),i.inclusive??!1,"smaller");if(o?.verb)return`${Vm(a??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.maximum.toString()} ${o.unit??"element\u0173"}`;let s=i.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Vm(a??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${i.maximum.toString()} ${o?.unit}`}case"too_small":{let a=n[i.origin]??i.origin,o=e(i.origin,QB(Number(i.minimum)),i.inclusive??!1,"bigger");if(o?.verb)return`${Vm(a??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.minimum.toString()} ${o.unit??"element\u0173"}`;let s=i.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Vm(a??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${i.minimum.toString()} ${o?.unit}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${a.prefix}"`:a.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${a.suffix}"`:a.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${a.includes}"`:a.format==="regex"?`Eilut\u0117 privalo atitikti ${a.pattern}`:`Neteisingas ${r[a.format]??i.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${j(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let a=n[i.origin]??i.origin;return`${Vm(a??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function eT(){return{localeError:KO()}}var WO=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(i){return t[i]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},n={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${i.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${a}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${q(i.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${a}${i.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0438\u043C\u0430 ${a}${i.minimum.toString()} ${o.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${a.pattern}`:`Invalid ${r[a.format]??i.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${j(i.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${i.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${i.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function tT(){return{localeError:WO()}}var LO=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(i){return t[i]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"nombor"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Input tidak sah: dijangka instanceof ${i.expected}, diterima ${s}`:`Input tidak sah: dijangka ${a}, diterima ${s}`}case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${q(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Terlalu besar: dijangka ${i.origin??"nilai"} ${o.verb} ${a}${i.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Terlalu kecil: dijangka ${i.origin} ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`String tidak sah: mesti bermula dengan "${a.prefix}"`:a.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${a.suffix}"`:a.format==="includes"?`String tidak sah: mesti mengandungi "${a.includes}"`:a.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${a.pattern}`:`${r[a.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${j(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}};function rT(){return{localeError:LO()}}var ZO=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(i){return t[i]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},n={nan:"NaN",number:"getal"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ongeldige invoer: verwacht instanceof ${i.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${a}, ontving ${s}`}case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${q(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin),s=i.origin==="date"?"laat":i.origin==="string"?"lang":"groot";return o?`Te ${s}: verwacht dat ${i.origin??"waarde"} ${a}${i.maximum.toString()} ${o.unit??"elementen"} ${o.verb}`:`Te ${s}: verwacht dat ${i.origin??"waarde"} ${a}${i.maximum.toString()} is`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin),s=i.origin==="date"?"vroeg":i.origin==="string"?"kort":"klein";return o?`Te ${s}: verwacht dat ${i.origin} ${a}${i.minimum.toString()} ${o.unit} ${o.verb}`:`Te ${s}: verwacht dat ${i.origin} ${a}${i.minimum.toString()} is`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ongeldige tekst: moet met "${a.prefix}" beginnen`:a.format==="ends_with"?`Ongeldige tekst: moet op "${a.suffix}" eindigen`:a.format==="includes"?`Ongeldige tekst: moet "${a.includes}" bevatten`:a.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${a.pattern}`:`Ongeldig: ${r[a.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${j(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}};function iT(){return{localeError:ZO()}}var GO=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(i){return t[i]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"tall",array:"liste"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ugyldig input: forventet instanceof ${i.expected}, fikk ${s}`:`Ugyldig input: forventet ${a}, fikk ${s}`}case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${q(i.values[0])}`:`Ugyldig valg: forventet en av ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${a}${i.maximum.toString()} ${o.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`For lite(n): forventet ${i.origin} til \xE5 ha ${a}${i.minimum.toString()} ${o.unit}`:`For lite(n): forventet ${i.origin} til \xE5 ha ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${a.pattern}`:`Ugyldig ${r[a.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${j(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}};function nT(){return{localeError:GO()}}var HO=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(i){return t[i]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},n={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`F\xE2sit giren: umulan instanceof ${i.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${a}, al\u0131nan ${s}`}case"invalid_value":return i.values.length===1?`F\xE2sit giren: umulan ${q(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${a}${i.maximum.toString()} ${o.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${a}${i.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${a}${i.minimum.toString()} ${o.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${a}${i.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let a=i;return a.format==="starts_with"?`F\xE2sit metin: "${a.prefix}" ile ba\u015Flamal\u0131.`:a.format==="ends_with"?`F\xE2sit metin: "${a.suffix}" ile bitmeli.`:a.format==="includes"?`F\xE2sit metin: "${a.includes}" ihtiv\xE2 etmeli.`:a.format==="regex"?`F\xE2sit metin: ${a.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[a.format]??i.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${i.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${i.keys.length>1?"s":""}: ${j(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${i.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function aT(){return{localeError:HO()}}var qO=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(i){return t[i]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${i.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${a} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return i.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${q(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${j(i.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${a}${i.maximum.toString()} \u0648\u064A`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} ${o.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${a}${i.minimum.toString()} \u0648\u064A`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:a.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${a.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:a.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${a.includes}" \u0648\u0644\u0631\u064A`:a.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${a.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[a.format]??i.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${i.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${i.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${j(i.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${i.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${i.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function oT(){return{localeError:qO()}}var JO=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(i){return t[i]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},n={nan:"NaN",number:"liczba",array:"tablica"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${i.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${a}, otrzymano ${s}`}case"invalid_value":return i.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${q(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${a}${i.maximum.toString()} ${o.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${a}${i.minimum.toString()} ${o.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${a.prefix}"`:a.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${a.suffix}"`:a.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${a.includes}"`:a.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${a.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[a.format]??i.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${j(i.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${i.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${i.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function sT(){return{localeError:JO()}}var YO=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(i){return t[i]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",number:"n\xFAmero",null:"nulo"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Tipo inv\xE1lido: esperado instanceof ${i.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${a}, recebido ${s}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: esperado ${q(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${a}${i.maximum.toString()} ${o.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Muito pequeno: esperado que ${i.origin} tivesse ${a}${i.minimum.toString()} ${o.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${a.prefix}"`:a.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inv\xE1lido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${a.pattern}`:`${r[a.format]??i.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${j(i.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${i.origin}`;default:return"Campo inv\xE1lido"}}};function lT(){return{localeError:YO()}}var XO=()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(i){return t[i]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},n={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return`Intrare invalid\u0103: a\u0219teptat ${a}, primit ${s}`}case"invalid_value":return i.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${q(i.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Prea mare: a\u0219teptat ca ${i.origin??"valoarea"} ${o.verb} ${a}${i.maximum.toString()} ${o.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${i.origin??"valoarea"} s\u0103 fie ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Prea mic: a\u0219teptat ca ${i.origin} ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`Prea mic: a\u0219teptat ca ${i.origin} s\u0103 fie ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${a.prefix}"`:a.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${a.suffix}"`:a.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${a.includes}"`:a.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${a.pattern}`:`Format invalid: ${r[a.format]??i.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${i.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${j(i.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${i.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${i.origin}`;default:return"Intrare invalid\u0103"}}};function cT(){return{localeError:XO()}}function uT(t,e,r,n){let i=Math.abs(t),a=i%10,o=i%100;return o>=11&&o<=19?n:a===1?e:a>=2&&a<=4?r:n}var QO=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${a}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${q(i.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);if(o){let s=Number(i.maximum),c=uT(s,o.unit.one,o.unit.few,o.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${a}${i.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);if(o){let s=Number(i.minimum),c=uT(s,o.unit.one,o.unit.few,o.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${a}${i.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${i.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0438":""}: ${j(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function dT(){return{localeError:QO()}}var e4=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(i){return t[i]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},n={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${i.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${a}, prejeto ${s}`}case"invalid_value":return i.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${q(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} imelo ${a}${i.maximum.toString()} ${o.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Premajhno: pri\u010Dakovano, da bo ${i.origin} imelo ${a}${i.minimum.toString()} ${o.unit}`:`Premajhno: pri\u010Dakovano, da bo ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${a.prefix}"`:a.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${a.suffix}"`:a.format==="includes"?`Neveljaven niz: mora vsebovati "${a.includes}"`:a.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${a.pattern}`:`Neveljaven ${r[a.format]??i.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${j(i.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}};function pT(){return{localeError:e4()}}var t4=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(i){return t[i]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},n={nan:"NaN",number:"antal",array:"lista"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${i.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${a}, fick ${s}`}case"invalid_value":return i.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${q(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`F\xF6r stor(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${a}${i.maximum.toString()} ${o.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${i.origin??"v\xE4rdet"} att ha ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${a}${i.minimum.toString()} ${o.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${a.prefix}"`:a.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${a.suffix}"`:a.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${a.includes}"`:a.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${a.pattern}"`:`Ogiltig(t) ${r[a.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${j(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${i.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function fT(){return{localeError:t4()}}var r4=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(i){return t[i]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${i.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return i.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${q(i.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${j(i.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${a}${i.maximum.toString()} ${o.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${a}${i.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${a}${i.minimum.toString()} ${o.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${a}${i.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${a.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:a.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${a.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${i.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${i.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${j(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function hT(){return{localeError:r4()}}var i4=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(i){return t[i]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},n={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${i.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${a} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return i.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${q(i.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",o=e(i.origin);return o?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.maximum.toString()} ${o.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",o=e(i.origin);return o?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.minimum.toString()} ${o.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${a} ${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${a.prefix}"`:a.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${a.suffix}"`:a.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${a.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:a.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${a.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[a.format]??i.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${i.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${j(i.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function mT(){return{localeError:i4()}}var n4=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(i){return t[i]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${i.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${a}, al\u0131nan ${s}`}case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${q(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${a}${i.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${a}${i.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Ge\xE7ersiz metin: "${a.prefix}" ile ba\u015Flamal\u0131`:a.format==="ends_with"?`Ge\xE7ersiz metin: "${a.suffix}" ile bitmeli`:a.format==="includes"?`Ge\xE7ersiz metin: "${a.includes}" i\xE7ermeli`:a.format==="regex"?`Ge\xE7ersiz metin: ${a.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[a.format]??i.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${i.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${i.keys.length>1?"lar":""}: ${j(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${i.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function gT(){return{localeError:n4()}}var a4=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(i){return t[i]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${i.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${a}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${q(i.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${o.verb} ${a}${i.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} \u0431\u0443\u0434\u0435 ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${a.prefix}"`:a.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${a.suffix}"`:a.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${a.includes}"`:a.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${a.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0456":""}: ${j(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${i.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function y0(){return{localeError:a4()}}function vT(){return y0()}var o4=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(i){return t[i]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},n={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${i.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${a} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return i.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${q(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${j(i.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${a}${i.maximum.toString()} ${o.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${a}${i.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u06D2 ${a}${i.minimum.toString()} ${o.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u0627 ${a}${i.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${a.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:a.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${a.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${i.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${i.keys.length>1?"\u0632":""}: ${j(i.keys,"\u060C ")}`;case"invalid_key":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function xT(){return{localeError:o4()}}var s4=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(i){return t[i]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},n={nan:"NaN",number:"raqam",array:"massiv"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${i.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${a}, qabul qilingan ${s}`}case"invalid_value":return i.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${q(i.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Juda katta: kutilgan ${i.origin??"qiymat"} ${a}${i.maximum.toString()} ${o.unit} ${o.verb}`:`Juda katta: kutilgan ${i.origin??"qiymat"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Juda kichik: kutilgan ${i.origin} ${a}${i.minimum.toString()} ${o.unit} ${o.verb}`:`Juda kichik: kutilgan ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${a.prefix}" bilan boshlanishi kerak`:a.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${a.suffix}" bilan tugashi kerak`:a.format==="includes"?`Noto\u2018g\u2018ri satr: "${a.includes}" ni o\u2018z ichiga olishi kerak`:a.format==="regex"?`Noto\u2018g\u2018ri satr: ${a.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[a.format]??i.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${i.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${i.keys.length>1?"lar":""}: ${j(i.keys,", ")}`;case"invalid_key":return`${i.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${i.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function yT(){return{localeError:s4()}}var l4=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(i){return t[i]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},n={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${i.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${a}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return i.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${q(i.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${o.verb} ${a}${i.maximum.toString()} ${o.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${o.verb} ${a}${i.minimum.toString()} ${o.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${a.prefix}"`:a.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${a.suffix}"`:a.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${a.includes}"`:a.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${a.pattern}`:`${r[a.format]??i.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${i.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${j(i.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function wT(){return{localeError:l4()}}var c4=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(i){return t[i]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},n={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${i.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${a}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return i.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${q(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${a}${i.maximum.toString()} ${o.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${a}${i.minimum.toString()} ${o.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.prefix}" \u5F00\u5934`:a.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${a.suffix}" \u7ED3\u5C3E`:a.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${a.includes}"`:a.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${a.pattern}`:`\u65E0\u6548${r[a.format]??i.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${i.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${j(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${i.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function bT(){return{localeError:c4()}}var u4=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(i){return t[i]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${i.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${a}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return i.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${q(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${a}${i.maximum.toString()} ${o.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${a}${i.maximum.toString()}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${a}${i.minimum.toString()} ${o.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${a}${i.minimum.toString()}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.prefix}" \u958B\u982D`:a.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${a.suffix}" \u7D50\u5C3E`:a.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${a.includes}"`:a.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${a.pattern}`:`\u7121\u6548\u7684 ${r[a.format]??i.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${i.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${i.keys.length>1?"\u5011":""}\uFF1A${j(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function _T(){return{localeError:u4()}}var d4=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(i){return t[i]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},n={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return i=>{switch(i.code){case"invalid_type":{let a=n[i.expected]??i.expected,o=J(i.input),s=n[o]??o;return/^[A-Z]/.test(i.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${i.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${a}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return i.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${q(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${j(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);return o?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin??"iye"} ${o.verb} ${a}${i.maximum} ${o.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${a}${i.maximum}`}case"too_small":{let a=i.inclusive?">=":">",o=e(i.origin);return o?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin} ${o.verb} ${a}${i.minimum} ${o.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${a}${i.minimum}`}case"invalid_format":{let a=i;return a.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${a.prefix}"`:a.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${a.suffix}"`:a.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${a.includes}"`:a.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${a.pattern}`:`A\u1E63\xEC\u1E63e: ${r[a.format]??i.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${i.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${j(i.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function FT(){return{localeError:d4()}}var AT,SE=Symbol("ZodOutput"),PE=Symbol("ZodInput"),w0=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function b0(){return new w0}(AT=globalThis).__zod_globalRegistry??(AT.__zod_globalRegistry=b0());var Gr=globalThis.__zod_globalRegistry;function ME(t,e){return new t({type:"string",...re(e)})}function NE(t,e){return new t({type:"string",coerce:!0,...re(e)})}function _0(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...re(e)})}function jm(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...re(e)})}function F0(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...re(e)})}function A0(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...re(e)})}function E0(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...re(e)})}function S0(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...re(e)})}function Km(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...re(e)})}function P0(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...re(e)})}function M0(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...re(e)})}function N0(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...re(e)})}function $0(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...re(e)})}function k0(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...re(e)})}function I0(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...re(e)})}function B0(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...re(e)})}function T0(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...re(e)})}function D0(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...re(e)})}function $E(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...re(e)})}function R0(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...re(e)})}function C0(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...re(e)})}function z0(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...re(e)})}function O0(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...re(e)})}function V0(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...re(e)})}function U0(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...re(e)})}var kE={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function IE(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...re(e)})}function BE(t,e){return new t({type:"string",format:"date",check:"string_format",...re(e)})}function TE(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...re(e)})}function DE(t,e){return new t({type:"string",format:"duration",check:"string_format",...re(e)})}function RE(t,e){return new t({type:"number",checks:[],...re(e)})}function CE(t,e){return new t({type:"number",coerce:!0,checks:[],...re(e)})}function zE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...re(e)})}function OE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...re(e)})}function VE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...re(e)})}function UE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...re(e)})}function jE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...re(e)})}function KE(t,e){return new t({type:"boolean",...re(e)})}function WE(t,e){return new t({type:"boolean",coerce:!0,...re(e)})}function LE(t,e){return new t({type:"bigint",...re(e)})}function ZE(t,e){return new t({type:"bigint",coerce:!0,...re(e)})}function GE(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...re(e)})}function HE(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...re(e)})}function qE(t,e){return new t({type:"symbol",...re(e)})}function JE(t,e){return new t({type:"undefined",...re(e)})}function YE(t,e){return new t({type:"null",...re(e)})}function XE(t){return new t({type:"any"})}function QE(t){return new t({type:"unknown"})}function eS(t,e){return new t({type:"never",...re(e)})}function tS(t,e){return new t({type:"void",...re(e)})}function rS(t,e){return new t({type:"date",...re(e)})}function iS(t,e){return new t({type:"date",coerce:!0,...re(e)})}function nS(t,e){return new t({type:"nan",...re(e)})}function so(t,e){return new o0({check:"less_than",...re(e),value:t,inclusive:!1})}function sn(t,e){return new o0({check:"less_than",...re(e),value:t,inclusive:!0})}function lo(t,e){return new s0({check:"greater_than",...re(e),value:t,inclusive:!1})}function yi(t,e){return new s0({check:"greater_than",...re(e),value:t,inclusive:!0})}function j0(t){return lo(0,t)}function K0(t){return so(0,t)}function W0(t){return sn(0,t)}function L0(t){return yi(0,t)}function Hs(t,e){return new YF({check:"multiple_of",...re(e),value:t})}function qs(t,e){return new eA({check:"max_size",...re(e),maximum:t})}function co(t,e){return new tA({check:"min_size",...re(e),minimum:t})}function Dc(t,e){return new rA({check:"size_equals",...re(e),size:t})}function Rc(t,e){return new iA({check:"max_length",...re(e),maximum:t})}function Wo(t,e){return new nA({check:"min_length",...re(e),minimum:t})}function Cc(t,e){return new aA({check:"length_equals",...re(e),length:t})}function dp(t,e){return new oA({check:"string_format",format:"regex",...re(e),pattern:t})}function pp(t){return new sA({check:"string_format",format:"lowercase",...re(t)})}function fp(t){return new lA({check:"string_format",format:"uppercase",...re(t)})}function hp(t,e){return new cA({check:"string_format",format:"includes",...re(e),includes:t})}function mp(t,e){return new uA({check:"string_format",format:"starts_with",...re(e),prefix:t})}function gp(t,e){return new dA({check:"string_format",format:"ends_with",...re(e),suffix:t})}function Z0(t,e,r){return new pA({check:"property",property:t,schema:e,...re(r)})}function vp(t,e){return new fA({check:"mime_type",mime:t,...re(e)})}function ba(t){return new hA({check:"overwrite",tx:t})}function xp(t){return ba(e=>e.normalize(t))}function yp(){return ba(t=>t.trim())}function wp(){return ba(t=>t.toLowerCase())}function bp(){return ba(t=>t.toUpperCase())}function _p(){return ba(t=>uF(t))}function aS(t,e,r){return new t({type:"array",element:e,...re(r)})}function f4(t,e,r){return new t({type:"union",options:e,...re(r)})}function h4(t,e,r){return new t({type:"union",options:e,inclusive:!1,...re(r)})}function m4(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...re(n)})}function g4(t,e,r){return new t({type:"intersection",left:e,right:r})}function v4(t,e,r,n){let i=r instanceof Ce,a=i?n:r,o=i?r:null;return new t({type:"tuple",items:e,rest:o,...re(a)})}function x4(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...re(n)})}function y4(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...re(n)})}function w4(t,e,r){return new t({type:"set",valueType:e,...re(r)})}function b4(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new t({type:"enum",entries:n,...re(r)})}function _4(t,e,r){return new t({type:"enum",entries:e,...re(r)})}function F4(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...re(r)})}function oS(t,e){return new t({type:"file",...re(e)})}function A4(t,e){return new t({type:"transform",transform:e})}function E4(t,e){return new t({type:"optional",innerType:e})}function S4(t,e){return new t({type:"nullable",innerType:e})}function P4(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():pF(r)}})}function M4(t,e,r){return new t({type:"nonoptional",innerType:e,...re(r)})}function N4(t,e){return new t({type:"success",innerType:e})}function $4(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function k4(t,e,r){return new t({type:"pipe",in:e,out:r})}function I4(t,e){return new t({type:"readonly",innerType:e})}function B4(t,e,r){return new t({type:"template_literal",parts:e,...re(r)})}function T4(t,e){return new t({type:"lazy",getter:e})}function D4(t,e){return new t({type:"promise",innerType:e})}function sS(t,e,r){let n=re(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function lS(t,e,r){return new t({type:"custom",check:"custom",fn:e,...re(r)})}function cS(t,e){let r=ET(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(np(i,n.value,r._zod.def));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=r),a.continue??(a.continue=!r._zod.def.abort),n.issues.push(np(a))}},t(n.value,n)),e);return r}function ET(t,e){let r=new _t({check:"custom",...re(e)});return r._zod.check=t,r}function uS(t){let e=new _t({check:"describe"});return e._zod.onattach=[r=>{let n=Gr.get(r)??{};Gr.add(r,{...n,description:t})}],e._zod.check=()=>{},e}function dS(t){let e=new _t({check:"meta"});return e._zod.onattach=[r=>{let n=Gr.get(r)??{};Gr.add(r,{...n,...t})}],e._zod.check=()=>{},e}function pS(t,e){let r=re(e),n=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(w=>typeof w=="string"?w.toLowerCase():w),i=i.map(w=>typeof w=="string"?w.toLowerCase():w));let a=new Set(n),o=new Set(i),s=t.Codec??Om,c=t.Boolean??Cm,u=t.String??Tc,f=new u({type:"string",error:r.error}),v=new c({type:"boolean",error:r.error}),m=new s({type:"pipe",in:f,out:v,transform:((w,y)=>{let P=w;return r.case!=="sensitive"&&(P=P.toLowerCase()),a.has(P)?!0:o.has(P)?!1:(y.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...o],input:y.value,inst:m,continue:!1}),{})}),reverseTransform:((w,y)=>w===!0?n[0]||"true":i[0]||"false"),error:r.error});return m}function Fp(t,e,r,n={}){let i=re(n),a={...re(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:s=>r.test(s),...i};return r instanceof RegExp&&(a.pattern=r),new t(a)}function Js(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Gr,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function ht(t,e,r={path:[],schemaPath:[]}){var n;let i=t._zod.def,a=e.seen.get(t);if(a)return a.count++,r.schemaPath.includes(t)&&(a.cycle=r.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,o);let s=t._zod.toJSONSchema?.();if(s)o.schema=s;else{let f={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,o.schema,f);else{let m=o.schema,w=e.processors[i.type];if(!w)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);w(t,e,m,f)}let v=t._zod.parent;v&&(o.ref||(o.ref=v),ht(v,e,f),e.seen.get(v).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(o.schema,c),e.io==="input"&&wi(t)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&"_prefault"in o.schema&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(t).schema}function Ys(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let o of t.seen.entries()){let s=t.metadataRegistry.get(o[0])?.id;if(s){let c=n.get(s);if(c&&c!==o[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(s,o[0])}}let i=o=>{let s=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let v=t.external.registry.get(o[0])?.id,m=t.external.uri??(y=>y);if(v)return{ref:m(v)};let w=o[1].defId??o[1].schema.id??`schema${t.counter++}`;return o[1].defId=w,{defId:w,ref:`${m("__shared")}#/${s}/${w}`}}if(o[1]===r)return{ref:"#"};let u=`#/${s}/`,f=o[1].schema.id??`__schema${t.counter++}`;return{defId:f,ref:u+f}},a=o=>{if(o[1].schema.$ref)return;let s=o[1],{ref:c,defId:u}=i(o);s.def={...s.schema},u&&(s.defId=u);let f=s.schema;for(let v in f)delete f[v];f.$ref=c};if(t.cycles==="throw")for(let o of t.seen.entries()){let s=o[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
114
114
 
115
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of t.seen.entries()){let s=o[1];if(e===o[0]){a(o);continue}if(t.external){let u=t.external.registry.get(o[0])?.id;if(e!==o[0]&&u){a(o);continue}}if(t.metadataRegistry.get(o[0])?.id){a(o);continue}if(s.cycle){a(o);continue}if(s.count>1&&t.reused==="ref"){a(o);continue}}}function Xs(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=s=>{let c=t.seen.get(s);if(c.ref===null)return;let u=c.def??c.schema,f={...u},v=c.ref;if(c.ref=null,v){n(v);let w=t.seen.get(v),y=w.schema;if(y.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(y)):Object.assign(u,y),Object.assign(u,f),s._zod.parent===v)for(let V in u)V==="$ref"||V==="allOf"||V in f||delete u[V];if(y.$ref&&w.def)for(let V in u)V==="$ref"||V==="allOf"||V in w.def&&JSON.stringify(u[V])===JSON.stringify(w.def[V])&&delete u[V]}let m=s._zod.parent;if(m&&m!==v){n(m);let w=t.seen.get(m);if(w?.schema.$ref&&(u.$ref=w.schema.$ref,w.def))for(let y in u)y==="$ref"||y==="allOf"||y in w.def&&JSON.stringify(u[y])===JSON.stringify(w.def[y])&&delete u[y]}t.override({zodSchema:s,jsonSchema:u,path:c.path??[]})};for(let s of[...t.seen.entries()].reverse())n(s[0]);let i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let s=t.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(s)}Object.assign(i,r.def??r.schema);let a=t.metadataRegistry.get(e)?.id;a!==void 0&&i.id===a&&delete i.id;let o=t.external?.defs??{};for(let s of t.seen.entries()){let c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,o[c.defId]=c.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let s=JSON.parse(JSON.stringify(i));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:Ap(e,"input",t.processors),output:Ap(e,"output",t.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function wi(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return wi(n.element,r);if(n.type==="set")return wi(n.valueType,r);if(n.type==="lazy")return wi(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return wi(n.innerType,r);if(n.type==="intersection")return wi(n.left,r)||wi(n.right,r);if(n.type==="record"||n.type==="map")return wi(n.keyType,r)||wi(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:wi(n.in,r)||wi(n.out,r);if(n.type==="object"){for(let i in n.shape)if(wi(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(wi(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(wi(i,r))return!0;return!!(n.rest&&wi(n.rest,r))}return!1}var fS=(t,e={})=>r=>{let n=Js({...r,processors:e});return ht(t,n),Ys(n,t),Xs(n,t)},Ap=(t,e,r={})=>n=>{let{libraryOptions:i,target:a}=n??{},o=Js({...i??{},target:a,io:e,processors:r});return ht(t,o),Ys(o,t),Xs(o,t)};var R4={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},hS=(t,e,r,n)=>{let i=r;i.type="string";let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:u}=t._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof o=="number"&&(i.maxLength=o),s&&(i.format=R4[s]??s,i.format===""&&delete i.format,s==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){let f=[...c];f.length===1?i.pattern=f[0].source:f.length>1&&(i.allOf=[...f.map(v=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},mS=(t,e,r,n)=>{let i=r,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:f}=t._zod.bag;typeof s=="string"&&s.includes("int")?i.type="integer":i.type="number";let v=typeof f=="number"&&f>=(a??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(o??Number.POSITIVE_INFINITY),w=e.target==="draft-04"||e.target==="openapi-3.0";v?w?(i.minimum=f,i.exclusiveMinimum=!0):i.exclusiveMinimum=f:typeof a=="number"&&(i.minimum=a),m?w?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u:typeof o=="number"&&(i.maximum=o),typeof c=="number"&&(i.multipleOf=c)},gS=(t,e,r,n)=>{r.type="boolean"},vS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},xS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},yS=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},wS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},bS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},_S=(t,e,r,n)=>{r.not={}},FS=(t,e,r,n)=>{},AS=(t,e,r,n)=>{},ES=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},SS=(t,e,r,n)=>{let i=t._zod.def,a=Sm(i.entries);a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),r.enum=a},PS=(t,e,r,n)=>{let i=t._zod.def,a=[];for(let o of i.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let o=a[0];r.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[o]:r.const=o}else a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),a.every(o=>typeof o=="boolean")&&(r.type="boolean"),a.every(o=>o===null)&&(r.type="null"),r.enum=a},MS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},NS=(t,e,r,n)=>{let i=r,a=t._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=a.source},$S=(t,e,r,n)=>{let i=r,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:s,mime:c}=t._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(i,a)},kS=(t,e,r,n)=>{r.type="boolean"},IS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},BS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},TS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},DS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},RS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},CS=(t,e,r,n)=>{let i=r,a=t._zod.def,{minimum:o,maximum:s}=t._zod.bag;typeof o=="number"&&(i.minItems=o),typeof s=="number"&&(i.maxItems=s),i.type="array",i.items=ht(a.element,e,{...n,path:[...n.path,"items"]})},zS=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="object",i.properties={};let o=a.shape;for(let u in o)i.properties[u]=ht(o[u],e,{...n,path:[...n.path,"properties",u]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(u=>{let f=a.shape[u]._zod;return e.io==="input"?f.optin===void 0:f.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=ht(a.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},H0=(t,e,r,n)=>{let i=t._zod.def,a=i.inclusive===!1,o=i.options.map((s,c)=>ht(s,e,{...n,path:[...n.path,a?"oneOf":"anyOf",c]}));a?r.oneOf=o:r.anyOf=o},OS=(t,e,r,n)=>{let i=t._zod.def,a=ht(i.left,e,{...n,path:[...n.path,"allOf",0]}),o=ht(i.right,e,{...n,path:[...n.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];r.allOf=c},VS=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="array";let o=e.target==="draft-2020-12"?"prefixItems":"items",s=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=a.items.map((m,w)=>ht(m,e,{...n,path:[...n.path,o,w]})),u=a.rest?ht(a.rest,e,{...n,path:[...n.path,s,...e.target==="openapi-3.0"?[a.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=c,u&&(i.items=u)):e.target==="openapi-3.0"?(i.items={anyOf:c},u&&i.items.anyOf.push(u),i.minItems=c.length,u||(i.maxItems=c.length)):(i.items=c,u&&(i.additionalItems=u));let{minimum:f,maximum:v}=t._zod.bag;typeof f=="number"&&(i.minItems=f),typeof v=="number"&&(i.maxItems=v)},US=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="object";let o=a.keyType,c=o._zod.bag?.patterns;if(a.mode==="loose"&&c&&c.size>0){let f=ht(a.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let v of c)i.patternProperties[v.source]=f}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=ht(a.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=ht(a.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let u=o._zod.values;if(u){let f=[...u].filter(v=>typeof v=="string"||typeof v=="number");f.length>0&&(i.required=f)}},jS=(t,e,r,n)=>{let i=t._zod.def,a=ht(i.innerType,e,n),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=i.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},KS=(t,e,r,n)=>{let i=t._zod.def;ht(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},WS=(t,e,r,n)=>{let i=t._zod.def;ht(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},LS=(t,e,r,n)=>{let i=t._zod.def;ht(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},ZS=(t,e,r,n)=>{let i=t._zod.def;ht(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=o},GS=(t,e,r,n)=>{let i=t._zod.def,a=i.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?a?i.out:i.in:i.out;ht(o,e,n);let s=e.seen.get(t);s.ref=o},HS=(t,e,r,n)=>{let i=t._zod.def;ht(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.readOnly=!0},qS=(t,e,r,n)=>{let i=t._zod.def;ht(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},q0=(t,e,r,n)=>{let i=t._zod.def;ht(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},JS=(t,e,r,n)=>{let i=t._zod.innerType;ht(i,e,n);let a=e.seen.get(t);a.ref=i},G0={string:hS,number:mS,boolean:gS,bigint:vS,symbol:xS,null:yS,undefined:wS,void:bS,never:_S,any:FS,unknown:AS,date:ES,enum:SS,literal:PS,nan:MS,template_literal:NS,file:$S,success:kS,custom:IS,function:BS,transform:TS,map:DS,set:RS,array:CS,object:zS,union:H0,intersection:OS,tuple:VS,record:US,nullable:jS,nonoptional:KS,default:WS,prefault:LS,catch:ZS,pipe:GS,readonly:HS,promise:qS,optional:q0,lazy:JS};function J0(t,e){if("_idmap"in t){let n=t,i=Js({...e,processors:G0}),a={};for(let c of n._idmap.entries()){let[u,f]=c;ht(f,i)}let o={},s={registry:n,uri:e?.uri,defs:a};i.external=s;for(let c of n._idmap.entries()){let[u,f]=c;Ys(i,f),o[u]=Xs(i,f)}if(Object.keys(a).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[c]:a}}return{schemas:o}}let r=Js({...e,processors:G0});return ht(t,r),Ys(r,t),Xs(r,t)}var Y0=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Js({processors:G0,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return ht(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Ys(this.ctx,e);let n=Xs(this.ctx,e),{"~standard":i,...a}=n;return a}};var ST={};var Wm={};_a(Wm,{ZodAny:()=>wP,ZodArray:()=>AP,ZodBase64:()=>xb,ZodBase64URL:()=>yb,ZodBigInt:()=>Ip,ZodBigIntFormat:()=>_b,ZodBoolean:()=>kp,ZodCIDRv4:()=>gb,ZodCIDRv6:()=>vb,ZodCUID:()=>cb,ZodCUID2:()=>ub,ZodCatch:()=>ZP,ZodCodec:()=>rg,ZodCustom:()=>ig,ZodCustomStringFormat:()=>Np,ZodDate:()=>Ym,ZodDefault:()=>VP,ZodDiscriminatedUnion:()=>SP,ZodE164:()=>wb,ZodEmail:()=>ob,ZodEmoji:()=>sb,ZodEnum:()=>Pp,ZodExactOptional:()=>CP,ZodFile:()=>DP,ZodFunction:()=>rM,ZodGUID:()=>Zm,ZodIPv4:()=>hb,ZodIPv6:()=>mb,ZodIntersection:()=>PP,ZodJWT:()=>bb,ZodKSUID:()=>fb,ZodLazy:()=>QP,ZodLiteral:()=>TP,ZodMAC:()=>fP,ZodMap:()=>IP,ZodNaN:()=>HP,ZodNanoID:()=>lb,ZodNever:()=>_P,ZodNonOptional:()=>Mb,ZodNull:()=>xP,ZodNullable:()=>OP,ZodNumber:()=>$p,ZodNumberFormat:()=>Oc,ZodObject:()=>Qm,ZodOptional:()=>Pb,ZodPipe:()=>tg,ZodPrefault:()=>jP,ZodPreprocess:()=>qP,ZodPromise:()=>tM,ZodReadonly:()=>JP,ZodRecord:()=>Sp,ZodSet:()=>BP,ZodString:()=>Mp,ZodStringFormat:()=>yt,ZodSuccess:()=>LP,ZodSymbol:()=>gP,ZodTemplateLiteral:()=>XP,ZodTransform:()=>RP,ZodTuple:()=>NP,ZodType:()=>Le,ZodULID:()=>db,ZodURL:()=>Jm,ZodUUID:()=>uo,ZodUndefined:()=>vP,ZodUnion:()=>eg,ZodUnknown:()=>bP,ZodVoid:()=>FP,ZodXID:()=>pb,ZodXor:()=>EP,_ZodString:()=>ab,_default:()=>UP,_function:()=>D2,any:()=>p2,array:()=>Xm,base64:()=>qT,base64url:()=>JT,bigint:()=>s2,boolean:()=>mP,catch:()=>GP,check:()=>R2,cidrv4:()=>GT,cidrv6:()=>HT,codec:()=>k2,cuid:()=>OT,cuid2:()=>VT,custom:()=>C2,date:()=>h2,describe:()=>z2,discriminatedUnion:()=>w2,e164:()=>YT,email:()=>NT,emoji:()=>CT,enum:()=>Eb,exactOptional:()=>zP,file:()=>P2,float32:()=>i2,float64:()=>n2,function:()=>D2,guid:()=>$T,hash:()=>r2,hex:()=>t2,hostname:()=>e2,httpUrl:()=>RT,instanceof:()=>V2,int:()=>ib,int32:()=>a2,int64:()=>l2,intersection:()=>MP,invertCodec:()=>I2,ipv4:()=>WT,ipv6:()=>ZT,json:()=>j2,jwt:()=>XT,keyof:()=>m2,ksuid:()=>KT,lazy:()=>eM,literal:()=>S2,looseObject:()=>x2,looseRecord:()=>_2,mac:()=>LT,map:()=>F2,meta:()=>O2,nan:()=>$2,nanoid:()=>zT,nativeEnum:()=>E2,never:()=>Fb,nonoptional:()=>WP,null:()=>yP,nullable:()=>Hm,nullish:()=>M2,number:()=>hP,object:()=>g2,optional:()=>Gm,partialRecord:()=>b2,pipe:()=>nb,prefault:()=>KP,preprocess:()=>K2,promise:()=>T2,readonly:()=>YP,record:()=>kP,refine:()=>iM,set:()=>A2,strictObject:()=>v2,string:()=>Lm,stringFormat:()=>QT,stringbool:()=>U2,success:()=>N2,superRefine:()=>nM,symbol:()=>u2,templateLiteral:()=>B2,transform:()=>Sb,tuple:()=>$P,uint32:()=>o2,uint64:()=>c2,ulid:()=>UT,undefined:()=>d2,union:()=>Ab,unknown:()=>zc,url:()=>DT,uuid:()=>kT,uuidv4:()=>IT,uuidv6:()=>BT,uuidv7:()=>TT,void:()=>f2,xid:()=>jT,xor:()=>y2});var X0={};_a(X0,{endsWith:()=>gp,gt:()=>lo,gte:()=>yi,includes:()=>hp,length:()=>Cc,lowercase:()=>pp,lt:()=>so,lte:()=>sn,maxLength:()=>Rc,maxSize:()=>qs,mime:()=>vp,minLength:()=>Wo,minSize:()=>co,multipleOf:()=>Hs,negative:()=>K0,nonnegative:()=>L0,nonpositive:()=>W0,normalize:()=>xp,overwrite:()=>ba,positive:()=>j0,property:()=>Z0,regex:()=>dp,size:()=>Dc,slugify:()=>_p,startsWith:()=>mp,toLowerCase:()=>wp,toUpperCase:()=>bp,trim:()=>yp,uppercase:()=>fp});var Ep={};_a(Ep,{ZodISODate:()=>eb,ZodISODateTime:()=>Q0,ZodISODuration:()=>rb,ZodISOTime:()=>tb,date:()=>XS,datetime:()=>YS,duration:()=>eP,time:()=>QS});var Q0=R("ZodISODateTime",(t,e)=>{MA.init(t,e),yt.init(t,e)});function YS(t){return IE(Q0,t)}var eb=R("ZodISODate",(t,e)=>{NA.init(t,e),yt.init(t,e)});function XS(t){return BE(eb,t)}var tb=R("ZodISOTime",(t,e)=>{$A.init(t,e),yt.init(t,e)});function QS(t){return TE(tb,t)}var rb=R("ZodISODuration",(t,e)=>{kA.init(t,e),yt.init(t,e)});function eP(t){return DE(rb,t)}var PT=(t,e)=>{km.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>Bm(t,r)},flatten:{value:r=>Im(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,rp,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,rp,2)}},isEmpty:{get(){return t.issues.length===0}}})},z4=R("ZodError",PT),Oi=R("ZodError",PT,{Parent:Error});var tP=ap(Oi),rP=op(Oi),iP=sp(Oi),nP=lp(Oi),aP=Jw(Oi),oP=Yw(Oi),sP=Xw(Oi),lP=Qw(Oi),cP=e0(Oi),uP=t0(Oi),dP=r0(Oi),pP=i0(Oi);var MT=new WeakMap;function qm(t,e,r){let n=Object.getPrototypeOf(t),i=MT.get(n);if(i||(i=new Set,MT.set(n,i)),!i.has(e)){i.add(e);for(let a in r){let o=r[a];Object.defineProperty(n,a,{configurable:!0,enumerable:!1,get(){let s=o.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}var Le=R("ZodType",(t,e)=>(Ce.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Ap(t,"input"),output:Ap(t,"output")}}),t.toJSONSchema=fS(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>tP(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>iP(t,r,n),t.parseAsync=async(r,n)=>rP(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>nP(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>aP(t,r,n),t.decode=(r,n)=>oP(t,r,n),t.encodeAsync=async(r,n)=>sP(t,r,n),t.decodeAsync=async(r,n)=>lP(t,r,n),t.safeEncode=(r,n)=>cP(t,r,n),t.safeDecode=(r,n)=>uP(t,r,n),t.safeEncodeAsync=async(r,n)=>dP(t,r,n),t.safeDecodeAsync=async(r,n)=>pP(t,r,n),qm(t,"ZodType",{check(...r){let n=this.def;return this.clone(X.mergeDefs(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return vi(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(iM(r,n))},superRefine(r,n){return this.check(nM(r,n))},overwrite(r){return this.check(ba(r))},optional(){return Gm(this)},exactOptional(){return zP(this)},nullable(){return Hm(this)},nullish(){return Gm(Hm(this))},nonoptional(r){return WP(this,r)},array(){return Xm(this)},or(r){return Ab([this,r])},and(r){return MP(this,r)},transform(r){return nb(this,Sb(r))},default(r){return UP(this,r)},prefault(r){return KP(this,r)},catch(r){return GP(this,r)},pipe(r){return nb(this,r)},readonly(){return YP(this)},describe(r){let n=this.clone();return Gr.add(n,{description:r}),n},meta(...r){if(r.length===0)return Gr.get(this);let n=this.clone();return Gr.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return Gr.get(t)?.description},configurable:!0}),t)),ab=R("_ZodString",(t,e)=>{Tc.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,a)=>hS(t,n,i,a);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,qm(t,"_ZodString",{regex(...n){return this.check(dp(...n))},includes(...n){return this.check(hp(...n))},startsWith(...n){return this.check(mp(...n))},endsWith(...n){return this.check(gp(...n))},min(...n){return this.check(Wo(...n))},max(...n){return this.check(Rc(...n))},length(...n){return this.check(Cc(...n))},nonempty(...n){return this.check(Wo(1,...n))},lowercase(n){return this.check(pp(n))},uppercase(n){return this.check(fp(n))},trim(){return this.check(yp())},normalize(...n){return this.check(xp(...n))},toLowerCase(){return this.check(wp())},toUpperCase(){return this.check(bp())},slugify(){return this.check(_p())}})}),Mp=R("ZodString",(t,e)=>{Tc.init(t,e),ab.init(t,e),t.email=r=>t.check(_0(ob,r)),t.url=r=>t.check(Km(Jm,r)),t.jwt=r=>t.check(U0(bb,r)),t.emoji=r=>t.check(P0(sb,r)),t.guid=r=>t.check(jm(Zm,r)),t.uuid=r=>t.check(F0(uo,r)),t.uuidv4=r=>t.check(A0(uo,r)),t.uuidv6=r=>t.check(E0(uo,r)),t.uuidv7=r=>t.check(S0(uo,r)),t.nanoid=r=>t.check(M0(lb,r)),t.guid=r=>t.check(jm(Zm,r)),t.cuid=r=>t.check(N0(cb,r)),t.cuid2=r=>t.check($0(ub,r)),t.ulid=r=>t.check(k0(db,r)),t.base64=r=>t.check(z0(xb,r)),t.base64url=r=>t.check(O0(yb,r)),t.xid=r=>t.check(I0(pb,r)),t.ksuid=r=>t.check(B0(fb,r)),t.ipv4=r=>t.check(T0(hb,r)),t.ipv6=r=>t.check(D0(mb,r)),t.cidrv4=r=>t.check(R0(gb,r)),t.cidrv6=r=>t.check(C0(vb,r)),t.e164=r=>t.check(V0(wb,r)),t.datetime=r=>t.check(YS(r)),t.date=r=>t.check(XS(r)),t.time=r=>t.check(QS(r)),t.duration=r=>t.check(eP(r))});function Lm(t){return ME(Mp,t)}var yt=R("ZodStringFormat",(t,e)=>{xt.init(t,e),ab.init(t,e)}),ob=R("ZodEmail",(t,e)=>{yA.init(t,e),yt.init(t,e)});function NT(t){return _0(ob,t)}var Zm=R("ZodGUID",(t,e)=>{vA.init(t,e),yt.init(t,e)});function $T(t){return jm(Zm,t)}var uo=R("ZodUUID",(t,e)=>{xA.init(t,e),yt.init(t,e)});function kT(t){return F0(uo,t)}function IT(t){return A0(uo,t)}function BT(t){return E0(uo,t)}function TT(t){return S0(uo,t)}var Jm=R("ZodURL",(t,e)=>{wA.init(t,e),yt.init(t,e)});function DT(t){return Km(Jm,t)}function RT(t){return Km(Jm,{protocol:on.httpProtocol,hostname:on.domain,...X.normalizeParams(t)})}var sb=R("ZodEmoji",(t,e)=>{bA.init(t,e),yt.init(t,e)});function CT(t){return P0(sb,t)}var lb=R("ZodNanoID",(t,e)=>{_A.init(t,e),yt.init(t,e)});function zT(t){return M0(lb,t)}var cb=R("ZodCUID",(t,e)=>{FA.init(t,e),yt.init(t,e)});function OT(t){return N0(cb,t)}var ub=R("ZodCUID2",(t,e)=>{AA.init(t,e),yt.init(t,e)});function VT(t){return $0(ub,t)}var db=R("ZodULID",(t,e)=>{EA.init(t,e),yt.init(t,e)});function UT(t){return k0(db,t)}var pb=R("ZodXID",(t,e)=>{SA.init(t,e),yt.init(t,e)});function jT(t){return I0(pb,t)}var fb=R("ZodKSUID",(t,e)=>{PA.init(t,e),yt.init(t,e)});function KT(t){return B0(fb,t)}var hb=R("ZodIPv4",(t,e)=>{IA.init(t,e),yt.init(t,e)});function WT(t){return T0(hb,t)}var fP=R("ZodMAC",(t,e)=>{TA.init(t,e),yt.init(t,e)});function LT(t){return $E(fP,t)}var mb=R("ZodIPv6",(t,e)=>{BA.init(t,e),yt.init(t,e)});function ZT(t){return D0(mb,t)}var gb=R("ZodCIDRv4",(t,e)=>{DA.init(t,e),yt.init(t,e)});function GT(t){return R0(gb,t)}var vb=R("ZodCIDRv6",(t,e)=>{RA.init(t,e),yt.init(t,e)});function HT(t){return C0(vb,t)}var xb=R("ZodBase64",(t,e)=>{zA.init(t,e),yt.init(t,e)});function qT(t){return z0(xb,t)}var yb=R("ZodBase64URL",(t,e)=>{OA.init(t,e),yt.init(t,e)});function JT(t){return O0(yb,t)}var wb=R("ZodE164",(t,e)=>{VA.init(t,e),yt.init(t,e)});function YT(t){return V0(wb,t)}var bb=R("ZodJWT",(t,e)=>{UA.init(t,e),yt.init(t,e)});function XT(t){return U0(bb,t)}var Np=R("ZodCustomStringFormat",(t,e)=>{jA.init(t,e),yt.init(t,e)});function QT(t,e,r={}){return Fp(Np,t,e,r)}function e2(t){return Fp(Np,"hostname",on.hostname,t)}function t2(t){return Fp(Np,"hex",on.hex,t)}function r2(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=on[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return Fp(Np,n,i,e)}var $p=R("ZodNumber",(t,e)=>{p0.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,a)=>mS(t,n,i,a),qm(t,"ZodNumber",{gt(n,i){return this.check(lo(n,i))},gte(n,i){return this.check(yi(n,i))},min(n,i){return this.check(yi(n,i))},lt(n,i){return this.check(so(n,i))},lte(n,i){return this.check(sn(n,i))},max(n,i){return this.check(sn(n,i))},int(n){return this.check(ib(n))},safe(n){return this.check(ib(n))},positive(n){return this.check(lo(0,n))},nonnegative(n){return this.check(yi(0,n))},negative(n){return this.check(so(0,n))},nonpositive(n){return this.check(sn(0,n))},multipleOf(n,i){return this.check(Hs(n,i))},step(n,i){return this.check(Hs(n,i))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function hP(t){return RE($p,t)}var Oc=R("ZodNumberFormat",(t,e)=>{KA.init(t,e),$p.init(t,e)});function ib(t){return zE(Oc,t)}function i2(t){return OE(Oc,t)}function n2(t){return VE(Oc,t)}function a2(t){return UE(Oc,t)}function o2(t){return jE(Oc,t)}var kp=R("ZodBoolean",(t,e)=>{Cm.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gS(t,r,n,i)});function mP(t){return KE(kp,t)}var Ip=R("ZodBigInt",(t,e)=>{f0.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,a)=>vS(t,n,i,a),t.gte=(n,i)=>t.check(yi(n,i)),t.min=(n,i)=>t.check(yi(n,i)),t.gt=(n,i)=>t.check(lo(n,i)),t.gte=(n,i)=>t.check(yi(n,i)),t.min=(n,i)=>t.check(yi(n,i)),t.lt=(n,i)=>t.check(so(n,i)),t.lte=(n,i)=>t.check(sn(n,i)),t.max=(n,i)=>t.check(sn(n,i)),t.positive=n=>t.check(lo(BigInt(0),n)),t.negative=n=>t.check(so(BigInt(0),n)),t.nonpositive=n=>t.check(sn(BigInt(0),n)),t.nonnegative=n=>t.check(yi(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(Hs(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function s2(t){return LE(Ip,t)}var _b=R("ZodBigIntFormat",(t,e)=>{WA.init(t,e),Ip.init(t,e)});function l2(t){return GE(_b,t)}function c2(t){return HE(_b,t)}var gP=R("ZodSymbol",(t,e)=>{LA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xS(t,r,n,i)});function u2(t){return qE(gP,t)}var vP=R("ZodUndefined",(t,e)=>{ZA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>wS(t,r,n,i)});function d2(t){return JE(vP,t)}var xP=R("ZodNull",(t,e)=>{GA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yS(t,r,n,i)});function yP(t){return YE(xP,t)}var wP=R("ZodAny",(t,e)=>{HA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>FS(t,r,n,i)});function p2(){return XE(wP)}var bP=R("ZodUnknown",(t,e)=>{qA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>AS(t,r,n,i)});function zc(){return QE(bP)}var _P=R("ZodNever",(t,e)=>{JA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_S(t,r,n,i)});function Fb(t){return eS(_P,t)}var FP=R("ZodVoid",(t,e)=>{YA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bS(t,r,n,i)});function f2(t){return tS(FP,t)}var Ym=R("ZodDate",(t,e)=>{XA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,a)=>ES(t,n,i,a),t.min=(n,i)=>t.check(yi(n,i)),t.max=(n,i)=>t.check(sn(n,i));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function h2(t){return rS(Ym,t)}var AP=R("ZodArray",(t,e)=>{QA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>CS(t,r,n,i),t.element=e.element,qm(t,"ZodArray",{min(r,n){return this.check(Wo(r,n))},nonempty(r){return this.check(Wo(1,r))},max(r,n){return this.check(Rc(r,n))},length(r,n){return this.check(Cc(r,n))},unwrap(){return this.element}})});function Xm(t,e){return aS(AP,t,e)}function m2(t){let e=t._zod.def.shape;return Eb(Object.keys(e))}var Qm=R("ZodObject",(t,e)=>{eE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>zS(t,r,n,i),X.defineLazy(t,"shape",()=>e.shape),qm(t,"ZodObject",{keyof(){return Eb(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:zc()})},loose(){return this.clone({...this._zod.def,catchall:zc()})},strict(){return this.clone({...this._zod.def,catchall:Fb()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return X.extend(this,r)},safeExtend(r){return X.safeExtend(this,r)},merge(r){return X.merge(this,r)},pick(r){return X.pick(this,r)},omit(r){return X.omit(this,r)},partial(...r){return X.partial(Pb,this,r[0])},required(...r){return X.required(Mb,this,r[0])}})});function g2(t,e){let r={type:"object",shape:t??{},...X.normalizeParams(e)};return new Qm(r)}function v2(t,e){return new Qm({type:"object",shape:t,catchall:Fb(),...X.normalizeParams(e)})}function x2(t,e){return new Qm({type:"object",shape:t,catchall:zc(),...X.normalizeParams(e)})}var eg=R("ZodUnion",(t,e)=>{zm.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>H0(t,r,n,i),t.options=e.options});function Ab(t,e){return new eg({type:"union",options:t,...X.normalizeParams(e)})}var EP=R("ZodXor",(t,e)=>{eg.init(t,e),tE.init(t,e),t._zod.processJSONSchema=(r,n,i)=>H0(t,r,n,i),t.options=e.options});function y2(t,e){return new EP({type:"union",options:t,inclusive:!1,...X.normalizeParams(e)})}var SP=R("ZodDiscriminatedUnion",(t,e)=>{eg.init(t,e),rE.init(t,e)});function w2(t,e,r){return new SP({type:"union",options:e,discriminator:t,...X.normalizeParams(r)})}var PP=R("ZodIntersection",(t,e)=>{iE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>OS(t,r,n,i)});function MP(t,e){return new PP({type:"intersection",left:t,right:e})}var NP=R("ZodTuple",(t,e)=>{h0.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>VS(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});function $P(t,e,r){let n=e instanceof Ce,i=n?r:e,a=n?e:null;return new NP({type:"tuple",items:t,rest:a,...X.normalizeParams(i)})}var Sp=R("ZodRecord",(t,e)=>{nE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>US(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function kP(t,e,r){return!e||!e._zod?new Sp({type:"record",keyType:Lm(),valueType:t,...X.normalizeParams(e)}):new Sp({type:"record",keyType:t,valueType:e,...X.normalizeParams(r)})}function b2(t,e,r){let n=vi(t);return n._zod.values=void 0,new Sp({type:"record",keyType:n,valueType:e,...X.normalizeParams(r)})}function _2(t,e,r){return new Sp({type:"record",keyType:t,valueType:e,mode:"loose",...X.normalizeParams(r)})}var IP=R("ZodMap",(t,e)=>{aE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>DS(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(co(...r)),t.nonempty=r=>t.check(co(1,r)),t.max=(...r)=>t.check(qs(...r)),t.size=(...r)=>t.check(Dc(...r))});function F2(t,e,r){return new IP({type:"map",keyType:t,valueType:e,...X.normalizeParams(r)})}var BP=R("ZodSet",(t,e)=>{oE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>RS(t,r,n,i),t.min=(...r)=>t.check(co(...r)),t.nonempty=r=>t.check(co(1,r)),t.max=(...r)=>t.check(qs(...r)),t.size=(...r)=>t.check(Dc(...r))});function A2(t,e){return new BP({type:"set",valueType:t,...X.normalizeParams(e)})}var Pp=R("ZodEnum",(t,e)=>{sE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,a)=>SS(t,n,i,a),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{let a={};for(let o of n)if(r.has(o))a[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Pp({...e,checks:[],...X.normalizeParams(i),entries:a})},t.exclude=(n,i)=>{let a={...e.entries};for(let o of n)if(r.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new Pp({...e,checks:[],...X.normalizeParams(i),entries:a})}});function Eb(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Pp({type:"enum",entries:r,...X.normalizeParams(e)})}function E2(t,e){return new Pp({type:"enum",entries:t,...X.normalizeParams(e)})}var TP=R("ZodLiteral",(t,e)=>{lE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>PS(t,r,n,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function S2(t,e){return new TP({type:"literal",values:Array.isArray(t)?t:[t],...X.normalizeParams(e)})}var DP=R("ZodFile",(t,e)=>{cE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$S(t,r,n,i),t.min=(r,n)=>t.check(co(r,n)),t.max=(r,n)=>t.check(qs(r,n)),t.mime=(r,n)=>t.check(vp(Array.isArray(r)?r:[r],n))});function P2(t){return oS(DP,t)}var RP=R("ZodTransform",(t,e)=>{uE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>TS(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ks(t.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(X.issue(a,r.value,e));else{let o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),r.issues.push(X.issue(o))}};let i=e.transform(r.value,r);return i instanceof Promise?i.then(a=>(r.value=a,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function Sb(t){return new RP({type:"transform",transform:t})}var Pb=R("ZodOptional",(t,e)=>{m0.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>q0(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Gm(t){return new Pb({type:"optional",innerType:t})}var CP=R("ZodExactOptional",(t,e)=>{dE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>q0(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function zP(t){return new CP({type:"optional",innerType:t})}var OP=R("ZodNullable",(t,e)=>{pE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>jS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Hm(t){return new OP({type:"nullable",innerType:t})}function M2(t){return Gm(Hm(t))}var VP=R("ZodDefault",(t,e)=>{fE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>WS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function UP(t,e){return new VP({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():X.shallowClone(e)}})}var jP=R("ZodPrefault",(t,e)=>{hE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>LS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function KP(t,e){return new jP({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():X.shallowClone(e)}})}var Mb=R("ZodNonOptional",(t,e)=>{mE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>KS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function WP(t,e){return new Mb({type:"nonoptional",innerType:t,...X.normalizeParams(e)})}var LP=R("ZodSuccess",(t,e)=>{gE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function N2(t){return new LP({type:"success",innerType:t})}var ZP=R("ZodCatch",(t,e)=>{vE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ZS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function GP(t,e){return new ZP({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var HP=R("ZodNaN",(t,e)=>{xE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>MS(t,r,n,i)});function $2(t){return nS(HP,t)}var tg=R("ZodPipe",(t,e)=>{g0.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>GS(t,r,n,i),t.in=e.in,t.out=e.out});function nb(t,e){return new tg({type:"pipe",in:t,out:e})}var rg=R("ZodCodec",(t,e)=>{tg.init(t,e),Om.init(t,e)});function k2(t,e,r){return new rg({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function I2(t){let e=t._zod.def;return new rg({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var qP=R("ZodPreprocess",(t,e)=>{tg.init(t,e),yE.init(t,e)}),JP=R("ZodReadonly",(t,e)=>{wE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>HS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function YP(t){return new JP({type:"readonly",innerType:t})}var XP=R("ZodTemplateLiteral",(t,e)=>{bE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>NS(t,r,n,i)});function B2(t,e){return new XP({type:"template_literal",parts:t,...X.normalizeParams(e)})}var QP=R("ZodLazy",(t,e)=>{AE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>JS(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});function eM(t){return new QP({type:"lazy",getter:t})}var tM=R("ZodPromise",(t,e)=>{FE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>qS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function T2(t){return new tM({type:"promise",innerType:t})}var rM=R("ZodFunction",(t,e)=>{_E.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>BS(t,r,n,i)});function D2(t){return new rM({type:"function",input:Array.isArray(t?.input)?$P(t?.input):t?.input??Xm(zc()),output:t?.output??zc()})}var ig=R("ZodCustom",(t,e)=>{EE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>IS(t,r,n,i)});function R2(t){let e=new _t({check:"custom"});return e._zod.check=t,e}function C2(t,e){return sS(ig,t??(()=>!0),e)}function iM(t,e={}){return lS(ig,t,e)}function nM(t,e){return cS(t,e)}var z2=uS,O2=dS;function V2(t,e={}){let r=new ig({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...X.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var U2=(...t)=>pS({Codec:rg,Boolean:kp,String:Mp},...t);function j2(t){let e=eM(()=>Ab([Lm(t),hP(),mP(),yP(),Xm(e),kP(Lm(),e)]));return e}function K2(t,e){return new qP({type:"pipe",in:Sb(t),out:e})}var V4={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function U4(t){Jt({customError:t})}function j4(){return Jt().customError}var aM;aM||(aM={});var le={...Wm,...X0,iso:Ep},K4=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function W4(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function L4(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let i=r[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${t}`);return e.defs[i]}throw new Error(`Reference not found: ${t}`)}function W2(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return le.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let i=t.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return le.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let a=L4(i,e),o=li(a,e);return e.refs.set(i,o),e.processing.delete(i),o}if(t.enum!==void 0){let i=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&i.length===1&&i[0]===null)return le.null();if(i.length===0)return le.never();if(i.length===1)return le.literal(i[0]);if(i.every(o=>typeof o=="string"))return le.enum(i);let a=i.map(o=>le.literal(o));return a.length<2?a[0]:le.union([a[0],a[1],...a.slice(2)])}if(t.const!==void 0)return le.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(a=>{let o={...t,type:a};return W2(o,e)});return i.length===0?le.never():i.length===1?i[0]:le.union(i)}if(!r)return le.any();let n;switch(r){case"string":{let i=le.string();if(t.format){let a=t.format;a==="email"?i=i.check(le.email()):a==="uri"||a==="uri-reference"?i=i.check(le.url()):a==="uuid"||a==="guid"?i=i.check(le.uuid()):a==="date-time"?i=i.check(le.iso.datetime()):a==="date"?i=i.check(le.iso.date()):a==="time"?i=i.check(le.iso.time()):a==="duration"?i=i.check(le.iso.duration()):a==="ipv4"?i=i.check(le.ipv4()):a==="ipv6"?i=i.check(le.ipv6()):a==="mac"?i=i.check(le.mac()):a==="cidr"?i=i.check(le.cidrv4()):a==="cidr-v6"?i=i.check(le.cidrv6()):a==="base64"?i=i.check(le.base64()):a==="base64url"?i=i.check(le.base64url()):a==="e164"?i=i.check(le.e164()):a==="jwt"?i=i.check(le.jwt()):a==="emoji"?i=i.check(le.emoji()):a==="nanoid"?i=i.check(le.nanoid()):a==="cuid"?i=i.check(le.cuid()):a==="cuid2"?i=i.check(le.cuid2()):a==="ulid"?i=i.check(le.ulid()):a==="xid"?i=i.check(le.xid()):a==="ksuid"&&(i=i.check(le.ksuid()))}typeof t.minLength=="number"&&(i=i.min(t.minLength)),typeof t.maxLength=="number"&&(i=i.max(t.maxLength)),t.pattern&&(i=i.regex(new RegExp(t.pattern))),n=i;break}case"number":case"integer":{let i=r==="integer"?le.number().int():le.number();typeof t.minimum=="number"&&(i=i.min(t.minimum)),typeof t.maximum=="number"&&(i=i.max(t.maximum)),typeof t.exclusiveMinimum=="number"?i=i.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(i=i.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?i=i.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(i=i.lt(t.maximum)),typeof t.multipleOf=="number"&&(i=i.multipleOf(t.multipleOf)),n=i;break}case"boolean":{n=le.boolean();break}case"null":{n=le.null();break}case"object":{let i={},a=t.properties||{},o=new Set(t.required||[]);for(let[c,u]of Object.entries(a)){let f=li(u,e);i[c]=o.has(c)?f:f.optional()}if(t.propertyNames){let c=li(t.propertyNames,e),u=t.additionalProperties&&typeof t.additionalProperties=="object"?li(t.additionalProperties,e):le.any();if(Object.keys(i).length===0){n=le.record(c,u);break}let f=le.object(i).passthrough(),v=le.looseRecord(c,u);n=le.intersection(f,v);break}if(t.patternProperties){let c=t.patternProperties,u=Object.keys(c),f=[];for(let m of u){let w=li(c[m],e),y=le.string().regex(new RegExp(m));f.push(le.looseRecord(y,w))}let v=[];if(Object.keys(i).length>0&&v.push(le.object(i).passthrough()),v.push(...f),v.length===0)n=le.object({}).passthrough();else if(v.length===1)n=v[0];else{let m=le.intersection(v[0],v[1]);for(let w=2;w<v.length;w++)m=le.intersection(m,v[w]);n=m}break}let s=le.object(i);t.additionalProperties===!1?n=s.strict():typeof t.additionalProperties=="object"?n=s.catchall(li(t.additionalProperties,e)):n=s.passthrough();break}case"array":{let i=t.prefixItems,a=t.items;if(i&&Array.isArray(i)){let o=i.map(c=>li(c,e)),s=a&&typeof a=="object"&&!Array.isArray(a)?li(a,e):void 0;s?n=le.tuple(o).rest(s):n=le.tuple(o),typeof t.minItems=="number"&&(n=n.check(le.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(le.maxLength(t.maxItems)))}else if(Array.isArray(a)){let o=a.map(c=>li(c,e)),s=t.additionalItems&&typeof t.additionalItems=="object"?li(t.additionalItems,e):void 0;s?n=le.tuple(o).rest(s):n=le.tuple(o),typeof t.minItems=="number"&&(n=n.check(le.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(le.maxLength(t.maxItems)))}else if(a!==void 0){let o=li(a,e),s=le.array(o);typeof t.minItems=="number"&&(s=s.min(t.minItems)),typeof t.maxItems=="number"&&(s=s.max(t.maxItems)),n=s}else n=le.array(le.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}function li(t,e){if(typeof t=="boolean")return t?le.any():le.never();let r=W2(t,e),n=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let s=t.anyOf.map(u=>li(u,e)),c=le.union(s);r=n?le.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let s=t.oneOf.map(u=>li(u,e)),c=le.xor(s);r=n?le.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:le.any();else{let s=n?r:li(t.allOf[0],e),c=n?0:1;for(let u=c;u<t.allOf.length;u++)s=le.intersection(s,li(t.allOf[u],e));r=s}t.nullable===!0&&e.version==="openapi-3.0"&&(r=le.nullable(r)),t.readOnly===!0&&(r=le.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let i={},a=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of a)s in t&&(i[s]=t[s]);let o=["contentEncoding","contentMediaType","contentSchema"];for(let s of o)s in t&&(i[s]=t[s]);for(let s of Object.keys(t))K4.has(s)||(i[s]=t[s]);return Object.keys(i).length>0&&e.registry.add(r,i),t.description&&(r=r.describe(t.description)),r}function L2(t,e){if(typeof t=="boolean")return t?le.any():le.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=W4(r,e?.defaultTarget),i=r.$defs||r.definitions||{},a={version:n,defs:i,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??Gr};return li(r,a)}var oM={};_a(oM,{bigint:()=>q4,boolean:()=>H4,date:()=>J4,number:()=>G4,string:()=>Z4});function Z4(t){return NE(Mp,t)}function G4(t){return CE($p,t)}function H4(t){return WE(kp,t)}function q4(t){return ZE(Ip,t)}function J4(t){return iS(Ym,t)}Jt(v0());var G2=[1,2,4,8],H2=[1,2,3,4,5,6,7,8],q2=["disable-track","mute-region"],J2=["none","all","previous-only"],Y2=Oe.object({metronome:Oe.object({enabled:Oe.boolean(),beatSubDivision:Oe.union(G2.map(t=>Oe.literal(t))),gain:Oe.number().min(Number.NEGATIVE_INFINITY).max(0),monophonic:Oe.boolean()}).default({enabled:!1,beatSubDivision:1,gain:-6,monophonic:!0}),playback:Oe.object({timestampEnabled:Oe.boolean(),pauseOnLoopDisabled:Oe.boolean(),truncateNotesAtRegionEnd:Oe.boolean()}).default({timestampEnabled:!0,pauseOnLoopDisabled:!1,truncateNotesAtRegionEnd:!1}),debug:Oe.object({dspLoadMeasurement:Oe.boolean()}).default({dspLoadMeasurement:!1}),recording:Oe.object({countInBars:Oe.union(H2.map(t=>Oe.literal(t))),allowTakes:Oe.boolean(),automationEnabled:Oe.boolean(),olderTakeAction:Oe.union(q2.map(t=>Oe.literal(t))),olderTakeScope:Oe.union(J2.map(t=>Oe.literal(t))),inputLatency:Oe.number().min(-1)}).default({countInBars:1,allowTakes:!0,automationEnabled:!0,olderTakeAction:"mute-region",olderTakeScope:"previous-only",inputLatency:0})}),Z2;(function(t){t.BeatSubDivisionOptions=G2,t.RecordingCountInBars=H2,t.OlderTakeActionOptions=q2,t.OlderTakeScopeOptions=J2})(Z2||(Z2={}));A();A();var Qs={[Tt.Instrument]:0,[Tt.Aux]:1,[Tt.Bus]:2,[Tt.Output]:3};var Nb;(function(t){t.create=({boxGraph:e,mandatoryBoxes:{rootBox:r,primaryAudioBusBox:n}},i,a,o)=>{let s=o??t.orderAndGetIndex(r,i);return console.debug(`createAudioUnit type: ${i}, insertIndex: ${s}`),it.create(e,k.generate(),c=>{c.collection.refer(r.audioUnits),c.output.refer(n.input),c.index.setValue(s),c.type.setValue(i),a.ifSome(u=>c.capture.refer(u))})},t.orderAndGetIndex=(e,r)=>{let n=bi.collectIndexedBoxes(e.audioUnits,it),i=Qs[r],a=0;for(;a<n.length&&!(Qs[n[a].type.getValue()]>i);a++);let o=a;for(;a<n.length;)n[a].index.setValue(++a);return o},t.trackTypeToCapture=(e,r)=>{switch(r){case ye.Audio:return _.wrap(Ia.create(e,k.generate()));case ye.Notes:return _.wrap(Ba.create(e,k.generate()));default:return _.None}}})(Nb||(Nb={}));var X2;(function(t){t.create=(e,r,n,i,a)=>{console.debug(`createAudioBus '${r}', type: ${i}, color: ${a}`);let{boxGraph:o,mandatoryBoxes:{rootBox:s}}=e;ee(s.isAttached(),"rootBox not attached");let c=k.generate(),u=ea.create(o,c,v=>{v.collection.refer(s.audioBusses),v.label.setValue(r),v.icon.setValue(We.toName(n)),v.color.setValue(a.toString())}),f=Nb.create(e,i,_.None);return u.output.refer(f.input),u}})(X2||(X2={}));var Q2;(function(t){t.forAudioType=e=>{switch(e){case Tt.Output:return ts.blue;case Tt.Aux:return ts.purple;case Tt.Bus:return ts.orange;case Tt.Instrument:return ts.green;default:return ts.dark}},t.forTrackType=e=>{switch(e){case ye.Audio:return 200;case ye.Notes:return 45;case ye.Value:return 156;default:return 0}}})(Q2||(Q2={}));A();rt();var eD;(function(t){t.Tape={defaultName:"Tape",defaultIcon:We.Tape,briefDescription:"Audio Player",description:"Plays audio regions & clips",manualPage:se.Tape,trackType:ye.Audio,create:(n,i,a,o,s)=>wu.create(n,k.generate(),c=>{c.label.setValue(a),c.icon.setValue(We.toName(o)),c.flutter.setValue(.2),c.wow.setValue(.05),c.noise.setValue(.02),c.saturation.setValue(.5),c.host.refer(i)})},t.Nano={defaultName:"Nano",defaultIcon:We.NanoWave,briefDescription:"Simple Sampler",description:"Simple sampler",manualPage:se.Nano,trackType:ye.Notes,create:(n,i,a,o,s)=>xu.create(n,k.generate(),c=>{c.label.setValue(a),c.icon.setValue(We.toName(o)),K(s)&&c.file.refer(s),c.host.refer(i)})},t.Playfield={defaultName:"Playfield",defaultIcon:We.Playfield,briefDescription:"Drum Machine",description:"Drum computer",manualPage:se.Playfield,trackType:ye.Notes,create:(n,i,a,o,s)=>{let c=yu.create(n,k.generate(),u=>{u.label.setValue(a),u.icon.setValue(We.toName(o)),u.host.refer(i)});return K(s)&&s.filter(({note:u,uuid:f,name:v,durationInSeconds:m,exclude:w})=>{let y=e(n,f,v,m);Ta.create(n,k.generate(),P=>{P.device.refer(c.samples),P.file.refer(y),P.index.setValue(u),P.exclude.setValue(w)})}),c}},t.Neon={defaultName:"Neon",defaultIcon:We.Neon,briefDescription:"CZ-style Synth",description:"CZ-style phase distortion synthesizer",manualPage:se.Neon,trackType:ye.Notes,create:(n,i,a,o,s)=>vu.create(n,k.generate(),c=>{c.label.setValue(a),c.icon.setValue(We.toName(o));for(let u of[0,1]){let f=c.envelopes.fields()[u*3+1];f.rate1.setInitValue(99),f.level1.setInitValue(99),f.sustain.setInitValue(1),f.end.setInitValue(2),f.rate2.setInitValue(99);let v=c.envelopes.fields()[u*3+2];v.rate1.setInitValue(99),v.level1.setInitValue(99),v.sustain.setInitValue(1),v.end.setInitValue(2),v.rate2.setInitValue(70)}c.host.refer(i)})},t.Cubed={defaultName:"Cubed",defaultIcon:We.Cube,briefDescription:"303-style Synth",description:"Acid bassline synthesizer",manualPage:"manuals/devices/instruments/cubed",trackType:ye.Notes,create:(n,i,a,o,s)=>_u.create(n,k.generate(),c=>{c.label.setValue(a),c.icon.setValue(We.toName(o)),c.host.refer(i)})},t.Vaporisateur={defaultName:"Vaporisateur",defaultIcon:We.Vaporisateur,briefDescription:"Subtractive Synth",description:"Classic subtractive synthesizer",manualPage:se.Vaporisateur,trackType:ye.Notes,create:(n,i,a,o,s)=>hu.create(n,k.generate(),c=>{c.label.setValue(a),c.icon.setValue(We.toName(o)),c.cutoff.setInitValue(8e3),c.resonance.setInitValue(.1),c.attack.setInitValue(.005),c.decay.setInitValue(.1),c.sustain.setInitValue(.5),c.release.setInitValue(.5),c.voicingMode.setInitValue(Ma.Polyphonic),c.lfo.rate.setInitValue(1),c.oscillators.fields()[0].waveform.setInitValue(Sa.saw),c.oscillators.fields()[0].volume.setInitValue(-6),c.oscillators.fields()[1].volume.setInitValue(Number.NEGATIVE_INFINITY),c.oscillators.fields()[1].waveform.setInitValue(Sa.square),c.host.refer(i),c.version.setValue(2)})},t.MIDIOutput={defaultName:"MIDIOutput",defaultIcon:We.Midi,briefDescription:"Send MIDI",description:"MIDI Output",manualPage:se.MIDIOutput,trackType:ye.Notes,create:(n,i,a,o,s)=>mu.create(n,k.generate(),c=>{c.label.setValue(a),c.icon.setValue(We.toName(o)),c.host.refer(i)})},t.Soundfont={defaultName:"Soundfont",defaultIcon:We.SoundFont,briefDescription:"Soundfont Player",description:"Soundfont Player",manualPage:se.Soundfont,trackType:ye.Notes,create:(n,i,a,o,s)=>gu.create(n,k.generate(),c=>{c.label.setValue(a),c.icon.setValue(We.toName(o)),K(s)&&c.file.refer(s),c.host.refer(i)})},t.Apparat={defaultName:"Apparat",defaultIcon:We.Code,briefDescription:"Scriptable Instrument",description:"User-scripted instrument",manualPage:se.Apparat,trackType:ye.Notes,create:(n,i,a,o)=>bu.create(n,k.generate(),s=>{s.label.setValue(a),s.icon.setValue(We.toName(o)),s.host.refer(i)})},t.Named={Apparat:t.Apparat,Cubed:t.Cubed,Neon:t.Neon,MIDIOutput:t.MIDIOutput,Nano:t.Nano,Playfield:t.Playfield,Soundfont:t.Soundfont,Tape:t.Tape,Vaporisateur:t.Vaporisateur};let e=(n,i,a,o)=>n.findBox(i).unwrapOrElse(()=>dn.create(n,i,s=>{s.fileName.setValue(a),s.endInSeconds.setValue(o)})),r=(n,i,a)=>n.findBox(i).unwrapOrElse(()=>ka.create(n,i,o=>o.fileName.setValue(a)))})(eD||(eD={}));A();A();var Zo;(function(t){t.empty=n=>{let i=new xo(_.wrap(bo.create)),a=new Date().toISOString();console.debug(`New Project created on ${a}`),i.beginTransaction();let o=pu.create(i,k.generate(),m=>{m.label.setValue("Groove Shuffle")}),s=is.create(i,k.generate(),m=>{m.groove.refer(o),m.created.setValue(a)}),c=ea.create(i,k.generate(),m=>{m.collection.refer(s.audioBusses),m.label.setValue("Output"),m.icon.setValue(We.toName(We.SpeakerHeadphone)),m.color.setValue(ts.blue.toString())}),u=it.create(i,k.generate(),m=>{m.type.setValue(Tt.Output),m.collection.refer(s.audioUnits),m.output.refer(s.outputDevice),m.index.setValue(0)});n.createOutputMaximizer&&fu.create(i,k.generate(),m=>{m.label.setValue("Master Maximizer"),m.index.setValue(0),m.host.refer(u.audioEffects),m.lookahead.setValue(!1)});let f=xl.create(i,k.generate());Qn.create(i,k.generate(),m=>f.tempoTrack.events.refer(m.owners)),s.timeline.refer(f.root),c.output.refer(u.input);let v=[];if(n.createDefaultUser){let m=_o.create(i,k.generate());m.root.refer(s.users),v.push(m)}return i.endTransaction(),{boxGraph:i,mandatoryBoxes:{rootBox:s,primaryAudioBusBox:c,primaryAudioUnitBox:u,timelineBox:f,userInterfaceBoxes:v}}},t.encode=n=>{let i=Gt.create();i.writeInt(1330660686),i.writeInt(2);let a=n.toArrayBuffer();return i.writeInt(a.byteLength),i.writeBytes(new Int8Array(a)),i.toArrayBuffer()},t.decode=n=>{let i=new lt(n);ee(i.readInt()===1330660686,"Corrupt header. Probably not an openDAW project file."),ee(i.readInt()===2,"Deprecated Format");let a=i.readInt(),o=new Int8Array(a);i.readBytes(o);let s=new xo(_.wrap(bo.create));return s.fromArrayBuffer(o.buffer,!1),{boxGraph:s,mandatoryBoxes:t.findMandatoryBoxes(s)}},t.findMandatoryBoxes=n=>{let i=n.boxes().find(a=>a.accept({visitRootBox:()=>!0}));if(K(i)){let a=je(i.outputDevice.pointerHub.incoming().at(0)?.box,it),o=je(a.input.pointerHub.incoming().at(0)?.box,ea),s=je(i.timeline.targetVertex.unwrap("TimelineBox not found").box,xl),c=i.users.pointerHub.incoming().map(({box:u})=>je(u,_o));return{rootBox:i,primaryAudioBusBox:o,primaryAudioUnitBox:a,timelineBox:s,userInterfaceBoxes:c}}return W("Could not find mandatory boxes")}})(Zo||(Zo={}));A();A();var Vt;(function(t){let e=({graph:n},{graph:i})=>n===i,r=(n,i)=>n.index.getValue()-i.index.getValue();t.excludeTimelinePredicate=n=>n.accept({visitTrackBox:()=>!0})===!0,t.shouldExclude=n=>n.ephemeral||n.name===du.ClassName,t.generateMap=(n,i,a,o)=>{let s=k.newSet(({source:c})=>c);return s.addMany([...n.filter(({output:{targetAddress:c}})=>c.nonEmpty()).map(c=>({source:c.output.targetAddress.unwrap().uuid,target:o})),...n.map(c=>({source:c.collection.targetAddress.unwrap("AudioUnitBox was not connected to a RootBox").uuid,target:a})),...n.map(c=>({source:c.address.uuid,target:k.generate()})),...i.map(c=>({source:c.address.uuid,target:c.resource==="preserved"?c.address.uuid:k.generate()}))]),s},t.copyBoxes=(n,i,a,o)=>{let s=k.newSet(u=>u);o.forEach(u=>{u.resource==="preserved"&&i.findBox(u.address.uuid).nonEmpty()&&s.add(u.address.uuid)});let c=u=>{for(let[f,v]of u.outgoingEdges())if(f.mandatory&&!v.isBox()&&s.hasKey(v.uuid))return!0;return!1};I.decodeWith({map:(u,f)=>f.flatMap(v=>n.opt(v.uuid).match({some:({target:m})=>_.wrap(v.moveTo(m)),none:()=>i.findBox(v.uuid).nonEmpty()?_.wrap(v):_.None}))},()=>{a.forEach(u=>{let f=new lt(u.toArrayBuffer()),v=n.get(u.address.uuid,"uuid mapping").target;i.createBox(u.name,v,m=>m.read(f))}),o.forEach(u=>{if(s.hasKey(u.address.uuid)||c(u))return;let f=new lt(u.toArrayBuffer()),v=n.get(u.address.uuid,"uuid mapping").target;i.createBox(u.name,v,m=>m.read(f))})})},t.reorderAudioUnits=(n,i,a,o)=>{let s=i.toSorted(r).map(m=>je(a.graph.findBox(n.get(m.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),it)),c=new Set(s),f=bi.collectIndexedBoxes(a.audioUnits,it).filter(m=>!c.has(m)),v;if(K(o)){let m=Se(o,0,f.length);v=[...f.slice(0,m),...s,...f.slice(m)]}else{let m=f.toSorted((P,V)=>(Qs[P.type.getValue()]??0)-(Qs[V.type.getValue()]??0)),w=s.reduce((P,V)=>Math.max(P,Qs[V.type.getValue()]??0),0),y=m.findIndex(P=>(Qs[P.type.getValue()]??0)>w);y===-1&&(y=m.length),v=[...m.slice(0,y),...s,...m.slice(y)]}v.forEach((m,w)=>m.index.setValue(w))},t.extractRegions=(n,{boxGraph:i,mandatoryBoxes:{primaryAudioBusBox:a,rootBox:o}},s=0)=>{ee(ie.satisfy(n,e),"Region smust be from the same BoxGraph");let c=new Set(n),u=new Set,f=new Mg;n.forEach(O=>{let C=je(O.regions.targetVertex.unwrap("regions.target").box,_i);u.add(C);let G=je(C.tracks.targetVertex.unwrap("tracks.target").box,it);f.add(G,C)}),console.debug(`Found ${f.keyCount()} audioUnits`),console.debug(`Found ${u.size} tracks`);let v=[...f.keys()],m=O=>t.shouldExclude(O)||Ft(O,_i)&&!u.has(O)||ya.isRegionBox(O)&&!c.has(O),w=Array.from(v[0].graph.dependenciesOf(v,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:m}).boxes),y=t.generateMap(v,w,o.audioUnits.address.uuid,a.address.uuid);t.copyBoxes(y,i,v,w),t.reorderAudioUnits(y,v,o),f.forEach((O,C)=>[...C].sort(r).forEach((G,Y)=>{let me=i.findBox(y.get(G.address.uuid,"uuid mapping").target).unwrap("Target Track has not been copied");je(me,_i).index.setValue(Y)}));let P=n.reduce((O,C)=>Math.min(O,C.position.getValue()),Number.MAX_VALUE),V=s-P;n.forEach(O=>{let C=i.findBox(y.get(O.address.uuid,"uuid mapping").target).unwrap("Target Track has not been copied"),{position:G}=ya.asRegionBox(C);G.setValue(G.getValue()+V)})}})(Vt||(Vt={}));var tD;(function(t){t.transfer=(e,{boxGraph:r,mandatoryBoxes:{primaryAudioBusBox:n,rootBox:i}},a={})=>{let o=e.filter(v=>v.type.getValue()!==Tt.Output);if(o.length===0)return[];let s=v=>Vt.shouldExclude(v)||a?.excludeTimeline===!0&&Vt.excludeTimelinePredicate(v),c=Array.from(o[0].graph.dependenciesOf(o,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:s}).boxes),u=Vt.generateMap(o,c,i.audioUnits.address.uuid,n.address.uuid);Vt.copyBoxes(u,r,o,c),Vt.reorderAudioUnits(u,o,i,a.insertIndex);let f=o.map(v=>je(i.graph.findBox(u.get(v.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),it));if(a.deleteSource===!0){let v=je(o[0].collection.targetVertex.unwrap("collection.target").box,is);o.forEach(m=>m.delete()),bi.collectIndexedBoxes(v.audioUnits,it).forEach((m,w)=>m.index.setValue(w))}return f}})(tD||(tD={}));A();var rD;(function(t){t.transfer=(e,r,n,i=!0)=>{let a=r.graph,o=k.newSet(m=>m.address.uuid);o.add(e);for(let m of e.graph.dependenciesOf(e,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:w=>w.ephemeral}).boxes)o.add(m);let s=k.newSet(m=>m);o.forEach(m=>{m.resource==="preserved"&&a.findBox(m.address.uuid).nonEmpty()&&s.add(m.address.uuid)});let c=m=>{if(m.resource==="preserved"&&s.hasKey(m.address.uuid))return!0;for(let[,w]of m.outgoingEdges())if(s.hasKey(w.uuid)&&!w.isBox())return!0;return!1},u=o.values().filter(m=>!c(m)),f=k.newSet(m=>m.source);u.forEach(m=>{f.add({source:m.address.uuid,target:m.resource==="preserved"?m.address.uuid:k.generate()})}),s.forEach(m=>f.add({source:m,target:m}));let v=null;return I.decodeWith({map:(m,w)=>{let y=w.flatMap(P=>f.opt(P.uuid).map(V=>P.moveTo(V.target)));return y.nonEmpty()?y:m.pointerType===l.RegionCollection?_.wrap(r.regions.address):m.pointerType===l.ClipCollection?_.wrap(r.clips.address):_.None}},()=>u.forEach(m=>{let w=new lt(m.toArrayBuffer()),y=f.get(m.address.uuid,"uuid mapping").target;a.createBox(m.name,y,P=>{if(P.read(w),ya.isRegionBox(P)){let V=ya.asRegionBox(P);V.position.setValue(n),v=V}})})),i&&e.delete(),He(v,"Failed to create region copy")}})(rD||(rD={}));var ar;(function(t){t.MAGIC_HEADER_OPEN=1330664005,t.FORMAT_VERSION=1;let e;(function(r){r[r.Midi=0]="Midi",r[r.Audio=1]="Audio"})(e=t.ChainKind||(t.ChainKind={}))})(ar||(ar={}));var iD;(function(t){t.decode=(e,r)=>{let n=new lt(e.slice(0,8));if(n.readInt()!==ar.MAGIC_HEADER_OPEN)return Yc.notify({message:"Invalid preset file.",icon:"Warning"}),[];let i=n.readInt();if(i!==ar.FORMAT_VERSION)return console.warn(`Unsupported preset version ${i} (supports ${ar.FORMAT_VERSION})`),Yc.notify({message:"Unsupported preset version.",icon:"Warning"}),[];let a=new xo(_.wrap(bo.create));try{a.fromArrayBuffer(e.slice(8),!1)}catch(y){return console.warn(y),Yc.notify({message:"Could not import preset.",icon:"Warning"}),[]}let o={};for(let y of a.boxes())o[y.name]=(o[y.name]??0)+1;console.info("PresetDecoder.decode: source graph boxes",o);let s=a.boxes().filter(y=>Ft(y,it)).filter(y=>y.type.getValue()!==Tt.Output),c=y=>Vt.shouldExclude(y),u=Array.from(a.dependenciesOf(s,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:c}).boxes),{mandatoryBoxes:{rootBox:f,primaryAudioBusBox:v}}=r,m=Vt.generateMap(s,u,f.audioUnits.address.uuid,v.address.uuid);Vt.copyBoxes(m,r.boxGraph,s,u),Vt.reorderAudioUnits(m,s,f);let w=s.map(y=>je(f.graph.findBox(m.get(y.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),it)).filter(y=>y.type.getValue()!==Tt.Output);return w.forEach(y=>{let P=y.input.pointerHub.incoming().at(0)?.box;if(!K(P))return;let V=y.tracks.pointerHub.incoming().length;console.info(`PresetDecoder.decode: AudioUnit ${k.toString(y.address.uuid)} has ${V} pre-copied track(s)`),!(V>0)&&y.capture.targetVertex.ifSome(({box:O})=>{O instanceof Ba?_i.create(r.boxGraph,k.generate(),C=>{C.index.setValue(0),C.type.setValue(ye.Notes),C.target.refer(y),C.tracks.refer(y.tracks)}):O instanceof Ia&&_i.create(r.boxGraph,k.generate(),C=>{C.index.setValue(0),C.type.setValue(ye.Audio),C.target.refer(y),C.tracks.refer(y.tracks)})})}),w},t.peekHasTimeline=e=>{if(e.byteLength<8)return!1;let r=new lt(e.slice(0,8));if(r.readInt()!==ar.MAGIC_HEADER_OPEN||r.readInt()!==ar.FORMAT_VERSION)return!1;let n=new xo(_.wrap(bo.create));if(sr(()=>n.fromArrayBuffer(e.slice(8),!1)).status==="failure")return!1;for(let a of n.boxes())if(Ft(a,_i))return!0;return!1},t.replaceAudioUnit=(e,r,n)=>{console.debug("ReplaceAudioUnit with preset...");let i=Zo.empty({createDefaultUser:!1,createOutputMaximizer:!1}),a=i.boxGraph,o=r.graph;a.beginTransaction(),t.decode(e,i),a.endTransaction();let s=i.mandatoryBoxes.rootBox.audioUnits.pointerHub.incoming().map(({box:C})=>je(C,it)).find(C=>C.type.getValue()!==Tt.Output);if(r_(s))return Dr.err("Preset contains no valid audio unit. Please send the file to the developers.");let c=s.capture.targetVertex.mapOr(({box:C})=>C.name,""),u=r.capture.targetVertex.mapOr(({box:C})=>C.name,"");if(c!==u)return Dr.err("Cannot replace incompatible instruments");let f=n?.keepMIDIEffects!==!0,v=n?.keepAudioEffects!==!0,m=n?.keepTimeline!==!0;console.debug("replaceMIDIEffects",f),console.debug("replaceAudioEffects",v),console.debug("replaceTimeline",m),He(r.input.pointerHub.incoming().at(0)?.box,"Target has no input").delete(),f?r.midiEffects.pointerHub.incoming().forEach(({box:C})=>C.delete()):(a.beginTransaction(),s.midiEffects.pointerHub.incoming().forEach(({box:C})=>C.delete()),a.endTransaction()),v?r.audioEffects.pointerHub.incoming().forEach(({box:C})=>C.delete()):(a.beginTransaction(),s.audioEffects.pointerHub.incoming().forEach(({box:C})=>C.delete()),a.endTransaction()),s.tracks.pointerHub.incoming().length>0&&m&&r.tracks.pointerHub.incoming().forEach(({box:C})=>C.delete());let y=C=>!!(C.accept({visitCaptureMidiBox:G=>!0,visitCaptureAudioBox:G=>!0})===!0||!m&&Vt.excludeTimelinePredicate(C)),P=k.newSet(({source:C})=>C),V=Array.from(a.dependenciesOf(s,{excludeBox:y,alwaysFollowMandatory:!0,stopAtResources:!0}).boxes);P.addMany([{source:s.address.uuid,target:r.address.uuid},...V.map(({address:{uuid:C},name:G})=>({source:C,target:G===dn.ClassName||G===ka.ClassName?C:k.generate()}))]);let O=k.newSet(C=>C);return V.forEach(C=>{(C instanceof dn||C instanceof ka)&&o.findBox(C.address.uuid).nonEmpty()&&O.add(C.address.uuid)}),I.decodeWith({map:(C,G)=>G.flatMap(Y=>P.opt(Y.uuid).match({some:({target:me})=>_.wrap(Y.moveTo(me)),none:()=>o.findBox(Y.uuid).nonEmpty()?_.wrap(Y):_.None}))},()=>{V.forEach(C=>{if((C instanceof dn||C instanceof ka)&&O.opt(C.address.uuid).nonEmpty())return;let G=new lt(C.toArrayBuffer()),Y=C.name,me=P.get(C.address.uuid,"uuid mapping").target;o.createBox(Y,me,ge=>ge.read(G))})}),Dr.Ok},t.insertEffectChain=(e,r,n,i)=>{if(e.byteLength<8)return Dr.err("Invalid preset header");let a=new lt(e.slice(0,8));if(a.readInt()!==ar.MAGIC_HEADER_OPEN)return Dr.err("Invalid preset header");let o=a.readInt();if(o!==ar.FORMAT_VERSION)return Dr.err(`Unsupported preset version ${o} (this build supports ${ar.FORMAT_VERSION}).`);let s=new xo(_.wrap(bo.create)),c=sr(()=>s.fromArrayBuffer(e.slice(8),!1));if(c.status==="failure")return Dr.err(`Failed to decode preset: ${String(c.error)}`);let u=s.boxes().filter(ge=>Ft(ge,it)).map(ge=>je(ge,it)).find(ge=>ge.type.getValue()!==Tt.Output);if(r_(u))return Dr.err("Preset contains no audio unit");let f=i===ar.ChainKind.Audio?u.audioEffects:u.midiEffects,v=bi.collectIndexedBoxes(f);if(v.length===0)return Dr.err("Preset contains no effects of the requested kind");let m=r.address,w=i===ar.ChainKind.Audio?l.AudioEffectHost:l.MIDIEffectHost,y=r.box.graph,P=v.length,V=bi.collectIndexedBoxes(r);for(let ge=V.length-1;ge>=0;ge--){let Ee=V[ge],he=Ee.index.getValue();he>=n&&Ee.index.setValue(he+P)}let O=ge=>Vt.shouldExclude(ge)||Vt.excludeTimelinePredicate(ge)||ge instanceof it,C=new Set(v),G=Array.from(s.dependenciesOf(v,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:O}).boxes).filter(ge=>!C.has(ge)),Y=k.newSet(ge=>ge);G.forEach(ge=>{ge.resource==="preserved"&&y.findBox(ge.address.uuid).nonEmpty()&&Y.add(ge.address.uuid)});let me=k.newSet(({source:ge})=>ge);return me.addMany([...v.map(ge=>({source:ge.address.uuid,target:k.generate()})),...G.map(ge=>({source:ge.address.uuid,target:ge.resource==="preserved"?ge.address.uuid:k.generate()}))]),I.decodeWith({map:(ge,Ee)=>{let he=Ee.flatMap(Me=>me.opt(Me.uuid).map(({target:ke})=>Me.moveTo(ke)));return he.nonEmpty()?he:ge.pointerType===w?_.wrap(m):Ee.flatMap(Me=>y.findBox(Me.uuid).nonEmpty()?_.wrap(Me):_.None)}},()=>{v.forEach((ge,Ee)=>{let he=new lt(ge.toArrayBuffer()),Me=me.get(ge.address.uuid,"uuid mapping").target;y.createBox(ge.name,Me,ke=>{ke.read(he),bi.isIndexedBox(ke)&&ke.index.setValue(n+Ee)})}),G.forEach(ge=>{if(Y.hasKey(ge.address.uuid))return;let Ee=new lt(ge.toArrayBuffer()),he=me.get(ge.address.uuid,"uuid mapping").target;y.createBox(ge.name,he,Me=>Me.read(Ee))})}),Dr.Ok}})(iD||(iD={}));A();var nD;(function(t){t.encode=(e,r={})=>{let n=Gt.create();n.writeInt(ar.MAGIC_HEADER_OPEN),n.writeInt(ar.FORMAT_VERSION);let i=Zo.empty({createOutputMaximizer:!1,createDefaultUser:!1}),{boxGraph:a,mandatoryBoxes:{rootBox:o,primaryAudioBusBox:s}}=i,c=[e],u=r.excludeEffect??(()=>!1),f=r.includeTimeline===!0,v=P=>Vt.shouldExclude(P)||!f&&Vt.excludeTimelinePredicate(P)||u(P);a.beginTransaction();let m=Array.from(e.graph.dependenciesOf(c,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:v}).boxes),w={};for(let P of m)w[P.name]=(w[P.name]??0)+1;console.info(`PresetEncoder.encode: includeTimeline=${f}, deps=${m.length}`,w);let y=Vt.generateMap(c,m,o.audioUnits.address.uuid,s.address.uuid);return Vt.copyBoxes(y,a,c,m),Vt.reorderAudioUnits(y,c,o),a.endTransaction(),ie.concatArrayBuffers(n.toArrayBuffer(),a.toArrayBuffer())},t.encodeEffects=(e,r)=>{let n=Gt.create();n.writeInt(ar.MAGIC_HEADER_OPEN),n.writeInt(ar.FORMAT_VERSION);let i=Zo.empty({createOutputMaximizer:!1,createDefaultUser:!1}),{boxGraph:a,mandatoryBoxes:{rootBox:o,primaryAudioBusBox:s}}=i;a.beginTransaction();let c=r===ar.ChainKind.Audio?Ia.create(a,k.generate()):Ba.create(a,k.generate()),u=it.create(a,k.generate(),f=>{f.collection.refer(o.audioUnits),f.output.refer(s.input),f.index.setValue(0),f.type.setValue(Tt.Instrument),f.capture.refer(c)});if(Fu.create(a,k.generate(),f=>{f.host.refer(u.input)}),e.length>0){let f=e[0].graph,v=O=>Vt.shouldExclude(O)||Vt.excludeTimelinePredicate(O)||O instanceof it,m=new Set(e),w=Array.from(f.dependenciesOf(e,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:v}).boxes).filter(O=>!m.has(O)),y=k.newSet(({source:O})=>O);y.addMany([...e.map(O=>({source:O.address.uuid,target:k.generate()})),...w.map(O=>({source:O.address.uuid,target:O.resource==="preserved"?O.address.uuid:k.generate()}))]);let P=r===ar.ChainKind.Audio?u.audioEffects:u.midiEffects,V=r===ar.ChainKind.Audio?l.AudioEffectHost:l.MIDIEffectHost;I.decodeWith({map:(O,C)=>{let G=C.flatMap(Y=>y.opt(Y.uuid).map(({target:me})=>Y.moveTo(me)));return G.nonEmpty()?G:O.pointerType===V?_.wrap(P.address):C.flatMap(Y=>a.findBox(Y.uuid).nonEmpty()?_.wrap(Y):_.None)}},()=>{e.forEach((O,C)=>{let G=new lt(O.toArrayBuffer()),Y=y.get(O.address.uuid,"uuid mapping").target;a.createBox(O.name,Y,me=>{me.read(G),bi.isIndexedBox(me)&&me.index.setValue(C)})}),w.forEach(O=>{let C=new lt(O.toArrayBuffer()),G=y.get(O.address.uuid,"uuid mapping").target;a.createBox(O.name,G,Y=>Y.read(C))})})}return a.endTransaction(),ie.concatArrayBuffers(n.toArrayBuffer(),a.toArrayBuffer())}})(nD||(nD={}));A();var aD;(function(t){t.existingInstrumentNames=e=>e.audioUnits.pointerHub.incoming().map(({box:r})=>{let n=je(r,it).input.pointerHub.incoming().at(0);if(n===void 0)return"N/A";let i=n.box;return"label"in i&&i.label instanceof T?i.label.getValue():"N/A"})})(aD||(aD={}));A();var oD;(function(t){t.Unknown={detect:async(e,r)=>(r(1),_.None)}})(oD||(oD={}));A();var sD=Oe.object({name:Oe.string(),bpm:Oe.number(),duration:Oe.number(),sample_rate:Oe.number(),origin:Oe.enum(["openDAW","recording","import"]),custom:Oe.string().optional()});var Dve=sD.extend({uuid:k.zType(Oe)});var Y4,X4,Q4,eV,tV,rV;Y4=new WeakMap,X4=new WeakMap,Q4=new WeakMap,eV=new WeakMap,tV=new WeakMap,rV=new WeakMap;var iV,nV,aV,oV,sV,lV;iV=new WeakMap,nV=new WeakMap,aV=new WeakMap,oV=new WeakMap,sV=new WeakMap,lV=new WeakMap;A();var cV=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},wr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},el,uV,dV,ng,lD,$b,sM,ag,pV,lM,cD,uD,cM,dD;uV=new WeakMap,dV=new WeakMap,ng=new WeakMap,lD=new WeakMap,$b=new WeakMap,sM=new WeakMap,ag=new WeakMap,el=new WeakSet,pV=function(e){let r=wr(this,ag,"f");cV(this,ag,e.isEmpty()?_.None:_.wrap(e.unwrap()),"f"),r.ifSome(n=>wr(this,el,"m",lM).call(this,n)),wr(this,ag,"f").ifSome(n=>{r.contains(n)||wr(this,el,"m",lM).call(this,n)})},lM=function(e){let r=wr(this,lD,"f").hasKey(e.address.uuid)&&!wr(this,ag,"f").contains(e),n=wr(this,$b,"f").hasKey(e.address.uuid);r!==n&&(r?wr(this,$b,"f").add({user:e,terminable:wr(this,el,"m",cD).call(this,e)}):wr(this,$b,"f").removeByKey(e.address.uuid).terminable.terminate())},cD=function(e){let r=k.newSet(i=>i.box.address.uuid),n=e.selection.pointerHub.catchupAndSubscribe({onAdded:i=>{let a=je(i.box,Na);a.selectable.targetVertex.ifSome(o=>{let s=o;r.add({box:a,selectable:s})&&wr(this,el,"m",uD).call(this,s,e)})},onRemoved:i=>{let a=je(i.box,Na),o=r.removeByKeyIfExist(a.address.uuid);K(o)&&wr(this,el,"m",cM).call(this,o.selectable,e)}},l.Selection);return{terminate:()=>{n.terminate(),r.forEach(i=>wr(this,el,"m",cM).call(this,i.selectable,e)),r.clear()}}},uD=function(e,r){(wr(this,ng,"f").getOrNull(e.address)??wr(this,el,"m",dD).call(this,e)).owners.add(r),wr(this,sM,"f").proxy.onSelected(e,r)},cM=function(e,r){let n=wr(this,ng,"f").getOrNull(e.address);K(n)&&(n.owners.removeByKey(r.address.uuid),n.owners.size()===0&&wr(this,ng,"f").removeByKey(e.address),wr(this,sM,"f").proxy.onDeselected(e,r))},dD=function(e){let r={selectable:e,owners:k.newSet(n=>n.address.uuid)};return wr(this,ng,"f").add(r),r};A();var Bp=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},fV,hV,uM,dM,pM,mV,gV,vV;hV=new WeakMap,uM=new WeakMap,dM=new WeakMap,pM=new WeakMap,mV=new WeakMap,gV=new WeakMap,fV=new WeakSet,vV=function(e){return e.pointerHub.catchupAndSubscribe({onAdded:r=>{let n=je(r.box,Na);ee(n.isAttached(),"SelectionBox is not attached");let i=n.selectable.targetVertex.unwrap(()=>`SelectionBox has no target (${n.selectable.targetAddress.unwrapOrUndefined()?.toString()??"No address"})`),a={box:n,selectable:i};Bp(this,pM,"f").proxy.onSelected(i),ee(Bp(this,uM,"f").add(a),"Could not add to entityMap"),ee(Bp(this,dM,"f").add(a),"Could not add to selectableMap")},onRemoved:r=>{let n=je(r.box,Na),i=Bp(this,uM,"f").removeByKey(n.address.uuid);ee(i.box===n,"Broken selection");let a=i.selectable;Bp(this,pM,"f").proxy.onDeselected(a),Bp(this,dM,"f").removeByKey(a.address)}},l.Selection)};A();var pD=Oe.object({name:Oe.string(),size:Oe.number().int(),url:Oe.string(),license:Oe.string(),origin:Oe.enum(["openDAW","import"])});var ixe=pD.extend({uuid:k.zType(Oe)});A();var fD;(function(t){t.cut=(e,r,n)=>{if(e.position>=r||r>=e.complete)return _.None;if(Q1.isLoopableRegion(e)){let{position:i,complete:a,loopOffset:o,loopDuration:s}=e;return e.duration=r-i,_.wrap(e.copyTo({position:r,duration:a-r,loopOffset:sl(o+(r-i),s),consolidate:n}))}else return W("Not yet implemented")},t.clip=(e,r,n)=>{if(Q1.isLoopableRegion(e)){let{position:i,complete:a,loopOffset:o,loopDuration:s}=e;return r-i<=0?W(`first part duration will be zero or negative(${r-i})`):a-n<=0?W(`second part duration will be zero or negative(${a-n})`):(e.duration=r-i,e.copyTo({position:n,duration:a-n,loopOffset:sl(o+(n-i),s)}))}else return W("Not yet implemented")}})(fD||(fD={}));var mD=()=>new WebAssembly.Memory({initial:256}),hD=[{url:"/wasm/plugins/device_vaporisateur.wasm",boxType:"VaporisateurDeviceBox"},{url:"/wasm/plugins/device_neon.wasm",boxType:"NeonDeviceBox"},{url:"/wasm/plugins/device_nano.wasm",boxType:"NanoDeviceBox"},{url:"/wasm/plugins/device_revamp.wasm",boxType:"RevampDeviceBox"},{url:"/wasm/plugins/device_tidal.wasm",boxType:"TidalDeviceBox"},{url:"/wasm/plugins/device_delay.wasm",boxType:"DelayDeviceBox"},{url:"/wasm/plugins/device_gate.wasm",boxType:"GateDeviceBox"},{url:"/wasm/plugins/device_arpeggio.wasm",boxType:"ArpeggioDeviceBox"},{url:"/wasm/plugins/device_zeitgeist.wasm",boxType:"ZeitgeistDeviceBox"},{url:"/wasm/plugins/device_pitch.wasm",boxType:"PitchDeviceBox"},{url:"/wasm/plugins/device_werkstatt.wasm",boxType:"WerkstattDeviceBox"},{url:"/wasm/plugins/device_apparat.wasm",boxType:"ApparatDeviceBox"},{url:"/wasm/plugins/device_spielwerk.wasm",boxType:"SpielwerkDeviceBox"},{url:"/wasm/plugins/device_waveshaper.wasm",boxType:"WaveshaperDeviceBox"},{url:"/wasm/plugins/device_crusher.wasm",boxType:"CrusherDeviceBox"},{url:"/wasm/plugins/device_fold.wasm",boxType:"FoldDeviceBox"},{url:"/wasm/plugins/device_stereo_tool.wasm",boxType:"StereoToolDeviceBox"},{url:"/wasm/plugins/device_velocity.wasm",boxType:"VelocityDeviceBox"},{url:"/wasm/plugins/device_maximizer.wasm",boxType:"MaximizerDeviceBox"},{url:"/wasm/plugins/device_compressor.wasm",boxType:"CompressorDeviceBox"},{url:"/wasm/plugins/device_reverb.wasm",boxType:"ReverbDeviceBox"},{url:"/wasm/plugins/device_dattorro_reverb.wasm",boxType:"DattorroReverbDeviceBox"},{url:"/wasm/plugins/device_soundfont.wasm",boxType:"SoundfontDeviceBox"},{url:"/wasm/plugins/device_cubed.wasm",boxType:"CubedDeviceBox"},{url:"/wasm/plugins/device_vocoder.wasm",boxType:"VocoderDeviceBox"},{url:"/wasm/plugins/device_neural_amp.wasm",boxType:"NeuralAmpDeviceBox"},{url:"/wasm/plugins/device_autotune.wasm",boxType:"AutotuneDeviceBox"},{url:"/wasm/plugins/device_playfield_sample.wasm",boxType:"PlayfieldSampleBox"}],xV=[{boxType:"PlayfieldDeviceBox",childrenField:10,indexKey:15,excludeKey:42,cellInstrumentField:0,cellMidiField:0,cellAudioField:0,childEnabledKey:22,childMuteKey:40,childSoloKey:41,childVolumeKey:50,childPanKey:51},{boxType:"CompositeDeviceBox",childrenField:10,indexKey:5,excludeKey:0,cellInstrumentField:2,cellMidiField:3,cellAudioField:4,childEnabledKey:0,childMuteKey:0,childSoloKey:0,childVolumeKey:0,childPanKey:0}],yV=[{boxType:"AudioEffectCompositeBox",kind:1,distributor:0,entriesField:10,indexKey:3,chainField:2,labelKey:4,gainKey:40,panKey:43,muteKey:41,soloKey:42,dryKey:12,wetKey:13,inputTapField:11,crossoverKeys:[0,0,0]},{boxType:"StereoCompositeBox",kind:1,distributor:1,entriesField:10,indexKey:3,chainField:2,labelKey:4,gainKey:40,panKey:43,muteKey:41,soloKey:42,dryKey:12,wetKey:13,inputTapField:11,crossoverKeys:[0,0,0]},{boxType:"FrequencySplitBox",kind:1,distributor:2,entriesField:10,indexKey:3,chainField:2,labelKey:4,gainKey:40,panKey:43,muteKey:41,soloKey:42,dryKey:12,wetKey:13,inputTapField:11,crossoverKeys:[14,15,16]}],gD=async(t="")=>{let e=[`${t}/wasm/engine.wasm`,...hD.map(a=>`${t}${a.url}`)],r=await Promise.all(e.map(a=>fetch(a).then(o=>o.ok?o.arrayBuffer():Promise.reject(new Error(`Could not load wasm module '${a}' (${o.status} ${o.statusText})`))))),[n,...i]=await Promise.all(r.map(a=>WebAssembly.compile(a)));return{engineModule:n,deviceModules:i,deviceBoxTypes:hD.map(a=>a.boxType),composites:xV,effectComposites:yV}};A();var vD=t=>{let e=Gt.create();return e.writeInt(t.length),t.forEach(r=>{if(e.writeString(r.type),r.type==="new")k.toDataOutput(e,r.uuid),e.writeString(r.name),e.writeInt(r.buffer.byteLength),e.writeBytes(new Int8Array(r.buffer));else if(r.type==="update-primitive"){ze.reconstruct(r.address).write(e);let n=vo[r.primitiveType];e.writeString(n.type),n.encode(e,r.value)}else r.type==="update-pointer"?(ze.reconstruct(r.address).write(e),K(r.target)?(e.writeBoolean(!0),ze.reconstruct(r.target).write(e)):e.writeBoolean(!1)):r.type==="delete"&&k.toDataOutput(e,r.uuid)}),e.toArrayBuffer()};A();A();var kb=class{#e;#t;#r;#i;#n=new Map;#a=[];constructor(e,r){this.#e=e,this.#t=new Uint32Array(r,0,2),this.#r=new Uint32Array(r,8),this.#i=(this.#r.length>>1)-1}send(e,r,n){let i=this.#n.get(e);if(xg(i)){if(i=this.#a.length,i>=64)return console.error(`Too many MIDI devices: ${i}, max is 64`),!1;this.#n.set(e,i),this.#a.push(e),this.#e.postMessage({registerDevice:e,id:i})}let a=Atomics.load(this.#t,0),o=a+1&this.#i;if(o===Atomics.load(this.#t,1))return!1;let s=r.length,c=r[0]??0,u=r[1]??0,f=r[2]??0,v=s<<30|i<<24|c<<16|u<<8|f,m=n|0,w=a<<1;return this.#r[w]=v,this.#r[w+1]=m,Atomics.store(this.#t,0,o),this.#e.postMessage(null),!0}};var Ib=t=>{let e="",r=0,n=()=>(t[r++]??0)&63;for(;r<t.length;){let i=t[r++]??0,a=i<128?i:(i&224)===192?(i&31)<<6|n():(i&240)===224?(i&15)<<12|n()<<6|n():(i&248)===240?(i&7)<<18|n()<<12|n()<<6|n():65533;e+=a<=1114111?String.fromCodePoint(a):"\uFFFD"}return e};var fM=16,Bb=class{#e=new Map;#t=[new Uint8Array(1),new Uint8Array(2),new Uint8Array(3)];#r=null;connect(e,r){this.#r=new kb(e,r)}drain(e,r){let n=e.midi_out_count();if(n===0)return;let i=e.input_reserve(n*fM),a=e.midi_out_take(i),o=this.#r;if(o===null)return;let s=new Uint8Array(r.buffer,i,a*fM).slice(),c=new DataView(s.buffer);for(let u=0;u<a;u++){let f=u*fM,v=c.getUint32(f,!0),m=Math.min(Math.max(c.getUint8(f+7),1),3),w=c.getFloat64(f+8,!0),y=this.#t[m-1];y[0]=c.getUint8(f+4),m>1&&(y[1]=c.getUint8(f+5)),m>2&&(y[2]=c.getUint8(f+6)),o.send(this.#i(e,r,v),y,w)}}#i(e,r,n){let i=this.#e.get(n);if(K(i))return i;let a=e.input_reserve(256),o=e.midi_out_device_id(n,a,256),s=o===0?"":Ib(new Uint8Array(r.buffer,a,o));return this.#e.set(n,s),s}};A();var xD=(t,e)=>{let r=t.panic_message_len();return r===0?"":Ib(new Uint8Array(e.buffer,t.panic_message_ptr(),r))};var wV=["host_pull_events","host_pulse_to_offset","host_bind_parameter","host_bind_broadcast","host_broadcast_ptr","host_broadcast_active","host_update_parameters","host_first_update_position","host_next_update_position","host_resolve_sample","host_observe_sample","host_resolve_soundfont","host_observe_soundfont","host_observe_field","host_observe_target_string","host_bind_sidechain","host_resolve_input","host_self_uuid","host_panic","host_base_frequency"],Tb=(t,e)=>{let r=0,n=0,i=e;for(;;){let a=t[i++];if(r|=(a&127)<<n,(a&128)===0)break;n+=7}return[r>>>0,i]},bV=t=>{let e=WebAssembly.Module.customSections(t,"dylink.0");if(e.length===0)return{memorySize:0,tableSize:0};let r=new Uint8Array(e[0]),n=0;for(;n<r.length;){let i=r[n++],[a,o]=Tb(r,n);if(i===1){let[s,c]=Tb(r,o),[,u]=Tb(r,c),[f]=Tb(r,u);return{memorySize:s,tableSize:f}}n=o+a}return{memorySize:0,tableSize:0}},hM=(t,e,r)=>{let n=r.length,i=t.input_reserve(n),a=new Uint8Array(e.buffer,i,n);for(let o=0;o<n;o++)a[o]=r.charCodeAt(o)&255;return n},yD=(t,e,r,n,i,a,o)=>{let{memorySize:s,tableSize:c}=bV(n),u=t.device_alloc(s),f=c>0?r.grow(c):r.length,v=t.device_alloc(262144),m={memory:e,__indirect_function_table:r,__memory_base:new WebAssembly.Global({value:"i32",mutable:!1},u),__table_base:new WebAssembly.Global({value:"i32",mutable:!1},f),__stack_pointer:new WebAssembly.Global({value:"i32",mutable:!0},v+262144)};for(let O of wV){let C=t[O];if(typeof C!="function")throw new Error(`engine is missing the device host export '${O}'`);m[O]=C}Object.assign(m,o);let w=new WebAssembly.Instance(n,{env:m}).exports;w.__wasm_apply_data_relocs?.(),w.__wasm_call_ctors?.();let y=O=>{if(O===void 0)return 0;let C=r.grow(1);return r.set(C,O),C},P=r.grow(1);r.set(P,w.process_events??w.process);let V=t.device_register(P,w.state_size(a),w.kind(),y(w.init),y(w.parameter_changed),y(w.field_changed),y(w.sample_changed),y(w.soundfont_changed),y(w.reset),y(w.terminate),w.midi_effects_field?.()??0,w.audio_effects_field?.()??0,w.observe_param_collection_field?.()??0,w.observe_sample_collection_field?.()??0);t.device_set_box_type(V,hM(t,e,i))},wD=(t,e,r)=>{t.composite_register(hM(t,e,r.boxType),r.childrenField,r.indexKey,r.excludeKey,r.cellInstrumentField,r.cellMidiField,r.cellAudioField,r.childEnabledKey,r.childMuteKey,r.childSoloKey,r.childVolumeKey,r.childPanKey)},bD=(t,e,r)=>{t.effect_composite_register(hM(t,e,r.boxType),r.kind,r.distributor,r.entriesField,r.indexKey,r.chainField,r.labelKey,r.gainKey,r.panKey,r.muteKey,r.soloKey,r.dryKey,r.wetKey,r.inputTapField,r.crossoverKeys[0],r.crossoverKeys[1],r.crossoverKeys[2])};A();rt();var _V=1,Db=class{retained=[];scheduled=[];sourceToOutput=new Map;reset(){this.retained.length=0,this.scheduled.length=0,this.sourceToOutput.clear()}},FV=(t,e,r,n,i,a,o,s,c)=>{let u=e*40;t.setFloat64(u+0,n,!0),t.setUint32(u+8,0,!0),t.setUint32(u+12,r,!0),t.setUint32(u+16,i,!0),t.setUint32(u+20,a,!0),t.setFloat32(u+24,o,!0),t.setFloat32(u+28,s,!0),t.setFloat64(u+32,c,!0)},mM=(t,e,r,n,i)=>{let a=Math.min(r,i);return new Uint8Array(t,n,a*40).set(new Uint8Array(t,e,a*40)),a},AV=(t,e)=>t==null?"process yielded undefined":typeof t.pitch!="number"||t.pitch!==t.pitch?`Invalid pitch: ${t.pitch}`:t.pitch<0||t.pitch>127?`Pitch out of range: ${t.pitch} (must be 0-127)`:typeof t.velocity!="number"||t.velocity!==t.velocity?`Invalid velocity: ${t.velocity}`:t.velocity<0||t.velocity>1?`Velocity out of range: ${t.velocity} (must be 0-1)`:typeof t.duration!="number"||t.duration!==t.duration?`Invalid duration: ${t.duration}`:t.duration<=0?`Duration must be positive: ${t.duration}`:typeof t.position!="number"||t.position!==t.position?`Invalid position: ${t.position}`:t.position<e?`Position ${t.position} is in the past (block starts at ${e})`:null,FD=(t,e,r,n,i,a,o,s,c,u,f,v,m,w)=>{let y=new DataView(r,n,i*40),P=new DataView(r,a,o*40),V=w?mM(r,n,i,a,o):0,O=(Ee,he,Me,ke,mt,te,_e)=>{if(V>=o)throw new Error(`Note flood: exceeded ${o} output notes per range`);FV(P,V++,Ee,he,Me,ke,mt,te,_e)};if((f&2)!==0){for(let Ee of t.retained)O(1,s,Ee.id,Ee.pitch,0,0,0);t.reset()}for(let Ee=t.retained.length-1;Ee>=0;Ee--){let he=t.retained[Ee],Me=he.position+he.duration;Me<c&&(t.retained.splice(Ee,1),O(1,Me,he.id,he.pitch,0,0,0))}let C=[];for(let Ee=0;Ee<i;Ee++){let he=Ee*40,Me=y.getUint32(he+12,!0),ke=y.getUint32(he+16,!0),mt=y.getFloat64(he+0,!0),te=y.getUint32(he+20,!0);if(Me===0)C.push({gate:!0,id:ke,position:mt,duration:y.getFloat64(he+32,!0),pitch:te,velocity:y.getFloat32(he+24,!0),cent:y.getFloat32(he+28,!0)});else if(Me===1){let _e=t.sourceToOutput.get(ke);if(_e!==void 0){for(let $r of _e){let Hr=t.retained.findIndex(or=>or.id===$r);if(Hr>=0){let or=t.retained.splice(Hr,1)[0];O(1,mt,or.id,or.pitch,0,0,0)}}t.sourceToOutput.delete(ke)}C.push({gate:!1,id:ke,position:mt,pitch:te})}}for(let Ee=t.scheduled.length-1;Ee>=0;Ee--){let he=t.scheduled[Ee];he.position>=s&&he.position<c&&(t.scheduled.splice(Ee,1),O(0,he.position,_D(t,he),he.pitch,he.velocity,he.cent,he.duration))}let G=-1,Y={[Symbol.iterator](){let Ee=0;return{next(){if(Ee>=C.length)return G=-1,{done:!0,value:void 0};let he=C[Ee++];return he.gate&&(G=he.id),{done:!1,value:he}}}}},me={from:s,to:c,bpm:u,s0:v,s1:m,flags:f},ge=0;for(let Ee of e.process(me,Y)){if(++ge>128)throw new Error("Note flood: exceeded 128 notes per block");let he=AV(Ee,s);if(he!==null)throw new Error(he);let Me={position:Ee.position,duration:Ee.duration,pitch:Ee.pitch,velocity:Ee.velocity,cent:Ee.cent??0};if(Me.position>=c){if(t.scheduled.length>=128)throw new Error("Scheduler full: exceeded 128 scheduled notes");t.scheduled.push(Me)}else{let ke=_D(t,Me);if(G>=0){let mt=t.sourceToOutput.get(G);mt===void 0&&(mt=new Set,t.sourceToOutput.set(G,mt)),mt.add(ke)}O(0,Me.position,ke,Me.pitch,Me.velocity,Me.cent,Me.duration)}}return V},_D=(t,e)=>{let r=1073741824+(_V++&1073741823);return t.retained.push({id:r,position:e.position,duration:e.duration,pitch:e.pitch,velocity:e.velocity,cent:e.cent}),r};var Rb=128,EV=375,gM=0,ED=1,SD=2,SV={[gM]:"apparatProcessors",[ED]:"werkstattProcessors",[SD]:"spielwerkProcessors"},PV=0,AD=1e3,vM=class{constructor(e,r,n){this.uuid=e;this.kind=r;this.registryName=n}proc=null;currentUpdate=-1;silenced=!1;paramMappings=new Map;rawParams=new Map;sampleLabels=new Map;sampleHandles=new Map;limiter=null;spielwerk=null;pass=!0;missingCalls=0;warnedMissing=!1},MV=t=>{switch(t.mapping){case"unipolar":return E.unipolar();case"linear":return E.linear(t.min,t.max);case"exp":return E.exponential(t.min,t.max);case"int":return E.linearInteger(t.min,t.max);case"bool":return E.linearInteger(0,1);default:return E.unipolar()}},NV=(t,e,r)=>{for(let n=0;n<t.length;n++){let i=t[n];for(let a=e;a<r;a++){let o=i[a];if(o!==o)return`NaN detected in output channel ${n} at sample ${a}`;if(o>AD||o<-AD)return`Signal overflow in channel ${n} at sample ${a} (amplitude: ${o.toFixed(1)})`}}return null},Cb=class{#e;#t;#r;#i;#n=new Map;#a=new Map;#s=1;constructor(e,r,n,i=()=>{}){this.#e=e,this.#t=r,this.#r=n,this.#i=i}imports(){return{host_script_create:(e,r,n)=>this.#o(e,r,n),host_script_audio:(e,r,n,i,a,o,s,c,u,f,v,m)=>this.#l(e,r,n,i,a,o,s,c,u,f,v,m),host_script_note_on:(e,r,n,i,a)=>this.#u(e,r,n,i,a),host_script_note_off:(e,r)=>this.#m(e,r),host_script_reset:e=>this.#v(e),host_script_param:(e,r,n,i)=>this.#g(e,r,n,i),host_script_sample:(e,r,n,i)=>this.#p(e,r,n,i),host_script_notes:(e,r,n,i,a,o,s,c,u,f,v)=>this.#y(e,r,n,i,a,o,s,c,u,f,v),host_script_release:e=>this.#h(e)}}#o(e,r,n){let i=k.toString(new Uint8Array(this.#e.buffer,e,16).slice()),a=this.#a.get(i);K(a)&&this.#h(a);let o=this.#s++;return this.#n.set(o,new vM(i,r,SV[r]??"werkstattProcessors")),this.#a.set(i,o),o}#c(e){let r=globalThis.openDAW?.[e.registryName]?.[e.uuid];if(r===void 0&&e.currentUpdate===-1)return!e.warnedMissing&&++e.missingCalls>EV&&(e.warnedMissing=!0,this.#i(e.uuid,`No Processor registered at globalThis.openDAW.${e.registryName}[${e.uuid}] \u2014 device is rendering silence`)),null;if(r!==void 0&&r.update!==e.currentUpdate){e.pass=r.pass!==!1;try{let n=new r.create;if(e.paramMappings=new Map(r.params.map(i=>[i.index,{label:i.label,mapping:MV(i)}])),e.sampleLabels=new Map(r.samples.map(i=>[i.index,i.label])),e.kind===gM){n.samples={};for(let i of e.sampleLabels.values())n.samples[i]=null;e.limiter??=new Gg(this.#r)}e.kind===SD&&(e.spielwerk=new Db),e.proc=n,e.currentUpdate=r.update,e.silenced=!1;for(let[i,a]of e.rawParams)this.#d(e,i,a.kind,a.value);for(let[i,a]of e.sampleHandles)this.#f(e,i,a)}catch(n){this.#x(e,`Failed to instantiate Processor: ${n}`)}}return e.silenced?null:e.proc}#l(e,r,n,i,a,o,s,c,u,f,v,m){let w=this.#n.get(e);if(w===void 0)return 1;let y=this.#c(w);if(y===null)return 1;let P=this.#e.buffer,V=new Float32Array(P,i,Rb),O=new Float32Array(P,a,Rb),C={index:c,p0:u,p1:f,s0:o,s1:s,bpm:v,flags:m};try{if(w.kind===ED){let Y={src:[new Float32Array(P,r,Rb),new Float32Array(P,n,Rb)],out:[V,O]};y.process(Y,C)}else{for(let[Y,me]of w.sampleHandles)this.#f(w,Y,me);V.fill(0,o,s),O.fill(0,o,s),y.process([V,O],C)}}catch(Y){return this.#x(w,`Runtime error: ${Y}`),1}let G=NV([V,O],o,s);return G!==null?(V.fill(0,o,s),O.fill(0,o,s),this.#x(w,G),1):(w.kind===gM&&w.limiter!==null&&w.limiter.replace({channels:()=>[V,O]},o,s),0)}#u(e,r,n,i,a){let o=this.#n.get(e);o!==void 0&&this.#c(o)?.noteOn?.(r,n,i,a)}#m(e,r){let n=this.#n.get(e);n!==void 0&&this.#c(n)?.noteOff?.(r)}#v(e){let r=this.#n.get(e);r?.proc?.reset?.(),r?.spielwerk?.reset()}#g(e,r,n,i){let a=this.#n.get(e);a!==void 0&&(a.rawParams.set(r,{kind:n,value:i}),this.#d(a,r,n,i))}#d(e,r,n,i){let a=e.paramMappings.get(r);if(a===void 0)return;let o=n===PV?a.mapping.y(i):i;e.proc?.paramChanged?.(a.label,o)}#p(e,r,n,i){let a=this.#n.get(e);if(a===void 0)return;let o=i!==0?n:-1;a.sampleHandles.set(r,o),this.#f(a,r,o)}#y(e,r,n,i,a,o,s,c,u,f,v){let m=this.#n.get(e);if(m===void 0)return 0;let w=()=>m.pass?mM(this.#e.buffer,r,n,i,a):0,y=this.#c(m);if(y===null||m.spielwerk===null)return w();try{return FD(m.spielwerk,y,this.#e.buffer,r,n,i,a,o,s,c,u,f,v,m.pass)}catch(P){return this.#x(m,`Runtime error: ${P}`),w()}}#f(e,r,n){if(e.proc===null)return;let i=e.sampleLabels.get(r);if(i===void 0)return;if(n<0){e.proc.samples[i]=null;return}let a=this.#t.input_reserve(16);if(this.#t.host_resolve_sample(n,a)===0){e.proc.samples[i]=null;return}let o=new DataView(this.#e.buffer,a,16),s=o.getUint32(0,!0),c=o.getUint32(4,!0),u=o.getUint32(8,!0),f=o.getFloat32(12,!0),v=[];for(let m=0;m<u;m++)v.push(new Float32Array(this.#e.buffer,s+m*c*4,c));e.proc.samples[i]={sampleRate:f,numberOfFrames:c,numberOfChannels:u,frames:v}}#x(e,r){e.silenced=!0,this.#i(e.uuid,r)}#h(e){let r=this.#n.get(e);K(r)&&(this.#n.delete(e),this.#a.get(r.uuid)===e&&this.#a.delete(r.uuid))}liveBridgeCount(){return this.#n.size}};A();var zb=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},st=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ct,Vc,Uc,og,sg=class t{constructor(e,r=128){if(Ct.set(this,void 0),Vc.set(this,void 0),Uc.set(this,void 0),og.set(this,void 0),zb(this,Ct,e,"f"),zb(this,og,r,"f"),zb(this,Vc,e._malloc(r*4),"f"),zb(this,Uc,e._malloc(r*4),"f"),st(this,Vc,"f")===0||st(this,Uc,"f")===0)throw new Error("Failed to allocate audio buffers")}static async create(e,r=128){let n=await e();return new t(n,r)}static fromModule(e,r=128){return new t(e,r)}dispose(){st(this,Ct,"f")._free(st(this,Vc,"f")),st(this,Ct,"f")._free(st(this,Uc,"f"))}createInstance(){return st(this,Ct,"f")._nam_createInstance()}destroyInstance(e){st(this,Ct,"f")._nam_destroyInstance(e)}getInstanceCount(){return st(this,Ct,"f")._nam_getInstanceCount()}loadModel(e,r){let n=st(this,Ct,"f").lengthBytesUTF8(r)+1,i=st(this,Ct,"f")._malloc(n);if(i===0)return!1;try{return st(this,Ct,"f").stringToUTF8(r,i,n),st(this,Ct,"f")._nam_loadModel(e,i)}finally{st(this,Ct,"f")._free(i)}}unloadModel(e){st(this,Ct,"f")._nam_unloadModel(e)}hasModel(e){return st(this,Ct,"f")._nam_hasModel(e)}process(e,r,n){let i=Math.min(r.length,n.length,st(this,og,"f")),a=st(this,Vc,"f")>>2,o=st(this,Uc,"f")>>2;st(this,Ct,"f").HEAPF32.set(r.subarray(0,i),a),st(this,Ct,"f")._nam_process(e,st(this,Vc,"f"),st(this,Uc,"f"),i),n.set(st(this,Ct,"f").HEAPF32.subarray(o,o+i))}processInPlace(e,r){this.process(e,r,r)}setSampleRate(e){st(this,Ct,"f")._nam_setSampleRate(e)}getSampleRate(){return st(this,Ct,"f")._nam_getSampleRate()}setMaxBufferSize(e){st(this,Ct,"f")._nam_setMaxBufferSize(e)}getMaxBufferSize(){return st(this,Ct,"f")._nam_getMaxBufferSize()}getModelLoudness(e){return st(this,Ct,"f")._nam_getModelLoudness(e)}hasModelLoudness(e){return st(this,Ct,"f")._nam_hasModelLoudness(e)}reset(e){st(this,Ct,"f")._nam_reset(e)}get bufferSize(){return st(this,og,"f")}};Ct=new WeakMap,Vc=new WeakMap,Uc=new WeakMap,og=new WeakMap;var xM;(function(t){t.parse=e=>JSON.parse(e),t.isArchitecture2=e=>e.architecture==="WaveNet"&&e.config.layers!==void 0&&e.config.layers.some(r=>r.gating_mode!==void 0||r.bottleneck!==void 0)})(xM||(xM={}));var $V=(()=>{var t=import.meta.url;return(function(e={}){var r=e,n,i;r.ready=new Promise((d,h)=>{n=d,i=h});var a=Object.assign({},r),o=[],s="./this.program",c=(d,h)=>{throw h},u=typeof window=="object",f=typeof importScripts=="function",v=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",m="";function w(d){return r.locateFile?r.locateFile(d,m):m+d}var y,P,V;(u||f)&&(f?m=self.location.href:typeof document<"u"&&document.currentScript&&(m=document.currentScript.src),t&&(m=t),m.indexOf("blob:")!==0?m=m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):m="",y=d=>{var h=new XMLHttpRequest;return h.open("GET",d,!1),h.send(null),h.responseText},f&&(V=d=>{var h=new XMLHttpRequest;return h.open("GET",d,!1),h.responseType="arraybuffer",h.send(null),new Uint8Array(h.response)}),P=(d,h,g)=>{var b=new XMLHttpRequest;b.open("GET",d,!0),b.responseType="arraybuffer",b.onload=()=>{if(b.status==200||b.status==0&&b.response){h(b.response);return}g()},b.onerror=g,b.send(null)});var O=r.print||console.log.bind(console),C=r.printErr||console.error.bind(console);Object.assign(r,a),a=null,r.arguments&&(o=r.arguments),r.thisProgram&&(s=r.thisProgram),r.quit&&(c=r.quit);var G;r.wasmBinary&&(G=r.wasmBinary),typeof WebAssembly!="object"&&Kc("no native wasm support detected");var Y,me=!1,ge;function Ee(d,h){d||Kc(h)}var he,Me,ke,mt,te,_e,$r,Hr;function or(){var d=Y.buffer;r.HEAP8=he=new Int8Array(d),r.HEAP16=ke=new Int16Array(d),r.HEAPU8=Me=new Uint8Array(d),r.HEAPU16=mt=new Uint16Array(d),r.HEAP32=te=new Int32Array(d),r.HEAPU32=_e=new Uint32Array(d),r.HEAPF32=$r=new Float32Array(d),r.HEAPF64=Hr=new Float64Array(d)}var Dp=[],cg=[],tl=[],jb=!1;function Kb(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)jc(r.preRun.shift());Gb(Dp)}function Rp(){jb=!0,!r.noFSInit&&!x.init.initialized&&x.init(),x.ignorePermissions=!1,Go.init(),Gb(cg)}function Wb(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)CD(r.postRun.shift());Gb(tl)}function jc(d){Dp.unshift(d)}function RD(d){cg.unshift(d)}function CD(d){tl.unshift(d)}var rl=0,Lb=null,Cp=null;function RV(d){return d}function Zb(d){rl++,r.monitorRunDependencies?.(rl)}function ug(d){if(rl--,r.monitorRunDependencies?.(rl),rl==0&&(Lb!==null&&(clearInterval(Lb),Lb=null),Cp)){var h=Cp;Cp=null,h()}}function Kc(d){r.onAbort?.(d),d="Aborted("+d+")",C(d),me=!0,ge=1,d+=". Build with -sASSERTIONS for more info.";var h=new WebAssembly.RuntimeError(d);throw i(h),h}var zD="data:application/octet-stream;base64,",AM=d=>d.startsWith(zD),il;r.locateFile?(il="nam.wasm",AM(il)||(il=w(il))):il=new URL("nam.wasm",import.meta.url).href;function EM(d){if(d==il&&G)return new Uint8Array(G);if(V)return V(d);throw"both async and sync fetching of the wasm failed"}function OD(d){return!G&&(u||f)&&typeof fetch=="function"?fetch(d,{credentials:"same-origin"}).then(h=>{if(!h.ok)throw"failed to load wasm binary file at '"+d+"'";return h.arrayBuffer()}).catch(()=>EM(d)):Promise.resolve().then(()=>EM(d))}function SM(d,h,g){return OD(d).then(b=>WebAssembly.instantiate(b,h)).then(b=>b).then(g,b=>{C(`failed to asynchronously prepare wasm: ${b}`),Kc(b)})}function VD(d,h,g,b){return!d&&typeof WebAssembly.instantiateStreaming=="function"&&!AM(h)&&typeof fetch=="function"?fetch(h,{credentials:"same-origin"}).then(M=>{var z=WebAssembly.instantiateStreaming(M,g);return z.then(b,function(U){return C(`wasm streaming compile failed: ${U}`),C("falling back to ArrayBuffer instantiation"),SM(h,g,b)})}):SM(h,g,b)}function UD(){var d={a:bR};function h(b,M){return wt=b.exports,Y=wt.l,or(),RD(wt.m),ug("wasm-instantiate"),wt}Zb("wasm-instantiate");function g(b){h(b.instance)}if(r.instantiateWasm)try{return r.instantiateWasm(d,h)}catch(b){C(`Module.instantiateWasm callback failed with error: ${b}`),i(b)}return VD(G,il,d,g).catch(i),{}}var tt,kr,Gb=d=>{for(;d.length>0;)d.shift()(r)},CV=r.noExitRuntime||!0;function jD(d){this.excPtr=d,this.ptr=d-24,this.set_type=function(h){_e[this.ptr+4>>2]=h},this.get_type=function(){return _e[this.ptr+4>>2]},this.set_destructor=function(h){_e[this.ptr+8>>2]=h},this.get_destructor=function(){return _e[this.ptr+8>>2]},this.set_caught=function(h){h=h?1:0,he[this.ptr+12>>0]=h},this.get_caught=function(){return he[this.ptr+12>>0]!=0},this.set_rethrown=function(h){h=h?1:0,he[this.ptr+13>>0]=h},this.get_rethrown=function(){return he[this.ptr+13>>0]!=0},this.init=function(h,g){this.set_adjusted_ptr(0),this.set_type(h),this.set_destructor(g)},this.set_adjusted_ptr=function(h){_e[this.ptr+16>>2]=h},this.get_adjusted_ptr=function(){return _e[this.ptr+16>>2]},this.get_exception_ptr=function(){var h=VM(this.get_type());if(h)return _e[this.excPtr>>2];var g=this.get_adjusted_ptr();return g!==0?g:this.excPtr}}var PM=0,KD=0,WD=(d,h,g)=>{var b=new jD(d);throw b.init(h,g),PM=d,KD++,PM},LD=()=>{Kc("")},ZD=(d,h,g)=>Me.copyWithin(d,h,h+g),GD=()=>536870912,HD=d=>{var h=Y.buffer,g=(d-h.byteLength+65535)/65536;try{return Y.grow(g),or(),1}catch{}},qD=d=>{var h=Me.length;d>>>=0;var g=GD();if(d>g)return!1;for(var b=(ce,Ue)=>ce+(Ue-ce%Ue)%Ue,M=1;M<=4;M*=2){var z=h*(1+.2/M);z=Math.min(z,d+100663296);var U=Math.min(g,b(Math.max(d,z),65536)),L=HD(U);if(L)return!0}return!1},Hb={},JD=()=>s||"./this.program",zp=()=>{if(!zp.strings){var d=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",h={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:d,_:JD()};for(var g in Hb)Hb[g]===void 0?delete h[g]:h[g]=Hb[g];var b=[];for(var g in h)b.push(`${g}=${h[g]}`);zp.strings=b}return zp.strings},YD=(d,h)=>{for(var g=0;g<d.length;++g)he[h++>>0]=d.charCodeAt(g);he[h>>0]=0},gt={isAbs:d=>d.charAt(0)==="/",splitPath:d=>{var h=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return h.exec(d).slice(1)},normalizeArray:(d,h)=>{for(var g=0,b=d.length-1;b>=0;b--){var M=d[b];M==="."?d.splice(b,1):M===".."?(d.splice(b,1),g++):g&&(d.splice(b,1),g--)}if(h)for(;g;g--)d.unshift("..");return d},normalize:d=>{var h=gt.isAbs(d),g=d.substr(-1)==="/";return d=gt.normalizeArray(d.split("/").filter(b=>!!b),!h).join("/"),!d&&!h&&(d="."),d&&g&&(d+="/"),(h?"/":"")+d},dirname:d=>{var h=gt.splitPath(d),g=h[0],b=h[1];return!g&&!b?".":(b&&(b=b.substr(0,b.length-1)),g+b)},basename:d=>{if(d==="/")return"/";d=gt.normalize(d),d=d.replace(/\/$/,"");var h=d.lastIndexOf("/");return h===-1?d:d.substr(h+1)},join:function(){var d=Array.prototype.slice.call(arguments);return gt.normalize(d.join("/"))},join2:(d,h)=>gt.normalize(d+"/"+h)},XD=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return d=>crypto.getRandomValues(d);Kc("initRandomDevice")},MM=d=>(MM=XD())(d),po={resolve:function(){for(var d="",h=!1,g=arguments.length-1;g>=-1&&!h;g--){var b=g>=0?arguments[g]:x.cwd();if(typeof b!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";d=b+"/"+d,h=gt.isAbs(b)}return d=gt.normalizeArray(d.split("/").filter(M=>!!M),!h).join("/"),(h?"/":"")+d||"."},relative:(d,h)=>{d=po.resolve(d).substr(1),h=po.resolve(h).substr(1);function g(Ue){for(var et=0;et<Ue.length&&Ue[et]==="";et++);for(var ut=Ue.length-1;ut>=0&&Ue[ut]==="";ut--);return et>ut?[]:Ue.slice(et,ut-et+1)}for(var b=g(d.split("/")),M=g(h.split("/")),z=Math.min(b.length,M.length),U=z,L=0;L<z;L++)if(b[L]!==M[L]){U=L;break}for(var ce=[],L=U;L<b.length;L++)ce.push("..");return ce=ce.concat(M.slice(U)),ce.join("/")}},NM=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Wc=(d,h,g)=>{for(var b=h+g,M=h;d[M]&&!(M>=b);)++M;if(M-h>16&&d.buffer&&NM)return NM.decode(d.subarray(h,M));for(var z="";h<M;){var U=d[h++];if(!(U&128)){z+=String.fromCharCode(U);continue}var L=d[h++]&63;if((U&224)==192){z+=String.fromCharCode((U&31)<<6|L);continue}var ce=d[h++]&63;if((U&240)==224?U=(U&15)<<12|L<<6|ce:U=(U&7)<<18|L<<12|ce<<6|d[h++]&63,U<65536)z+=String.fromCharCode(U);else{var Ue=U-65536;z+=String.fromCharCode(55296|Ue>>10,56320|Ue&1023)}}return z},qb=[],dg=d=>{for(var h=0,g=0;g<d.length;++g){var b=d.charCodeAt(g);b<=127?h++:b<=2047?h+=2:b>=55296&&b<=57343?(h+=4,++g):h+=3}return h},Jb=(d,h,g,b)=>{if(!(b>0))return 0;for(var M=g,z=g+b-1,U=0;U<d.length;++U){var L=d.charCodeAt(U);if(L>=55296&&L<=57343){var ce=d.charCodeAt(++U);L=65536+((L&1023)<<10)|ce&1023}if(L<=127){if(g>=z)break;h[g++]=L}else if(L<=2047){if(g+1>=z)break;h[g++]=192|L>>6,h[g++]=128|L&63}else if(L<=65535){if(g+2>=z)break;h[g++]=224|L>>12,h[g++]=128|L>>6&63,h[g++]=128|L&63}else{if(g+3>=z)break;h[g++]=240|L>>18,h[g++]=128|L>>12&63,h[g++]=128|L>>6&63,h[g++]=128|L&63}}return h[g]=0,g-M};function pg(d,h,g){var b=g>0?g:dg(d)+1,M=new Array(b),z=Jb(d,M,0,M.length);return h&&(M.length=z),M}var QD=()=>{if(!qb.length){var d=null;if(typeof window<"u"&&typeof window.prompt=="function"?(d=window.prompt("Input: "),d!==null&&(d+=`
115
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of t.seen.entries()){let s=o[1];if(e===o[0]){a(o);continue}if(t.external){let u=t.external.registry.get(o[0])?.id;if(e!==o[0]&&u){a(o);continue}}if(t.metadataRegistry.get(o[0])?.id){a(o);continue}if(s.cycle){a(o);continue}if(s.count>1&&t.reused==="ref"){a(o);continue}}}function Xs(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=s=>{let c=t.seen.get(s);if(c.ref===null)return;let u=c.def??c.schema,f={...u},v=c.ref;if(c.ref=null,v){n(v);let w=t.seen.get(v),y=w.schema;if(y.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(y)):Object.assign(u,y),Object.assign(u,f),s._zod.parent===v)for(let V in u)V==="$ref"||V==="allOf"||V in f||delete u[V];if(y.$ref&&w.def)for(let V in u)V==="$ref"||V==="allOf"||V in w.def&&JSON.stringify(u[V])===JSON.stringify(w.def[V])&&delete u[V]}let m=s._zod.parent;if(m&&m!==v){n(m);let w=t.seen.get(m);if(w?.schema.$ref&&(u.$ref=w.schema.$ref,w.def))for(let y in u)y==="$ref"||y==="allOf"||y in w.def&&JSON.stringify(u[y])===JSON.stringify(w.def[y])&&delete u[y]}t.override({zodSchema:s,jsonSchema:u,path:c.path??[]})};for(let s of[...t.seen.entries()].reverse())n(s[0]);let i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let s=t.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(s)}Object.assign(i,r.def??r.schema);let a=t.metadataRegistry.get(e)?.id;a!==void 0&&i.id===a&&delete i.id;let o=t.external?.defs??{};for(let s of t.seen.entries()){let c=s[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,o[c.defId]=c.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let s=JSON.parse(JSON.stringify(i));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:Ap(e,"input",t.processors),output:Ap(e,"output",t.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function wi(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return wi(n.element,r);if(n.type==="set")return wi(n.valueType,r);if(n.type==="lazy")return wi(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return wi(n.innerType,r);if(n.type==="intersection")return wi(n.left,r)||wi(n.right,r);if(n.type==="record"||n.type==="map")return wi(n.keyType,r)||wi(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:wi(n.in,r)||wi(n.out,r);if(n.type==="object"){for(let i in n.shape)if(wi(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(wi(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(wi(i,r))return!0;return!!(n.rest&&wi(n.rest,r))}return!1}var fS=(t,e={})=>r=>{let n=Js({...r,processors:e});return ht(t,n),Ys(n,t),Xs(n,t)},Ap=(t,e,r={})=>n=>{let{libraryOptions:i,target:a}=n??{},o=Js({...i??{},target:a,io:e,processors:r});return ht(t,o),Ys(o,t),Xs(o,t)};var R4={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},hS=(t,e,r,n)=>{let i=r;i.type="string";let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:u}=t._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof o=="number"&&(i.maxLength=o),s&&(i.format=R4[s]??s,i.format===""&&delete i.format,s==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){let f=[...c];f.length===1?i.pattern=f[0].source:f.length>1&&(i.allOf=[...f.map(v=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:v.source}))])}},mS=(t,e,r,n)=>{let i=r,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:f}=t._zod.bag;typeof s=="string"&&s.includes("int")?i.type="integer":i.type="number";let v=typeof f=="number"&&f>=(a??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(o??Number.POSITIVE_INFINITY),w=e.target==="draft-04"||e.target==="openapi-3.0";v?w?(i.minimum=f,i.exclusiveMinimum=!0):i.exclusiveMinimum=f:typeof a=="number"&&(i.minimum=a),m?w?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u:typeof o=="number"&&(i.maximum=o),typeof c=="number"&&(i.multipleOf=c)},gS=(t,e,r,n)=>{r.type="boolean"},vS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},xS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},yS=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},wS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},bS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},_S=(t,e,r,n)=>{r.not={}},FS=(t,e,r,n)=>{},AS=(t,e,r,n)=>{},ES=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},SS=(t,e,r,n)=>{let i=t._zod.def,a=Sm(i.entries);a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),r.enum=a},PS=(t,e,r,n)=>{let i=t._zod.def,a=[];for(let o of i.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let o=a[0];r.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[o]:r.const=o}else a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),a.every(o=>typeof o=="boolean")&&(r.type="boolean"),a.every(o=>o===null)&&(r.type="null"),r.enum=a},MS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},NS=(t,e,r,n)=>{let i=r,a=t._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=a.source},$S=(t,e,r,n)=>{let i=r,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:s,mime:c}=t._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(i,a)},kS=(t,e,r,n)=>{r.type="boolean"},IS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},BS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},TS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},DS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},RS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},CS=(t,e,r,n)=>{let i=r,a=t._zod.def,{minimum:o,maximum:s}=t._zod.bag;typeof o=="number"&&(i.minItems=o),typeof s=="number"&&(i.maxItems=s),i.type="array",i.items=ht(a.element,e,{...n,path:[...n.path,"items"]})},zS=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="object",i.properties={};let o=a.shape;for(let u in o)i.properties[u]=ht(o[u],e,{...n,path:[...n.path,"properties",u]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(u=>{let f=a.shape[u]._zod;return e.io==="input"?f.optin===void 0:f.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=ht(a.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},H0=(t,e,r,n)=>{let i=t._zod.def,a=i.inclusive===!1,o=i.options.map((s,c)=>ht(s,e,{...n,path:[...n.path,a?"oneOf":"anyOf",c]}));a?r.oneOf=o:r.anyOf=o},OS=(t,e,r,n)=>{let i=t._zod.def,a=ht(i.left,e,{...n,path:[...n.path,"allOf",0]}),o=ht(i.right,e,{...n,path:[...n.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];r.allOf=c},VS=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="array";let o=e.target==="draft-2020-12"?"prefixItems":"items",s=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=a.items.map((m,w)=>ht(m,e,{...n,path:[...n.path,o,w]})),u=a.rest?ht(a.rest,e,{...n,path:[...n.path,s,...e.target==="openapi-3.0"?[a.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=c,u&&(i.items=u)):e.target==="openapi-3.0"?(i.items={anyOf:c},u&&i.items.anyOf.push(u),i.minItems=c.length,u||(i.maxItems=c.length)):(i.items=c,u&&(i.additionalItems=u));let{minimum:f,maximum:v}=t._zod.bag;typeof f=="number"&&(i.minItems=f),typeof v=="number"&&(i.maxItems=v)},US=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="object";let o=a.keyType,c=o._zod.bag?.patterns;if(a.mode==="loose"&&c&&c.size>0){let f=ht(a.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let v of c)i.patternProperties[v.source]=f}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=ht(a.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=ht(a.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let u=o._zod.values;if(u){let f=[...u].filter(v=>typeof v=="string"||typeof v=="number");f.length>0&&(i.required=f)}},jS=(t,e,r,n)=>{let i=t._zod.def,a=ht(i.innerType,e,n),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=i.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},KS=(t,e,r,n)=>{let i=t._zod.def;ht(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},WS=(t,e,r,n)=>{let i=t._zod.def;ht(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},LS=(t,e,r,n)=>{let i=t._zod.def;ht(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},ZS=(t,e,r,n)=>{let i=t._zod.def;ht(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=o},GS=(t,e,r,n)=>{let i=t._zod.def,a=i.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?a?i.out:i.in:i.out;ht(o,e,n);let s=e.seen.get(t);s.ref=o},HS=(t,e,r,n)=>{let i=t._zod.def;ht(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.readOnly=!0},qS=(t,e,r,n)=>{let i=t._zod.def;ht(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},q0=(t,e,r,n)=>{let i=t._zod.def;ht(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},JS=(t,e,r,n)=>{let i=t._zod.innerType;ht(i,e,n);let a=e.seen.get(t);a.ref=i},G0={string:hS,number:mS,boolean:gS,bigint:vS,symbol:xS,null:yS,undefined:wS,void:bS,never:_S,any:FS,unknown:AS,date:ES,enum:SS,literal:PS,nan:MS,template_literal:NS,file:$S,success:kS,custom:IS,function:BS,transform:TS,map:DS,set:RS,array:CS,object:zS,union:H0,intersection:OS,tuple:VS,record:US,nullable:jS,nonoptional:KS,default:WS,prefault:LS,catch:ZS,pipe:GS,readonly:HS,promise:qS,optional:q0,lazy:JS};function J0(t,e){if("_idmap"in t){let n=t,i=Js({...e,processors:G0}),a={};for(let c of n._idmap.entries()){let[u,f]=c;ht(f,i)}let o={},s={registry:n,uri:e?.uri,defs:a};i.external=s;for(let c of n._idmap.entries()){let[u,f]=c;Ys(i,f),o[u]=Xs(i,f)}if(Object.keys(a).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[c]:a}}return{schemas:o}}let r=Js({...e,processors:G0});return ht(t,r),Ys(r,t),Xs(r,t)}var Y0=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Js({processors:G0,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return ht(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Ys(this.ctx,e);let n=Xs(this.ctx,e),{"~standard":i,...a}=n;return a}};var ST={};var Wm={};_a(Wm,{ZodAny:()=>wP,ZodArray:()=>AP,ZodBase64:()=>xb,ZodBase64URL:()=>yb,ZodBigInt:()=>Ip,ZodBigIntFormat:()=>_b,ZodBoolean:()=>kp,ZodCIDRv4:()=>gb,ZodCIDRv6:()=>vb,ZodCUID:()=>cb,ZodCUID2:()=>ub,ZodCatch:()=>ZP,ZodCodec:()=>rg,ZodCustom:()=>ig,ZodCustomStringFormat:()=>Np,ZodDate:()=>Ym,ZodDefault:()=>VP,ZodDiscriminatedUnion:()=>SP,ZodE164:()=>wb,ZodEmail:()=>ob,ZodEmoji:()=>sb,ZodEnum:()=>Pp,ZodExactOptional:()=>CP,ZodFile:()=>DP,ZodFunction:()=>rM,ZodGUID:()=>Zm,ZodIPv4:()=>hb,ZodIPv6:()=>mb,ZodIntersection:()=>PP,ZodJWT:()=>bb,ZodKSUID:()=>fb,ZodLazy:()=>QP,ZodLiteral:()=>TP,ZodMAC:()=>fP,ZodMap:()=>IP,ZodNaN:()=>HP,ZodNanoID:()=>lb,ZodNever:()=>_P,ZodNonOptional:()=>Mb,ZodNull:()=>xP,ZodNullable:()=>OP,ZodNumber:()=>$p,ZodNumberFormat:()=>Oc,ZodObject:()=>Qm,ZodOptional:()=>Pb,ZodPipe:()=>tg,ZodPrefault:()=>jP,ZodPreprocess:()=>qP,ZodPromise:()=>tM,ZodReadonly:()=>JP,ZodRecord:()=>Sp,ZodSet:()=>BP,ZodString:()=>Mp,ZodStringFormat:()=>yt,ZodSuccess:()=>LP,ZodSymbol:()=>gP,ZodTemplateLiteral:()=>XP,ZodTransform:()=>RP,ZodTuple:()=>NP,ZodType:()=>Le,ZodULID:()=>db,ZodURL:()=>Jm,ZodUUID:()=>uo,ZodUndefined:()=>vP,ZodUnion:()=>eg,ZodUnknown:()=>bP,ZodVoid:()=>FP,ZodXID:()=>pb,ZodXor:()=>EP,_ZodString:()=>ab,_default:()=>UP,_function:()=>D2,any:()=>p2,array:()=>Xm,base64:()=>qT,base64url:()=>JT,bigint:()=>s2,boolean:()=>mP,catch:()=>GP,check:()=>R2,cidrv4:()=>GT,cidrv6:()=>HT,codec:()=>k2,cuid:()=>OT,cuid2:()=>VT,custom:()=>C2,date:()=>h2,describe:()=>z2,discriminatedUnion:()=>w2,e164:()=>YT,email:()=>NT,emoji:()=>CT,enum:()=>Eb,exactOptional:()=>zP,file:()=>P2,float32:()=>i2,float64:()=>n2,function:()=>D2,guid:()=>$T,hash:()=>r2,hex:()=>t2,hostname:()=>e2,httpUrl:()=>RT,instanceof:()=>V2,int:()=>ib,int32:()=>a2,int64:()=>l2,intersection:()=>MP,invertCodec:()=>I2,ipv4:()=>WT,ipv6:()=>ZT,json:()=>j2,jwt:()=>XT,keyof:()=>m2,ksuid:()=>KT,lazy:()=>eM,literal:()=>S2,looseObject:()=>x2,looseRecord:()=>_2,mac:()=>LT,map:()=>F2,meta:()=>O2,nan:()=>$2,nanoid:()=>zT,nativeEnum:()=>E2,never:()=>Fb,nonoptional:()=>WP,null:()=>yP,nullable:()=>Hm,nullish:()=>M2,number:()=>hP,object:()=>g2,optional:()=>Gm,partialRecord:()=>b2,pipe:()=>nb,prefault:()=>KP,preprocess:()=>K2,promise:()=>T2,readonly:()=>YP,record:()=>kP,refine:()=>iM,set:()=>A2,strictObject:()=>v2,string:()=>Lm,stringFormat:()=>QT,stringbool:()=>U2,success:()=>N2,superRefine:()=>nM,symbol:()=>u2,templateLiteral:()=>B2,transform:()=>Sb,tuple:()=>$P,uint32:()=>o2,uint64:()=>c2,ulid:()=>UT,undefined:()=>d2,union:()=>Ab,unknown:()=>zc,url:()=>DT,uuid:()=>kT,uuidv4:()=>IT,uuidv6:()=>BT,uuidv7:()=>TT,void:()=>f2,xid:()=>jT,xor:()=>y2});var X0={};_a(X0,{endsWith:()=>gp,gt:()=>lo,gte:()=>yi,includes:()=>hp,length:()=>Cc,lowercase:()=>pp,lt:()=>so,lte:()=>sn,maxLength:()=>Rc,maxSize:()=>qs,mime:()=>vp,minLength:()=>Wo,minSize:()=>co,multipleOf:()=>Hs,negative:()=>K0,nonnegative:()=>L0,nonpositive:()=>W0,normalize:()=>xp,overwrite:()=>ba,positive:()=>j0,property:()=>Z0,regex:()=>dp,size:()=>Dc,slugify:()=>_p,startsWith:()=>mp,toLowerCase:()=>wp,toUpperCase:()=>bp,trim:()=>yp,uppercase:()=>fp});var Ep={};_a(Ep,{ZodISODate:()=>eb,ZodISODateTime:()=>Q0,ZodISODuration:()=>rb,ZodISOTime:()=>tb,date:()=>XS,datetime:()=>YS,duration:()=>eP,time:()=>QS});var Q0=R("ZodISODateTime",(t,e)=>{MA.init(t,e),yt.init(t,e)});function YS(t){return IE(Q0,t)}var eb=R("ZodISODate",(t,e)=>{NA.init(t,e),yt.init(t,e)});function XS(t){return BE(eb,t)}var tb=R("ZodISOTime",(t,e)=>{$A.init(t,e),yt.init(t,e)});function QS(t){return TE(tb,t)}var rb=R("ZodISODuration",(t,e)=>{kA.init(t,e),yt.init(t,e)});function eP(t){return DE(rb,t)}var PT=(t,e)=>{km.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>Bm(t,r)},flatten:{value:r=>Im(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,rp,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,rp,2)}},isEmpty:{get(){return t.issues.length===0}}})},z4=R("ZodError",PT),Oi=R("ZodError",PT,{Parent:Error});var tP=ap(Oi),rP=op(Oi),iP=sp(Oi),nP=lp(Oi),aP=Jw(Oi),oP=Yw(Oi),sP=Xw(Oi),lP=Qw(Oi),cP=e0(Oi),uP=t0(Oi),dP=r0(Oi),pP=i0(Oi);var MT=new WeakMap;function qm(t,e,r){let n=Object.getPrototypeOf(t),i=MT.get(n);if(i||(i=new Set,MT.set(n,i)),!i.has(e)){i.add(e);for(let a in r){let o=r[a];Object.defineProperty(n,a,{configurable:!0,enumerable:!1,get(){let s=o.bind(this);return Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s}),s},set(s){Object.defineProperty(this,a,{configurable:!0,writable:!0,enumerable:!0,value:s})}})}}}var Le=R("ZodType",(t,e)=>(Ce.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Ap(t,"input"),output:Ap(t,"output")}}),t.toJSONSchema=fS(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>tP(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>iP(t,r,n),t.parseAsync=async(r,n)=>rP(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>nP(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>aP(t,r,n),t.decode=(r,n)=>oP(t,r,n),t.encodeAsync=async(r,n)=>sP(t,r,n),t.decodeAsync=async(r,n)=>lP(t,r,n),t.safeEncode=(r,n)=>cP(t,r,n),t.safeDecode=(r,n)=>uP(t,r,n),t.safeEncodeAsync=async(r,n)=>dP(t,r,n),t.safeDecodeAsync=async(r,n)=>pP(t,r,n),qm(t,"ZodType",{check(...r){let n=this.def;return this.clone(X.mergeDefs(n,{checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return vi(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(iM(r,n))},superRefine(r,n){return this.check(nM(r,n))},overwrite(r){return this.check(ba(r))},optional(){return Gm(this)},exactOptional(){return zP(this)},nullable(){return Hm(this)},nullish(){return Gm(Hm(this))},nonoptional(r){return WP(this,r)},array(){return Xm(this)},or(r){return Ab([this,r])},and(r){return MP(this,r)},transform(r){return nb(this,Sb(r))},default(r){return UP(this,r)},prefault(r){return KP(this,r)},catch(r){return GP(this,r)},pipe(r){return nb(this,r)},readonly(){return YP(this)},describe(r){let n=this.clone();return Gr.add(n,{description:r}),n},meta(...r){if(r.length===0)return Gr.get(this);let n=this.clone();return Gr.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return Gr.get(t)?.description},configurable:!0}),t)),ab=R("_ZodString",(t,e)=>{Tc.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,a)=>hS(t,n,i,a);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,qm(t,"_ZodString",{regex(...n){return this.check(dp(...n))},includes(...n){return this.check(hp(...n))},startsWith(...n){return this.check(mp(...n))},endsWith(...n){return this.check(gp(...n))},min(...n){return this.check(Wo(...n))},max(...n){return this.check(Rc(...n))},length(...n){return this.check(Cc(...n))},nonempty(...n){return this.check(Wo(1,...n))},lowercase(n){return this.check(pp(n))},uppercase(n){return this.check(fp(n))},trim(){return this.check(yp())},normalize(...n){return this.check(xp(...n))},toLowerCase(){return this.check(wp())},toUpperCase(){return this.check(bp())},slugify(){return this.check(_p())}})}),Mp=R("ZodString",(t,e)=>{Tc.init(t,e),ab.init(t,e),t.email=r=>t.check(_0(ob,r)),t.url=r=>t.check(Km(Jm,r)),t.jwt=r=>t.check(U0(bb,r)),t.emoji=r=>t.check(P0(sb,r)),t.guid=r=>t.check(jm(Zm,r)),t.uuid=r=>t.check(F0(uo,r)),t.uuidv4=r=>t.check(A0(uo,r)),t.uuidv6=r=>t.check(E0(uo,r)),t.uuidv7=r=>t.check(S0(uo,r)),t.nanoid=r=>t.check(M0(lb,r)),t.guid=r=>t.check(jm(Zm,r)),t.cuid=r=>t.check(N0(cb,r)),t.cuid2=r=>t.check($0(ub,r)),t.ulid=r=>t.check(k0(db,r)),t.base64=r=>t.check(z0(xb,r)),t.base64url=r=>t.check(O0(yb,r)),t.xid=r=>t.check(I0(pb,r)),t.ksuid=r=>t.check(B0(fb,r)),t.ipv4=r=>t.check(T0(hb,r)),t.ipv6=r=>t.check(D0(mb,r)),t.cidrv4=r=>t.check(R0(gb,r)),t.cidrv6=r=>t.check(C0(vb,r)),t.e164=r=>t.check(V0(wb,r)),t.datetime=r=>t.check(YS(r)),t.date=r=>t.check(XS(r)),t.time=r=>t.check(QS(r)),t.duration=r=>t.check(eP(r))});function Lm(t){return ME(Mp,t)}var yt=R("ZodStringFormat",(t,e)=>{xt.init(t,e),ab.init(t,e)}),ob=R("ZodEmail",(t,e)=>{yA.init(t,e),yt.init(t,e)});function NT(t){return _0(ob,t)}var Zm=R("ZodGUID",(t,e)=>{vA.init(t,e),yt.init(t,e)});function $T(t){return jm(Zm,t)}var uo=R("ZodUUID",(t,e)=>{xA.init(t,e),yt.init(t,e)});function kT(t){return F0(uo,t)}function IT(t){return A0(uo,t)}function BT(t){return E0(uo,t)}function TT(t){return S0(uo,t)}var Jm=R("ZodURL",(t,e)=>{wA.init(t,e),yt.init(t,e)});function DT(t){return Km(Jm,t)}function RT(t){return Km(Jm,{protocol:on.httpProtocol,hostname:on.domain,...X.normalizeParams(t)})}var sb=R("ZodEmoji",(t,e)=>{bA.init(t,e),yt.init(t,e)});function CT(t){return P0(sb,t)}var lb=R("ZodNanoID",(t,e)=>{_A.init(t,e),yt.init(t,e)});function zT(t){return M0(lb,t)}var cb=R("ZodCUID",(t,e)=>{FA.init(t,e),yt.init(t,e)});function OT(t){return N0(cb,t)}var ub=R("ZodCUID2",(t,e)=>{AA.init(t,e),yt.init(t,e)});function VT(t){return $0(ub,t)}var db=R("ZodULID",(t,e)=>{EA.init(t,e),yt.init(t,e)});function UT(t){return k0(db,t)}var pb=R("ZodXID",(t,e)=>{SA.init(t,e),yt.init(t,e)});function jT(t){return I0(pb,t)}var fb=R("ZodKSUID",(t,e)=>{PA.init(t,e),yt.init(t,e)});function KT(t){return B0(fb,t)}var hb=R("ZodIPv4",(t,e)=>{IA.init(t,e),yt.init(t,e)});function WT(t){return T0(hb,t)}var fP=R("ZodMAC",(t,e)=>{TA.init(t,e),yt.init(t,e)});function LT(t){return $E(fP,t)}var mb=R("ZodIPv6",(t,e)=>{BA.init(t,e),yt.init(t,e)});function ZT(t){return D0(mb,t)}var gb=R("ZodCIDRv4",(t,e)=>{DA.init(t,e),yt.init(t,e)});function GT(t){return R0(gb,t)}var vb=R("ZodCIDRv6",(t,e)=>{RA.init(t,e),yt.init(t,e)});function HT(t){return C0(vb,t)}var xb=R("ZodBase64",(t,e)=>{zA.init(t,e),yt.init(t,e)});function qT(t){return z0(xb,t)}var yb=R("ZodBase64URL",(t,e)=>{OA.init(t,e),yt.init(t,e)});function JT(t){return O0(yb,t)}var wb=R("ZodE164",(t,e)=>{VA.init(t,e),yt.init(t,e)});function YT(t){return V0(wb,t)}var bb=R("ZodJWT",(t,e)=>{UA.init(t,e),yt.init(t,e)});function XT(t){return U0(bb,t)}var Np=R("ZodCustomStringFormat",(t,e)=>{jA.init(t,e),yt.init(t,e)});function QT(t,e,r={}){return Fp(Np,t,e,r)}function e2(t){return Fp(Np,"hostname",on.hostname,t)}function t2(t){return Fp(Np,"hex",on.hex,t)}function r2(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=on[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return Fp(Np,n,i,e)}var $p=R("ZodNumber",(t,e)=>{p0.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,a)=>mS(t,n,i,a),qm(t,"ZodNumber",{gt(n,i){return this.check(lo(n,i))},gte(n,i){return this.check(yi(n,i))},min(n,i){return this.check(yi(n,i))},lt(n,i){return this.check(so(n,i))},lte(n,i){return this.check(sn(n,i))},max(n,i){return this.check(sn(n,i))},int(n){return this.check(ib(n))},safe(n){return this.check(ib(n))},positive(n){return this.check(lo(0,n))},nonnegative(n){return this.check(yi(0,n))},negative(n){return this.check(so(0,n))},nonpositive(n){return this.check(sn(0,n))},multipleOf(n,i){return this.check(Hs(n,i))},step(n,i){return this.check(Hs(n,i))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function hP(t){return RE($p,t)}var Oc=R("ZodNumberFormat",(t,e)=>{KA.init(t,e),$p.init(t,e)});function ib(t){return zE(Oc,t)}function i2(t){return OE(Oc,t)}function n2(t){return VE(Oc,t)}function a2(t){return UE(Oc,t)}function o2(t){return jE(Oc,t)}var kp=R("ZodBoolean",(t,e)=>{Cm.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gS(t,r,n,i)});function mP(t){return KE(kp,t)}var Ip=R("ZodBigInt",(t,e)=>{f0.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,a)=>vS(t,n,i,a),t.gte=(n,i)=>t.check(yi(n,i)),t.min=(n,i)=>t.check(yi(n,i)),t.gt=(n,i)=>t.check(lo(n,i)),t.gte=(n,i)=>t.check(yi(n,i)),t.min=(n,i)=>t.check(yi(n,i)),t.lt=(n,i)=>t.check(so(n,i)),t.lte=(n,i)=>t.check(sn(n,i)),t.max=(n,i)=>t.check(sn(n,i)),t.positive=n=>t.check(lo(BigInt(0),n)),t.negative=n=>t.check(so(BigInt(0),n)),t.nonpositive=n=>t.check(sn(BigInt(0),n)),t.nonnegative=n=>t.check(yi(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(Hs(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function s2(t){return LE(Ip,t)}var _b=R("ZodBigIntFormat",(t,e)=>{WA.init(t,e),Ip.init(t,e)});function l2(t){return GE(_b,t)}function c2(t){return HE(_b,t)}var gP=R("ZodSymbol",(t,e)=>{LA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xS(t,r,n,i)});function u2(t){return qE(gP,t)}var vP=R("ZodUndefined",(t,e)=>{ZA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>wS(t,r,n,i)});function d2(t){return JE(vP,t)}var xP=R("ZodNull",(t,e)=>{GA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yS(t,r,n,i)});function yP(t){return YE(xP,t)}var wP=R("ZodAny",(t,e)=>{HA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>FS(t,r,n,i)});function p2(){return XE(wP)}var bP=R("ZodUnknown",(t,e)=>{qA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>AS(t,r,n,i)});function zc(){return QE(bP)}var _P=R("ZodNever",(t,e)=>{JA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_S(t,r,n,i)});function Fb(t){return eS(_P,t)}var FP=R("ZodVoid",(t,e)=>{YA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bS(t,r,n,i)});function f2(t){return tS(FP,t)}var Ym=R("ZodDate",(t,e)=>{XA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,a)=>ES(t,n,i,a),t.min=(n,i)=>t.check(yi(n,i)),t.max=(n,i)=>t.check(sn(n,i));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function h2(t){return rS(Ym,t)}var AP=R("ZodArray",(t,e)=>{QA.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>CS(t,r,n,i),t.element=e.element,qm(t,"ZodArray",{min(r,n){return this.check(Wo(r,n))},nonempty(r){return this.check(Wo(1,r))},max(r,n){return this.check(Rc(r,n))},length(r,n){return this.check(Cc(r,n))},unwrap(){return this.element}})});function Xm(t,e){return aS(AP,t,e)}function m2(t){let e=t._zod.def.shape;return Eb(Object.keys(e))}var Qm=R("ZodObject",(t,e)=>{eE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>zS(t,r,n,i),X.defineLazy(t,"shape",()=>e.shape),qm(t,"ZodObject",{keyof(){return Eb(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:zc()})},loose(){return this.clone({...this._zod.def,catchall:zc()})},strict(){return this.clone({...this._zod.def,catchall:Fb()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return X.extend(this,r)},safeExtend(r){return X.safeExtend(this,r)},merge(r){return X.merge(this,r)},pick(r){return X.pick(this,r)},omit(r){return X.omit(this,r)},partial(...r){return X.partial(Pb,this,r[0])},required(...r){return X.required(Mb,this,r[0])}})});function g2(t,e){let r={type:"object",shape:t??{},...X.normalizeParams(e)};return new Qm(r)}function v2(t,e){return new Qm({type:"object",shape:t,catchall:Fb(),...X.normalizeParams(e)})}function x2(t,e){return new Qm({type:"object",shape:t,catchall:zc(),...X.normalizeParams(e)})}var eg=R("ZodUnion",(t,e)=>{zm.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>H0(t,r,n,i),t.options=e.options});function Ab(t,e){return new eg({type:"union",options:t,...X.normalizeParams(e)})}var EP=R("ZodXor",(t,e)=>{eg.init(t,e),tE.init(t,e),t._zod.processJSONSchema=(r,n,i)=>H0(t,r,n,i),t.options=e.options});function y2(t,e){return new EP({type:"union",options:t,inclusive:!1,...X.normalizeParams(e)})}var SP=R("ZodDiscriminatedUnion",(t,e)=>{eg.init(t,e),rE.init(t,e)});function w2(t,e,r){return new SP({type:"union",options:e,discriminator:t,...X.normalizeParams(r)})}var PP=R("ZodIntersection",(t,e)=>{iE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>OS(t,r,n,i)});function MP(t,e){return new PP({type:"intersection",left:t,right:e})}var NP=R("ZodTuple",(t,e)=>{h0.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>VS(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});function $P(t,e,r){let n=e instanceof Ce,i=n?r:e,a=n?e:null;return new NP({type:"tuple",items:t,rest:a,...X.normalizeParams(i)})}var Sp=R("ZodRecord",(t,e)=>{nE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>US(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function kP(t,e,r){return!e||!e._zod?new Sp({type:"record",keyType:Lm(),valueType:t,...X.normalizeParams(e)}):new Sp({type:"record",keyType:t,valueType:e,...X.normalizeParams(r)})}function b2(t,e,r){let n=vi(t);return n._zod.values=void 0,new Sp({type:"record",keyType:n,valueType:e,...X.normalizeParams(r)})}function _2(t,e,r){return new Sp({type:"record",keyType:t,valueType:e,mode:"loose",...X.normalizeParams(r)})}var IP=R("ZodMap",(t,e)=>{aE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>DS(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(co(...r)),t.nonempty=r=>t.check(co(1,r)),t.max=(...r)=>t.check(qs(...r)),t.size=(...r)=>t.check(Dc(...r))});function F2(t,e,r){return new IP({type:"map",keyType:t,valueType:e,...X.normalizeParams(r)})}var BP=R("ZodSet",(t,e)=>{oE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>RS(t,r,n,i),t.min=(...r)=>t.check(co(...r)),t.nonempty=r=>t.check(co(1,r)),t.max=(...r)=>t.check(qs(...r)),t.size=(...r)=>t.check(Dc(...r))});function A2(t,e){return new BP({type:"set",valueType:t,...X.normalizeParams(e)})}var Pp=R("ZodEnum",(t,e)=>{sE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(n,i,a)=>SS(t,n,i,a),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{let a={};for(let o of n)if(r.has(o))a[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Pp({...e,checks:[],...X.normalizeParams(i),entries:a})},t.exclude=(n,i)=>{let a={...e.entries};for(let o of n)if(r.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new Pp({...e,checks:[],...X.normalizeParams(i),entries:a})}});function Eb(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Pp({type:"enum",entries:r,...X.normalizeParams(e)})}function E2(t,e){return new Pp({type:"enum",entries:t,...X.normalizeParams(e)})}var TP=R("ZodLiteral",(t,e)=>{lE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>PS(t,r,n,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function S2(t,e){return new TP({type:"literal",values:Array.isArray(t)?t:[t],...X.normalizeParams(e)})}var DP=R("ZodFile",(t,e)=>{cE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$S(t,r,n,i),t.min=(r,n)=>t.check(co(r,n)),t.max=(r,n)=>t.check(qs(r,n)),t.mime=(r,n)=>t.check(vp(Array.isArray(r)?r:[r],n))});function P2(t){return oS(DP,t)}var RP=R("ZodTransform",(t,e)=>{uE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>TS(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ks(t.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(X.issue(a,r.value,e));else{let o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),r.issues.push(X.issue(o))}};let i=e.transform(r.value,r);return i instanceof Promise?i.then(a=>(r.value=a,r.fallback=!0,r)):(r.value=i,r.fallback=!0,r)}});function Sb(t){return new RP({type:"transform",transform:t})}var Pb=R("ZodOptional",(t,e)=>{m0.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>q0(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Gm(t){return new Pb({type:"optional",innerType:t})}var CP=R("ZodExactOptional",(t,e)=>{dE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>q0(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function zP(t){return new CP({type:"optional",innerType:t})}var OP=R("ZodNullable",(t,e)=>{pE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>jS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Hm(t){return new OP({type:"nullable",innerType:t})}function M2(t){return Gm(Hm(t))}var VP=R("ZodDefault",(t,e)=>{fE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>WS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function UP(t,e){return new VP({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():X.shallowClone(e)}})}var jP=R("ZodPrefault",(t,e)=>{hE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>LS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function KP(t,e){return new jP({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():X.shallowClone(e)}})}var Mb=R("ZodNonOptional",(t,e)=>{mE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>KS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function WP(t,e){return new Mb({type:"nonoptional",innerType:t,...X.normalizeParams(e)})}var LP=R("ZodSuccess",(t,e)=>{gE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function N2(t){return new LP({type:"success",innerType:t})}var ZP=R("ZodCatch",(t,e)=>{vE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ZS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function GP(t,e){return new ZP({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var HP=R("ZodNaN",(t,e)=>{xE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>MS(t,r,n,i)});function $2(t){return nS(HP,t)}var tg=R("ZodPipe",(t,e)=>{g0.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>GS(t,r,n,i),t.in=e.in,t.out=e.out});function nb(t,e){return new tg({type:"pipe",in:t,out:e})}var rg=R("ZodCodec",(t,e)=>{tg.init(t,e),Om.init(t,e)});function k2(t,e,r){return new rg({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function I2(t){let e=t._zod.def;return new rg({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var qP=R("ZodPreprocess",(t,e)=>{tg.init(t,e),yE.init(t,e)}),JP=R("ZodReadonly",(t,e)=>{wE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>HS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function YP(t){return new JP({type:"readonly",innerType:t})}var XP=R("ZodTemplateLiteral",(t,e)=>{bE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>NS(t,r,n,i)});function B2(t,e){return new XP({type:"template_literal",parts:t,...X.normalizeParams(e)})}var QP=R("ZodLazy",(t,e)=>{AE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>JS(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});function eM(t){return new QP({type:"lazy",getter:t})}var tM=R("ZodPromise",(t,e)=>{FE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>qS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function T2(t){return new tM({type:"promise",innerType:t})}var rM=R("ZodFunction",(t,e)=>{_E.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>BS(t,r,n,i)});function D2(t){return new rM({type:"function",input:Array.isArray(t?.input)?$P(t?.input):t?.input??Xm(zc()),output:t?.output??zc()})}var ig=R("ZodCustom",(t,e)=>{EE.init(t,e),Le.init(t,e),t._zod.processJSONSchema=(r,n,i)=>IS(t,r,n,i)});function R2(t){let e=new _t({check:"custom"});return e._zod.check=t,e}function C2(t,e){return sS(ig,t??(()=>!0),e)}function iM(t,e={}){return lS(ig,t,e)}function nM(t,e){return cS(t,e)}var z2=uS,O2=dS;function V2(t,e={}){let r=new ig({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...X.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var U2=(...t)=>pS({Codec:rg,Boolean:kp,String:Mp},...t);function j2(t){let e=eM(()=>Ab([Lm(t),hP(),mP(),yP(),Xm(e),kP(Lm(),e)]));return e}function K2(t,e){return new qP({type:"pipe",in:Sb(t),out:e})}var V4={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function U4(t){Jt({customError:t})}function j4(){return Jt().customError}var aM;aM||(aM={});var le={...Wm,...X0,iso:Ep},K4=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function W4(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function L4(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let i=r[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${t}`);return e.defs[i]}throw new Error(`Reference not found: ${t}`)}function W2(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return le.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let i=t.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return le.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let a=L4(i,e),o=li(a,e);return e.refs.set(i,o),e.processing.delete(i),o}if(t.enum!==void 0){let i=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&i.length===1&&i[0]===null)return le.null();if(i.length===0)return le.never();if(i.length===1)return le.literal(i[0]);if(i.every(o=>typeof o=="string"))return le.enum(i);let a=i.map(o=>le.literal(o));return a.length<2?a[0]:le.union([a[0],a[1],...a.slice(2)])}if(t.const!==void 0)return le.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(a=>{let o={...t,type:a};return W2(o,e)});return i.length===0?le.never():i.length===1?i[0]:le.union(i)}if(!r)return le.any();let n;switch(r){case"string":{let i=le.string();if(t.format){let a=t.format;a==="email"?i=i.check(le.email()):a==="uri"||a==="uri-reference"?i=i.check(le.url()):a==="uuid"||a==="guid"?i=i.check(le.uuid()):a==="date-time"?i=i.check(le.iso.datetime()):a==="date"?i=i.check(le.iso.date()):a==="time"?i=i.check(le.iso.time()):a==="duration"?i=i.check(le.iso.duration()):a==="ipv4"?i=i.check(le.ipv4()):a==="ipv6"?i=i.check(le.ipv6()):a==="mac"?i=i.check(le.mac()):a==="cidr"?i=i.check(le.cidrv4()):a==="cidr-v6"?i=i.check(le.cidrv6()):a==="base64"?i=i.check(le.base64()):a==="base64url"?i=i.check(le.base64url()):a==="e164"?i=i.check(le.e164()):a==="jwt"?i=i.check(le.jwt()):a==="emoji"?i=i.check(le.emoji()):a==="nanoid"?i=i.check(le.nanoid()):a==="cuid"?i=i.check(le.cuid()):a==="cuid2"?i=i.check(le.cuid2()):a==="ulid"?i=i.check(le.ulid()):a==="xid"?i=i.check(le.xid()):a==="ksuid"&&(i=i.check(le.ksuid()))}typeof t.minLength=="number"&&(i=i.min(t.minLength)),typeof t.maxLength=="number"&&(i=i.max(t.maxLength)),t.pattern&&(i=i.regex(new RegExp(t.pattern))),n=i;break}case"number":case"integer":{let i=r==="integer"?le.number().int():le.number();typeof t.minimum=="number"&&(i=i.min(t.minimum)),typeof t.maximum=="number"&&(i=i.max(t.maximum)),typeof t.exclusiveMinimum=="number"?i=i.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(i=i.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?i=i.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(i=i.lt(t.maximum)),typeof t.multipleOf=="number"&&(i=i.multipleOf(t.multipleOf)),n=i;break}case"boolean":{n=le.boolean();break}case"null":{n=le.null();break}case"object":{let i={},a=t.properties||{},o=new Set(t.required||[]);for(let[c,u]of Object.entries(a)){let f=li(u,e);i[c]=o.has(c)?f:f.optional()}if(t.propertyNames){let c=li(t.propertyNames,e),u=t.additionalProperties&&typeof t.additionalProperties=="object"?li(t.additionalProperties,e):le.any();if(Object.keys(i).length===0){n=le.record(c,u);break}let f=le.object(i).passthrough(),v=le.looseRecord(c,u);n=le.intersection(f,v);break}if(t.patternProperties){let c=t.patternProperties,u=Object.keys(c),f=[];for(let m of u){let w=li(c[m],e),y=le.string().regex(new RegExp(m));f.push(le.looseRecord(y,w))}let v=[];if(Object.keys(i).length>0&&v.push(le.object(i).passthrough()),v.push(...f),v.length===0)n=le.object({}).passthrough();else if(v.length===1)n=v[0];else{let m=le.intersection(v[0],v[1]);for(let w=2;w<v.length;w++)m=le.intersection(m,v[w]);n=m}break}let s=le.object(i);t.additionalProperties===!1?n=s.strict():typeof t.additionalProperties=="object"?n=s.catchall(li(t.additionalProperties,e)):n=s.passthrough();break}case"array":{let i=t.prefixItems,a=t.items;if(i&&Array.isArray(i)){let o=i.map(c=>li(c,e)),s=a&&typeof a=="object"&&!Array.isArray(a)?li(a,e):void 0;s?n=le.tuple(o).rest(s):n=le.tuple(o),typeof t.minItems=="number"&&(n=n.check(le.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(le.maxLength(t.maxItems)))}else if(Array.isArray(a)){let o=a.map(c=>li(c,e)),s=t.additionalItems&&typeof t.additionalItems=="object"?li(t.additionalItems,e):void 0;s?n=le.tuple(o).rest(s):n=le.tuple(o),typeof t.minItems=="number"&&(n=n.check(le.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(le.maxLength(t.maxItems)))}else if(a!==void 0){let o=li(a,e),s=le.array(o);typeof t.minItems=="number"&&(s=s.min(t.minItems)),typeof t.maxItems=="number"&&(s=s.max(t.maxItems)),n=s}else n=le.array(le.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}function li(t,e){if(typeof t=="boolean")return t?le.any():le.never();let r=W2(t,e),n=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let s=t.anyOf.map(u=>li(u,e)),c=le.union(s);r=n?le.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let s=t.oneOf.map(u=>li(u,e)),c=le.xor(s);r=n?le.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:le.any();else{let s=n?r:li(t.allOf[0],e),c=n?0:1;for(let u=c;u<t.allOf.length;u++)s=le.intersection(s,li(t.allOf[u],e));r=s}t.nullable===!0&&e.version==="openapi-3.0"&&(r=le.nullable(r)),t.readOnly===!0&&(r=le.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let i={},a=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of a)s in t&&(i[s]=t[s]);let o=["contentEncoding","contentMediaType","contentSchema"];for(let s of o)s in t&&(i[s]=t[s]);for(let s of Object.keys(t))K4.has(s)||(i[s]=t[s]);return Object.keys(i).length>0&&e.registry.add(r,i),t.description&&(r=r.describe(t.description)),r}function L2(t,e){if(typeof t=="boolean")return t?le.any():le.never();let r;try{r=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let n=W4(r,e?.defaultTarget),i=r.$defs||r.definitions||{},a={version:n,defs:i,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??Gr};return li(r,a)}var oM={};_a(oM,{bigint:()=>q4,boolean:()=>H4,date:()=>J4,number:()=>G4,string:()=>Z4});function Z4(t){return NE(Mp,t)}function G4(t){return CE($p,t)}function H4(t){return WE(kp,t)}function q4(t){return ZE(Ip,t)}function J4(t){return iS(Ym,t)}Jt(v0());var G2=[1,2,4,8],H2=[1,2,3,4,5,6,7,8],q2=["disable-track","mute-region"],J2=["none","all","previous-only"],Y2=Oe.object({metronome:Oe.object({enabled:Oe.boolean(),beatSubDivision:Oe.union(G2.map(t=>Oe.literal(t))),gain:Oe.number().min(Number.NEGATIVE_INFINITY).max(0),monophonic:Oe.boolean()}).default({enabled:!1,beatSubDivision:1,gain:-6,monophonic:!0}),playback:Oe.object({timestampEnabled:Oe.boolean(),pauseOnLoopDisabled:Oe.boolean(),truncateNotesAtRegionEnd:Oe.boolean()}).default({timestampEnabled:!0,pauseOnLoopDisabled:!1,truncateNotesAtRegionEnd:!1}),debug:Oe.object({dspLoadMeasurement:Oe.boolean()}).default({dspLoadMeasurement:!1}),recording:Oe.object({countInBars:Oe.union(H2.map(t=>Oe.literal(t))),allowTakes:Oe.boolean(),automationEnabled:Oe.boolean(),olderTakeAction:Oe.union(q2.map(t=>Oe.literal(t))),olderTakeScope:Oe.union(J2.map(t=>Oe.literal(t))),inputLatency:Oe.number().min(-1)}).default({countInBars:1,allowTakes:!0,automationEnabled:!0,olderTakeAction:"mute-region",olderTakeScope:"previous-only",inputLatency:0})}),Z2;(function(t){t.BeatSubDivisionOptions=G2,t.RecordingCountInBars=H2,t.OlderTakeActionOptions=q2,t.OlderTakeScopeOptions=J2})(Z2||(Z2={}));A();A();var Qs={[Tt.Instrument]:0,[Tt.Aux]:1,[Tt.Bus]:2,[Tt.Output]:3};var Nb;(function(t){t.create=({boxGraph:e,mandatoryBoxes:{rootBox:r,primaryAudioBusBox:n}},i,a,o)=>{let s=o??t.orderAndGetIndex(r,i);return console.debug(`createAudioUnit type: ${i}, insertIndex: ${s}`),it.create(e,k.generate(),c=>{c.collection.refer(r.audioUnits),c.output.refer(n.input),c.index.setValue(s),c.type.setValue(i),a.ifSome(u=>c.capture.refer(u))})},t.orderAndGetIndex=(e,r)=>{let n=bi.collectIndexedBoxes(e.audioUnits,it),i=Qs[r],a=0;for(;a<n.length&&!(Qs[n[a].type.getValue()]>i);a++);let o=a;for(;a<n.length;)n[a].index.setValue(++a);return o},t.trackTypeToCapture=(e,r)=>{switch(r){case ye.Audio:return _.wrap(Ia.create(e,k.generate()));case ye.Notes:return _.wrap(Ba.create(e,k.generate()));default:return _.None}}})(Nb||(Nb={}));var X2;(function(t){t.create=(e,r,n,i,a)=>{console.debug(`createAudioBus '${r}', type: ${i}, color: ${a}`);let{boxGraph:o,mandatoryBoxes:{rootBox:s}}=e;ee(s.isAttached(),"rootBox not attached");let c=k.generate(),u=ea.create(o,c,v=>{v.collection.refer(s.audioBusses),v.label.setValue(r),v.icon.setValue(We.toName(n)),v.color.setValue(a.toString())}),f=Nb.create(e,i,_.None);return u.output.refer(f.input),u}})(X2||(X2={}));var Q2;(function(t){t.forAudioType=e=>{switch(e){case Tt.Output:return ts.blue;case Tt.Aux:return ts.purple;case Tt.Bus:return ts.orange;case Tt.Instrument:return ts.green;default:return ts.dark}},t.forTrackType=e=>{switch(e){case ye.Audio:return 200;case ye.Notes:return 45;case ye.Value:return 156;default:return 0}}})(Q2||(Q2={}));A();rt();var eD;(function(t){t.Tape={defaultName:"Tape",defaultIcon:We.Tape,briefDescription:"Audio Player",description:"Plays audio regions & clips",manualPage:se.Tape,trackType:ye.Audio,create:(n,i,a,o,s)=>wu.create(n,k.generate(),c=>{c.label.setValue(a),c.icon.setValue(We.toName(o)),c.flutter.setValue(.2),c.wow.setValue(.05),c.noise.setValue(.02),c.saturation.setValue(.5),c.host.refer(i)})},t.Nano={defaultName:"Nano",defaultIcon:We.NanoWave,briefDescription:"Simple Sampler",description:"Simple sampler",manualPage:se.Nano,trackType:ye.Notes,create:(n,i,a,o,s)=>xu.create(n,k.generate(),c=>{c.label.setValue(a),c.icon.setValue(We.toName(o)),K(s)&&c.file.refer(s),c.host.refer(i)})},t.Playfield={defaultName:"Playfield",defaultIcon:We.Playfield,briefDescription:"Drum Machine",description:"Drum computer",manualPage:se.Playfield,trackType:ye.Notes,create:(n,i,a,o,s)=>{let c=yu.create(n,k.generate(),u=>{u.label.setValue(a),u.icon.setValue(We.toName(o)),u.host.refer(i)});return K(s)&&s.filter(({note:u,uuid:f,name:v,durationInSeconds:m,exclude:w})=>{let y=e(n,f,v,m);Ta.create(n,k.generate(),P=>{P.device.refer(c.samples),P.file.refer(y),P.index.setValue(u),P.exclude.setValue(w)})}),c}},t.Neon={defaultName:"Neon",defaultIcon:We.Neon,briefDescription:"CZ-style Synth",description:"CZ-style phase distortion synthesizer",manualPage:se.Neon,trackType:ye.Notes,create:(n,i,a,o,s)=>vu.create(n,k.generate(),c=>{c.label.setValue(a),c.icon.setValue(We.toName(o));for(let u of[0,1]){let f=c.envelopes.fields()[u*3+1];f.rate1.setInitValue(99),f.level1.setInitValue(99),f.sustain.setInitValue(1),f.end.setInitValue(2),f.rate2.setInitValue(99);let v=c.envelopes.fields()[u*3+2];v.rate1.setInitValue(99),v.level1.setInitValue(99),v.sustain.setInitValue(1),v.end.setInitValue(2),v.rate2.setInitValue(70)}c.host.refer(i)})},t.Cubed={defaultName:"Cubed",defaultIcon:We.Cube,briefDescription:"303-style Synth",description:"Acid bassline synthesizer",manualPage:"manuals/devices/instruments/cubed",trackType:ye.Notes,create:(n,i,a,o,s)=>_u.create(n,k.generate(),c=>{c.label.setValue(a),c.icon.setValue(We.toName(o)),c.host.refer(i)})},t.Vaporisateur={defaultName:"Vaporisateur",defaultIcon:We.Vaporisateur,briefDescription:"Subtractive Synth",description:"Classic subtractive synthesizer",manualPage:se.Vaporisateur,trackType:ye.Notes,create:(n,i,a,o,s)=>hu.create(n,k.generate(),c=>{c.label.setValue(a),c.icon.setValue(We.toName(o)),c.cutoff.setInitValue(8e3),c.resonance.setInitValue(.1),c.attack.setInitValue(.005),c.decay.setInitValue(.1),c.sustain.setInitValue(.5),c.release.setInitValue(.5),c.voicingMode.setInitValue(Ma.Polyphonic),c.lfo.rate.setInitValue(1),c.oscillators.fields()[0].waveform.setInitValue(Sa.saw),c.oscillators.fields()[0].volume.setInitValue(-6),c.oscillators.fields()[1].volume.setInitValue(Number.NEGATIVE_INFINITY),c.oscillators.fields()[1].waveform.setInitValue(Sa.square),c.host.refer(i),c.version.setValue(2)})},t.MIDIOutput={defaultName:"MIDIOutput",defaultIcon:We.Midi,briefDescription:"Send MIDI",description:"MIDI Output",manualPage:se.MIDIOutput,trackType:ye.Notes,create:(n,i,a,o,s)=>mu.create(n,k.generate(),c=>{c.label.setValue(a),c.icon.setValue(We.toName(o)),c.host.refer(i)})},t.Soundfont={defaultName:"Soundfont",defaultIcon:We.SoundFont,briefDescription:"Soundfont Player",description:"Soundfont Player",manualPage:se.Soundfont,trackType:ye.Notes,create:(n,i,a,o,s)=>gu.create(n,k.generate(),c=>{c.label.setValue(a),c.icon.setValue(We.toName(o)),K(s)&&c.file.refer(s),c.host.refer(i)})},t.Apparat={defaultName:"Apparat",defaultIcon:We.Code,briefDescription:"Scriptable Instrument",description:"User-scripted instrument",manualPage:se.Apparat,trackType:ye.Notes,create:(n,i,a,o)=>bu.create(n,k.generate(),s=>{s.label.setValue(a),s.icon.setValue(We.toName(o)),s.host.refer(i)})},t.Named={Apparat:t.Apparat,Cubed:t.Cubed,Neon:t.Neon,MIDIOutput:t.MIDIOutput,Nano:t.Nano,Playfield:t.Playfield,Soundfont:t.Soundfont,Tape:t.Tape,Vaporisateur:t.Vaporisateur};let e=(n,i,a,o)=>n.findBox(i).unwrapOrElse(()=>dn.create(n,i,s=>{s.fileName.setValue(a),s.endInSeconds.setValue(o)})),r=(n,i,a)=>n.findBox(i).unwrapOrElse(()=>ka.create(n,i,o=>o.fileName.setValue(a)))})(eD||(eD={}));A();A();var Zo;(function(t){t.empty=n=>{let i=new xo(_.wrap(bo.create)),a=new Date().toISOString();console.debug(`New Project created on ${a}`),i.beginTransaction();let o=pu.create(i,k.generate(),m=>{m.label.setValue("Groove Shuffle")}),s=is.create(i,k.generate(),m=>{m.groove.refer(o),m.created.setValue(a)}),c=ea.create(i,k.generate(),m=>{m.collection.refer(s.audioBusses),m.label.setValue("Output"),m.icon.setValue(We.toName(We.SpeakerHeadphone)),m.color.setValue(ts.blue.toString())}),u=it.create(i,k.generate(),m=>{m.type.setValue(Tt.Output),m.collection.refer(s.audioUnits),m.output.refer(s.outputDevice),m.index.setValue(0)});n.createOutputMaximizer&&fu.create(i,k.generate(),m=>{m.label.setValue("Master Maximizer"),m.index.setValue(0),m.host.refer(u.audioEffects),m.lookahead.setValue(!1)});let f=xl.create(i,k.generate());Qn.create(i,k.generate(),m=>f.tempoTrack.events.refer(m.owners)),s.timeline.refer(f.root),c.output.refer(u.input);let v=[];if(n.createDefaultUser){let m=_o.create(i,k.generate());m.root.refer(s.users),v.push(m)}return i.endTransaction(),{boxGraph:i,mandatoryBoxes:{rootBox:s,primaryAudioBusBox:c,primaryAudioUnitBox:u,timelineBox:f,userInterfaceBoxes:v}}},t.encode=n=>{let i=Gt.create();i.writeInt(1330660686),i.writeInt(2);let a=n.toArrayBuffer();return i.writeInt(a.byteLength),i.writeBytes(new Int8Array(a)),i.toArrayBuffer()},t.decode=n=>{let i=new lt(n);ee(i.readInt()===1330660686,"Corrupt header. Probably not an openDAW project file."),ee(i.readInt()===2,"Deprecated Format");let a=i.readInt(),o=new Int8Array(a);i.readBytes(o);let s=new xo(_.wrap(bo.create));return s.fromArrayBuffer(o.buffer,!1),{boxGraph:s,mandatoryBoxes:t.findMandatoryBoxes(s)}},t.findMandatoryBoxes=n=>{let i=n.boxes().find(a=>a.accept({visitRootBox:()=>!0}));if(K(i)){let a=je(i.outputDevice.pointerHub.incoming().at(0)?.box,it),o=je(a.input.pointerHub.incoming().at(0)?.box,ea),s=je(i.timeline.targetVertex.unwrap("TimelineBox not found").box,xl),c=i.users.pointerHub.incoming().map(({box:u})=>je(u,_o));return{rootBox:i,primaryAudioBusBox:o,primaryAudioUnitBox:a,timelineBox:s,userInterfaceBoxes:c}}return W("Could not find mandatory boxes")}})(Zo||(Zo={}));A();A();var Vt;(function(t){let e=({graph:n},{graph:i})=>n===i,r=(n,i)=>n.index.getValue()-i.index.getValue();t.excludeTimelinePredicate=n=>n.accept({visitTrackBox:()=>!0})===!0,t.shouldExclude=n=>n.ephemeral||n.name===du.ClassName,t.generateMap=(n,i,a,o)=>{let s=k.newSet(({source:c})=>c);return s.addMany([...n.filter(({output:{targetAddress:c}})=>c.nonEmpty()).map(c=>({source:c.output.targetAddress.unwrap().uuid,target:o})),...n.map(c=>({source:c.collection.targetAddress.unwrap("AudioUnitBox was not connected to a RootBox").uuid,target:a})),...n.map(c=>({source:c.address.uuid,target:k.generate()})),...i.map(c=>({source:c.address.uuid,target:c.resource==="preserved"?c.address.uuid:k.generate()}))]),s},t.copyBoxes=(n,i,a,o)=>{let s=k.newSet(u=>u);o.forEach(u=>{u.resource==="preserved"&&i.findBox(u.address.uuid).nonEmpty()&&s.add(u.address.uuid)});let c=u=>{for(let[f,v]of u.outgoingEdges())if(f.mandatory&&!v.isBox()&&s.hasKey(v.uuid))return!0;return!1};I.decodeWith({map:(u,f)=>f.flatMap(v=>n.opt(v.uuid).match({some:({target:m})=>_.wrap(v.moveTo(m)),none:()=>i.findBox(v.uuid).nonEmpty()?_.wrap(v):_.None}))},()=>{a.forEach(u=>{let f=new lt(u.toArrayBuffer()),v=n.get(u.address.uuid,"uuid mapping").target;i.createBox(u.name,v,m=>m.read(f))}),o.forEach(u=>{if(s.hasKey(u.address.uuid)||c(u))return;let f=new lt(u.toArrayBuffer()),v=n.get(u.address.uuid,"uuid mapping").target;i.createBox(u.name,v,m=>m.read(f))})})},t.reorderAudioUnits=(n,i,a,o)=>{let s=i.toSorted(r).map(m=>je(a.graph.findBox(n.get(m.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),it)),c=new Set(s),f=bi.collectIndexedBoxes(a.audioUnits,it).filter(m=>!c.has(m)),v;if(K(o)){let m=Se(o,0,f.length);v=[...f.slice(0,m),...s,...f.slice(m)]}else{let m=f.toSorted((P,V)=>(Qs[P.type.getValue()]??0)-(Qs[V.type.getValue()]??0)),w=s.reduce((P,V)=>Math.max(P,Qs[V.type.getValue()]??0),0),y=m.findIndex(P=>(Qs[P.type.getValue()]??0)>w);y===-1&&(y=m.length),v=[...m.slice(0,y),...s,...m.slice(y)]}v.forEach((m,w)=>m.index.setValue(w))},t.extractRegions=(n,{boxGraph:i,mandatoryBoxes:{primaryAudioBusBox:a,rootBox:o}},s=0)=>{ee(ie.satisfy(n,e),"Region smust be from the same BoxGraph");let c=new Set(n),u=new Set,f=new Mg;n.forEach(O=>{let C=je(O.regions.targetVertex.unwrap("regions.target").box,_i);u.add(C);let G=je(C.tracks.targetVertex.unwrap("tracks.target").box,it);f.add(G,C)}),console.debug(`Found ${f.keyCount()} audioUnits`),console.debug(`Found ${u.size} tracks`);let v=[...f.keys()],m=O=>t.shouldExclude(O)||Ft(O,_i)&&!u.has(O)||ya.isRegionBox(O)&&!c.has(O),w=Array.from(v[0].graph.dependenciesOf(v,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:m}).boxes),y=t.generateMap(v,w,o.audioUnits.address.uuid,a.address.uuid);t.copyBoxes(y,i,v,w),t.reorderAudioUnits(y,v,o),f.forEach((O,C)=>[...C].sort(r).forEach((G,Y)=>{let me=i.findBox(y.get(G.address.uuid,"uuid mapping").target).unwrap("Target Track has not been copied");je(me,_i).index.setValue(Y)}));let P=n.reduce((O,C)=>Math.min(O,C.position.getValue()),Number.MAX_VALUE),V=s-P;n.forEach(O=>{let C=i.findBox(y.get(O.address.uuid,"uuid mapping").target).unwrap("Target Track has not been copied"),{position:G}=ya.asRegionBox(C);G.setValue(G.getValue()+V)})}})(Vt||(Vt={}));var tD;(function(t){t.transfer=(e,{boxGraph:r,mandatoryBoxes:{primaryAudioBusBox:n,rootBox:i}},a={})=>{let o=e.filter(v=>v.type.getValue()!==Tt.Output);if(o.length===0)return[];let s=v=>Vt.shouldExclude(v)||a?.excludeTimeline===!0&&Vt.excludeTimelinePredicate(v),c=Array.from(o[0].graph.dependenciesOf(o,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:s}).boxes),u=Vt.generateMap(o,c,i.audioUnits.address.uuid,n.address.uuid);Vt.copyBoxes(u,r,o,c),Vt.reorderAudioUnits(u,o,i,a.insertIndex);let f=o.map(v=>je(i.graph.findBox(u.get(v.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),it));if(a.deleteSource===!0){let v=je(o[0].collection.targetVertex.unwrap("collection.target").box,is);o.forEach(m=>m.delete()),bi.collectIndexedBoxes(v.audioUnits,it).forEach((m,w)=>m.index.setValue(w))}return f}})(tD||(tD={}));A();var rD;(function(t){t.transfer=(e,r,n,i=!0)=>{let a=r.graph,o=k.newSet(m=>m.address.uuid);o.add(e);for(let m of e.graph.dependenciesOf(e,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:w=>w.ephemeral}).boxes)o.add(m);let s=k.newSet(m=>m);o.forEach(m=>{m.resource==="preserved"&&a.findBox(m.address.uuid).nonEmpty()&&s.add(m.address.uuid)});let c=m=>{if(m.resource==="preserved"&&s.hasKey(m.address.uuid))return!0;for(let[,w]of m.outgoingEdges())if(s.hasKey(w.uuid)&&!w.isBox())return!0;return!1},u=o.values().filter(m=>!c(m)),f=k.newSet(m=>m.source);u.forEach(m=>{f.add({source:m.address.uuid,target:m.resource==="preserved"?m.address.uuid:k.generate()})}),s.forEach(m=>f.add({source:m,target:m}));let v=null;return I.decodeWith({map:(m,w)=>{let y=w.flatMap(P=>f.opt(P.uuid).map(V=>P.moveTo(V.target)));return y.nonEmpty()?y:m.pointerType===l.RegionCollection?_.wrap(r.regions.address):m.pointerType===l.ClipCollection?_.wrap(r.clips.address):_.None}},()=>u.forEach(m=>{let w=new lt(m.toArrayBuffer()),y=f.get(m.address.uuid,"uuid mapping").target;a.createBox(m.name,y,P=>{if(P.read(w),ya.isRegionBox(P)){let V=ya.asRegionBox(P);V.position.setValue(n),v=V}})})),i&&e.delete(),He(v,"Failed to create region copy")}})(rD||(rD={}));var ar;(function(t){t.MAGIC_HEADER_OPEN=1330664005,t.FORMAT_VERSION=1;let e;(function(r){r[r.Midi=0]="Midi",r[r.Audio=1]="Audio"})(e=t.ChainKind||(t.ChainKind={}))})(ar||(ar={}));var iD;(function(t){t.decode=(e,r)=>{let n=new lt(e.slice(0,8));if(n.readInt()!==ar.MAGIC_HEADER_OPEN)return Yc.notify({message:"Invalid preset file.",icon:"Warning"}),[];let i=n.readInt();if(i!==ar.FORMAT_VERSION)return console.warn(`Unsupported preset version ${i} (supports ${ar.FORMAT_VERSION})`),Yc.notify({message:"Unsupported preset version.",icon:"Warning"}),[];let a=new xo(_.wrap(bo.create));try{a.fromArrayBuffer(e.slice(8),!1)}catch(y){return console.warn(y),Yc.notify({message:"Could not import preset.",icon:"Warning"}),[]}let o={};for(let y of a.boxes())o[y.name]=(o[y.name]??0)+1;console.info("PresetDecoder.decode: source graph boxes",o);let s=a.boxes().filter(y=>Ft(y,it)).filter(y=>y.type.getValue()!==Tt.Output),c=y=>Vt.shouldExclude(y),u=Array.from(a.dependenciesOf(s,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:c}).boxes),{mandatoryBoxes:{rootBox:f,primaryAudioBusBox:v}}=r,m=Vt.generateMap(s,u,f.audioUnits.address.uuid,v.address.uuid);Vt.copyBoxes(m,r.boxGraph,s,u),Vt.reorderAudioUnits(m,s,f);let w=s.map(y=>je(f.graph.findBox(m.get(y.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),it)).filter(y=>y.type.getValue()!==Tt.Output);return w.forEach(y=>{let P=y.input.pointerHub.incoming().at(0)?.box;if(!K(P))return;let V=y.tracks.pointerHub.incoming().length;console.info(`PresetDecoder.decode: AudioUnit ${k.toString(y.address.uuid)} has ${V} pre-copied track(s)`),!(V>0)&&y.capture.targetVertex.ifSome(({box:O})=>{O instanceof Ba?_i.create(r.boxGraph,k.generate(),C=>{C.index.setValue(0),C.type.setValue(ye.Notes),C.target.refer(y),C.tracks.refer(y.tracks)}):O instanceof Ia&&_i.create(r.boxGraph,k.generate(),C=>{C.index.setValue(0),C.type.setValue(ye.Audio),C.target.refer(y),C.tracks.refer(y.tracks)})})}),w},t.peekHasTimeline=e=>{if(e.byteLength<8)return!1;let r=new lt(e.slice(0,8));if(r.readInt()!==ar.MAGIC_HEADER_OPEN||r.readInt()!==ar.FORMAT_VERSION)return!1;let n=new xo(_.wrap(bo.create));if(sr(()=>n.fromArrayBuffer(e.slice(8),!1)).status==="failure")return!1;for(let a of n.boxes())if(Ft(a,_i))return!0;return!1},t.replaceAudioUnit=(e,r,n)=>{console.debug("ReplaceAudioUnit with preset...");let i=Zo.empty({createDefaultUser:!1,createOutputMaximizer:!1}),a=i.boxGraph,o=r.graph;a.beginTransaction(),t.decode(e,i),a.endTransaction();let s=i.mandatoryBoxes.rootBox.audioUnits.pointerHub.incoming().map(({box:C})=>je(C,it)).find(C=>C.type.getValue()!==Tt.Output);if(r_(s))return Dr.err("Preset contains no valid audio unit. Please send the file to the developers.");let c=s.capture.targetVertex.mapOr(({box:C})=>C.name,""),u=r.capture.targetVertex.mapOr(({box:C})=>C.name,"");if(c!==u)return Dr.err("Cannot replace incompatible instruments");let f=n?.keepMIDIEffects!==!0,v=n?.keepAudioEffects!==!0,m=n?.keepTimeline!==!0;console.debug("replaceMIDIEffects",f),console.debug("replaceAudioEffects",v),console.debug("replaceTimeline",m),He(r.input.pointerHub.incoming().at(0)?.box,"Target has no input").delete(),f?r.midiEffects.pointerHub.incoming().forEach(({box:C})=>C.delete()):(a.beginTransaction(),s.midiEffects.pointerHub.incoming().forEach(({box:C})=>C.delete()),a.endTransaction()),v?r.audioEffects.pointerHub.incoming().forEach(({box:C})=>C.delete()):(a.beginTransaction(),s.audioEffects.pointerHub.incoming().forEach(({box:C})=>C.delete()),a.endTransaction()),s.tracks.pointerHub.incoming().length>0&&m&&r.tracks.pointerHub.incoming().forEach(({box:C})=>C.delete());let y=C=>!!(C.accept({visitCaptureMidiBox:G=>!0,visitCaptureAudioBox:G=>!0})===!0||!m&&Vt.excludeTimelinePredicate(C)),P=k.newSet(({source:C})=>C),V=Array.from(a.dependenciesOf(s,{excludeBox:y,alwaysFollowMandatory:!0,stopAtResources:!0}).boxes);P.addMany([{source:s.address.uuid,target:r.address.uuid},...V.map(({address:{uuid:C},name:G})=>({source:C,target:G===dn.ClassName||G===ka.ClassName?C:k.generate()}))]);let O=k.newSet(C=>C);return V.forEach(C=>{(C instanceof dn||C instanceof ka)&&o.findBox(C.address.uuid).nonEmpty()&&O.add(C.address.uuid)}),I.decodeWith({map:(C,G)=>G.flatMap(Y=>P.opt(Y.uuid).match({some:({target:me})=>_.wrap(Y.moveTo(me)),none:()=>o.findBox(Y.uuid).nonEmpty()?_.wrap(Y):_.None}))},()=>{V.forEach(C=>{if((C instanceof dn||C instanceof ka)&&O.opt(C.address.uuid).nonEmpty())return;let G=new lt(C.toArrayBuffer()),Y=C.name,me=P.get(C.address.uuid,"uuid mapping").target;o.createBox(Y,me,ge=>ge.read(G))})}),Dr.Ok},t.insertEffectChain=(e,r,n,i)=>{if(e.byteLength<8)return Dr.err("Invalid preset header");let a=new lt(e.slice(0,8));if(a.readInt()!==ar.MAGIC_HEADER_OPEN)return Dr.err("Invalid preset header");let o=a.readInt();if(o!==ar.FORMAT_VERSION)return Dr.err(`Unsupported preset version ${o} (this build supports ${ar.FORMAT_VERSION}).`);let s=new xo(_.wrap(bo.create)),c=sr(()=>s.fromArrayBuffer(e.slice(8),!1));if(c.status==="failure")return Dr.err(`Failed to decode preset: ${String(c.error)}`);let u=s.boxes().filter(ge=>Ft(ge,it)).map(ge=>je(ge,it)).find(ge=>ge.type.getValue()!==Tt.Output);if(r_(u))return Dr.err("Preset contains no audio unit");let f=i===ar.ChainKind.Audio?u.audioEffects:u.midiEffects,v=bi.collectIndexedBoxes(f);if(v.length===0)return Dr.err("Preset contains no effects of the requested kind");let m=r.address,w=i===ar.ChainKind.Audio?l.AudioEffectHost:l.MIDIEffectHost,y=r.box.graph,P=v.length,V=bi.collectIndexedBoxes(r);for(let ge=V.length-1;ge>=0;ge--){let Ee=V[ge],he=Ee.index.getValue();he>=n&&Ee.index.setValue(he+P)}let O=ge=>Vt.shouldExclude(ge)||Vt.excludeTimelinePredicate(ge)||ge instanceof it,C=new Set(v),G=Array.from(s.dependenciesOf(v,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:O}).boxes).filter(ge=>!C.has(ge)),Y=k.newSet(ge=>ge);G.forEach(ge=>{ge.resource==="preserved"&&y.findBox(ge.address.uuid).nonEmpty()&&Y.add(ge.address.uuid)});let me=k.newSet(({source:ge})=>ge);return me.addMany([...v.map(ge=>({source:ge.address.uuid,target:k.generate()})),...G.map(ge=>({source:ge.address.uuid,target:ge.resource==="preserved"?ge.address.uuid:k.generate()}))]),I.decodeWith({map:(ge,Ee)=>{let he=Ee.flatMap(Me=>me.opt(Me.uuid).map(({target:ke})=>Me.moveTo(ke)));return he.nonEmpty()?he:ge.pointerType===w?_.wrap(m):Ee.flatMap(Me=>y.findBox(Me.uuid).nonEmpty()?_.wrap(Me):_.None)}},()=>{v.forEach((ge,Ee)=>{let he=new lt(ge.toArrayBuffer()),Me=me.get(ge.address.uuid,"uuid mapping").target;y.createBox(ge.name,Me,ke=>{ke.read(he),bi.isIndexedBox(ke)&&ke.index.setValue(n+Ee)})}),G.forEach(ge=>{if(Y.hasKey(ge.address.uuid))return;let Ee=new lt(ge.toArrayBuffer()),he=me.get(ge.address.uuid,"uuid mapping").target;y.createBox(ge.name,he,Me=>Me.read(Ee))})}),Dr.Ok}})(iD||(iD={}));A();var nD;(function(t){t.encode=(e,r={})=>{let n=Gt.create();n.writeInt(ar.MAGIC_HEADER_OPEN),n.writeInt(ar.FORMAT_VERSION);let i=Zo.empty({createOutputMaximizer:!1,createDefaultUser:!1}),{boxGraph:a,mandatoryBoxes:{rootBox:o,primaryAudioBusBox:s}}=i,c=[e],u=r.excludeEffect??(()=>!1),f=r.includeTimeline===!0,v=P=>Vt.shouldExclude(P)||!f&&Vt.excludeTimelinePredicate(P)||u(P);a.beginTransaction();let m=Array.from(e.graph.dependenciesOf(c,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:v}).boxes),w={};for(let P of m)w[P.name]=(w[P.name]??0)+1;console.info(`PresetEncoder.encode: includeTimeline=${f}, deps=${m.length}`,w);let y=Vt.generateMap(c,m,o.audioUnits.address.uuid,s.address.uuid);return Vt.copyBoxes(y,a,c,m),Vt.reorderAudioUnits(y,c,o),a.endTransaction(),ie.concatArrayBuffers(n.toArrayBuffer(),a.toArrayBuffer())},t.encodeEffects=(e,r)=>{let n=Gt.create();n.writeInt(ar.MAGIC_HEADER_OPEN),n.writeInt(ar.FORMAT_VERSION);let i=Zo.empty({createOutputMaximizer:!1,createDefaultUser:!1}),{boxGraph:a,mandatoryBoxes:{rootBox:o,primaryAudioBusBox:s}}=i;a.beginTransaction();let c=r===ar.ChainKind.Audio?Ia.create(a,k.generate()):Ba.create(a,k.generate()),u=it.create(a,k.generate(),f=>{f.collection.refer(o.audioUnits),f.output.refer(s.input),f.index.setValue(0),f.type.setValue(Tt.Instrument),f.capture.refer(c)});if(Fu.create(a,k.generate(),f=>{f.host.refer(u.input)}),e.length>0){let f=e[0].graph,v=O=>Vt.shouldExclude(O)||Vt.excludeTimelinePredicate(O)||O instanceof it,m=new Set(e),w=Array.from(f.dependenciesOf(e,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:v}).boxes).filter(O=>!m.has(O)),y=k.newSet(({source:O})=>O);y.addMany([...e.map(O=>({source:O.address.uuid,target:k.generate()})),...w.map(O=>({source:O.address.uuid,target:O.resource==="preserved"?O.address.uuid:k.generate()}))]);let P=r===ar.ChainKind.Audio?u.audioEffects:u.midiEffects,V=r===ar.ChainKind.Audio?l.AudioEffectHost:l.MIDIEffectHost;I.decodeWith({map:(O,C)=>{let G=C.flatMap(Y=>y.opt(Y.uuid).map(({target:me})=>Y.moveTo(me)));return G.nonEmpty()?G:O.pointerType===V?_.wrap(P.address):C.flatMap(Y=>a.findBox(Y.uuid).nonEmpty()?_.wrap(Y):_.None)}},()=>{e.forEach((O,C)=>{let G=new lt(O.toArrayBuffer()),Y=y.get(O.address.uuid,"uuid mapping").target;a.createBox(O.name,Y,me=>{me.read(G),bi.isIndexedBox(me)&&me.index.setValue(C)})}),w.forEach(O=>{let C=new lt(O.toArrayBuffer()),G=y.get(O.address.uuid,"uuid mapping").target;a.createBox(O.name,G,Y=>Y.read(C))})})}return a.endTransaction(),ie.concatArrayBuffers(n.toArrayBuffer(),a.toArrayBuffer())}})(nD||(nD={}));A();var aD;(function(t){t.existingInstrumentNames=e=>e.audioUnits.pointerHub.incoming().map(({box:r})=>{let n=je(r,it).input.pointerHub.incoming().at(0);if(n===void 0)return"N/A";let i=n.box;return"label"in i&&i.label instanceof T?i.label.getValue():"N/A"})})(aD||(aD={}));A();var oD;(function(t){t.Unknown={detect:async(e,r)=>(r(1),_.None)}})(oD||(oD={}));A();var sD=Oe.object({name:Oe.string(),bpm:Oe.number(),duration:Oe.number(),sample_rate:Oe.number(),origin:Oe.enum(["openDAW","recording","import"]),custom:Oe.string().optional()});var Dve=sD.extend({uuid:k.zType(Oe)});var Y4,X4,Q4,eV,tV,rV;Y4=new WeakMap,X4=new WeakMap,Q4=new WeakMap,eV=new WeakMap,tV=new WeakMap,rV=new WeakMap;var iV,nV,aV,oV,sV,lV;iV=new WeakMap,nV=new WeakMap,aV=new WeakMap,oV=new WeakMap,sV=new WeakMap,lV=new WeakMap;A();var cV=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},wr=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},el,uV,dV,ng,lD,$b,sM,ag,pV,lM,cD,uD,cM,dD;uV=new WeakMap,dV=new WeakMap,ng=new WeakMap,lD=new WeakMap,$b=new WeakMap,sM=new WeakMap,ag=new WeakMap,el=new WeakSet,pV=function(e){let r=wr(this,ag,"f");cV(this,ag,e.isEmpty()?_.None:_.wrap(e.unwrap()),"f"),r.ifSome(n=>wr(this,el,"m",lM).call(this,n)),wr(this,ag,"f").ifSome(n=>{r.contains(n)||wr(this,el,"m",lM).call(this,n)})},lM=function(e){let r=wr(this,lD,"f").hasKey(e.address.uuid)&&!wr(this,ag,"f").contains(e),n=wr(this,$b,"f").hasKey(e.address.uuid);r!==n&&(r?wr(this,$b,"f").add({user:e,terminable:wr(this,el,"m",cD).call(this,e)}):wr(this,$b,"f").removeByKey(e.address.uuid).terminable.terminate())},cD=function(e){let r=k.newSet(i=>i.box.address.uuid),n=e.selection.pointerHub.catchupAndSubscribe({onAdded:i=>{let a=je(i.box,Na);a.selectable.targetVertex.ifSome(o=>{let s=o;r.add({box:a,selectable:s})&&wr(this,el,"m",uD).call(this,s,e)})},onRemoved:i=>{let a=je(i.box,Na),o=r.removeByKeyIfExist(a.address.uuid);K(o)&&wr(this,el,"m",cM).call(this,o.selectable,e)}},l.Selection);return{terminate:()=>{n.terminate(),r.forEach(i=>wr(this,el,"m",cM).call(this,i.selectable,e)),r.clear()}}},uD=function(e,r){(wr(this,ng,"f").getOrNull(e.address)??wr(this,el,"m",dD).call(this,e)).owners.add(r),wr(this,sM,"f").proxy.onSelected(e,r)},cM=function(e,r){let n=wr(this,ng,"f").getOrNull(e.address);K(n)&&(n.owners.removeByKey(r.address.uuid),n.owners.size()===0&&wr(this,ng,"f").removeByKey(e.address),wr(this,sM,"f").proxy.onDeselected(e,r))},dD=function(e){let r={selectable:e,owners:k.newSet(n=>n.address.uuid)};return wr(this,ng,"f").add(r),r};A();var Bp=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},fV,hV,uM,dM,pM,mV,gV,vV;hV=new WeakMap,uM=new WeakMap,dM=new WeakMap,pM=new WeakMap,mV=new WeakMap,gV=new WeakMap,fV=new WeakSet,vV=function(e){return e.pointerHub.catchupAndSubscribe({onAdded:r=>{let n=je(r.box,Na);ee(n.isAttached(),"SelectionBox is not attached");let i=n.selectable.targetVertex.unwrap(()=>`SelectionBox has no target (${n.selectable.targetAddress.unwrapOrUndefined()?.toString()??"No address"})`),a={box:n,selectable:i};Bp(this,pM,"f").proxy.onSelected(i),ee(Bp(this,uM,"f").add(a),"Could not add to entityMap"),ee(Bp(this,dM,"f").add(a),"Could not add to selectableMap")},onRemoved:r=>{let n=je(r.box,Na),i=Bp(this,uM,"f").removeByKey(n.address.uuid);ee(i.box===n,"Broken selection");let a=i.selectable;Bp(this,pM,"f").proxy.onDeselected(a),Bp(this,dM,"f").removeByKey(a.address)}},l.Selection)};A();var pD=Oe.object({name:Oe.string(),size:Oe.number().int(),url:Oe.string(),license:Oe.string(),origin:Oe.enum(["openDAW","import"])});var ixe=pD.extend({uuid:k.zType(Oe)});A();var fD;(function(t){t.cut=(e,r,n)=>{if(e.position>=r||r>=e.complete)return _.None;if(Q1.isLoopableRegion(e)){let{position:i,complete:a,loopOffset:o,loopDuration:s}=e;return e.duration=r-i,_.wrap(e.copyTo({position:r,duration:a-r,loopOffset:sl(o+(r-i),s),consolidate:n}))}else return W("Not yet implemented")},t.clip=(e,r,n)=>{if(Q1.isLoopableRegion(e)){let{position:i,complete:a,loopOffset:o,loopDuration:s}=e;return r-i<=0?W(`first part duration will be zero or negative(${r-i})`):a-n<=0?W(`second part duration will be zero or negative(${a-n})`):(e.duration=r-i,e.copyTo({position:n,duration:a-n,loopOffset:sl(o+(n-i),s)}))}else return W("Not yet implemented")}})(fD||(fD={}));var mD=()=>new WebAssembly.Memory({initial:256}),hD=[{url:"/wasm/plugins/device_vaporisateur.wasm",boxType:"VaporisateurDeviceBox"},{url:"/wasm/plugins/device_neon.wasm",boxType:"NeonDeviceBox"},{url:"/wasm/plugins/device_nano.wasm",boxType:"NanoDeviceBox"},{url:"/wasm/plugins/device_revamp.wasm",boxType:"RevampDeviceBox"},{url:"/wasm/plugins/device_tidal.wasm",boxType:"TidalDeviceBox"},{url:"/wasm/plugins/device_delay.wasm",boxType:"DelayDeviceBox"},{url:"/wasm/plugins/device_gate.wasm",boxType:"GateDeviceBox"},{url:"/wasm/plugins/device_arpeggio.wasm",boxType:"ArpeggioDeviceBox"},{url:"/wasm/plugins/device_zeitgeist.wasm",boxType:"ZeitgeistDeviceBox"},{url:"/wasm/plugins/device_pitch.wasm",boxType:"PitchDeviceBox"},{url:"/wasm/plugins/device_werkstatt.wasm",boxType:"WerkstattDeviceBox"},{url:"/wasm/plugins/device_apparat.wasm",boxType:"ApparatDeviceBox"},{url:"/wasm/plugins/device_spielwerk.wasm",boxType:"SpielwerkDeviceBox"},{url:"/wasm/plugins/device_waveshaper.wasm",boxType:"WaveshaperDeviceBox"},{url:"/wasm/plugins/device_crusher.wasm",boxType:"CrusherDeviceBox"},{url:"/wasm/plugins/device_fold.wasm",boxType:"FoldDeviceBox"},{url:"/wasm/plugins/device_stereo_tool.wasm",boxType:"StereoToolDeviceBox"},{url:"/wasm/plugins/device_velocity.wasm",boxType:"VelocityDeviceBox"},{url:"/wasm/plugins/device_maximizer.wasm",boxType:"MaximizerDeviceBox"},{url:"/wasm/plugins/device_compressor.wasm",boxType:"CompressorDeviceBox"},{url:"/wasm/plugins/device_reverb.wasm",boxType:"ReverbDeviceBox"},{url:"/wasm/plugins/device_dattorro_reverb.wasm",boxType:"DattorroReverbDeviceBox"},{url:"/wasm/plugins/device_soundfont.wasm",boxType:"SoundfontDeviceBox"},{url:"/wasm/plugins/device_cubed.wasm",boxType:"CubedDeviceBox"},{url:"/wasm/plugins/device_vocoder.wasm",boxType:"VocoderDeviceBox"},{url:"/wasm/plugins/device_neural_amp.wasm",boxType:"NeuralAmpDeviceBox"},{url:"/wasm/plugins/device_autotune.wasm",boxType:"AutotuneDeviceBox"},{url:"/wasm/plugins/device_playfield_sample.wasm",boxType:"PlayfieldSampleBox"}],xV=[{boxType:"PlayfieldDeviceBox",childrenField:10,indexKey:15,excludeKey:42,cellInstrumentField:0,cellMidiField:0,cellAudioField:0,childEnabledKey:22,childMuteKey:40,childSoloKey:41,childVolumeKey:50,childPanKey:51},{boxType:"CompositeDeviceBox",childrenField:10,indexKey:5,excludeKey:0,cellInstrumentField:2,cellMidiField:3,cellAudioField:4,childEnabledKey:0,childMuteKey:0,childSoloKey:0,childVolumeKey:0,childPanKey:0}],yV=[{boxType:"AudioEffectCompositeBox",kind:1,distributor:0,entriesField:10,indexKey:3,chainField:2,labelKey:4,gainKey:40,panKey:43,muteKey:41,soloKey:42,dryKey:12,wetKey:13,inputTapField:11,crossoverKeys:[0,0,0]},{boxType:"StereoCompositeBox",kind:1,distributor:1,entriesField:10,indexKey:3,chainField:2,labelKey:4,gainKey:40,panKey:43,muteKey:41,soloKey:42,dryKey:12,wetKey:13,inputTapField:11,crossoverKeys:[0,0,0]},{boxType:"FrequencySplitBox",kind:1,distributor:2,entriesField:10,indexKey:3,chainField:2,labelKey:4,gainKey:40,panKey:43,muteKey:41,soloKey:42,dryKey:12,wetKey:13,inputTapField:11,crossoverKeys:[14,15,16]}],gD=async(t="")=>{let e=[`${t}/wasm/engine.wasm`,...hD.map(a=>`${t}${a.url}`)],r=await Promise.all(e.map(a=>fetch(a).then(o=>o.ok?o.arrayBuffer():Promise.reject(new Error(`Could not load wasm module '${a}' (${o.status} ${o.statusText})`))))),[n,...i]=await Promise.all(r.map(a=>WebAssembly.compile(a)));return{engineModule:n,deviceModules:i,deviceBoxTypes:hD.map(a=>a.boxType),composites:xV,effectComposites:yV}};A();var vD=t=>{let e=Gt.create();return e.writeInt(t.length),t.forEach(r=>{if(e.writeString(r.type),r.type==="new")k.toDataOutput(e,r.uuid),e.writeString(r.name),e.writeInt(r.buffer.byteLength),e.writeBytes(new Int8Array(r.buffer));else if(r.type==="update-primitive"){ze.reconstruct(r.address).write(e);let n=vo[r.primitiveType];e.writeString(n.type),n.encode(e,r.value)}else r.type==="update-pointer"?(ze.reconstruct(r.address).write(e),K(r.target)?(e.writeBoolean(!0),ze.reconstruct(r.target).write(e)):e.writeBoolean(!1)):r.type==="delete"&&k.toDataOutput(e,r.uuid)}),e.toArrayBuffer()};A();A();var kb=class{#e;#t;#r;#i;#n=new Map;#a=[];constructor(e,r){this.#e=e,this.#t=new Uint32Array(r,0,2),this.#r=new Uint32Array(r,8),this.#i=(this.#r.length>>1)-1}send(e,r,n){let i=this.#n.get(e);if(xg(i)){if(i=this.#a.length,i>=64)return console.error(`Too many MIDI devices: ${i}, max is 64`),!1;this.#n.set(e,i),this.#a.push(e),this.#e.postMessage({registerDevice:e,id:i})}let a=Atomics.load(this.#t,0),o=a+1&this.#i;if(o===Atomics.load(this.#t,1))return!1;let s=r.length,c=r[0]??0,u=r[1]??0,f=r[2]??0,v=s<<30|i<<24|c<<16|u<<8|f,m=n|0,w=a<<1;return this.#r[w]=v,this.#r[w+1]=m,Atomics.store(this.#t,0,o),this.#e.postMessage(null),!0}};var Ib=t=>{let e="",r=0,n=()=>(t[r++]??0)&63;for(;r<t.length;){let i=t[r++]??0,a=i<128?i:(i&224)===192?(i&31)<<6|n():(i&240)===224?(i&15)<<12|n()<<6|n():(i&248)===240?(i&7)<<18|n()<<12|n()<<6|n():65533;e+=a<=1114111?String.fromCodePoint(a):"\uFFFD"}return e};var fM=16,Bb=class{#e=new Map;#t=[new Uint8Array(1),new Uint8Array(2),new Uint8Array(3)];#r=null;connect(e,r){this.#r=new kb(e,r)}drain(e,r){let n=e.midi_out_count();if(n===0)return;let i=e.input_reserve(n*fM),a=e.midi_out_take(i),o=this.#r;if(o===null)return;let s=new Uint8Array(r.buffer,i,a*fM).slice(),c=new DataView(s.buffer);for(let u=0;u<a;u++){let f=u*fM,v=c.getUint32(f,!0),m=Math.min(Math.max(c.getUint8(f+7),1),3),w=c.getFloat64(f+8,!0),y=this.#t[m-1];y[0]=c.getUint8(f+4),m>1&&(y[1]=c.getUint8(f+5)),m>2&&(y[2]=c.getUint8(f+6)),o.send(this.#i(e,r,v),y,w)}}#i(e,r,n){let i=this.#e.get(n);if(K(i))return i;let a=e.input_reserve(256),o=e.midi_out_device_id(n,a,256),s=o===0?"":Ib(new Uint8Array(r.buffer,a,o));return this.#e.set(n,s),s}};A();var xD=(t,e)=>{let r=t.panic_message_len();return r===0?"":Ib(new Uint8Array(e.buffer,t.panic_message_ptr(),r))};var wV=["host_pull_events","host_pulse_to_offset","host_bind_parameter","host_bind_broadcast","host_broadcast_ptr","host_broadcast_active","host_update_parameters","host_first_update_position","host_next_update_position","host_resolve_sample","host_observe_sample","host_resolve_soundfont","host_observe_soundfont","host_observe_field","host_observe_target_string","host_bind_sidechain","host_resolve_input","host_self_uuid","host_panic","host_base_frequency"],Tb=(t,e)=>{let r=0,n=0,i=e;for(;;){let a=t[i++];if(r|=(a&127)<<n,(a&128)===0)break;n+=7}return[r>>>0,i]},bV=t=>{let e=WebAssembly.Module.customSections(t,"dylink.0");if(e.length===0)return{memorySize:0,tableSize:0};let r=new Uint8Array(e[0]),n=0;for(;n<r.length;){let i=r[n++],[a,o]=Tb(r,n);if(i===1){let[s,c]=Tb(r,o),[,u]=Tb(r,c),[f]=Tb(r,u);return{memorySize:s,tableSize:f}}n=o+a}return{memorySize:0,tableSize:0}},hM=(t,e,r)=>{let n=r.length,i=t.input_reserve(n),a=new Uint8Array(e.buffer,i,n);for(let o=0;o<n;o++)a[o]=r.charCodeAt(o)&255;return n},yD=(t,e,r,n,i,a,o)=>{let{memorySize:s,tableSize:c}=bV(n),u=t.device_alloc(s),f=c>0?r.grow(c):r.length,v=t.device_alloc(262144),m={memory:e,__indirect_function_table:r,__memory_base:new WebAssembly.Global({value:"i32",mutable:!1},u),__table_base:new WebAssembly.Global({value:"i32",mutable:!1},f),__stack_pointer:new WebAssembly.Global({value:"i32",mutable:!0},v+262144)};for(let O of wV){let C=t[O];if(typeof C!="function")throw new Error(`engine is missing the device host export '${O}'`);m[O]=C}Object.assign(m,o);let w=new WebAssembly.Instance(n,{env:m}).exports;w.__wasm_apply_data_relocs?.(),w.__wasm_call_ctors?.();let y=O=>{if(O===void 0)return 0;let C=r.grow(1);return r.set(C,O),C},P=r.grow(1);r.set(P,w.process_events??w.process);let V=t.device_register(P,w.state_size(a),w.kind(),y(w.init),y(w.parameter_changed),y(w.field_changed),y(w.sample_changed),y(w.soundfont_changed),y(w.reset),y(w.terminate),w.midi_effects_field?.()??0,w.audio_effects_field?.()??0,w.observe_param_collection_field?.()??0,w.observe_sample_collection_field?.()??0);t.device_set_box_type(V,hM(t,e,i))},wD=(t,e,r)=>{t.composite_register(hM(t,e,r.boxType),r.childrenField,r.indexKey,r.excludeKey,r.cellInstrumentField,r.cellMidiField,r.cellAudioField,r.childEnabledKey,r.childMuteKey,r.childSoloKey,r.childVolumeKey,r.childPanKey)},bD=(t,e,r)=>{t.effect_composite_register(hM(t,e,r.boxType),r.kind,r.distributor,r.entriesField,r.indexKey,r.chainField,r.labelKey,r.gainKey,r.panKey,r.muteKey,r.soloKey,r.dryKey,r.wetKey,r.inputTapField,r.crossoverKeys[0],r.crossoverKeys[1],r.crossoverKeys[2])};A();rt();var _V=1,Db=class{retained=[];scheduled=[];sourceToOutput=new Map;reset(){this.retained.length=0,this.scheduled.length=0,this.sourceToOutput.clear()}},FV=(t,e,r,n,i,a,o,s,c)=>{let u=e*40;t.setFloat64(u+0,n,!0),t.setUint32(u+8,0,!0),t.setUint32(u+12,r,!0),t.setUint32(u+16,i,!0),t.setUint32(u+20,a,!0),t.setFloat32(u+24,o,!0),t.setFloat32(u+28,s,!0),t.setFloat64(u+32,c,!0)},mM=(t,e,r,n,i)=>{let a=Math.min(r,i);return new Uint8Array(t,n,a*40).set(new Uint8Array(t,e,a*40)),a},AV=(t,e)=>t==null?"process yielded undefined":typeof t.pitch!="number"||t.pitch!==t.pitch?`Invalid pitch: ${t.pitch}`:t.pitch<0||t.pitch>127?`Pitch out of range: ${t.pitch} (must be 0-127)`:typeof t.velocity!="number"||t.velocity!==t.velocity?`Invalid velocity: ${t.velocity}`:t.velocity<0||t.velocity>1?`Velocity out of range: ${t.velocity} (must be 0-1)`:typeof t.duration!="number"||t.duration!==t.duration?`Invalid duration: ${t.duration}`:t.duration<=0?`Duration must be positive: ${t.duration}`:typeof t.position!="number"||t.position!==t.position?`Invalid position: ${t.position}`:t.position<e?`Position ${t.position} is in the past (block starts at ${e})`:null,FD=(t,e,r,n,i,a,o,s,c,u,f,v,m,w)=>{let y=new DataView(r,n,i*40),P=new DataView(r,a,o*40),V=w?mM(r,n,i,a,o):0,O=(Ee,he,Me,ke,mt,te,_e)=>{if(V>=o)throw new Error(`Note flood: exceeded ${o} output notes per range`);FV(P,V++,Ee,he,Me,ke,mt,te,_e)};if((f&2)!==0){for(let Ee of t.retained)O(1,s,Ee.id,Ee.pitch,0,0,0);t.reset()}for(let Ee=t.retained.length-1;Ee>=0;Ee--){let he=t.retained[Ee],Me=he.position+he.duration;Me<c&&(t.retained.splice(Ee,1),O(1,Me,he.id,he.pitch,0,0,0))}let C=[];for(let Ee=0;Ee<i;Ee++){let he=Ee*40,Me=y.getUint32(he+12,!0),ke=y.getUint32(he+16,!0),mt=y.getFloat64(he+0,!0),te=y.getUint32(he+20,!0);if(Me===0)C.push({gate:!0,id:ke,position:mt,duration:y.getFloat64(he+32,!0),pitch:te,velocity:y.getFloat32(he+24,!0),cent:y.getFloat32(he+28,!0)});else if(Me===1){let _e=t.sourceToOutput.get(ke);if(_e!==void 0){for(let $r of _e){let Hr=t.retained.findIndex(or=>or.id===$r);if(Hr>=0){let or=t.retained.splice(Hr,1)[0];O(1,mt,or.id,or.pitch,0,0,0)}}t.sourceToOutput.delete(ke)}C.push({gate:!1,id:ke,position:mt,pitch:te})}}for(let Ee=t.scheduled.length-1;Ee>=0;Ee--){let he=t.scheduled[Ee];he.position>=s&&he.position<c&&(t.scheduled.splice(Ee,1),O(0,he.position,_D(t,he),he.pitch,he.velocity,he.cent,he.duration))}let G=-1,Y={[Symbol.iterator](){let Ee=0;return{next(){if(Ee>=C.length)return G=-1,{done:!0,value:void 0};let he=C[Ee++];return he.gate&&(G=he.id),{done:!1,value:he}}}}},me={from:s,to:c,bpm:u,s0:v,s1:m,flags:f},ge=0;for(let Ee of e.process(me,Y)){if(++ge>128)throw new Error("Note flood: exceeded 128 notes per block");let he=AV(Ee,s);if(he!==null)throw new Error(he);let Me={position:Ee.position,duration:Ee.duration,pitch:Ee.pitch,velocity:Ee.velocity,cent:Ee.cent??0};if(Me.position>=c){if(t.scheduled.length>=128)throw new Error("Scheduler full: exceeded 128 scheduled notes");t.scheduled.push(Me)}else{let ke=_D(t,Me);if(G>=0){let mt=t.sourceToOutput.get(G);mt===void 0&&(mt=new Set,t.sourceToOutput.set(G,mt)),mt.add(ke)}O(0,Me.position,ke,Me.pitch,Me.velocity,Me.cent,Me.duration)}}return V},_D=(t,e)=>{let r=1073741824+(_V++&1073741823);return t.retained.push({id:r,position:e.position,duration:e.duration,pitch:e.pitch,velocity:e.velocity,cent:e.cent}),r};var Rb=128,EV=375,gM=0,ED=1,SD=2,SV={[gM]:"apparatProcessors",[ED]:"werkstattProcessors",[SD]:"spielwerkProcessors"},PV=0,AD=1e3,vM=class{constructor(e,r,n){this.uuid=e;this.kind=r;this.registryName=n}proc=null;currentUpdate=-1;silenced=!1;paramMappings=new Map;rawParams=new Map;sampleLabels=new Map;sampleHandles=new Map;limiter=null;spielwerk=null;pass=!0;missingCalls=0;warnedMissing=!1},MV=t=>{switch(t.mapping){case"unipolar":return E.unipolar();case"linear":return E.linear(t.min,t.max);case"exp":return E.exponential(t.min,t.max);case"int":return E.linearInteger(t.min,t.max);case"bool":return E.linearInteger(0,1);default:return E.unipolar()}},NV=(t,e,r)=>{for(let n=0;n<t.length;n++){let i=t[n];for(let a=e;a<r;a++){let o=i[a];if(o!==o)return`NaN detected in output channel ${n} at sample ${a}`;if(o>AD||o<-AD)return`Signal overflow in channel ${n} at sample ${a} (amplitude: ${o.toFixed(1)})`}}return null},Cb=class{#e;#t;#r;#i;#n=new Map;#a=new Map;#s=1;constructor(e,r,n,i=()=>{}){this.#e=e,this.#t=r,this.#r=n,this.#i=i}imports(){return{host_script_create:(e,r,n)=>this.#o(e,r,n),host_script_audio:(e,r,n,i,a,o,s,c,u,f,v,m)=>this.#l(e,r,n,i,a,o,s,c,u,f,v,m),host_script_note_on:(e,r,n,i,a)=>this.#u(e,r,n,i,a),host_script_note_off:(e,r)=>this.#m(e,r),host_script_reset:e=>this.#v(e),host_script_param:(e,r,n,i)=>this.#d(e,r,n,i),host_script_sample:(e,r,n,i)=>this.#f(e,r,n,i),host_script_notes:(e,r,n,i,a,o,s,c,u,f,v)=>this.#y(e,r,n,i,a,o,s,c,u,f,v),host_script_release:e=>this.#g(e)}}#o(e,r,n){let i=k.toString(new Uint8Array(this.#e.buffer,e,16).slice()),a=this.#a.get(i);K(a)&&this.#g(a);let o=this.#s++;return this.#n.set(o,new vM(i,r,SV[r]??"werkstattProcessors")),this.#a.set(i,o),o}#c(e){let r=globalThis.openDAW?.[e.registryName]?.[e.uuid];if(r===void 0&&e.currentUpdate===-1)return!e.warnedMissing&&++e.missingCalls>EV&&(e.warnedMissing=!0,this.#i(e.uuid,`No Processor registered at globalThis.openDAW.${e.registryName}[${e.uuid}] \u2014 device is rendering silence`)),null;if(r!==void 0&&r.update!==e.currentUpdate){e.pass=r.pass!==!1;try{let n=new r.create;if(e.paramMappings=new Map(r.params.map(i=>[i.index,{label:i.label,mapping:MV(i)}])),e.sampleLabels=new Map(r.samples.map(i=>[i.index,i.label])),e.kind===gM){n.samples={};for(let i of e.sampleLabels.values())n.samples[i]=null;e.limiter??=new Gg(this.#r)}e.kind===SD&&(e.spielwerk=new Db),e.proc=n,e.currentUpdate=r.update,e.silenced=!1;for(let[i,a]of e.rawParams)this.#p(e,i,a.kind,a.value);for(let[i,a]of e.sampleHandles)this.#h(e,i,a)}catch(n){this.#x(e,`Failed to instantiate Processor: ${n}`)}}return e.silenced?null:e.proc}#l(e,r,n,i,a,o,s,c,u,f,v,m){let w=this.#n.get(e);if(w===void 0)return 1;let y=this.#c(w);if(y===null)return 1;let P=this.#e.buffer,V=new Float32Array(P,i,Rb),O=new Float32Array(P,a,Rb),C={index:c,p0:u,p1:f,s0:o,s1:s,bpm:v,flags:m};try{if(w.kind===ED){let Y={src:[new Float32Array(P,r,Rb),new Float32Array(P,n,Rb)],out:[V,O]};y.process(Y,C)}else{for(let[Y,me]of w.sampleHandles)this.#h(w,Y,me);V.fill(0,o,s),O.fill(0,o,s),y.process([V,O],C)}}catch(Y){return this.#x(w,`Runtime error: ${Y}`),1}let G=NV([V,O],o,s);return G!==null?(V.fill(0,o,s),O.fill(0,o,s),this.#x(w,G),1):(w.kind===gM&&w.limiter!==null&&w.limiter.replace({channels:()=>[V,O]},o,s),0)}#u(e,r,n,i,a){let o=this.#n.get(e);o!==void 0&&this.#c(o)?.noteOn?.(r,n,i,a)}#m(e,r){let n=this.#n.get(e);n!==void 0&&this.#c(n)?.noteOff?.(r)}#v(e){let r=this.#n.get(e);r?.proc?.reset?.(),r?.spielwerk?.reset()}#d(e,r,n,i){let a=this.#n.get(e);a!==void 0&&(a.rawParams.set(r,{kind:n,value:i}),this.#p(a,r,n,i))}#p(e,r,n,i){let a=e.paramMappings.get(r);if(a===void 0)return;let o=n===PV?a.mapping.y(i):i;e.proc?.paramChanged?.(a.label,o)}#f(e,r,n,i){let a=this.#n.get(e);if(a===void 0)return;let o=i!==0?n:-1;a.sampleHandles.set(r,o),this.#h(a,r,o)}#y(e,r,n,i,a,o,s,c,u,f,v){let m=this.#n.get(e);if(m===void 0)return 0;let w=()=>m.pass?mM(this.#e.buffer,r,n,i,a):0,y=this.#c(m);if(y===null||m.spielwerk===null)return w();try{return FD(m.spielwerk,y,this.#e.buffer,r,n,i,a,o,s,c,u,f,v,m.pass)}catch(P){return this.#x(m,`Runtime error: ${P}`),w()}}#h(e,r,n){if(e.proc===null)return;let i=e.sampleLabels.get(r);if(i===void 0)return;if(n<0){e.proc.samples[i]=null;return}let a=this.#t.input_reserve(16);if(this.#t.host_resolve_sample(n,a)===0){e.proc.samples[i]=null;return}let o=new DataView(this.#e.buffer,a,16),s=o.getUint32(0,!0),c=o.getUint32(4,!0),u=o.getUint32(8,!0),f=o.getFloat32(12,!0),v=[];for(let m=0;m<u;m++)v.push(new Float32Array(this.#e.buffer,s+m*c*4,c));e.proc.samples[i]={sampleRate:f,numberOfFrames:c,numberOfChannels:u,frames:v}}#x(e,r){e.silenced=!0,this.#i(e.uuid,r)}#g(e){let r=this.#n.get(e);K(r)&&(this.#n.delete(e),this.#a.get(r.uuid)===e&&this.#a.delete(r.uuid))}liveBridgeCount(){return this.#n.size}};A();var zb=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},st=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Ct,Vc,Uc,og,sg=class t{constructor(e,r=128){if(Ct.set(this,void 0),Vc.set(this,void 0),Uc.set(this,void 0),og.set(this,void 0),zb(this,Ct,e,"f"),zb(this,og,r,"f"),zb(this,Vc,e._malloc(r*4),"f"),zb(this,Uc,e._malloc(r*4),"f"),st(this,Vc,"f")===0||st(this,Uc,"f")===0)throw new Error("Failed to allocate audio buffers")}static async create(e,r=128){let n=await e();return new t(n,r)}static fromModule(e,r=128){return new t(e,r)}dispose(){st(this,Ct,"f")._free(st(this,Vc,"f")),st(this,Ct,"f")._free(st(this,Uc,"f"))}createInstance(){return st(this,Ct,"f")._nam_createInstance()}destroyInstance(e){st(this,Ct,"f")._nam_destroyInstance(e)}getInstanceCount(){return st(this,Ct,"f")._nam_getInstanceCount()}loadModel(e,r){let n=st(this,Ct,"f").lengthBytesUTF8(r)+1,i=st(this,Ct,"f")._malloc(n);if(i===0)return!1;try{return st(this,Ct,"f").stringToUTF8(r,i,n),st(this,Ct,"f")._nam_loadModel(e,i)}finally{st(this,Ct,"f")._free(i)}}unloadModel(e){st(this,Ct,"f")._nam_unloadModel(e)}hasModel(e){return st(this,Ct,"f")._nam_hasModel(e)}process(e,r,n){let i=Math.min(r.length,n.length,st(this,og,"f")),a=st(this,Vc,"f")>>2,o=st(this,Uc,"f")>>2;st(this,Ct,"f").HEAPF32.set(r.subarray(0,i),a),st(this,Ct,"f")._nam_process(e,st(this,Vc,"f"),st(this,Uc,"f"),i),n.set(st(this,Ct,"f").HEAPF32.subarray(o,o+i))}processInPlace(e,r){this.process(e,r,r)}setSampleRate(e){st(this,Ct,"f")._nam_setSampleRate(e)}getSampleRate(){return st(this,Ct,"f")._nam_getSampleRate()}setMaxBufferSize(e){st(this,Ct,"f")._nam_setMaxBufferSize(e)}getMaxBufferSize(){return st(this,Ct,"f")._nam_getMaxBufferSize()}getModelLoudness(e){return st(this,Ct,"f")._nam_getModelLoudness(e)}hasModelLoudness(e){return st(this,Ct,"f")._nam_hasModelLoudness(e)}reset(e){st(this,Ct,"f")._nam_reset(e)}get bufferSize(){return st(this,og,"f")}};Ct=new WeakMap,Vc=new WeakMap,Uc=new WeakMap,og=new WeakMap;var xM;(function(t){t.parse=e=>JSON.parse(e),t.isArchitecture2=e=>e.architecture==="WaveNet"&&e.config.layers!==void 0&&e.config.layers.some(r=>r.gating_mode!==void 0||r.bottleneck!==void 0)})(xM||(xM={}));var $V=(()=>{var t=import.meta.url;return(function(e={}){var r=e,n,i;r.ready=new Promise((d,h)=>{n=d,i=h});var a=Object.assign({},r),o=[],s="./this.program",c=(d,h)=>{throw h},u=typeof window=="object",f=typeof importScripts=="function",v=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",m="";function w(d){return r.locateFile?r.locateFile(d,m):m+d}var y,P,V;(u||f)&&(f?m=self.location.href:typeof document<"u"&&document.currentScript&&(m=document.currentScript.src),t&&(m=t),m.indexOf("blob:")!==0?m=m.substr(0,m.replace(/[?#].*/,"").lastIndexOf("/")+1):m="",y=d=>{var h=new XMLHttpRequest;return h.open("GET",d,!1),h.send(null),h.responseText},f&&(V=d=>{var h=new XMLHttpRequest;return h.open("GET",d,!1),h.responseType="arraybuffer",h.send(null),new Uint8Array(h.response)}),P=(d,h,g)=>{var b=new XMLHttpRequest;b.open("GET",d,!0),b.responseType="arraybuffer",b.onload=()=>{if(b.status==200||b.status==0&&b.response){h(b.response);return}g()},b.onerror=g,b.send(null)});var O=r.print||console.log.bind(console),C=r.printErr||console.error.bind(console);Object.assign(r,a),a=null,r.arguments&&(o=r.arguments),r.thisProgram&&(s=r.thisProgram),r.quit&&(c=r.quit);var G;r.wasmBinary&&(G=r.wasmBinary),typeof WebAssembly!="object"&&Kc("no native wasm support detected");var Y,me=!1,ge;function Ee(d,h){d||Kc(h)}var he,Me,ke,mt,te,_e,$r,Hr;function or(){var d=Y.buffer;r.HEAP8=he=new Int8Array(d),r.HEAP16=ke=new Int16Array(d),r.HEAPU8=Me=new Uint8Array(d),r.HEAPU16=mt=new Uint16Array(d),r.HEAP32=te=new Int32Array(d),r.HEAPU32=_e=new Uint32Array(d),r.HEAPF32=$r=new Float32Array(d),r.HEAPF64=Hr=new Float64Array(d)}var Dp=[],cg=[],tl=[],jb=!1;function Kb(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)jc(r.preRun.shift());Gb(Dp)}function Rp(){jb=!0,!r.noFSInit&&!x.init.initialized&&x.init(),x.ignorePermissions=!1,Go.init(),Gb(cg)}function Wb(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)CD(r.postRun.shift());Gb(tl)}function jc(d){Dp.unshift(d)}function RD(d){cg.unshift(d)}function CD(d){tl.unshift(d)}var rl=0,Lb=null,Cp=null;function RV(d){return d}function Zb(d){rl++,r.monitorRunDependencies?.(rl)}function ug(d){if(rl--,r.monitorRunDependencies?.(rl),rl==0&&(Lb!==null&&(clearInterval(Lb),Lb=null),Cp)){var h=Cp;Cp=null,h()}}function Kc(d){r.onAbort?.(d),d="Aborted("+d+")",C(d),me=!0,ge=1,d+=". Build with -sASSERTIONS for more info.";var h=new WebAssembly.RuntimeError(d);throw i(h),h}var zD="data:application/octet-stream;base64,",AM=d=>d.startsWith(zD),il;r.locateFile?(il="nam.wasm",AM(il)||(il=w(il))):il=new URL("nam.wasm",import.meta.url).href;function EM(d){if(d==il&&G)return new Uint8Array(G);if(V)return V(d);throw"both async and sync fetching of the wasm failed"}function OD(d){return!G&&(u||f)&&typeof fetch=="function"?fetch(d,{credentials:"same-origin"}).then(h=>{if(!h.ok)throw"failed to load wasm binary file at '"+d+"'";return h.arrayBuffer()}).catch(()=>EM(d)):Promise.resolve().then(()=>EM(d))}function SM(d,h,g){return OD(d).then(b=>WebAssembly.instantiate(b,h)).then(b=>b).then(g,b=>{C(`failed to asynchronously prepare wasm: ${b}`),Kc(b)})}function VD(d,h,g,b){return!d&&typeof WebAssembly.instantiateStreaming=="function"&&!AM(h)&&typeof fetch=="function"?fetch(h,{credentials:"same-origin"}).then(M=>{var z=WebAssembly.instantiateStreaming(M,g);return z.then(b,function(U){return C(`wasm streaming compile failed: ${U}`),C("falling back to ArrayBuffer instantiation"),SM(h,g,b)})}):SM(h,g,b)}function UD(){var d={a:bR};function h(b,M){return wt=b.exports,Y=wt.l,or(),RD(wt.m),ug("wasm-instantiate"),wt}Zb("wasm-instantiate");function g(b){h(b.instance)}if(r.instantiateWasm)try{return r.instantiateWasm(d,h)}catch(b){C(`Module.instantiateWasm callback failed with error: ${b}`),i(b)}return VD(G,il,d,g).catch(i),{}}var tt,kr,Gb=d=>{for(;d.length>0;)d.shift()(r)},CV=r.noExitRuntime||!0;function jD(d){this.excPtr=d,this.ptr=d-24,this.set_type=function(h){_e[this.ptr+4>>2]=h},this.get_type=function(){return _e[this.ptr+4>>2]},this.set_destructor=function(h){_e[this.ptr+8>>2]=h},this.get_destructor=function(){return _e[this.ptr+8>>2]},this.set_caught=function(h){h=h?1:0,he[this.ptr+12>>0]=h},this.get_caught=function(){return he[this.ptr+12>>0]!=0},this.set_rethrown=function(h){h=h?1:0,he[this.ptr+13>>0]=h},this.get_rethrown=function(){return he[this.ptr+13>>0]!=0},this.init=function(h,g){this.set_adjusted_ptr(0),this.set_type(h),this.set_destructor(g)},this.set_adjusted_ptr=function(h){_e[this.ptr+16>>2]=h},this.get_adjusted_ptr=function(){return _e[this.ptr+16>>2]},this.get_exception_ptr=function(){var h=VM(this.get_type());if(h)return _e[this.excPtr>>2];var g=this.get_adjusted_ptr();return g!==0?g:this.excPtr}}var PM=0,KD=0,WD=(d,h,g)=>{var b=new jD(d);throw b.init(h,g),PM=d,KD++,PM},LD=()=>{Kc("")},ZD=(d,h,g)=>Me.copyWithin(d,h,h+g),GD=()=>536870912,HD=d=>{var h=Y.buffer,g=(d-h.byteLength+65535)/65536;try{return Y.grow(g),or(),1}catch{}},qD=d=>{var h=Me.length;d>>>=0;var g=GD();if(d>g)return!1;for(var b=(ce,Ue)=>ce+(Ue-ce%Ue)%Ue,M=1;M<=4;M*=2){var z=h*(1+.2/M);z=Math.min(z,d+100663296);var U=Math.min(g,b(Math.max(d,z),65536)),L=HD(U);if(L)return!0}return!1},Hb={},JD=()=>s||"./this.program",zp=()=>{if(!zp.strings){var d=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",h={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:d,_:JD()};for(var g in Hb)Hb[g]===void 0?delete h[g]:h[g]=Hb[g];var b=[];for(var g in h)b.push(`${g}=${h[g]}`);zp.strings=b}return zp.strings},YD=(d,h)=>{for(var g=0;g<d.length;++g)he[h++>>0]=d.charCodeAt(g);he[h>>0]=0},gt={isAbs:d=>d.charAt(0)==="/",splitPath:d=>{var h=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return h.exec(d).slice(1)},normalizeArray:(d,h)=>{for(var g=0,b=d.length-1;b>=0;b--){var M=d[b];M==="."?d.splice(b,1):M===".."?(d.splice(b,1),g++):g&&(d.splice(b,1),g--)}if(h)for(;g;g--)d.unshift("..");return d},normalize:d=>{var h=gt.isAbs(d),g=d.substr(-1)==="/";return d=gt.normalizeArray(d.split("/").filter(b=>!!b),!h).join("/"),!d&&!h&&(d="."),d&&g&&(d+="/"),(h?"/":"")+d},dirname:d=>{var h=gt.splitPath(d),g=h[0],b=h[1];return!g&&!b?".":(b&&(b=b.substr(0,b.length-1)),g+b)},basename:d=>{if(d==="/")return"/";d=gt.normalize(d),d=d.replace(/\/$/,"");var h=d.lastIndexOf("/");return h===-1?d:d.substr(h+1)},join:function(){var d=Array.prototype.slice.call(arguments);return gt.normalize(d.join("/"))},join2:(d,h)=>gt.normalize(d+"/"+h)},XD=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return d=>crypto.getRandomValues(d);Kc("initRandomDevice")},MM=d=>(MM=XD())(d),po={resolve:function(){for(var d="",h=!1,g=arguments.length-1;g>=-1&&!h;g--){var b=g>=0?arguments[g]:x.cwd();if(typeof b!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";d=b+"/"+d,h=gt.isAbs(b)}return d=gt.normalizeArray(d.split("/").filter(M=>!!M),!h).join("/"),(h?"/":"")+d||"."},relative:(d,h)=>{d=po.resolve(d).substr(1),h=po.resolve(h).substr(1);function g(Ue){for(var et=0;et<Ue.length&&Ue[et]==="";et++);for(var ut=Ue.length-1;ut>=0&&Ue[ut]==="";ut--);return et>ut?[]:Ue.slice(et,ut-et+1)}for(var b=g(d.split("/")),M=g(h.split("/")),z=Math.min(b.length,M.length),U=z,L=0;L<z;L++)if(b[L]!==M[L]){U=L;break}for(var ce=[],L=U;L<b.length;L++)ce.push("..");return ce=ce.concat(M.slice(U)),ce.join("/")}},NM=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Wc=(d,h,g)=>{for(var b=h+g,M=h;d[M]&&!(M>=b);)++M;if(M-h>16&&d.buffer&&NM)return NM.decode(d.subarray(h,M));for(var z="";h<M;){var U=d[h++];if(!(U&128)){z+=String.fromCharCode(U);continue}var L=d[h++]&63;if((U&224)==192){z+=String.fromCharCode((U&31)<<6|L);continue}var ce=d[h++]&63;if((U&240)==224?U=(U&15)<<12|L<<6|ce:U=(U&7)<<18|L<<12|ce<<6|d[h++]&63,U<65536)z+=String.fromCharCode(U);else{var Ue=U-65536;z+=String.fromCharCode(55296|Ue>>10,56320|Ue&1023)}}return z},qb=[],dg=d=>{for(var h=0,g=0;g<d.length;++g){var b=d.charCodeAt(g);b<=127?h++:b<=2047?h+=2:b>=55296&&b<=57343?(h+=4,++g):h+=3}return h},Jb=(d,h,g,b)=>{if(!(b>0))return 0;for(var M=g,z=g+b-1,U=0;U<d.length;++U){var L=d.charCodeAt(U);if(L>=55296&&L<=57343){var ce=d.charCodeAt(++U);L=65536+((L&1023)<<10)|ce&1023}if(L<=127){if(g>=z)break;h[g++]=L}else if(L<=2047){if(g+1>=z)break;h[g++]=192|L>>6,h[g++]=128|L&63}else if(L<=65535){if(g+2>=z)break;h[g++]=224|L>>12,h[g++]=128|L>>6&63,h[g++]=128|L&63}else{if(g+3>=z)break;h[g++]=240|L>>18,h[g++]=128|L>>12&63,h[g++]=128|L>>6&63,h[g++]=128|L&63}}return h[g]=0,g-M};function pg(d,h,g){var b=g>0?g:dg(d)+1,M=new Array(b),z=Jb(d,M,0,M.length);return h&&(M.length=z),M}var QD=()=>{if(!qb.length){var d=null;if(typeof window<"u"&&typeof window.prompt=="function"?(d=window.prompt("Input: "),d!==null&&(d+=`
116
116
  `)):typeof readline=="function"&&(d=readline(),d!==null&&(d+=`
117
117
  `)),!d)return null;qb=pg(d,!0)}return qb.shift()},Go={ttys:[],init(){},shutdown(){},register(d,h){Go.ttys[d]={input:[],output:[],ops:h},x.registerDevice(d,Go.stream_ops)},stream_ops:{open(d){var h=Go.ttys[d.node.rdev];if(!h)throw new x.ErrnoError(43);d.tty=h,d.seekable=!1},close(d){d.tty.ops.fsync(d.tty)},fsync(d){d.tty.ops.fsync(d.tty)},read(d,h,g,b,M){if(!d.tty||!d.tty.ops.get_char)throw new x.ErrnoError(60);for(var z=0,U=0;U<b;U++){var L;try{L=d.tty.ops.get_char(d.tty)}catch{throw new x.ErrnoError(29)}if(L===void 0&&z===0)throw new x.ErrnoError(6);if(L==null)break;z++,h[g+U]=L}return z&&(d.node.timestamp=Date.now()),z},write(d,h,g,b,M){if(!d.tty||!d.tty.ops.put_char)throw new x.ErrnoError(60);try{for(var z=0;z<b;z++)d.tty.ops.put_char(d.tty,h[g+z])}catch{throw new x.ErrnoError(29)}return b&&(d.node.timestamp=Date.now()),z}},default_tty_ops:{get_char(d){return QD()},put_char(d,h){h===null||h===10?(O(Wc(d.output,0)),d.output=[]):h!=0&&d.output.push(h)},fsync(d){d.output&&d.output.length>0&&(O(Wc(d.output,0)),d.output=[])},ioctl_tcgets(d){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(d,h,g){return 0},ioctl_tiocgwinsz(d){return[24,80]}},default_tty1_ops:{put_char(d,h){h===null||h===10?(C(Wc(d.output,0)),d.output=[]):h!=0&&d.output.push(h)},fsync(d){d.output&&d.output.length>0&&(C(Wc(d.output,0)),d.output=[])}}},$M=d=>{Kc()},Ze={ops_table:null,mount(d){return Ze.createNode(null,"/",16895,0)},createNode(d,h,g,b){if(x.isBlkdev(g)||x.isFIFO(g))throw new x.ErrnoError(63);Ze.ops_table||={dir:{node:{getattr:Ze.node_ops.getattr,setattr:Ze.node_ops.setattr,lookup:Ze.node_ops.lookup,mknod:Ze.node_ops.mknod,rename:Ze.node_ops.rename,unlink:Ze.node_ops.unlink,rmdir:Ze.node_ops.rmdir,readdir:Ze.node_ops.readdir,symlink:Ze.node_ops.symlink},stream:{llseek:Ze.stream_ops.llseek}},file:{node:{getattr:Ze.node_ops.getattr,setattr:Ze.node_ops.setattr},stream:{llseek:Ze.stream_ops.llseek,read:Ze.stream_ops.read,write:Ze.stream_ops.write,allocate:Ze.stream_ops.allocate,mmap:Ze.stream_ops.mmap,msync:Ze.stream_ops.msync}},link:{node:{getattr:Ze.node_ops.getattr,setattr:Ze.node_ops.setattr,readlink:Ze.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Ze.node_ops.getattr,setattr:Ze.node_ops.setattr},stream:x.chrdev_stream_ops}};var M=x.createNode(d,h,g,b);return x.isDir(M.mode)?(M.node_ops=Ze.ops_table.dir.node,M.stream_ops=Ze.ops_table.dir.stream,M.contents={}):x.isFile(M.mode)?(M.node_ops=Ze.ops_table.file.node,M.stream_ops=Ze.ops_table.file.stream,M.usedBytes=0,M.contents=null):x.isLink(M.mode)?(M.node_ops=Ze.ops_table.link.node,M.stream_ops=Ze.ops_table.link.stream):x.isChrdev(M.mode)&&(M.node_ops=Ze.ops_table.chrdev.node,M.stream_ops=Ze.ops_table.chrdev.stream),M.timestamp=Date.now(),d&&(d.contents[h]=M,d.timestamp=M.timestamp),M},getFileDataAsTypedArray(d){return d.contents?d.contents.subarray?d.contents.subarray(0,d.usedBytes):new Uint8Array(d.contents):new Uint8Array(0)},expandFileStorage(d,h){var g=d.contents?d.contents.length:0;if(!(g>=h)){var b=1024*1024;h=Math.max(h,g*(g<b?2:1.125)>>>0),g!=0&&(h=Math.max(h,256));var M=d.contents;d.contents=new Uint8Array(h),d.usedBytes>0&&d.contents.set(M.subarray(0,d.usedBytes),0)}},resizeFileStorage(d,h){if(d.usedBytes!=h)if(h==0)d.contents=null,d.usedBytes=0;else{var g=d.contents;d.contents=new Uint8Array(h),g&&d.contents.set(g.subarray(0,Math.min(h,d.usedBytes))),d.usedBytes=h}},node_ops:{getattr(d){var h={};return h.dev=x.isChrdev(d.mode)?d.id:1,h.ino=d.id,h.mode=d.mode,h.nlink=1,h.uid=0,h.gid=0,h.rdev=d.rdev,x.isDir(d.mode)?h.size=4096:x.isFile(d.mode)?h.size=d.usedBytes:x.isLink(d.mode)?h.size=d.link.length:h.size=0,h.atime=new Date(d.timestamp),h.mtime=new Date(d.timestamp),h.ctime=new Date(d.timestamp),h.blksize=4096,h.blocks=Math.ceil(h.size/h.blksize),h},setattr(d,h){h.mode!==void 0&&(d.mode=h.mode),h.timestamp!==void 0&&(d.timestamp=h.timestamp),h.size!==void 0&&Ze.resizeFileStorage(d,h.size)},lookup(d,h){throw x.genericErrors[44]},mknod(d,h,g,b){return Ze.createNode(d,h,g,b)},rename(d,h,g){if(x.isDir(d.mode)){var b;try{b=x.lookupNode(h,g)}catch{}if(b)for(var M in b.contents)throw new x.ErrnoError(55)}delete d.parent.contents[d.name],d.parent.timestamp=Date.now(),d.name=g,h.contents[g]=d,h.timestamp=d.parent.timestamp,d.parent=h},unlink(d,h){delete d.contents[h],d.timestamp=Date.now()},rmdir(d,h){var g=x.lookupNode(d,h);for(var b in g.contents)throw new x.ErrnoError(55);delete d.contents[h],d.timestamp=Date.now()},readdir(d){var h=[".",".."];for(var g of Object.keys(d.contents))h.push(g);return h},symlink(d,h,g){var b=Ze.createNode(d,h,41471,0);return b.link=g,b},readlink(d){if(!x.isLink(d.mode))throw new x.ErrnoError(28);return d.link}},stream_ops:{read(d,h,g,b,M){var z=d.node.contents;if(M>=d.node.usedBytes)return 0;var U=Math.min(d.node.usedBytes-M,b);if(U>8&&z.subarray)h.set(z.subarray(M,M+U),g);else for(var L=0;L<U;L++)h[g+L]=z[M+L];return U},write(d,h,g,b,M,z){if(h.buffer===he.buffer&&(z=!1),!b)return 0;var U=d.node;if(U.timestamp=Date.now(),h.subarray&&(!U.contents||U.contents.subarray)){if(z)return U.contents=h.subarray(g,g+b),U.usedBytes=b,b;if(U.usedBytes===0&&M===0)return U.contents=h.slice(g,g+b),U.usedBytes=b,b;if(M+b<=U.usedBytes)return U.contents.set(h.subarray(g,g+b),M),b}if(Ze.expandFileStorage(U,M+b),U.contents.subarray&&h.subarray)U.contents.set(h.subarray(g,g+b),M);else for(var L=0;L<b;L++)U.contents[M+L]=h[g+L];return U.usedBytes=Math.max(U.usedBytes,M+b),b},llseek(d,h,g){var b=h;if(g===1?b+=d.position:g===2&&x.isFile(d.node.mode)&&(b+=d.node.usedBytes),b<0)throw new x.ErrnoError(28);return b},allocate(d,h,g){Ze.expandFileStorage(d.node,h+g),d.node.usedBytes=Math.max(d.node.usedBytes,h+g)},mmap(d,h,g,b,M){if(!x.isFile(d.node.mode))throw new x.ErrnoError(43);var z,U,L=d.node.contents;if(!(M&2)&&L.buffer===he.buffer)U=!1,z=L.byteOffset;else{if((g>0||g+h<L.length)&&(L.subarray?L=L.subarray(g,g+h):L=Array.prototype.slice.call(L,g,g+h)),U=!0,z=$M(h),!z)throw new x.ErrnoError(48);he.set(L,z)}return{ptr:z,allocated:U}},msync(d,h,g,b,M){return Ze.stream_ops.write(d,h,0,b,g,!1),0}}},eR=(d,h,g,b)=>{var M=b?"":`al ${d}`;P(d,z=>{Ee(z,`Loading data file "${d}" failed (no arrayBuffer).`),h(new Uint8Array(z)),M&&ug(M)},z=>{if(g)g();else throw`Loading data file "${d}" failed.`}),M&&Zb(M)},tR=(d,h,g,b,M,z)=>{x.createDataFile(d,h,g,b,M,z)},rR=r.preloadPlugins||[],iR=(d,h,g,b)=>{typeof Browser<"u"&&Browser.init();var M=!1;return rR.forEach(z=>{M||z.canHandle(h)&&(z.handle(d,h,g,b),M=!0)}),M},nR=(d,h,g,b,M,z,U,L,ce,Ue)=>{var et=h?po.resolve(gt.join2(d,h)):d,ut=`cp ${et}`;function Te(Pe){function Ne(Ut){Ue?.(),L||tR(d,h,Ut,b,M,ce),z?.(),ug(ut)}iR(Pe,et,Ne,()=>{U?.(),ug(ut)})||Ne(Pe)}Zb(ut),typeof g=="string"?eR(g,Pe=>Te(Pe),U):Te(g)},aR=d=>{var h={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},g=h[d];if(typeof g>"u")throw new Error(`Unknown file open mode: ${d}`);return g},Yb=(d,h)=>{var g=0;return d&&(g|=365),h&&(g|=146),g},x={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(d,h={}){if(d=po.resolve(d),!d)return{path:"",node:null};var g={follow_mount:!0,recurse_count:0};if(h=Object.assign(g,h),h.recurse_count>8)throw new x.ErrnoError(32);for(var b=d.split("/").filter(ut=>!!ut),M=x.root,z="/",U=0;U<b.length;U++){var L=U===b.length-1;if(L&&h.parent)break;if(M=x.lookupNode(M,b[U]),z=gt.join2(z,b[U]),x.isMountpoint(M)&&(!L||L&&h.follow_mount)&&(M=M.mounted.root),!L||h.follow)for(var ce=0;x.isLink(M.mode);){var Ue=x.readlink(z);z=po.resolve(gt.dirname(z),Ue);var et=x.lookupPath(z,{recurse_count:h.recurse_count+1});if(M=et.node,ce++>40)throw new x.ErrnoError(32)}}return{path:z,node:M}},getPath(d){for(var h;;){if(x.isRoot(d)){var g=d.mount.mountpoint;return h?g[g.length-1]!=="/"?`${g}/${h}`:g+h:g}h=h?`${d.name}/${h}`:d.name,d=d.parent}},hashName(d,h){for(var g=0,b=0;b<h.length;b++)g=(g<<5)-g+h.charCodeAt(b)|0;return(d+g>>>0)%x.nameTable.length},hashAddNode(d){var h=x.hashName(d.parent.id,d.name);d.name_next=x.nameTable[h],x.nameTable[h]=d},hashRemoveNode(d){var h=x.hashName(d.parent.id,d.name);if(x.nameTable[h]===d)x.nameTable[h]=d.name_next;else for(var g=x.nameTable[h];g;){if(g.name_next===d){g.name_next=d.name_next;break}g=g.name_next}},lookupNode(d,h){var g=x.mayLookup(d);if(g)throw new x.ErrnoError(g,d);for(var b=x.hashName(d.id,h),M=x.nameTable[b];M;M=M.name_next){var z=M.name;if(M.parent.id===d.id&&z===h)return M}return x.lookup(d,h)},createNode(d,h,g,b){var M=new x.FSNode(d,h,g,b);return x.hashAddNode(M),M},destroyNode(d){x.hashRemoveNode(d)},isRoot(d){return d===d.parent},isMountpoint(d){return!!d.mounted},isFile(d){return(d&61440)===32768},isDir(d){return(d&61440)===16384},isLink(d){return(d&61440)===40960},isChrdev(d){return(d&61440)===8192},isBlkdev(d){return(d&61440)===24576},isFIFO(d){return(d&61440)===4096},isSocket(d){return(d&49152)===49152},flagsToPermissionString(d){var h=["r","w","rw"][d&3];return d&512&&(h+="w"),h},nodePermissions(d,h){return x.ignorePermissions?0:h.includes("r")&&!(d.mode&292)||h.includes("w")&&!(d.mode&146)||h.includes("x")&&!(d.mode&73)?2:0},mayLookup(d){var h=x.nodePermissions(d,"x");return h||(d.node_ops.lookup?0:2)},mayCreate(d,h){try{var g=x.lookupNode(d,h);return 20}catch{}return x.nodePermissions(d,"wx")},mayDelete(d,h,g){var b;try{b=x.lookupNode(d,h)}catch(z){return z.errno}var M=x.nodePermissions(d,"wx");if(M)return M;if(g){if(!x.isDir(b.mode))return 54;if(x.isRoot(b)||x.getPath(b)===x.cwd())return 10}else if(x.isDir(b.mode))return 31;return 0},mayOpen(d,h){return d?x.isLink(d.mode)?32:x.isDir(d.mode)&&(x.flagsToPermissionString(h)!=="r"||h&512)?31:x.nodePermissions(d,x.flagsToPermissionString(h)):44},MAX_OPEN_FDS:4096,nextfd(){for(var d=0;d<=x.MAX_OPEN_FDS;d++)if(!x.streams[d])return d;throw new x.ErrnoError(33)},getStreamChecked(d){var h=x.getStream(d);if(!h)throw new x.ErrnoError(8);return h},getStream:d=>x.streams[d],createStream(d,h=-1){return x.FSStream||(x.FSStream=function(){this.shared={}},x.FSStream.prototype={},Object.defineProperties(x.FSStream.prototype,{object:{get(){return this.node},set(g){this.node=g}},isRead:{get(){return(this.flags&2097155)!==1}},isWrite:{get(){return(this.flags&2097155)!==0}},isAppend:{get(){return this.flags&1024}},flags:{get(){return this.shared.flags},set(g){this.shared.flags=g}},position:{get(){return this.shared.position},set(g){this.shared.position=g}}})),d=Object.assign(new x.FSStream,d),h==-1&&(h=x.nextfd()),d.fd=h,x.streams[h]=d,d},closeStream(d){x.streams[d]=null},chrdev_stream_ops:{open(d){var h=x.getDevice(d.node.rdev);d.stream_ops=h.stream_ops,d.stream_ops.open?.(d)},llseek(){throw new x.ErrnoError(70)}},major:d=>d>>8,minor:d=>d&255,makedev:(d,h)=>d<<8|h,registerDevice(d,h){x.devices[d]={stream_ops:h}},getDevice:d=>x.devices[d],getMounts(d){for(var h=[],g=[d];g.length;){var b=g.pop();h.push(b),g.push.apply(g,b.mounts)}return h},syncfs(d,h){typeof d=="function"&&(h=d,d=!1),x.syncFSRequests++,x.syncFSRequests>1&&C(`warning: ${x.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var g=x.getMounts(x.root.mount),b=0;function M(U){return x.syncFSRequests--,h(U)}function z(U){if(U)return z.errored?void 0:(z.errored=!0,M(U));++b>=g.length&&M(null)}g.forEach(U=>{if(!U.type.syncfs)return z(null);U.type.syncfs(U,d,z)})},mount(d,h,g){var b=g==="/",M=!g,z;if(b&&x.root)throw new x.ErrnoError(10);if(!b&&!M){var U=x.lookupPath(g,{follow_mount:!1});if(g=U.path,z=U.node,x.isMountpoint(z))throw new x.ErrnoError(10);if(!x.isDir(z.mode))throw new x.ErrnoError(54)}var L={type:d,opts:h,mountpoint:g,mounts:[]},ce=d.mount(L);return ce.mount=L,L.root=ce,b?x.root=ce:z&&(z.mounted=L,z.mount&&z.mount.mounts.push(L)),ce},unmount(d){var h=x.lookupPath(d,{follow_mount:!1});if(!x.isMountpoint(h.node))throw new x.ErrnoError(28);var g=h.node,b=g.mounted,M=x.getMounts(b);Object.keys(x.nameTable).forEach(U=>{for(var L=x.nameTable[U];L;){var ce=L.name_next;M.includes(L.mount)&&x.destroyNode(L),L=ce}}),g.mounted=null;var z=g.mount.mounts.indexOf(b);g.mount.mounts.splice(z,1)},lookup(d,h){return d.node_ops.lookup(d,h)},mknod(d,h,g){var b=x.lookupPath(d,{parent:!0}),M=b.node,z=gt.basename(d);if(!z||z==="."||z==="..")throw new x.ErrnoError(28);var U=x.mayCreate(M,z);if(U)throw new x.ErrnoError(U);if(!M.node_ops.mknod)throw new x.ErrnoError(63);return M.node_ops.mknod(M,z,h,g)},create(d,h){return h=h!==void 0?h:438,h&=4095,h|=32768,x.mknod(d,h,0)},mkdir(d,h){return h=h!==void 0?h:511,h&=1023,h|=16384,x.mknod(d,h,0)},mkdirTree(d,h){for(var g=d.split("/"),b="",M=0;M<g.length;++M)if(g[M]){b+="/"+g[M];try{x.mkdir(b,h)}catch(z){if(z.errno!=20)throw z}}},mkdev(d,h,g){return typeof g>"u"&&(g=h,h=438),h|=8192,x.mknod(d,h,g)},symlink(d,h){if(!po.resolve(d))throw new x.ErrnoError(44);var g=x.lookupPath(h,{parent:!0}),b=g.node;if(!b)throw new x.ErrnoError(44);var M=gt.basename(h),z=x.mayCreate(b,M);if(z)throw new x.ErrnoError(z);if(!b.node_ops.symlink)throw new x.ErrnoError(63);return b.node_ops.symlink(b,M,d)},rename(d,h){var g=gt.dirname(d),b=gt.dirname(h),M=gt.basename(d),z=gt.basename(h),U,L,ce;if(U=x.lookupPath(d,{parent:!0}),L=U.node,U=x.lookupPath(h,{parent:!0}),ce=U.node,!L||!ce)throw new x.ErrnoError(44);if(L.mount!==ce.mount)throw new x.ErrnoError(75);var Ue=x.lookupNode(L,M),et=po.relative(d,b);if(et.charAt(0)!==".")throw new x.ErrnoError(28);if(et=po.relative(h,g),et.charAt(0)!==".")throw new x.ErrnoError(55);var ut;try{ut=x.lookupNode(ce,z)}catch{}if(Ue!==ut){var Te=x.isDir(Ue.mode),Pe=x.mayDelete(L,M,Te);if(Pe)throw new x.ErrnoError(Pe);if(Pe=ut?x.mayDelete(ce,z,Te):x.mayCreate(ce,z),Pe)throw new x.ErrnoError(Pe);if(!L.node_ops.rename)throw new x.ErrnoError(63);if(x.isMountpoint(Ue)||ut&&x.isMountpoint(ut))throw new x.ErrnoError(10);if(ce!==L&&(Pe=x.nodePermissions(L,"w"),Pe))throw new x.ErrnoError(Pe);x.hashRemoveNode(Ue);try{L.node_ops.rename(Ue,ce,z)}catch(Ne){throw Ne}finally{x.hashAddNode(Ue)}}},rmdir(d){var h=x.lookupPath(d,{parent:!0}),g=h.node,b=gt.basename(d),M=x.lookupNode(g,b),z=x.mayDelete(g,b,!0);if(z)throw new x.ErrnoError(z);if(!g.node_ops.rmdir)throw new x.ErrnoError(63);if(x.isMountpoint(M))throw new x.ErrnoError(10);g.node_ops.rmdir(g,b),x.destroyNode(M)},readdir(d){var h=x.lookupPath(d,{follow:!0}),g=h.node;if(!g.node_ops.readdir)throw new x.ErrnoError(54);return g.node_ops.readdir(g)},unlink(d){var h=x.lookupPath(d,{parent:!0}),g=h.node;if(!g)throw new x.ErrnoError(44);var b=gt.basename(d),M=x.lookupNode(g,b),z=x.mayDelete(g,b,!1);if(z)throw new x.ErrnoError(z);if(!g.node_ops.unlink)throw new x.ErrnoError(63);if(x.isMountpoint(M))throw new x.ErrnoError(10);g.node_ops.unlink(g,b),x.destroyNode(M)},readlink(d){var h=x.lookupPath(d),g=h.node;if(!g)throw new x.ErrnoError(44);if(!g.node_ops.readlink)throw new x.ErrnoError(28);return po.resolve(x.getPath(g.parent),g.node_ops.readlink(g))},stat(d,h){var g=x.lookupPath(d,{follow:!h}),b=g.node;if(!b)throw new x.ErrnoError(44);if(!b.node_ops.getattr)throw new x.ErrnoError(63);return b.node_ops.getattr(b)},lstat(d){return x.stat(d,!0)},chmod(d,h,g){var b;if(typeof d=="string"){var M=x.lookupPath(d,{follow:!g});b=M.node}else b=d;if(!b.node_ops.setattr)throw new x.ErrnoError(63);b.node_ops.setattr(b,{mode:h&4095|b.mode&-4096,timestamp:Date.now()})},lchmod(d,h){x.chmod(d,h,!0)},fchmod(d,h){var g=x.getStreamChecked(d);x.chmod(g.node,h)},chown(d,h,g,b){var M;if(typeof d=="string"){var z=x.lookupPath(d,{follow:!b});M=z.node}else M=d;if(!M.node_ops.setattr)throw new x.ErrnoError(63);M.node_ops.setattr(M,{timestamp:Date.now()})},lchown(d,h,g){x.chown(d,h,g,!0)},fchown(d,h,g){var b=x.getStreamChecked(d);x.chown(b.node,h,g)},truncate(d,h){if(h<0)throw new x.ErrnoError(28);var g;if(typeof d=="string"){var b=x.lookupPath(d,{follow:!0});g=b.node}else g=d;if(!g.node_ops.setattr)throw new x.ErrnoError(63);if(x.isDir(g.mode))throw new x.ErrnoError(31);if(!x.isFile(g.mode))throw new x.ErrnoError(28);var M=x.nodePermissions(g,"w");if(M)throw new x.ErrnoError(M);g.node_ops.setattr(g,{size:h,timestamp:Date.now()})},ftruncate(d,h){var g=x.getStreamChecked(d);if((g.flags&2097155)===0)throw new x.ErrnoError(28);x.truncate(g.node,h)},utime(d,h,g){var b=x.lookupPath(d,{follow:!0}),M=b.node;M.node_ops.setattr(M,{timestamp:Math.max(h,g)})},open(d,h,g){if(d==="")throw new x.ErrnoError(44);h=typeof h=="string"?aR(h):h,g=typeof g>"u"?438:g,h&64?g=g&4095|32768:g=0;var b;if(typeof d=="object")b=d;else{d=gt.normalize(d);try{var M=x.lookupPath(d,{follow:!(h&131072)});b=M.node}catch{}}var z=!1;if(h&64)if(b){if(h&128)throw new x.ErrnoError(20)}else b=x.mknod(d,g,0),z=!0;if(!b)throw new x.ErrnoError(44);if(x.isChrdev(b.mode)&&(h&=-513),h&65536&&!x.isDir(b.mode))throw new x.ErrnoError(54);if(!z){var U=x.mayOpen(b,h);if(U)throw new x.ErrnoError(U)}h&512&&!z&&x.truncate(b,0),h&=-131713;var L=x.createStream({node:b,path:x.getPath(b),flags:h,seekable:!0,position:0,stream_ops:b.stream_ops,ungotten:[],error:!1});return L.stream_ops.open&&L.stream_ops.open(L),r.logReadFiles&&!(h&1)&&(x.readFiles||(x.readFiles={}),d in x.readFiles||(x.readFiles[d]=1)),L},close(d){if(x.isClosed(d))throw new x.ErrnoError(8);d.getdents&&(d.getdents=null);try{d.stream_ops.close&&d.stream_ops.close(d)}catch(h){throw h}finally{x.closeStream(d.fd)}d.fd=null},isClosed(d){return d.fd===null},llseek(d,h,g){if(x.isClosed(d))throw new x.ErrnoError(8);if(!d.seekable||!d.stream_ops.llseek)throw new x.ErrnoError(70);if(g!=0&&g!=1&&g!=2)throw new x.ErrnoError(28);return d.position=d.stream_ops.llseek(d,h,g),d.ungotten=[],d.position},read(d,h,g,b,M){if(b<0||M<0)throw new x.ErrnoError(28);if(x.isClosed(d))throw new x.ErrnoError(8);if((d.flags&2097155)===1)throw new x.ErrnoError(8);if(x.isDir(d.node.mode))throw new x.ErrnoError(31);if(!d.stream_ops.read)throw new x.ErrnoError(28);var z=typeof M<"u";if(!z)M=d.position;else if(!d.seekable)throw new x.ErrnoError(70);var U=d.stream_ops.read(d,h,g,b,M);return z||(d.position+=U),U},write(d,h,g,b,M,z){if(b<0||M<0)throw new x.ErrnoError(28);if(x.isClosed(d))throw new x.ErrnoError(8);if((d.flags&2097155)===0)throw new x.ErrnoError(8);if(x.isDir(d.node.mode))throw new x.ErrnoError(31);if(!d.stream_ops.write)throw new x.ErrnoError(28);d.seekable&&d.flags&1024&&x.llseek(d,0,2);var U=typeof M<"u";if(!U)M=d.position;else if(!d.seekable)throw new x.ErrnoError(70);var L=d.stream_ops.write(d,h,g,b,M,z);return U||(d.position+=L),L},allocate(d,h,g){if(x.isClosed(d))throw new x.ErrnoError(8);if(h<0||g<=0)throw new x.ErrnoError(28);if((d.flags&2097155)===0)throw new x.ErrnoError(8);if(!x.isFile(d.node.mode)&&!x.isDir(d.node.mode))throw new x.ErrnoError(43);if(!d.stream_ops.allocate)throw new x.ErrnoError(138);d.stream_ops.allocate(d,h,g)},mmap(d,h,g,b,M){if((b&2)!==0&&(M&2)===0&&(d.flags&2097155)!==2)throw new x.ErrnoError(2);if((d.flags&2097155)===1)throw new x.ErrnoError(2);if(!d.stream_ops.mmap)throw new x.ErrnoError(43);return d.stream_ops.mmap(d,h,g,b,M)},msync(d,h,g,b,M){return d.stream_ops.msync?d.stream_ops.msync(d,h,g,b,M):0},munmap:d=>0,ioctl(d,h,g){if(!d.stream_ops.ioctl)throw new x.ErrnoError(59);return d.stream_ops.ioctl(d,h,g)},readFile(d,h={}){if(h.flags=h.flags||0,h.encoding=h.encoding||"binary",h.encoding!=="utf8"&&h.encoding!=="binary")throw new Error(`Invalid encoding type "${h.encoding}"`);var g,b=x.open(d,h.flags),M=x.stat(d),z=M.size,U=new Uint8Array(z);return x.read(b,U,0,z,0),h.encoding==="utf8"?g=Wc(U,0):h.encoding==="binary"&&(g=U),x.close(b),g},writeFile(d,h,g={}){g.flags=g.flags||577;var b=x.open(d,g.flags,g.mode);if(typeof h=="string"){var M=new Uint8Array(dg(h)+1),z=Jb(h,M,0,M.length);x.write(b,M,0,z,void 0,g.canOwn)}else if(ArrayBuffer.isView(h))x.write(b,h,0,h.byteLength,void 0,g.canOwn);else throw new Error("Unsupported data type");x.close(b)},cwd:()=>x.currentPath,chdir(d){var h=x.lookupPath(d,{follow:!0});if(h.node===null)throw new x.ErrnoError(44);if(!x.isDir(h.node.mode))throw new x.ErrnoError(54);var g=x.nodePermissions(h.node,"x");if(g)throw new x.ErrnoError(g);x.currentPath=h.path},createDefaultDirectories(){x.mkdir("/tmp"),x.mkdir("/home"),x.mkdir("/home/web_user")},createDefaultDevices(){x.mkdir("/dev"),x.registerDevice(x.makedev(1,3),{read:()=>0,write:(b,M,z,U,L)=>U}),x.mkdev("/dev/null",x.makedev(1,3)),Go.register(x.makedev(5,0),Go.default_tty_ops),Go.register(x.makedev(6,0),Go.default_tty1_ops),x.mkdev("/dev/tty",x.makedev(5,0)),x.mkdev("/dev/tty1",x.makedev(6,0));var d=new Uint8Array(1024),h=0,g=()=>(h===0&&(h=MM(d).byteLength),d[--h]);x.createDevice("/dev","random",g),x.createDevice("/dev","urandom",g),x.mkdir("/dev/shm"),x.mkdir("/dev/shm/tmp")},createSpecialDirectories(){x.mkdir("/proc");var d=x.mkdir("/proc/self");x.mkdir("/proc/self/fd"),x.mount({mount(){var h=x.createNode(d,"fd",16895,73);return h.node_ops={lookup(g,b){var M=+b,z=x.getStreamChecked(M),U={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>z.path}};return U.parent=U,U}},h}},{},"/proc/self/fd")},createStandardStreams(){r.stdin?x.createDevice("/dev","stdin",r.stdin):x.symlink("/dev/tty","/dev/stdin"),r.stdout?x.createDevice("/dev","stdout",null,r.stdout):x.symlink("/dev/tty","/dev/stdout"),r.stderr?x.createDevice("/dev","stderr",null,r.stderr):x.symlink("/dev/tty1","/dev/stderr");var d=x.open("/dev/stdin",0),h=x.open("/dev/stdout",1),g=x.open("/dev/stderr",1)},ensureErrnoError(){x.ErrnoError||(x.ErrnoError=function(h,g){this.name="ErrnoError",this.node=g,this.setErrno=function(b){this.errno=b},this.setErrno(h),this.message="FS error"},x.ErrnoError.prototype=new Error,x.ErrnoError.prototype.constructor=x.ErrnoError,[44].forEach(d=>{x.genericErrors[d]=new x.ErrnoError(d),x.genericErrors[d].stack="<generic error, no stack>"}))},staticInit(){x.ensureErrnoError(),x.nameTable=new Array(4096),x.mount(Ze,{},"/"),x.createDefaultDirectories(),x.createDefaultDevices(),x.createSpecialDirectories(),x.filesystems={MEMFS:Ze}},init(d,h,g){x.init.initialized=!0,x.ensureErrnoError(),r.stdin=d||r.stdin,r.stdout=h||r.stdout,r.stderr=g||r.stderr,x.createStandardStreams()},quit(){x.init.initialized=!1;for(var d=0;d<x.streams.length;d++){var h=x.streams[d];h&&x.close(h)}},findObject(d,h){var g=x.analyzePath(d,h);return g.exists?g.object:null},analyzePath(d,h){try{var g=x.lookupPath(d,{follow:!h});d=g.path}catch{}var b={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var g=x.lookupPath(d,{parent:!0});b.parentExists=!0,b.parentPath=g.path,b.parentObject=g.node,b.name=gt.basename(d),g=x.lookupPath(d,{follow:!h}),b.exists=!0,b.path=g.path,b.object=g.node,b.name=g.node.name,b.isRoot=g.path==="/"}catch(M){b.error=M.errno}return b},createPath(d,h,g,b){d=typeof d=="string"?d:x.getPath(d);for(var M=h.split("/").reverse();M.length;){var z=M.pop();if(z){var U=gt.join2(d,z);try{x.mkdir(U)}catch{}d=U}}return U},createFile(d,h,g,b,M){var z=gt.join2(typeof d=="string"?d:x.getPath(d),h),U=Yb(b,M);return x.create(z,U)},createDataFile(d,h,g,b,M,z){var U=h;d&&(d=typeof d=="string"?d:x.getPath(d),U=h?gt.join2(d,h):d);var L=Yb(b,M),ce=x.create(U,L);if(g){if(typeof g=="string"){for(var Ue=new Array(g.length),et=0,ut=g.length;et<ut;++et)Ue[et]=g.charCodeAt(et);g=Ue}x.chmod(ce,L|146);var Te=x.open(ce,577);x.write(Te,g,0,g.length,0,z),x.close(Te),x.chmod(ce,L)}},createDevice(d,h,g,b){var M=gt.join2(typeof d=="string"?d:x.getPath(d),h),z=Yb(!!g,!!b);x.createDevice.major||(x.createDevice.major=64);var U=x.makedev(x.createDevice.major++,0);return x.registerDevice(U,{open(L){L.seekable=!1},close(L){b?.buffer?.length&&b(10)},read(L,ce,Ue,et,ut){for(var Te=0,Pe=0;Pe<et;Pe++){var Ne;try{Ne=g()}catch{throw new x.ErrnoError(29)}if(Ne===void 0&&Te===0)throw new x.ErrnoError(6);if(Ne==null)break;Te++,ce[Ue+Pe]=Ne}return Te&&(L.node.timestamp=Date.now()),Te},write(L,ce,Ue,et,ut){for(var Te=0;Te<et;Te++)try{b(ce[Ue+Te])}catch{throw new x.ErrnoError(29)}return et&&(L.node.timestamp=Date.now()),Te}}),x.mkdev(M,z,U)},forceLoadFile(d){if(d.isDevice||d.isFolder||d.link||d.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(y)try{d.contents=pg(y(d.url),!0),d.usedBytes=d.contents.length}catch{throw new x.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile(d,h,g,b,M){function z(){this.lengthKnown=!1,this.chunks=[]}if(z.prototype.get=function(Pe){if(!(Pe>this.length-1||Pe<0)){var Ne=Pe%this.chunkSize,Ut=Pe/this.chunkSize|0;return this.getter(Ut)[Ne]}},z.prototype.setDataGetter=function(Pe){this.getter=Pe},z.prototype.cacheLength=function(){var Pe=new XMLHttpRequest;if(Pe.open("HEAD",g,!1),Pe.send(null),!(Pe.status>=200&&Pe.status<300||Pe.status===304))throw new Error("Couldn't load "+g+". Status: "+Pe.status);var Ne=Number(Pe.getResponseHeader("Content-length")),Ut,ln=(Ut=Pe.getResponseHeader("Accept-Ranges"))&&Ut==="bytes",ci=(Ut=Pe.getResponseHeader("Content-Encoding"))&&Ut==="gzip",Q=1024*1024;ln||(Q=Ne);var Fe=(It,Gn)=>{if(It>Gn)throw new Error("invalid range ("+It+", "+Gn+") or no bytes requested!");if(Gn>Ne-1)throw new Error("only "+Ne+" bytes available! programmer error!");var br=new XMLHttpRequest;if(br.open("GET",g,!1),Ne!==Q&&br.setRequestHeader("Range","bytes="+It+"-"+Gn),br.responseType="arraybuffer",br.overrideMimeType&&br.overrideMimeType("text/plain; charset=x-user-defined"),br.send(null),!(br.status>=200&&br.status<300||br.status===304))throw new Error("Couldn't load "+g+". Status: "+br.status);return br.response!==void 0?new Uint8Array(br.response||[]):pg(br.responseText||"",!0)},Ir=this;Ir.setDataGetter(It=>{var Gn=It*Q,br=(It+1)*Q-1;if(br=Math.min(br,Ne-1),typeof Ir.chunks[It]>"u"&&(Ir.chunks[It]=Fe(Gn,br)),typeof Ir.chunks[It]>"u")throw new Error("doXHR failed!");return Ir.chunks[It]}),(ci||!Ne)&&(Q=Ne=1,Ne=this.getter(0).length,Q=Ne,O("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=Ne,this._chunkSize=Q,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){if(!f)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var U=new z;Object.defineProperties(U,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var L={isDevice:!1,contents:U}}else var L={isDevice:!1,url:g};var ce=x.createFile(d,h,L,b,M);L.contents?ce.contents=L.contents:L.url&&(ce.contents=null,ce.url=L.url),Object.defineProperties(ce,{usedBytes:{get:function(){return this.contents.length}}});var Ue={},et=Object.keys(ce.stream_ops);et.forEach(Te=>{var Pe=ce.stream_ops[Te];Ue[Te]=function(){return x.forceLoadFile(ce),Pe.apply(null,arguments)}});function ut(Te,Pe,Ne,Ut,ln){var ci=Te.node.contents;if(ln>=ci.length)return 0;var Q=Math.min(ci.length-ln,Ut);if(ci.slice)for(var Fe=0;Fe<Q;Fe++)Pe[Ne+Fe]=ci[ln+Fe];else for(var Fe=0;Fe<Q;Fe++)Pe[Ne+Fe]=ci.get(ln+Fe);return Q}return Ue.read=(Te,Pe,Ne,Ut,ln)=>(x.forceLoadFile(ce),ut(Te,Pe,Ne,Ut,ln)),Ue.mmap=(Te,Pe,Ne,Ut,ln)=>{x.forceLoadFile(ce);var ci=$M(Pe);if(!ci)throw new x.ErrnoError(48);return ut(Te,he,ci,Pe,Ne),{ptr:ci,allocated:!0}},ce.stream_ops=Ue,ce}},fg=(d,h)=>d?Wc(Me,d,h):"",Ho={DEFAULT_POLLMASK:5,calculateAt(d,h,g){if(gt.isAbs(h))return h;var b;if(d===-100)b=x.cwd();else{var M=Ho.getStreamFromFD(d);b=M.path}if(h.length==0){if(!g)throw new x.ErrnoError(44);return b}return gt.join2(b,h)},doStat(d,h,g){try{var b=d(h)}catch(L){if(L&&L.node&&gt.normalize(h)!==gt.normalize(x.getPath(L.node)))return-54;throw L}te[g>>2]=b.dev,te[g+4>>2]=b.mode,_e[g+8>>2]=b.nlink,te[g+12>>2]=b.uid,te[g+16>>2]=b.gid,te[g+20>>2]=b.rdev,kr=[b.size>>>0,(tt=b.size,+Math.abs(tt)>=1?tt>0?+Math.floor(tt/4294967296)>>>0:~~+Math.ceil((tt-+(~~tt>>>0))/4294967296)>>>0:0)],te[g+24>>2]=kr[0],te[g+28>>2]=kr[1],te[g+32>>2]=4096,te[g+36>>2]=b.blocks;var M=b.atime.getTime(),z=b.mtime.getTime(),U=b.ctime.getTime();return kr=[Math.floor(M/1e3)>>>0,(tt=Math.floor(M/1e3),+Math.abs(tt)>=1?tt>0?+Math.floor(tt/4294967296)>>>0:~~+Math.ceil((tt-+(~~tt>>>0))/4294967296)>>>0:0)],te[g+40>>2]=kr[0],te[g+44>>2]=kr[1],_e[g+48>>2]=M%1e3*1e3,kr=[Math.floor(z/1e3)>>>0,(tt=Math.floor(z/1e3),+Math.abs(tt)>=1?tt>0?+Math.floor(tt/4294967296)>>>0:~~+Math.ceil((tt-+(~~tt>>>0))/4294967296)>>>0:0)],te[g+56>>2]=kr[0],te[g+60>>2]=kr[1],_e[g+64>>2]=z%1e3*1e3,kr=[Math.floor(U/1e3)>>>0,(tt=Math.floor(U/1e3),+Math.abs(tt)>=1?tt>0?+Math.floor(tt/4294967296)>>>0:~~+Math.ceil((tt-+(~~tt>>>0))/4294967296)>>>0:0)],te[g+72>>2]=kr[0],te[g+76>>2]=kr[1],_e[g+80>>2]=U%1e3*1e3,kr=[b.ino>>>0,(tt=b.ino,+Math.abs(tt)>=1?tt>0?+Math.floor(tt/4294967296)>>>0:~~+Math.ceil((tt-+(~~tt>>>0))/4294967296)>>>0:0)],te[g+88>>2]=kr[0],te[g+92>>2]=kr[1],0},doMsync(d,h,g,b,M){if(!x.isFile(h.node.mode))throw new x.ErrnoError(43);if(b&2)return 0;var z=Me.slice(d,d+g);x.msync(h,z,M,g,b)},varargs:void 0,get(){var d=te[+Ho.varargs>>2];return Ho.varargs+=4,d},getp(){return Ho.get()},getStr(d){var h=fg(d);return h},getStreamFromFD(d){var h=x.getStreamChecked(d);return h}},oR=(d,h)=>{var g=0;return zp().forEach((b,M)=>{var z=h+g;_e[d+M*4>>2]=z,YD(b,z),g+=b.length+1}),0},sR=(d,h)=>{var g=zp();_e[d>>2]=g.length;var b=0;return g.forEach(M=>b+=M.length+1),_e[h>>2]=b,0};function lR(d){try{var h=Ho.getStreamFromFD(d);return x.close(h),0}catch(g){if(typeof x>"u"||g.name!=="ErrnoError")throw g;return g.errno}}var cR=(d,h,g,b)=>{for(var M=0,z=0;z<g;z++){var U=_e[h>>2],L=_e[h+4>>2];h+=8;var ce=x.read(d,he,U,L,b);if(ce<0)return-1;if(M+=ce,ce<L)break;typeof b<"u"&&(b+=ce)}return M};function uR(d,h,g,b){try{var M=Ho.getStreamFromFD(d),z=cR(M,h,g);return _e[b>>2]=z,0}catch(U){if(typeof x>"u"||U.name!=="ErrnoError")throw U;return U.errno}}var dR=(d,h)=>h+2097152>>>0<4194305-!!d?(d>>>0)+h*4294967296:NaN;function pR(d,h,g,b,M){var z=dR(h,g);try{if(isNaN(z))return 61;var U=Ho.getStreamFromFD(d);return x.llseek(U,z,b),kr=[U.position>>>0,(tt=U.position,+Math.abs(tt)>=1?tt>0?+Math.floor(tt/4294967296)>>>0:~~+Math.ceil((tt-+(~~tt>>>0))/4294967296)>>>0:0)],te[M>>2]=kr[0],te[M+4>>2]=kr[1],U.getdents&&z===0&&b===0&&(U.getdents=null),0}catch(L){if(typeof x>"u"||L.name!=="ErrnoError")throw L;return L.errno}}var fR=(d,h,g,b)=>{for(var M=0,z=0;z<g;z++){var U=_e[h>>2],L=_e[h+4>>2];h+=8;var ce=x.write(d,he,U,L,b);if(ce<0)return-1;M+=ce,typeof b<"u"&&(b+=ce)}return M};function hR(d,h,g,b){try{var M=Ho.getStreamFromFD(d),z=fR(M,h,g);return _e[b>>2]=z,0}catch(U){if(typeof x>"u"||U.name!=="ErrnoError")throw U;return U.errno}}var hg=d=>d%4===0&&(d%100!==0||d%400===0),mR=(d,h)=>{for(var g=0,b=0;b<=h;g+=d[b++]);return g},kM=[31,29,31,30,31,30,31,31,30,31,30,31],IM=[31,28,31,30,31,30,31,31,30,31,30,31],gR=(d,h)=>{for(var g=new Date(d.getTime());h>0;){var b=hg(g.getFullYear()),M=g.getMonth(),z=(b?kM:IM)[M];if(h>z-g.getDate())h-=z-g.getDate()+1,g.setDate(1),M<11?g.setMonth(M+1):(g.setMonth(0),g.setFullYear(g.getFullYear()+1));else return g.setDate(g.getDate()+h),g}return g},BM=(d,h)=>{he.set(d,h)},vR=(d,h,g,b)=>{var M=_e[b+40>>2],z={tm_sec:te[b>>2],tm_min:te[b+4>>2],tm_hour:te[b+8>>2],tm_mday:te[b+12>>2],tm_mon:te[b+16>>2],tm_year:te[b+20>>2],tm_wday:te[b+24>>2],tm_yday:te[b+28>>2],tm_isdst:te[b+32>>2],tm_gmtoff:te[b+36>>2],tm_zone:M?fg(M):""},U=fg(g),L={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var ce in L)U=U.replace(new RegExp(ce,"g"),L[ce]);var Ue=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],et=["January","February","March","April","May","June","July","August","September","October","November","December"];function ut(Q,Fe,Ir){for(var It=typeof Q=="number"?Q.toString():Q||"";It.length<Fe;)It=Ir[0]+It;return It}function Te(Q,Fe){return ut(Q,Fe,"0")}function Pe(Q,Fe){function Ir(Gn){return Gn<0?-1:Gn>0?1:0}var It;return(It=Ir(Q.getFullYear()-Fe.getFullYear()))===0&&(It=Ir(Q.getMonth()-Fe.getMonth()))===0&&(It=Ir(Q.getDate()-Fe.getDate())),It}function Ne(Q){switch(Q.getDay()){case 0:return new Date(Q.getFullYear()-1,11,29);case 1:return Q;case 2:return new Date(Q.getFullYear(),0,3);case 3:return new Date(Q.getFullYear(),0,2);case 4:return new Date(Q.getFullYear(),0,1);case 5:return new Date(Q.getFullYear()-1,11,31);case 6:return new Date(Q.getFullYear()-1,11,30)}}function Ut(Q){var Fe=gR(new Date(Q.tm_year+1900,0,1),Q.tm_yday),Ir=new Date(Fe.getFullYear(),0,4),It=new Date(Fe.getFullYear()+1,0,4),Gn=Ne(Ir),br=Ne(It);return Pe(Gn,Fe)<=0?Pe(br,Fe)<=0?Fe.getFullYear()+1:Fe.getFullYear():Fe.getFullYear()-1}var ln={"%a":Q=>Ue[Q.tm_wday].substring(0,3),"%A":Q=>Ue[Q.tm_wday],"%b":Q=>et[Q.tm_mon].substring(0,3),"%B":Q=>et[Q.tm_mon],"%C":Q=>{var Fe=Q.tm_year+1900;return Te(Fe/100|0,2)},"%d":Q=>Te(Q.tm_mday,2),"%e":Q=>ut(Q.tm_mday,2," "),"%g":Q=>Ut(Q).toString().substring(2),"%G":Q=>Ut(Q),"%H":Q=>Te(Q.tm_hour,2),"%I":Q=>{var Fe=Q.tm_hour;return Fe==0?Fe=12:Fe>12&&(Fe-=12),Te(Fe,2)},"%j":Q=>Te(Q.tm_mday+mR(hg(Q.tm_year+1900)?kM:IM,Q.tm_mon-1),3),"%m":Q=>Te(Q.tm_mon+1,2),"%M":Q=>Te(Q.tm_min,2),"%n":()=>`
118
- `,"%p":Q=>Q.tm_hour>=0&&Q.tm_hour<12?"AM":"PM","%S":Q=>Te(Q.tm_sec,2),"%t":()=>" ","%u":Q=>Q.tm_wday||7,"%U":Q=>{var Fe=Q.tm_yday+7-Q.tm_wday;return Te(Math.floor(Fe/7),2)},"%V":Q=>{var Fe=Math.floor((Q.tm_yday+7-(Q.tm_wday+6)%7)/7);if((Q.tm_wday+371-Q.tm_yday-2)%7<=2&&Fe++,Fe){if(Fe==53){var It=(Q.tm_wday+371-Q.tm_yday)%7;It!=4&&(It!=3||!hg(Q.tm_year))&&(Fe=1)}}else{Fe=52;var Ir=(Q.tm_wday+7-Q.tm_yday-1)%7;(Ir==4||Ir==5&&hg(Q.tm_year%400-1))&&Fe++}return Te(Fe,2)},"%w":Q=>Q.tm_wday,"%W":Q=>{var Fe=Q.tm_yday+7-(Q.tm_wday+6)%7;return Te(Math.floor(Fe/7),2)},"%y":Q=>(Q.tm_year+1900).toString().substring(2),"%Y":Q=>Q.tm_year+1900,"%z":Q=>{var Fe=Q.tm_gmtoff,Ir=Fe>=0;return Fe=Math.abs(Fe)/60,Fe=Fe/60*100+Fe%60,(Ir?"+":"-")+("0000"+Fe).slice(-4)},"%Z":Q=>Q.tm_zone,"%%":()=>"%"};U=U.replace(/%%/g,"\0\0");for(var ce in ln)U.includes(ce)&&(U=U.replace(new RegExp(ce,"g"),ln[ce](z)));U=U.replace(/\0\0/g,"%");var ci=pg(U,!1);return ci.length>h?0:(BM(ci,d),ci.length-1)},xR=(d,h,g,b,M)=>vR(d,h,g,b),TM=d=>{var h=r["_"+d];return h},DM=(d,h,g)=>Jb(d,Me,h,g),yR=d=>{var h=dg(d)+1,g=Xb(h);return DM(d,g,h),g},RM=(d,h,g,b,M)=>{var z={string:Ne=>{var Ut=0;return Ne!=null&&Ne!==0&&(Ut=yR(Ne)),Ut},array:Ne=>{var Ut=Xb(Ne.length);return BM(Ne,Ut),Ut}};function U(Ne){return h==="string"?fg(Ne):h==="boolean"?!!Ne:Ne}var L=TM(d),ce=[],Ue=0;if(b)for(var et=0;et<b.length;et++){var ut=z[g[et]];ut?(Ue===0&&(Ue=zM()),ce[et]=ut(b[et])):ce[et]=b[et]}var Te=L.apply(null,ce);function Pe(Ne){return Ue!==0&&OM(Ue),U(Ne)}return Te=Pe(Te),Te},wR=(d,h,g,b)=>{var M=!g||g.every(U=>U==="number"||U==="boolean"),z=h!=="string";return z&&M&&!b?TM(d):function(){return RM(d,h,g,arguments,b)}},CM=function(d,h,g,b){d||(d=this),this.parent=d,this.mount=d.mount,this.mounted=null,this.id=x.nextInode++,this.name=h,this.mode=g,this.node_ops={},this.stream_ops={},this.rdev=b},mg=365,gg=146;Object.defineProperties(CM.prototype,{read:{get:function(){return(this.mode&mg)===mg},set:function(d){d?this.mode|=mg:this.mode&=~mg}},write:{get:function(){return(this.mode&gg)===gg},set:function(d){d?this.mode|=gg:this.mode&=~gg}},isFolder:{get:function(){return x.isDir(this.mode)}},isDevice:{get:function(){return x.isChrdev(this.mode)}}}),x.FSNode=CM,x.createPreloadedFile=nR,x.staticInit();var bR={a:WD,b:LD,k:ZD,i:qD,e:oR,f:sR,g:lR,h:uR,j:pR,c:hR,d:xR},wt=UD(),_R=()=>(_R=wt.m)(),FR=r._nam_createInstance=()=>(FR=r._nam_createInstance=wt.n)(),AR=r._nam_destroyInstance=d=>(AR=r._nam_destroyInstance=wt.o)(d),ER=r._nam_getInstanceCount=()=>(ER=r._nam_getInstanceCount=wt.p)(),SR=r._nam_loadModel=(d,h)=>(SR=r._nam_loadModel=wt.q)(d,h),PR=r._nam_unloadModel=d=>(PR=r._nam_unloadModel=wt.r)(d),MR=r._nam_hasModel=d=>(MR=r._nam_hasModel=wt.s)(d),NR=r._nam_process=(d,h,g,b)=>(NR=r._nam_process=wt.t)(d,h,g,b),$R=r._nam_setSampleRate=d=>($R=r._nam_setSampleRate=wt.u)(d),kR=r._nam_getSampleRate=()=>(kR=r._nam_getSampleRate=wt.v)(),IR=r._nam_setMaxBufferSize=d=>(IR=r._nam_setMaxBufferSize=wt.w)(d),BR=r._nam_getMaxBufferSize=()=>(BR=r._nam_getMaxBufferSize=wt.x)(),TR=r._nam_getModelLoudness=d=>(TR=r._nam_getModelLoudness=wt.y)(d),DR=r._nam_hasModelLoudness=d=>(DR=r._nam_hasModelLoudness=wt.z)(d),RR=r._nam_reset=d=>(RR=r._nam_reset=wt.A)(d),CR=r._free=d=>(CR=r._free=wt.B)(d),zR=r._malloc=d=>(zR=r._malloc=wt.C)(d),OR=()=>(OR=wt.__errno_location)(),zM=()=>(zM=wt.E)(),OM=d=>(OM=wt.F)(d),Xb=d=>(Xb=wt.G)(d),VR=d=>(VR=wt.__cxa_increment_exception_refcount)(d),VM=d=>(VM=wt.H)(d);r.ccall=RM,r.cwrap=wR,r.stringToUTF8=DM,r.lengthBytesUTF8=dg;var vg;Cp=function d(){vg||UM(),vg||(Cp=d)};function UM(){if(rl>0||(Kb(),rl>0))return;function d(){vg||(vg=!0,r.calledRun=!0,!me&&(Rp(),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),Wb()))}r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),d()},1)):d()}if(r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return UM(),e.ready})})(),yM=$V;var wM=class{constructor(e){this.uuid=e}instances=[-1,-1];json=null;loaded=!1;mono=!0},kV=(t,e)=>{if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0},Ob=class{#e;#t;#r;#i=new Map;#n=new Map;#a=1;#s=null;#o=null;#c=!1;#l=!1;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}async settle(){for(;this.#c;)await new Promise(e=>setTimeout(e,1))}imports(){return{host_nam_create:e=>this.#u(e),host_nam_load:(e,r,n)=>this.#m(e,r,n),host_nam_set_mono:(e,r)=>this.#v(e,r!==0),host_nam_process:(e,r,n,i,a,o,s)=>this.#g(e,r,n,i,a,o,s),host_nam_reset:e=>this.#d(e),host_nam_release:e=>this.#p(e)}}#u(e){let r=k.toString(new Uint8Array(this.#e.buffer,e,16).slice()),n=this.#n.get(r);if(K(n))return n;let i=this.#a++;return this.#i.set(i,new wM(r)),this.#n.set(r,i),i}#m(e,r,n){let i=this.#i.get(e);if(!K(i))return;if(n===0){i.json=null,this.#x(i);return}let a=new Uint8Array(this.#e.buffer,r,n).slice();K(i.json)&&kV(i.json,a)||(i.json=a,K(this.#o)?this.#f(i):this.#y())}#v(e,r){let n=this.#i.get(e);if(!K(n))return;n.mono=r;let i=this.#o;K(i)&&(r?n.instances[1]>=0&&(i.unloadModel(n.instances[1]),i.destroyInstance(n.instances[1]),n.instances[1]=-1):n.instances[1]<0&&(n.instances[1]=i.createInstance(),K(n.json)&&n.loaded&&(n.loaded=this.#h(n.instances[1],n.json)&&n.loaded)))}#g(e,r,n,i,a,o,s){let c=this.#i.get(e),u=this.#o;if(!K(c)||!K(u)||!c.loaded||c.instances[0]<0)return 0;let f=this.#e.buffer;if(u.process(c.instances[0],new Float32Array(f,r,o),new Float32Array(f,i,o)),s>1){if(c.instances[1]<0)return 0;u.process(c.instances[1],new Float32Array(f,n,o),new Float32Array(f,a,o))}return 1}#d(e){let r=this.#i.get(e),n=this.#o;if(!(!K(r)||!K(n)))for(let i of r.instances)i>=0&&n.reset(i)}#p(e){let r=this.#i.get(e);if(!K(r))return;let n=this.#o;if(K(n))for(let i of r.instances)i>=0&&(n.unloadModel(i),n.destroyInstance(i));this.#i.delete(e),this.#n.get(r.uuid)===e&&this.#n.delete(r.uuid)}#y(){this.#c||this.#l||K(this.#o)||(this.#c=!0,this.#t().then(e=>yM({wasmBinary:e,locateFile:()=>""})).then(e=>{this.#s=e;let r=sg.fromModule(e);r.setSampleRate(this.#r),this.#o=r,this.#c=!1;for(let n of this.#i.values())K(n.json)&&this.#f(n)}).catch(e=>{this.#c=!1,this.#l=!0,console.error("Failed to load NAM WASM:",e)}))}#f(e){let r=this.#o;!K(r)||!K(e.json)||(e.instances[0]<0&&(e.instances[0]=r.createInstance()),!e.mono&&e.instances[1]<0&&(e.instances[1]=r.createInstance()),e.loaded=this.#h(e.instances[0],e.json),e.instances[1]>=0&&(e.loaded=this.#h(e.instances[1],e.json)&&e.loaded))}#x(e){e.loaded=!1;let r=this.#o;if(K(r))for(let n of e.instances)n>=0&&r.unloadModel(n)}#h(e,r){let n=this.#s;if(!K(n))return!1;let i=n._malloc(r.length+1);n.HEAPU8.set(r,i),n.HEAPU8[i+r.length]=0;let a=n._nam_loadModel(e,i);return n._free(i),a||console.error("NAM loadModel failed"),!!a}};var Zn={Pan:17,AttackVolEnv:34,DecayVolEnv:36,SustainVolEnv:37,ReleaseVolEnv:38,KeyRange:43,VelRange:44,CoarseTune:51,FineTune:52,SampleId:53,SampleModes:54,OverridingRootKey:58},IV=1330857522,BV=32,PD=24,MD=40,ND=8,TV=({samples:t,presets:e})=>{let r=e.reduce((m,w)=>m+w.length,0),n=BV,i=n+t.length*PD,a=i+r*MD,o=a+e.length*ND,s=t.reduce((m,w)=>m+w.pcm.length,0),c=new ArrayBuffer(o+s*4),u=new DataView(c);u.setUint32(0,IV,!0),u.setUint32(4,1,!0),u.setUint32(8,t.length,!0),u.setUint32(12,r,!0),u.setUint32(16,e.length,!0),u.setUint32(20,n,!0),u.setUint32(24,i,!0),u.setUint32(28,a,!0);let f=o;t.forEach((m,w)=>{let y=n+w*PD;u.setUint32(y,f,!0),u.setUint32(y+4,m.pcm.length,!0),u.setFloat32(y+8,m.sampleRate,!0),u.setUint32(y+12,m.loopStart,!0),u.setUint32(y+16,m.loopEnd,!0),new Float32Array(c,f,m.pcm.length).set(m.pcm),f+=m.pcm.length*4});let v=0;return e.forEach((m,w)=>{let y=a+w*ND;u.setUint32(y,v,!0),u.setUint32(y+4,m.length,!0);for(let P of m){let V=i+v*MD;u.setUint8(V,P.keyLo),u.setUint8(V+1,P.keyHi),u.setUint8(V+2,P.velLo),u.setUint8(V+3,P.velHi),u.setUint32(V+4,P.sampleIndex,!0),u.setUint32(V+8,P.rootKey,!0),u.setUint32(V+12,P.loopMode,!0),u.setFloat32(V+16,P.pan,!0),u.setFloat32(V+20,P.attack,!0),u.setFloat32(V+24,P.decay,!0),u.setFloat32(V+28,P.sustain,!0),u.setFloat32(V+32,P.release,!0),v++}}),c},Ub=(t,e)=>t.generators[e]?.value,Tp=(t,e,r)=>Ub(e,r)??Ub(t,r),bM=t=>t!==void 0?Math.pow(2,t/1200):.005,Vb=(t,e)=>t.generators[e]?.range??{lo:0,hi:127},$D=t=>{let e=[],r=new Map,n=a=>{let o=r.get(a);if(o!==void 0)return o;let s=new Float32Array(a.data.length);for(let u=0;u<s.length;u++)s[u]=a.data[u]/32768;let c=e.length;return e.push({pcm:s,sampleRate:a.header.sampleRate,loopStart:a.header.startLoop,loopEnd:a.header.endLoop}),r.set(a,c),c},i=t.presets.map(a=>{let o=[];for(let s of a.zones){let c=Vb(s,Zn.KeyRange),u=Vb(s,Zn.VelRange);for(let f of s.instrument.zones){let v=Vb(f,Zn.KeyRange),m=Vb(f,Zn.VelRange),w=Math.max(c.lo,v.lo),y=Math.min(c.hi,v.hi),P=Math.max(u.lo,m.lo),V=Math.min(u.hi,m.hi);if(w>y||P>V)continue;let O=f.sample??t.samples[Ub(f,Zn.SampleId)??0];if(O===void 0)continue;let C=n(O),G=Ub(f,Zn.OverridingRootKey)??O.header.originalPitch??60,Y=Tp(s,f,Zn.SampleModes)??0,me=Tp(s,f,Zn.SustainVolEnv);o.push({keyLo:w,keyHi:y,velLo:P,velHi:V,sampleIndex:C,rootKey:G,loopMode:Y===1||Y===3?1:0,pan:(Tp(s,f,Zn.Pan)??0)/1e3,attack:bM(Tp(s,f,Zn.AttackVolEnv)),decay:bM(Tp(s,f,Zn.DecayVolEnv)),sustain:1-(me??0)/1e3,release:bM(Tp(s,f,Zn.ReleaseVolEnv))})}}return o});return TV({samples:e,presets:i})};var DV=512,_M=(t,e,r)=>{let n=sr(()=>xD(t,e));return n.status==="failure"||n.value.length===0?r:new Error(`wasm panic: ${n.value}`,{cause:r})},kD=(t,e,r,n)=>{let i=new WebAssembly.Table({initial:DV,element:"anyfunc"}),a=K(globalThis.performance)?()=>performance.now()*1e3:()=>Date.now()*1e3,o=new WebAssembly.Instance(t.engineModule,{env:{memory:e,__indirect_function_table:i,host_perf_now:a}}).exports;o.init(r);let s=new Cb(e,o,r,(f,v)=>n.deviceMessage(f,v)),c=new Ob(e,()=>n.fetchNamWasm(),r),u={...s.imports(),...c.imports()};return t.deviceModules.forEach((f,v)=>yD(o,e,i,f,t.deviceBoxTypes[v],r,u)),t.composites.forEach(f=>wD(o,e,f)),t.effectComposites.forEach(f=>bD(o,e,f)),o},ID=(t,e,r,n,i,a)=>{let o=s=>{let c=s.catch(a);n.add(c),c.finally(()=>n.delete(c))};for(;;){let s=t.input_reserve(16),c=t.sample_take_request(s);if(c<0)break;let u=new Uint8Array(e.buffer,s,16).slice();o(r.fetchAudio(u).then(f=>{let{numberOfFrames:v,numberOfChannels:m,sampleRate:w,frames:y}=f,P=v*Float32Array.BYTES_PER_ELEMENT,V=t.sample_allocate(c,m*P);if(V!==0){for(let O=0;O<m;O++)new Float32Array(e.buffer,V+O*P,v).set(y[O]);t.sample_set_ready(c,v,m,w)}},f=>{t.sample_allocate(c,4),t.sample_set_ready(c,1,1,i),r.log(`sample load failed: ${f}`)}))}for(;;){let s=t.input_reserve(16),c=t.soundfont_take_request(s);if(c<0)break;let u=new Uint8Array(e.buffer,s,16).slice();o(r.fetchSoundfont(u).then(f=>{let v=new Uint8Array($D(f)),m=t.soundfont_allocate(c,v.byteLength);m!==0&&(new Uint8Array(e.buffer,m,v.byteLength).set(v),t.soundfont_set_ready(c))},f=>r.log(`soundfont load failed: ${f}`)))}};var lg=_.None,DD=(t,e)=>{let{engine:r,memory:n,stems:i,midi:a,analyser:o,peaks:s,broadcaster:c}=t,u=sr(()=>r.render());if(u.status==="failure")throw _M(r,n,u.error);if(a.drain(r,n),i>0){let m=r.stem_output_ptr(),w=new Float32Array(n.buffer,m,i*2*Yt);for(let y=0;y<e.length&&y<i*2;y++)e[y].set(w.subarray(y*Yt,(y+1)*Yt));return}let f=r.output_ptr(),v=n.buffer;e[0].set(new Float32Array(v,f,Yt)),e.length>1&&e[1].set(new Float32Array(v,f+Yt*Float32Array.BYTES_PER_ELEMENT,Yt)),o.process(e[0],e[1]??e[0],0,Yt),s.process(e[0],e[1]??e[0],0,Yt),c.flush()};Jo.executor(__.for(self).channel("offline-engine"),{async initialize(t,e){globalThis.sampleRate=e.sampleRate;let r=e.variant,n=await gD(r.wasmUrl),i=mD(),a=__.for(t),o=Jo.sender(a.channel("engine-to-client"),te=>new class{log(_e){te.dispatchAndForget(this.log,_e)}error(_e){te.dispatchAndForget(this.error,_e)}deviceMessage(_e,$r){te.dispatchAndForget(this.deviceMessage,_e,$r)}fetchAudio(_e){return te.dispatchAndReturn(this.fetchAudio,_e)}fetchSoundfont(_e){return te.dispatchAndReturn(this.fetchSoundfont,_e)}fetchNamWasm(){return te.dispatchAndReturn(this.fetchNamWasm)}notifyClipSequenceChanges(_e){te.dispatchAndForget(this.notifyClipSequenceChanges,_e)}switchMarkerState(_e){te.dispatchAndForget(this.switchMarkerState,_e)}ready(){te.dispatchAndForget(this.ready)}}),s=kD(n,i,e.sampleRate,o),c=e.exportConfiguration?.metronome,u=Ow.isMetronomeAudible(_.wrap(e.exportConfiguration));if(s.set_metronome_enabled(u?1:0),u){let{gain:te,beatSubDivision:_e,monophonic:$r}={...Y2.parse({}).metronome,...c?.settings};s.set_metronome_gain(te),s.set_metronome_beat_sub_division(_e),s.set_metronome_monophonic($r?1:0);let Hr=(or,Dp)=>{if(!K(Dp))return;let{frames:cg,numberOfFrames:tl,numberOfChannels:jb,sampleRate:Kb}=Dp,Rp=Math.min(jb,2),Wb=s.click_allocate(tl,Rp);for(let jc=0;jc<Rp;jc++)new Float32Array(i.buffer,Wb+jc*tl*4,tl).set(cg[jc]);s.set_click_sound(or,tl,Rp,Kb)};Hr(0,c?.clickSounds?.downbeat),Hr(1,c?.clickSounds?.beat)}let{boxGraph:f}=Zo.decode(e.project),v=f.boxes().map(te=>({type:"new",name:te.name,uuid:te.address.uuid,buffer:te.toArrayBuffer()})),m=new Uint8Array(vD(v)),w=s.input_reserve(m.length);if(new Uint8Array(i.buffer,w,m.length).set(m),s.apply_updates(m.length)!==0)throw new Error("apply_updates rejected the project snapshot");let y=e.exportConfiguration?.stems,P=K(y)?Object.keys(y):[],V=K(y)&&K(c?.stem),O=P.length+(V?1:0);if(O>0){if(P.length>0){let te=s.input_reserve(P.length*20),_e=new DataView(i.buffer,te,P.length*20);P.forEach(($r,Hr)=>{let or=y[$r];new Uint8Array(i.buffer,te+Hr*20,16).set(k.parse($r)),_e.setUint32(Hr*20+16,(or.includeAudioEffects?1:0)|(or.includeSends?2:0)|(or.useInstrumentOutput?4:0)|(or.skipChannelStrip??!1?8:0),!0)})}s.set_stem_export(P.length,V?1:0)}if(s.bind()!==0)throw new Error("the project snapshot carries no TimelineBox");let C=new Bb,G=Xg.create(a,"engine-live-data"),Y=new Og,{PeakBroadcaster:me}=await Promise.resolve().then(()=>(TD(),BD)),ge=new me(G,tp.PEAKS),Ee=new Float32Array(Y.numBins()),he=new Float32Array(Y.numBins()),Me=[ge,G.broadcastFloats(tp.SPECTRUM,Ee,te=>{te&&(Ee.set(Y.bins()),Y.decay=!0)}),G.broadcastFloats(tp.WAVEFORM,he,te=>{te&&he.set(Y.waveform())})],ke=new Set;ID(s,i,o,ke,e.sampleRate,te=>o.error(_M(s,i,te)));let mt=Dg.writer(vI(),e.syncStreamBuffer,te=>{let _e=s.engine_state_ptr(),$r=new DataView(i.buffer,_e,s.engine_state_len());te.position=$r.getFloat32(0),te.bpm=$r.getFloat32(4),te.playbackTimestamp=0,te.countInBeatsRemaining=0,te.isPlaying=$r.getUint8(16)===1,te.isCountingIn=!1,te.isRecording=!1});Jo.executor(a.channel("engine-commands"),{play:()=>s.play(),stop:te=>{s.pause(),te&&s.stop()},setPosition:te=>s.set_position(te),prepareRecordingState:te=>{},stopRecording:()=>{},queryLoadingComplete:()=>Promise.all(ke).then(()=>!0),panic:()=>{},loadClickSound:(te,_e)=>{},setFrozenAudio:(te,_e)=>{},updateMonitoringMap:te=>{},noteSignal:te=>{},ignoreNoteRegion:te=>{},scheduleClipPlay:te=>{},scheduleClipStop:te=>{},setupMIDI:(te,_e)=>C.connect(te,_e),terminate:()=>{}}),t.start(),lg=_.wrap({engine:s,memory:i,stateSender:mt,pending:ke,midi:C,broadcaster:G,analyser:Y,peaks:ge,broadcasts:Me,sampleRate:e.sampleRate,numberOfChannels:O>0?O*2:2,stems:O,totalFrames:0,running:!1}),o.ready()},async addModule(t){new Function(t)()},async step(t){let e=lg.unwrap("state.step"),{stateSender:r,pending:n}=e;await Promise.all(n);let{numberOfChannels:i}=e,a=ie.create(()=>new Float32Array(t),i),o=ie.create(()=>new Float32Array(Yt),i),s=0;for(;s<t;){DD(e,o);let c=Math.min(t-s,Yt);for(let u=0;u<i;u++)a[u].set(o[u].subarray(0,c),s);s+=c,r.tryWrite()}return a},async render(t){let e=lg.unwrap("state.render"),{silenceThresholdDb:r,silenceDurationSeconds:n,maxDurationSeconds:i}=t,a=s$(r??-72),o=Math.ceil((n??10)*e.sampleRate),s=K(i)?Math.ceil(i*e.sampleRate):1/0,{numberOfChannels:c}=lg.unwrap("state.render"),u=ie.create(()=>[],c),f=0,v=!1,m=0;for(e.running=!0,await cl.timeSpan(ll.seconds(0));e.running&&e.totalFrames<s;){let y=ie.create(()=>new Float32Array(Yt),c);DD(e,y);let P=0;for(let O of y)for(let C of O){let G=Math.abs(C);G>P&&(P=G)}let V=P<=a;if(P>a&&(v=!0),V&&v){if(f+=Yt,f>=o)break}else f=0;for(let O=0;O<c;O++)u[O].push(y[O].slice());e.totalFrames+=Yt,e.stateSender.tryWrite(),e.totalFrames-m>=e.sampleRate&&(m=e.totalFrames,await new Promise(O=>setTimeout(O,0)))}let w=e.totalFrames-f+Math.min(e.sampleRate/4,f);return ie.create(y=>{let P=new Float32Array(w),V=0;for(let O of u[y]){if(V>=w)break;let C=Math.min(O.length,w-V);P.set(O.subarray(0,C),V),V+=C}return P},c)},stop(){lg.unwrap("state.stop").running=!1}});
118
+ `,"%p":Q=>Q.tm_hour>=0&&Q.tm_hour<12?"AM":"PM","%S":Q=>Te(Q.tm_sec,2),"%t":()=>" ","%u":Q=>Q.tm_wday||7,"%U":Q=>{var Fe=Q.tm_yday+7-Q.tm_wday;return Te(Math.floor(Fe/7),2)},"%V":Q=>{var Fe=Math.floor((Q.tm_yday+7-(Q.tm_wday+6)%7)/7);if((Q.tm_wday+371-Q.tm_yday-2)%7<=2&&Fe++,Fe){if(Fe==53){var It=(Q.tm_wday+371-Q.tm_yday)%7;It!=4&&(It!=3||!hg(Q.tm_year))&&(Fe=1)}}else{Fe=52;var Ir=(Q.tm_wday+7-Q.tm_yday-1)%7;(Ir==4||Ir==5&&hg(Q.tm_year%400-1))&&Fe++}return Te(Fe,2)},"%w":Q=>Q.tm_wday,"%W":Q=>{var Fe=Q.tm_yday+7-(Q.tm_wday+6)%7;return Te(Math.floor(Fe/7),2)},"%y":Q=>(Q.tm_year+1900).toString().substring(2),"%Y":Q=>Q.tm_year+1900,"%z":Q=>{var Fe=Q.tm_gmtoff,Ir=Fe>=0;return Fe=Math.abs(Fe)/60,Fe=Fe/60*100+Fe%60,(Ir?"+":"-")+("0000"+Fe).slice(-4)},"%Z":Q=>Q.tm_zone,"%%":()=>"%"};U=U.replace(/%%/g,"\0\0");for(var ce in ln)U.includes(ce)&&(U=U.replace(new RegExp(ce,"g"),ln[ce](z)));U=U.replace(/\0\0/g,"%");var ci=pg(U,!1);return ci.length>h?0:(BM(ci,d),ci.length-1)},xR=(d,h,g,b,M)=>vR(d,h,g,b),TM=d=>{var h=r["_"+d];return h},DM=(d,h,g)=>Jb(d,Me,h,g),yR=d=>{var h=dg(d)+1,g=Xb(h);return DM(d,g,h),g},RM=(d,h,g,b,M)=>{var z={string:Ne=>{var Ut=0;return Ne!=null&&Ne!==0&&(Ut=yR(Ne)),Ut},array:Ne=>{var Ut=Xb(Ne.length);return BM(Ne,Ut),Ut}};function U(Ne){return h==="string"?fg(Ne):h==="boolean"?!!Ne:Ne}var L=TM(d),ce=[],Ue=0;if(b)for(var et=0;et<b.length;et++){var ut=z[g[et]];ut?(Ue===0&&(Ue=zM()),ce[et]=ut(b[et])):ce[et]=b[et]}var Te=L.apply(null,ce);function Pe(Ne){return Ue!==0&&OM(Ue),U(Ne)}return Te=Pe(Te),Te},wR=(d,h,g,b)=>{var M=!g||g.every(U=>U==="number"||U==="boolean"),z=h!=="string";return z&&M&&!b?TM(d):function(){return RM(d,h,g,arguments,b)}},CM=function(d,h,g,b){d||(d=this),this.parent=d,this.mount=d.mount,this.mounted=null,this.id=x.nextInode++,this.name=h,this.mode=g,this.node_ops={},this.stream_ops={},this.rdev=b},mg=365,gg=146;Object.defineProperties(CM.prototype,{read:{get:function(){return(this.mode&mg)===mg},set:function(d){d?this.mode|=mg:this.mode&=~mg}},write:{get:function(){return(this.mode&gg)===gg},set:function(d){d?this.mode|=gg:this.mode&=~gg}},isFolder:{get:function(){return x.isDir(this.mode)}},isDevice:{get:function(){return x.isChrdev(this.mode)}}}),x.FSNode=CM,x.createPreloadedFile=nR,x.staticInit();var bR={a:WD,b:LD,k:ZD,i:qD,e:oR,f:sR,g:lR,h:uR,j:pR,c:hR,d:xR},wt=UD(),_R=()=>(_R=wt.m)(),FR=r._nam_createInstance=()=>(FR=r._nam_createInstance=wt.n)(),AR=r._nam_destroyInstance=d=>(AR=r._nam_destroyInstance=wt.o)(d),ER=r._nam_getInstanceCount=()=>(ER=r._nam_getInstanceCount=wt.p)(),SR=r._nam_loadModel=(d,h)=>(SR=r._nam_loadModel=wt.q)(d,h),PR=r._nam_unloadModel=d=>(PR=r._nam_unloadModel=wt.r)(d),MR=r._nam_hasModel=d=>(MR=r._nam_hasModel=wt.s)(d),NR=r._nam_process=(d,h,g,b)=>(NR=r._nam_process=wt.t)(d,h,g,b),$R=r._nam_setSampleRate=d=>($R=r._nam_setSampleRate=wt.u)(d),kR=r._nam_getSampleRate=()=>(kR=r._nam_getSampleRate=wt.v)(),IR=r._nam_setMaxBufferSize=d=>(IR=r._nam_setMaxBufferSize=wt.w)(d),BR=r._nam_getMaxBufferSize=()=>(BR=r._nam_getMaxBufferSize=wt.x)(),TR=r._nam_getModelLoudness=d=>(TR=r._nam_getModelLoudness=wt.y)(d),DR=r._nam_hasModelLoudness=d=>(DR=r._nam_hasModelLoudness=wt.z)(d),RR=r._nam_reset=d=>(RR=r._nam_reset=wt.A)(d),CR=r._free=d=>(CR=r._free=wt.B)(d),zR=r._malloc=d=>(zR=r._malloc=wt.C)(d),OR=()=>(OR=wt.__errno_location)(),zM=()=>(zM=wt.E)(),OM=d=>(OM=wt.F)(d),Xb=d=>(Xb=wt.G)(d),VR=d=>(VR=wt.__cxa_increment_exception_refcount)(d),VM=d=>(VM=wt.H)(d);r.ccall=RM,r.cwrap=wR,r.stringToUTF8=DM,r.lengthBytesUTF8=dg;var vg;Cp=function d(){vg||UM(),vg||(Cp=d)};function UM(){if(rl>0||(Kb(),rl>0))return;function d(){vg||(vg=!0,r.calledRun=!0,!me&&(Rp(),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),Wb()))}r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),d()},1)):d()}if(r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return UM(),e.ready})})(),yM=$V;var wM=class{constructor(e){this.uuid=e}instances=[-1,-1];json=null;loaded=!1;mono=!0},kV=(t,e)=>{if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0},Ob=class{#e;#t;#r;#i=new Map;#n=new Map;#a=1;#s=null;#o=null;#c=!1;#l=!1;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}async settle(){for(;this.#c;)await new Promise(e=>setTimeout(e,1))}imports(){return{host_nam_create:e=>this.#u(e),host_nam_load:(e,r,n)=>this.#m(e,r,n),host_nam_set_mono:(e,r)=>this.#v(e,r!==0),host_nam_process:(e,r,n,i,a,o,s)=>this.#d(e,r,n,i,a,o,s),host_nam_reset:e=>this.#p(e),host_nam_release:e=>this.#f(e)}}#u(e){let r=k.toString(new Uint8Array(this.#e.buffer,e,16).slice()),n=this.#n.get(r);if(K(n))return n;let i=this.#a++;return this.#i.set(i,new wM(r)),this.#n.set(r,i),i}#m(e,r,n){let i=this.#i.get(e);if(!K(i))return;if(n===0){i.json=null,this.#x(i);return}let a=new Uint8Array(this.#e.buffer,r,n).slice();K(i.json)&&kV(i.json,a)||(i.json=a,K(this.#o)?this.#h(i):this.#y())}#v(e,r){let n=this.#i.get(e);if(!K(n))return;n.mono=r;let i=this.#o;K(i)&&(r?n.instances[1]>=0&&(i.unloadModel(n.instances[1]),i.destroyInstance(n.instances[1]),n.instances[1]=-1):n.instances[1]<0&&(n.instances[1]=i.createInstance(),K(n.json)&&n.loaded&&(n.loaded=this.#g(n.instances[1],n.json)&&n.loaded)))}#d(e,r,n,i,a,o,s){let c=this.#i.get(e),u=this.#o;if(!K(c)||!K(u)||!c.loaded||c.instances[0]<0)return 0;let f=this.#e.buffer;if(u.process(c.instances[0],new Float32Array(f,r,o),new Float32Array(f,i,o)),s>1){if(c.instances[1]<0)return 0;u.process(c.instances[1],new Float32Array(f,n,o),new Float32Array(f,a,o))}return 1}#p(e){let r=this.#i.get(e),n=this.#o;if(!(!K(r)||!K(n)))for(let i of r.instances)i>=0&&n.reset(i)}#f(e){let r=this.#i.get(e);if(!K(r))return;let n=this.#o;if(K(n))for(let i of r.instances)i>=0&&(n.unloadModel(i),n.destroyInstance(i));this.#i.delete(e),this.#n.get(r.uuid)===e&&this.#n.delete(r.uuid)}#y(){this.#c||this.#l||K(this.#o)||(this.#c=!0,this.#t().then(e=>yM({wasmBinary:e,locateFile:()=>""})).then(e=>{this.#s=e;let r=sg.fromModule(e);r.setSampleRate(this.#r),this.#o=r,this.#c=!1;for(let n of this.#i.values())K(n.json)&&this.#h(n)}).catch(e=>{this.#c=!1,this.#l=!0,console.error("Failed to load NAM WASM:",e)}))}#h(e){let r=this.#o;!K(r)||!K(e.json)||(e.instances[0]<0&&(e.instances[0]=r.createInstance()),!e.mono&&e.instances[1]<0&&(e.instances[1]=r.createInstance()),e.loaded=this.#g(e.instances[0],e.json),e.instances[1]>=0&&(e.loaded=this.#g(e.instances[1],e.json)&&e.loaded))}#x(e){e.loaded=!1;let r=this.#o;if(K(r))for(let n of e.instances)n>=0&&r.unloadModel(n)}#g(e,r){let n=this.#s;if(!K(n))return!1;let i=n._malloc(r.length+1);n.HEAPU8.set(r,i),n.HEAPU8[i+r.length]=0;let a=n._nam_loadModel(e,i);return n._free(i),a||console.error("NAM loadModel failed"),!!a}};var Zn={Pan:17,AttackVolEnv:34,DecayVolEnv:36,SustainVolEnv:37,ReleaseVolEnv:38,KeyRange:43,VelRange:44,CoarseTune:51,FineTune:52,SampleId:53,SampleModes:54,OverridingRootKey:58},IV=1330857522,BV=32,PD=24,MD=40,ND=8,TV=({samples:t,presets:e})=>{let r=e.reduce((m,w)=>m+w.length,0),n=BV,i=n+t.length*PD,a=i+r*MD,o=a+e.length*ND,s=t.reduce((m,w)=>m+w.pcm.length,0),c=new ArrayBuffer(o+s*4),u=new DataView(c);u.setUint32(0,IV,!0),u.setUint32(4,1,!0),u.setUint32(8,t.length,!0),u.setUint32(12,r,!0),u.setUint32(16,e.length,!0),u.setUint32(20,n,!0),u.setUint32(24,i,!0),u.setUint32(28,a,!0);let f=o;t.forEach((m,w)=>{let y=n+w*PD;u.setUint32(y,f,!0),u.setUint32(y+4,m.pcm.length,!0),u.setFloat32(y+8,m.sampleRate,!0),u.setUint32(y+12,m.loopStart,!0),u.setUint32(y+16,m.loopEnd,!0),new Float32Array(c,f,m.pcm.length).set(m.pcm),f+=m.pcm.length*4});let v=0;return e.forEach((m,w)=>{let y=a+w*ND;u.setUint32(y,v,!0),u.setUint32(y+4,m.length,!0);for(let P of m){let V=i+v*MD;u.setUint8(V,P.keyLo),u.setUint8(V+1,P.keyHi),u.setUint8(V+2,P.velLo),u.setUint8(V+3,P.velHi),u.setUint32(V+4,P.sampleIndex,!0),u.setUint32(V+8,P.rootKey,!0),u.setUint32(V+12,P.loopMode,!0),u.setFloat32(V+16,P.pan,!0),u.setFloat32(V+20,P.attack,!0),u.setFloat32(V+24,P.decay,!0),u.setFloat32(V+28,P.sustain,!0),u.setFloat32(V+32,P.release,!0),v++}}),c},Ub=(t,e)=>t.generators[e]?.value,Tp=(t,e,r)=>Ub(e,r)??Ub(t,r),bM=t=>t!==void 0?Math.pow(2,t/1200):.005,Vb=(t,e)=>t.generators[e]?.range??{lo:0,hi:127},$D=t=>{let e=[],r=new Map,n=a=>{let o=r.get(a);if(o!==void 0)return o;let s=new Float32Array(a.data.length);for(let u=0;u<s.length;u++)s[u]=a.data[u]/32768;let c=e.length;return e.push({pcm:s,sampleRate:a.header.sampleRate,loopStart:a.header.startLoop,loopEnd:a.header.endLoop}),r.set(a,c),c},i=t.presets.map(a=>{let o=[];for(let s of a.zones){let c=Vb(s,Zn.KeyRange),u=Vb(s,Zn.VelRange);for(let f of s.instrument.zones){let v=Vb(f,Zn.KeyRange),m=Vb(f,Zn.VelRange),w=Math.max(c.lo,v.lo),y=Math.min(c.hi,v.hi),P=Math.max(u.lo,m.lo),V=Math.min(u.hi,m.hi);if(w>y||P>V)continue;let O=f.sample??t.samples[Ub(f,Zn.SampleId)??0];if(O===void 0)continue;let C=n(O),G=Ub(f,Zn.OverridingRootKey)??O.header.originalPitch??60,Y=Tp(s,f,Zn.SampleModes)??0,me=Tp(s,f,Zn.SustainVolEnv);o.push({keyLo:w,keyHi:y,velLo:P,velHi:V,sampleIndex:C,rootKey:G,loopMode:Y===1||Y===3?1:0,pan:(Tp(s,f,Zn.Pan)??0)/1e3,attack:bM(Tp(s,f,Zn.AttackVolEnv)),decay:bM(Tp(s,f,Zn.DecayVolEnv)),sustain:1-(me??0)/1e3,release:bM(Tp(s,f,Zn.ReleaseVolEnv))})}}return o});return TV({samples:e,presets:i})};var DV=512,_M=(t,e,r)=>{let n=sr(()=>xD(t,e));return n.status==="failure"||n.value.length===0?r:new Error(`wasm panic: ${n.value}`,{cause:r})},kD=(t,e,r,n)=>{let i=new WebAssembly.Table({initial:DV,element:"anyfunc"}),a=K(globalThis.performance)?()=>performance.now()*1e3:()=>Date.now()*1e3,o=new WebAssembly.Instance(t.engineModule,{env:{memory:e,__indirect_function_table:i,host_perf_now:a}}).exports;o.init(r);let s=new Cb(e,o,r,(f,v)=>n.deviceMessage(f,v)),c=new Ob(e,()=>n.fetchNamWasm(),r),u={...s.imports(),...c.imports()};return t.deviceModules.forEach((f,v)=>yD(o,e,i,f,t.deviceBoxTypes[v],r,u)),t.composites.forEach(f=>wD(o,e,f)),t.effectComposites.forEach(f=>bD(o,e,f)),o},ID=(t,e,r,n,i,a)=>{let o=s=>{let c=s.catch(a);n.add(c),c.finally(()=>n.delete(c))};for(;;){let s=t.input_reserve(16),c=t.sample_take_request(s);if(c<0)break;let u=new Uint8Array(e.buffer,s,16).slice();o(r.fetchAudio(u).then(f=>{let{numberOfFrames:v,numberOfChannels:m,sampleRate:w,frames:y}=f,P=v*Float32Array.BYTES_PER_ELEMENT,V=t.sample_allocate(c,m*P);if(V!==0){for(let O=0;O<m;O++)new Float32Array(e.buffer,V+O*P,v).set(y[O]);t.sample_set_ready(c,v,m,w)}},f=>{t.sample_allocate(c,4),t.sample_set_ready(c,1,1,i),r.log(`sample load failed: ${f}`)}))}for(;;){let s=t.input_reserve(16),c=t.soundfont_take_request(s);if(c<0)break;let u=new Uint8Array(e.buffer,s,16).slice();o(r.fetchSoundfont(u).then(f=>{let v=new Uint8Array($D(f)),m=t.soundfont_allocate(c,v.byteLength);m!==0&&(new Uint8Array(e.buffer,m,v.byteLength).set(v),t.soundfont_set_ready(c))},f=>r.log(`soundfont load failed: ${f}`)))}};var lg=_.None,DD=(t,e)=>{let{engine:r,memory:n,stems:i,midi:a,analyser:o,peaks:s,broadcaster:c}=t,u=sr(()=>r.render());if(u.status==="failure")throw _M(r,n,u.error);if(a.drain(r,n),i>0){let m=r.stem_output_ptr(),w=new Float32Array(n.buffer,m,i*2*Yt);for(let y=0;y<e.length&&y<i*2;y++)e[y].set(w.subarray(y*Yt,(y+1)*Yt));return}let f=r.output_ptr(),v=n.buffer;e[0].set(new Float32Array(v,f,Yt)),e.length>1&&e[1].set(new Float32Array(v,f+Yt*Float32Array.BYTES_PER_ELEMENT,Yt)),o.process(e[0],e[1]??e[0],0,Yt),s.process(e[0],e[1]??e[0],0,Yt),c.flush()};Jo.executor(__.for(self).channel("offline-engine"),{async initialize(t,e){globalThis.sampleRate=e.sampleRate;let r=e.variant,n=await gD(r.wasmUrl),i=mD(),a=__.for(t),o=Jo.sender(a.channel("engine-to-client"),te=>new class{log(_e){te.dispatchAndForget(this.log,_e)}error(_e){te.dispatchAndForget(this.error,_e)}deviceMessage(_e,$r){te.dispatchAndForget(this.deviceMessage,_e,$r)}fetchAudio(_e){return te.dispatchAndReturn(this.fetchAudio,_e)}fetchSoundfont(_e){return te.dispatchAndReturn(this.fetchSoundfont,_e)}fetchNamWasm(){return te.dispatchAndReturn(this.fetchNamWasm)}notifyClipSequenceChanges(_e){te.dispatchAndForget(this.notifyClipSequenceChanges,_e)}switchMarkerState(_e){te.dispatchAndForget(this.switchMarkerState,_e)}ready(){te.dispatchAndForget(this.ready)}}),s=kD(n,i,e.sampleRate,o),c=e.exportConfiguration?.metronome,u=Ow.isMetronomeAudible(_.wrap(e.exportConfiguration));if(s.set_metronome_enabled(u?1:0),u){let{gain:te,beatSubDivision:_e,monophonic:$r}={...Y2.parse({}).metronome,...c?.settings};s.set_metronome_gain(te),s.set_metronome_beat_sub_division(_e),s.set_metronome_monophonic($r?1:0);let Hr=(or,Dp)=>{if(!K(Dp))return;let{frames:cg,numberOfFrames:tl,numberOfChannels:jb,sampleRate:Kb}=Dp,Rp=Math.min(jb,2),Wb=s.click_allocate(tl,Rp);for(let jc=0;jc<Rp;jc++)new Float32Array(i.buffer,Wb+jc*tl*4,tl).set(cg[jc]);s.set_click_sound(or,tl,Rp,Kb)};Hr(0,c?.clickSounds?.downbeat),Hr(1,c?.clickSounds?.beat)}let{boxGraph:f}=Zo.decode(e.project),v=f.boxes().map(te=>({type:"new",name:te.name,uuid:te.address.uuid,buffer:te.toArrayBuffer()})),m=new Uint8Array(vD(v)),w=s.input_reserve(m.length);if(new Uint8Array(i.buffer,w,m.length).set(m),s.apply_updates(m.length)!==0)throw new Error("apply_updates rejected the project snapshot");let y=e.exportConfiguration?.stems,P=K(y)?Object.keys(y):[],V=K(y)&&K(c?.stem),O=P.length+(V?1:0);if(O>0){if(P.length>0){let te=s.input_reserve(P.length*20),_e=new DataView(i.buffer,te,P.length*20);P.forEach(($r,Hr)=>{let or=y[$r];new Uint8Array(i.buffer,te+Hr*20,16).set(k.parse($r)),_e.setUint32(Hr*20+16,(or.includeAudioEffects?1:0)|(or.includeSends?2:0)|(or.useInstrumentOutput?4:0)|(or.skipChannelStrip??!1?8:0),!0)})}s.set_stem_export(P.length,V?1:0)}if(s.bind()!==0)throw new Error("the project snapshot carries no TimelineBox");let C=new Bb,G=Xg.create(a,"engine-live-data"),Y=new Og,{PeakBroadcaster:me}=await Promise.resolve().then(()=>(TD(),BD)),ge=new me(G,tp.PEAKS),Ee=new Float32Array(Y.numBins()),he=new Float32Array(Y.numBins()),Me=[ge,G.broadcastFloats(tp.SPECTRUM,Ee,te=>{te&&(Ee.set(Y.bins()),Y.decay=!0)}),G.broadcastFloats(tp.WAVEFORM,he,te=>{te&&he.set(Y.waveform())})],ke=new Set;ID(s,i,o,ke,e.sampleRate,te=>o.error(_M(s,i,te)));let mt=Dg.writer(vI(),e.syncStreamBuffer,te=>{let _e=s.engine_state_ptr(),$r=new DataView(i.buffer,_e,s.engine_state_len());te.position=$r.getFloat32(0),te.bpm=$r.getFloat32(4),te.playbackTimestamp=0,te.countInBeatsRemaining=0,te.isPlaying=$r.getUint8(16)===1,te.isCountingIn=!1,te.isRecording=!1});Jo.executor(a.channel("engine-commands"),{play:()=>s.play(),stop:te=>{s.pause(),te&&s.stop()},setPosition:te=>s.set_position(te),prepareRecordingState:te=>{},stopRecording:()=>{},queryLoadingComplete:()=>Promise.all(ke).then(()=>!0),panic:()=>{},loadClickSound:(te,_e)=>{},setFrozenAudio:(te,_e)=>{},updateMonitoringMap:te=>{},noteSignal:te=>{},ignoreNoteRegion:te=>{},scheduleClipPlay:te=>{},scheduleClipStop:te=>{},setupMIDI:(te,_e)=>C.connect(te,_e),terminate:()=>{}}),t.start(),lg=_.wrap({engine:s,memory:i,stateSender:mt,pending:ke,midi:C,broadcaster:G,analyser:Y,peaks:ge,broadcasts:Me,sampleRate:e.sampleRate,numberOfChannels:O>0?O*2:2,stems:O,totalFrames:0,running:!1}),o.ready()},async addModule(t){new Function(t)()},async step(t){let e=lg.unwrap("state.step"),{stateSender:r,pending:n}=e;await Promise.all(n);let{numberOfChannels:i}=e,a=ie.create(()=>new Float32Array(t),i),o=ie.create(()=>new Float32Array(Yt),i),s=0;for(;s<t;){DD(e,o);let c=Math.min(t-s,Yt);for(let u=0;u<i;u++)a[u].set(o[u].subarray(0,c),s);s+=c,r.tryWrite()}return a},async render(t){let e=lg.unwrap("state.render"),{silenceThresholdDb:r,silenceDurationSeconds:n,maxDurationSeconds:i}=t,a=s$(r??-72),o=Math.ceil((n??10)*e.sampleRate),s=K(i)?Math.ceil(i*e.sampleRate):1/0,{numberOfChannels:c}=lg.unwrap("state.render"),u=ie.create(()=>[],c),f=0,v=!1,m=0;for(e.running=!0,await cl.timeSpan(ll.seconds(0));e.running&&e.totalFrames<s;){let y=ie.create(()=>new Float32Array(Yt),c);DD(e,y);let P=0;for(let O of y)for(let C of O){let G=Math.abs(C);G>P&&(P=G)}let V=P<=a;if(P>a&&(v=!0),V&&v){if(f+=Yt,f>=o)break}else f=0;for(let O=0;O<c;O++)u[O].push(y[O].slice());e.totalFrames+=Yt,e.stateSender.tryWrite(),e.totalFrames-m>=e.sampleRate&&(m=e.totalFrames,await new Promise(O=>setTimeout(O,0)))}let w=e.totalFrames-f+Math.min(e.sampleRate/4,f);return ie.create(y=>{let P=new Float32Array(w),V=0;for(let O of u[y]){if(V>=w)break;let C=Math.min(O.length,w-V);P.set(O.subarray(0,C),V),V+=C}return P},c)},stop(){lg.unwrap("state.stop").running=!1}});
119
119
  /*! Bundled license information:
120
120
 
121
121
  @opendaw/nam-wasm/dist/index.js: