@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.
@@ -1,6 +1,6 @@
1
1
  var dD=Object.defineProperty;var no=(t,e)=>{for(var r in e)dD(t,r,{get:e[r],enumerable:!0})};var uM=globalThis;uM.self??=globalThis;uM.location??={href:"/"};var K=t=>t!=null,en=t=>t===null,dM=t=>t!==null,tg=t=>t===void 0,T0=t=>t!==void 0,D0=t=>t==null,R0=(t,e)=>t!=null?e(t):void 0,Ke=(t,e="asDefined failed")=>t??j(fa(e)),gt=(t,e)=>t instanceof e,Re=(t,e)=>t instanceof e?t:j(`${t} is not instance of ${e}`),C0=(t,e)=>{t instanceof e||j(`${t} is not instance of ${e}`)};var fa=t=>t instanceof Function?t():t;var N=(t,...e)=>t?.apply(null,e),rg=t=>K(t)&&typeof t=="object";var ig=t=>{throw new Error(`Unhandled ${t}`)},j=t=>{throw typeof t=="string"?new Error(t):t},re=(t,e)=>t?void 0:j(fa(e));var bp=t=>new Proxy({},{get(){return j(t)}});var B0=class{value;status="success";constructor(e){this.value=e}error=bp("Cannot access error when succeeded")},I0=class{error;status="failure";constructor(e){this.error=e}value=bp("Cannot access value when failed")},Lt=t=>{try{return new B0(t())}catch(e){return new I0(e)}};var ao=(t,e)=>Object.keys(e).length===0?j("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(i=>isNaN(Number(i))).map(i=>e[i]).includes(t)?t:j(`Invalid enum value: ${String(t)}`),_p=()=>{};var z0;(function(t){t[t.Ascending=1]="Ascending",t[t.Descending=-1]="Descending"})(z0||(z0={}));var de=class{static#e=Object.freeze(new Array(0));static empty=()=>this.#e;static clear=e=>{e.length=0};static replace=(e,r)=>{e.length=0,e.push(...r)};static consume=(e,r)=>{for(let n=0;n<e.length;)r(e[n])?e.splice(n,1):n++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,r)=>Ke(e.at(0),r);static getLast=(e,r)=>Ke(e.at(-1),r);static getPrev=(e,r)=>{let n=e.indexOf(r);return n===-1?j(`${r} not found in ${e}`):Ke(e.at((n-1)%e.length),"Internal Error")};static getNext=(e,r)=>{let n=e.indexOf(r);return n===-1?j(`${r} not found in ${e}`):Ke(e.at((n+1)%e.length),"Internal Error")};static removeLast=(e,r)=>Ke(e.pop(),r);static create=(e,r)=>{let n=new Array(r);for(let i=0;i<r;i++)n[i]=e(i);return n};static equals=(e,r)=>{if(e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==r[n])return!1;return!0};static satisfy=(e,r)=>{if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++)if(!r(n,e[i]))return!1;return!0};static remove=(e,r)=>{let n=e.indexOf(r);if(n===-1)return j(`${r} not found in ${e}`);e.splice(n,1)};static removeIf=(e,r)=>{for(let n=e.length-1;n>=0;n--)r(e[n])&&e.splice(n,1)};static removeOpt=(e,r)=>{let n=e.indexOf(r);return n===-1?!1:(e.splice(n,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let r=0,n=new Set;for(let i of e)n.has(i)||(n.add(i),e[r++]=i);return e.length=r,e};static removeDuplicateKeys=(e,r)=>{let n=0,i=new Set;for(let a of e){let o=a[r];i.has(o)||(i.add(o),e[n++]=a)}return e.length=n,e};static partition(e,...r){let n=r.map(()=>[]);for(let i of e)for(let a=0;a<r.length;a++)r[a](i)&&n[a].push(i);return n}static subtract(e,r,n){return e.filter(i=>!r.some(a=>n(i,a)))}static intersect(e,r,n){return e.filter(i=>r.some(a=>n(i,a)))}static merge(e,r,n){return[...e.filter(i=>!r.some(a=>n(i,a))),...r]}static*iterate(e){for(let r=0;r<e.length;r++)yield e[r]}static*iterateReverse(e){for(let r=e.length-1;r>=0;r--)yield e[r]}static*iterateStateFull(e){let r=e.length-1;for(let n=0;n<=r;n++)yield{value:e[n],isFirst:n===0,isLast:n===r}}static*iterateAdjacent(e){if(!(e.length<=1))for(let r=1,n=e[0];r<e.length;r++){let i=e[r];yield[n,i],n=i}}static isSorted(e,r=z0.Ascending){if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++){let a=e[i];if(Math.sign(n-a)===r)return!1;n=a}return!0}static toRecord(e,r){return e.reduce((n,i)=>(n[r(i)]=i,n),{})}static concatArrayBuffers(e,r){let n=new ArrayBuffer(e.byteLength+r.byteLength),i=new Uint8Array(n);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(r),e.byteLength),n}};var b;(function(t){t.wrap=r=>K(r)?new e(r):t.None,t.from=r=>t.wrap(r()),t.tryCatch=r=>{try{return t.wrap(r())}catch{return t.None}},t.execute=(r,...n)=>t.wrap(r?.apply(null,n)),t.async=r=>r.then(n=>t.wrap(n),()=>t.None);class e{#e;constructor(n){this.#e=Ke(n)}unwrap(){return this.#e}unwrapOrElse(n){return this.#e}unwrapOrNull(){return this.#e}unwrapOrUndefined(){return this.#e}contains(n){return n===this.#e}match(n){return n.some(this.#e)}ifSome(n){return n(this.#e)}ifAbsent(n){}isEmpty(){return!1}nonEmpty(){return!0}map(n){return t.wrap(n(this.#e))}mapOr(n,i){return n(this.#e)}flatMap(n){return n(this.#e)}equals(n){return this.unwrapOrNull()===n.unwrapOrNull()}assert(n){return this}toString(){return`{Option.Some(${this.#e})}`}get[Symbol.toStringTag](){return this.toString()}}t.Some=e,t.None=new class{unwrap=r=>j(K(r)?fa(r):"unwrap failed");unwrapOrElse=r=>fa(r);unwrapOrNull=()=>null;unwrapOrUndefined=()=>{};contains=r=>!1;match=r=>r.none();ifSome=r=>{};ifAbsent=r=>r(void 0);isEmpty=()=>!0;nonEmpty=()=>!1;map=r=>t.None;mapOr=(r,n)=>fa(n);flatMap=r=>t.None;equals=r=>r.isEmpty();assert=r=>j(fa(r)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(b||(b={}));var Pr;(function(t){t.async=e=>e.then(r=>t.ok(r),r=>t.err(r)),t.tryGet=e=>{try{return t.ok(e())}catch(r){return t.err(r)}},t.ok=e=>new class{value;constructor(r){this.value=r}asOption=()=>b.wrap(this.value);failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>this.value;map=r=>{try{return t.ok(r(this.value))}catch(n){return t.err(n)}};mapOr=(r,n)=>r(this.value);unwrapOrElse=r=>this.value;flatMap=r=>r(this.value);match=r=>r.ok(this.value);toVoid=()=>t.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>`{Success: ${this.value}`;get[Symbol.toStringTag](){return"Success"}}(e),t.Ok=new class{constructor(){}asOption=()=>b.None;failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>{};map=e=>t.ok(e());mapOr=(e,r)=>e();unwrapOrElse=e=>{};flatMap=e=>e();match=e=>e.ok();toVoid=()=>t.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>"{Success: Ok";get[Symbol.toStringTag](){return"Success"}},t.err=e=>new class{reason;constructor(r){this.reason=r}asOption=()=>b.None;failureReason=()=>this.reason;isFailure=()=>!0;isSuccess=()=>!1;result=()=>j(`'${this.reason}'`);map=()=>this;mapOr=(r,n)=>fa(n);unwrapOrElse=r=>fa(r);flatMap=()=>this;match=r=>r.err(this.reason);toVoid=()=>t.err(this.reason);failure=()=>this;toString=()=>`{Failure: ${this.reason}`;get[Symbol.toStringTag](){return"Failure"}}(e)})(Pr||(Pr={}));var vt;(function(t){t.exact=(e,r,n)=>{let i=0,a=e.length-1;for(;i<=a;){let o=i+a>>>1,s=n(e[o],r);if(s===0)return o;s<0?i=o+1:a=o-1}return-1},t.exactMapped=(e,r,n,i)=>{let a=0,o=e.length-1;for(;a<=o;){let s=a+o>>>1,c=n(i(e[s]),r);if(c===0)return s;c<0?a=s+1:o=s-1}return-1},t.leftMost=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<0?i=o+1:a=o}return i},t.rightMost=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<=0?i=o+1:a=o}return a-1},t.stableInsert=(e,r,n)=>{let i=0,a=e.length;for(;i<a;){let o=i+a>>>1;n(e[o],r)<0?i=o+1:a=o}for(;i<e.length&&n(e[i],r)===0;)i++;return i},t.leftMostMapped=(e,r,n,i)=>{let a=0,o=e.length;for(;a<o;){let s=a+o>>>1;n(i(e[s]),r)<0?a=s+1:o=s}return a},t.rightMostMapped=(e,r,n,i)=>{let a=0,o=e.length;for(;a<o;){let s=a+o>>>1;n(i(e[s]),r)<=0?a=s+1:o=s}return o-1},t.rangeMapped=(e,r,n,i)=>[t.leftMostMapped(e,r,n,i),t.rightMostMapped(e,r,n,i)]})(vt||(vt={}));var ng=class{#e;#t=null;constructor(e){this.#e=e}invalidate=()=>this.#t=null;get(){return this.#t===null&&(this.#t=this.#e()),this.#t}terminate(){this.invalidate()}};var er=class t{static parseCssRgbOrRgba(e){let r=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(K(r)&&r.every(n=>!isNaN(n))){if(r.length===3)return[r[0]/255,r[1]/255,r[2]/255,1];if(r.length===4)return[r[0]/255,r[1]/255,r[2]/255,r[3]]}throw new Error(`${e} is not proper formatted. Example: 'rgb(255, 255, 255)' or 'rgba(255, 255, 255, 1)'`)}static hslToHex(e,r,n){let i=c=>(c+e/30)%12,a=r*Math.min(n,1-n),o=c=>n-a*Math.max(-1,Math.min(i(c)-3,Math.min(9-i(c),1))),s=c=>Math.round(c*255).toString(16).padStart(2,"0");return`#${s(o(0))}${s(o(8))}${s(o(4))}`}static hexToHsl(e){let r=e.startsWith("#")?e.slice(1):e,n=parseInt(r.slice(0,2),16)/255,i=parseInt(r.slice(2,4),16)/255,a=parseInt(r.slice(4,6),16)/255,o=Math.max(n,i,a),s=Math.min(n,i,a),c=(o+s)/2,u=0,f=0;if(o!==s){let v=o-s;switch(f=c>.5?v/(2-o-s):v/(o+s),o){case n:u=((i-a)/v+(i<a?6:0))*60;break;case i:u=((a-n)/v+2)*60;break;case a:u=((n-i)/v+4)*60;break}}return{h:u,s:f,l:c}}static hslStringToHex(e){let[r,n,i]=e.match(/\d+(\.\d+)?/g).map(Number);return t.hslToHex(r,n/100,i/100)}#e;#t;#r;#i;constructor(e,r,n,i=1){this.#e=e,this.#t=r,this.#r=n,this.#i=i}opacity(e){return new t(this.#e,this.#t,this.#r,e)}brightness(e){let r=Math.max(0,Math.min(100,this.#r+e));return new t(this.#e,this.#t,r,this.#i)}saturate(e){return new t(this.#e,this.#t*e,this.#r,this.#i)}lerp(e,r){let n=Math.PI/180,i=this.#t*Math.cos(this.#e*n),a=this.#t*Math.sin(this.#e*n),o=e.#t*Math.cos(e.#e*n),s=e.#t*Math.sin(e.#e*n),c=i+(o-i)*r,u=a+(s-a)*r,f=(Math.atan2(u,c)/n+360)%360,v=Math.sqrt(c*c+u*u),h=this.#r+(e.#r-this.#r)*r,y=this.#i+(e.#i-this.#i)*r;return new t(f,v,h,y)}fade(e){let r=this.#t*(1-Math.sqrt(e)),n=this.#r+(100-this.#r)*e**3;return new t(this.#e,r,n,this.#i)}toString(){return this.#i===1?`hsl(${this.#e}, ${this.#t}%, ${this.#r}%)`:`hsla(${this.#e}, ${this.#t}%, ${this.#r}%, ${this.#i})`}};var jo=(t,e)=>t-e;var oo=Math.PI*2,x4=Math.PI/2,y4=Math.PI/4,w4=1/Math.sqrt(2),Fe=(t,e,r)=>Math.max(e,Math.min(t,r)),ag=t=>Math.max(0,Math.min(t,1)),pM=(t,e)=>e+(1-2*e)*Math.max(0,Math.min(t,1)),O0=(t,e)=>Math.floor(t/e)*e;var fM=(t,e,r)=>t+(e-t)*r;var Js=(t,e)=>pD(t/e)*e,pD=t=>t-Math.floor(t),og=t=>Math.pow(2,Math.ceil(Math.log(t)/Math.log(2)));var V0=(t,e)=>t*e/((2*e-1)*(t-1)+e);var tr;(function(t){t.valueAt=({slope:i,steps:a,y0:o,y1:s},c)=>t.normalizedAt(c/a,i)*(s-o)+o,t.normalizedAt=(i,a)=>{if(a>.499999&&a<.500001)return i;{let o=Fe(a,1e-15,.999999999999999);return o*o/(1-o*2)*(Math.pow((1-o)/o,2*i)-1)}},t.inverseAt=(i,a)=>{let o=Fe(a,1e-15,.999999999999999);return Math.log(i*(1-2*o)/(o*o)+1)/(2*Math.log((1-o)/o))},t.coefficients=i=>{let a=t.valueAt(i,1),s=(t.valueAt(i,2)-a)/(a-i.y0),c=a-s*i.y0;return{m:s,q:c}};function*r(i,a,o,s){let{m:c,q:u}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let f=0,v=o;f<a;f++)yield v=c*v+u}t.walk=r,t.run=(i,a,o,s,c)=>{let{m:u,q:f}=t.coefficients({slope:i,steps:a,y0:o,y1:s});for(let v=0,h=o;v<a;v++)c(h=u*h+f)};function*n(i,a){let o=1/a,s=t.normalizedAt(o,i),u=(t.normalizedAt(2*o,i)-s)/s;for(let f=0,v=0;f<a;f++)yield v=u*v+s}t.walkNormalized=n,t.byHalf=(i,a,o,s)=>({slope:t.slopeByHalf(a,o,s),steps:i,y0:a,y1:s}),t.slopeByHalf=(i,a,o)=>Math.abs(o-i)<1e-6?.5:(a-i)/(o-i)})(tr||(tr={}));var ma=new DataView(new ArrayBuffer(8)),Mr;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647,t.toByte=e=>(ma.setInt8(0,e),ma.getInt8(0)),t.toShort=e=>(ma.setInt16(0,e),ma.getInt16(0)),t.toInt=e=>(ma.setInt32(0,e),ma.getInt32(0))})(Mr||(Mr={}));var so;(function(t){let n=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),i=new Float32Array(n),a=new Int32Array(n);t.floatToIntBits=o=>{let s=t.floatToRawIntBits(o);return(s&2139095040)===2139095040&&(s&8388607)!==0?2143289344:s},t.intBitsToFloat=o=>(a[0]=o,i[0]),t.floatToRawIntBits=o=>(i[0]=o,a[0]),t.toFloat32=o=>(ma.setFloat32(0,o),ma.getFloat32(0))})(so||(so={}));var mM;(function(t){t.floatToIntBits=e=>{let r=so.floatToIntBits(e),n=r>>>16&32768,i=(r&2147483647)+4096;return i>=1199570944?(r&2147483647)>=1199570944?i<2139095040?n|31744:n|31744|(r&8388607)>>>13:n|31743:i>=947912704?n|i-939524096>>>13:i<855638016?n:(i=(r&2147483647)>>>23,n|(r&8388607|8388608)+(8388608>>>i-102)>>>126-i)},t.intBitsToFloat=e=>{let r=e&1023,n=e&31744;if(n===31744)n=261120;else if(n!==0){if(n+=114688,r===0&&n>115712)return so.intBitsToFloat((e&32768)<<16|n<<13|1023)}else if(r!==0){n=115712;do r<<=1,n-=1024;while((r&1024)===0);r&=1023}return so.intBitsToFloat((e&32768)<<16|(n|r)<<13)}})(mM||(mM={}));var sg;(function(t){let e=9218868437227405312n,r=4503599627370495n,n=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),i=new Float64Array(n),a=new BigInt64Array(n);t.float64ToLongBits=o=>{let s=t.float64ToRawLongBits(o);return(s&e)===e&&(s&r)!==0n?0x7ff8000000000000n:s},t.longBitsToFloat64=o=>(a[0]=o,i[0]),t.float64ToRawLongBits=o=>(i[0]=o,a[0]),t.clamp=o=>(ma.setFloat64(0,o),ma.getFloat64(0))})(sg||(sg={}));var rr=class{static*empty(){}static one(e){return[e]}static*range(e,r,n=1){re(K(r)||e>=0,()=>`range count must be non-negative, got ${e}`);let i=K(r)?e:0,a=K(r)?r:e;if(n!==0)if(n>0)for(let o=i;o<a;o+=n)yield o;else for(let o=i;o>a;o+=n)yield o}static count(e){let r=0;for(let n of e)r++;return r}static some(e,r){for(let n of e)if(r(n))return!0;return!1}static every(e,r){for(let n of e)if(!r(n))return!1;return!0}static reduce(e,r,n){let i=n,a=0;for(let o of e)i=r(i,o,a++);return i}static includes(e,r){for(let n of e)if(n===r)return!0;return!1}static forEach(e,r){for(let n of e)r(n)}static*map(e,r){let n=0;for(let i of e)yield r(i,n++)}static*take(e,r){let n=0;for(let i of e){if(n++>=r)return;yield i}}static filter(e,r){let n=[];for(let i of e)r(i)&&n.push(i);return n}static filterMap(e,r){let n=[];for(let i of e){let a=r(i);K(a)&&n.push(a)}return n}static reverse(e){let r=[];for(let n of e)r.push(n);return r.reverse()}static*pairWise(e){let r=e[Symbol.iterator](),{done:n,value:i}=r.next(),a=i;if(n!==!0)for(;;){let{done:o,value:s}=r.next();if(o===!0){yield[a,null];return}yield[a,s],a=s}}};var ir=class t{static create(e=1024){return this.use(new ArrayBuffer(e))}static use(e,r=0){return new t(new DataView(e,r))}littleEndian=!1;#e;#t=0;constructor(e){this.#e=e}get remaining(){return this.#e.byteLength-this.#t}get position(){return this.#t}set position(e){e<0?j(`position(${e}) cannot be negative.`):e>this.#e.byteLength?j(`position(${e}) is outside range (${this.#e.byteLength}).`):this.#t=e}writeBoolean(e){this.writeByte(e?1:0)}writeByte(e){this.#r(1),this.#e.setInt8(this.#t++,e)}writeShort(e){this.#r(Int16Array.BYTES_PER_ELEMENT),this.#e.setInt16(this.#t,e,this.littleEndian),this.#t+=Int16Array.BYTES_PER_ELEMENT}writeInt(e){this.#r(Int32Array.BYTES_PER_ELEMENT),this.#e.setInt32(this.#t,e,this.littleEndian),this.#t+=Int32Array.BYTES_PER_ELEMENT}writeLong(e){this.#r(BigInt64Array.BYTES_PER_ELEMENT),this.#e.setBigInt64(this.#t,e,this.littleEndian),this.#t+=BigInt64Array.BYTES_PER_ELEMENT}writeFloat(e){this.#r(Float32Array.BYTES_PER_ELEMENT),this.#e.setFloat32(this.#t,e,this.littleEndian),this.#t+=Float32Array.BYTES_PER_ELEMENT}writeDouble(e){this.#r(Float64Array.BYTES_PER_ELEMENT),this.#e.setFloat64(this.#t,e,this.littleEndian),this.#t+=Float64Array.BYTES_PER_ELEMENT}writeBytes(e){this.#r(e.length);for(let r=0;r<e.length;++r)this.#e.setInt8(this.#t++,e[r])}writeString(e){let r=e.length;this.#r(Int32Array.BYTES_PER_ELEMENT+r*Int16Array.BYTES_PER_ELEMENT),this.writeInt(r);for(let n=0;n<r;n++)this.writeShort(e.charCodeAt(n))}toArrayBuffer(){return this.#e.buffer.slice(0,this.#t)}#r(e){let r=this.#e.byteLength;if(this.#t+e>r){let n=this.#e;this.#e=new DataView(new ArrayBuffer(og(r+e)));for(let i=0;i<this.#t;i++)this.#e.setInt8(i,n.getInt8(i))}}},Ic=class{#e=0;writeByte(e){this.#e++}writeShort(e){this.#e+=2}writeInt(e){this.#e+=4}writeLong(e){this.#e+=8}writeFloat(e){this.#e+=4}writeDouble(e){this.#e+=8}writeBoolean(e){this.#e++}writeBytes(e){this.#e+=e.length}writeString(e){this.#e+=e.length+4}get count(){return this.#e}},lg=class{#e;#t=0;constructor(e=32){this.#e=new Int8Array(e)}result(){return this.#e}equals(e){return e===this?!0:this.#e.every((r,n)=>e.#e[n]===r)}writeBoolean(e){this.writeByte(e?31:11)}writeShort(e){this.writeByte(e&255),this.writeByte(e>>>8&255)}writeByte(e){this.#t>=this.#e.length&&(this.#t=0),this.#e[this.#t++]^=e}writeInt(e){this.writeByte(e&255),this.writeByte(e>>>8&255),this.writeByte(e>>>16&255),this.writeByte(e>>>24&255)}writeBytes(e){e.forEach(r=>this.writeByte(r))}writeFloat(e){this.writeInt(so.floatToIntBits(e))}writeDouble(e){this.writeLong(sg.float64ToLongBits(e))}writeLong(e){this.writeByte(Number(e)&255),this.writeByte(Number(e>>8n)&255),this.writeByte(Number(e>>16n)&255),this.writeByte(Number(e>>24n)&255),this.writeByte(Number(e>>32n)&255),this.writeByte(Number(e>>40n)&255),this.writeByte(Number(e>>48n)&255),this.writeByte(Number(e>>56n)&255)}writeString(e){for(let r=0;r<e.length;r++)this.writeShort(e.charCodeAt(r))}toHexString(){return Array.from(rr.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},it=class{littleEndian=!1;#e;#t=0;constructor(e,r=0){this.#e=new DataView(e,r)}get position(){return this.#t}set position(e){e<0?j(`position(${e}) cannot be negative.`):e>this.#e.byteLength?j(`position(${e}) is outside range (${this.#e.byteLength}).`):this.#t=e}readByte(){return this.#e.getInt8(this.#t++)}readShort(){let e=this.#e.getInt16(this.#t,this.littleEndian);return this.#t+=Int16Array.BYTES_PER_ELEMENT,e}readInt(){let e=this.#e.getInt32(this.#t,this.littleEndian);return this.#t+=Int32Array.BYTES_PER_ELEMENT,e}readLong(){let e=this.#e.getBigInt64(this.#t,this.littleEndian);return this.#t+=BigInt64Array.BYTES_PER_ELEMENT,e}readFloat(){let e=this.#e.getFloat32(this.#t,this.littleEndian);return this.#t+=Float32Array.BYTES_PER_ELEMENT,e}readDouble(){let e=this.#e.getFloat64(this.#t,this.littleEndian);return this.#t+=Float64Array.BYTES_PER_ELEMENT,e}readBoolean(){return this.readByte()===1}readBytes(e){for(let r=0;r<e.length;r++)e[r]=this.readByte()}readString(){let e=this.readInt(),r="";for(let n=0;n<e;n++)r+=String.fromCharCode(this.readShort());return r}available(e){return this.#t+e<=this.#e.byteLength}remaining(){return this.#e.byteLength-this.#t}skip(e){this.position+=e}};var fD=t=>K(t)?t.value!==void 0?"value":t.get!==void 0?"get":j(`Cannot resolve method key of ${t}`):j("Cannot resolve method key of undefined descriptor"),Tc=(t,e,r)=>{if(!K(r))return function(a,o){if(o&&o.kind==="getter")return function(){let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!K(s?.get))return j(`Cannot find getter for property '${e}'`);let c=s.get.apply(this);return Object.defineProperty(this,e,{value:c,configurable:!1,writable:!1,enumerable:!1}),c}};let n=fD(r),i=Ke(r[n]);return{[n]:function(...a){if(a.length>0)return j("lazy accessory must not have any construction parameters");let o=i.apply(this);return Object.defineProperty(this,e,{value:n==="get"?o:()=>o,configurable:!1,writable:!1,enumerable:!1}),o}}};var lo;(function(t){function*e(){}t.empty=e;function*r(...n){for(let i of n)for(let a of i)yield a}t.flatten=r})(lo||(lo={}));var nr=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,r)=>(...n)=>this.#e.forEach(i=>Object.getPrototypeOf(i)===Object.getPrototypeOf({})?N(i[r],...n):i[r]?.apply(i,n))})}get proxy(){return this.#t}get size(){return this.#e.size}subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}forEach(e){this.#e.forEach(e)}terminate(){this.#e.clear()}};var Ap=class{static createIfAbsent(e,r,n){let i=e.get(r);return i===void 0&&(i=n(r),e.set(r,i)),i}};var Fp=class t{static#e=Object.freeze(new Set);static empty=()=>t.#e};var cg=class t{map;constructor(e){this.map=new Map(e?.map(r=>{let n=r[0],i=r[1];return[n,new Set(i)]}))}clear(){this.map.clear()}containsEntry(e,r){return rr.some(this.map.entries(),n=>e===n[0]&&n[1].has(r))}containsKey(e){return rr.includes(this.map.keys(),e)}containsValue(e){return rr.some(this.map.values(),r=>r.has(e))}get(e){return this.map.get(e)??Fp.empty()}isEmpty(){return this.keyCount()===0}add(e,r){Ap.createIfAbsent(this.map,e,()=>new Set).add(r)}addAll(e,r){let n=Ap.createIfAbsent(this.map,e,()=>new Set);for(let i of r)n.add(i)}remove(e,r){let n=this.map.get(e);return n===void 0?!1:n.delete(r)?(n.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let r=new Set;for(let[n,i]of this.map.entries()){for(let a of i)e(a)&&(i.delete(a),r.add(a));i.size===0&&this.map.delete(n)}return r}removeFromKeyIf(e,r){let n=this.map.get(e);if(n===void 0)return null;for(let i of n)if(r(i))return n.delete(i),n.size===0&&this.map.delete(e),i;return null}removeKey(e){let r=this.map.get(e);return this.map.delete(e),r??Fp.empty()}forEach(e){rr.forEach(this.map.entries(),r=>e(r[0],r[1]))}keyCount(){return this.map.size}keys(){return this.map.keys()}sortKeys(e){let r=this.clone(),n=Array.from(this.keys()).sort(e);this.map.clear();for(let i of n)this.addAll(i,r.get(i));return this}clone(){let e=new t;return this.map.forEach((r,n)=>{e.map.set(n,new Set(Array.from(r)))}),e}};var pe=Object.freeze({Empty:{terminate:_p},create:t=>({terminate:t}),many:(...t)=>({terminate:()=>{for(;t.length>0;)t.pop().terminate()}})}),Y=class t{#e=[];isEmpty(){return this.#e.length===0}nonEmpty(){return this.#e.length>0}own(e){return this.#e.push(e),e}ownAll(...e){for(let r of e)this.#e.push(r)}spawn(){let e=new t;return e.own({terminate:()=>de.removeOpt(this.#e,e)}),this.own(e)}terminate(){for(;this.#e.length>0;)this.#e.pop().terminate()}};var fe=class{static subscribeMany(e,...r){return pe.many(...r.map(n=>n.subscribe(()=>e(n))))}#e=new Set;subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}isEmpty(){return this.#e.size===0}notify(e){this.#e.forEach(r=>r(e))}observers(){return this.#e}terminate(){this.#e.clear()}};var ug;(function(t){let e=Object.freeze({});t.empty=()=>e,t.mergeNoOverlap=(r,n)=>{let i=new Set(Object.keys(r));for(let a of Object.keys(n))if(i.has(a))return j(`'${a}' is an overlapping key`);return{...r,...n}},t.include=(r,...n)=>{let i={};for(let a of n)i[a]=r[a];return i},t.exclude=(r,...n)=>{let i=new Set(n);return Object.entries(r).reduce((a,[o,s])=>(i.has(o)||(a[o]=s),a),{})},t.overwrite=(r,n)=>Object.assign(r,n),t.entries=r=>Object.entries(r)})(ug||(ug={}));var dg;(function(t){t.seal=e=>new class{getValue(){return e}subscribe(r){return pe.Empty}catchupAndSubscribe(r){return r(this),pe.Empty}}})(dg||(dg={}));var hM;(function(t){t.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return pe.Empty}catchupAndSubscribe(e){return e(this),pe.Empty}},t.inverseBoolean=e=>new class{getValue(){return!e.getValue()}setValue(r){e.setValue(!r)}subscribe(r){return e.subscribe(r)}catchupAndSubscribe(r){return r(this),this.subscribe(r)}}})(hM||(hM={}));var Nr=class{#e;#t=b.None;constructor(e){this.#e=new fe,this.wrap(e)}wrap(e){this.wrapOption(b.wrap(e))}wrapOption(e){this.#t.equals(e)||(this.#t=e,this.#e.notify(this))}clear(e){this.#t.isEmpty()||(K(e)&&e(this.#t.unwrap()),this.#t=b.None,this.#e.notify(this))}assert(e){return this.#t.assert(e),this}contains(e){return this.#t.contains(e)}equals(e){return this.#t.equals(e)}flatMap(e){return this.#t.flatMap(e)}ifSome(e){return this.#t.ifSome(e)}ifAbsent(e){return this.#t.ifAbsent(e)}isEmpty(){return this.#t.isEmpty()}map(e){return this.#t.map(e)}mapOr(e,r){return this.#t.mapOr(e,r)}match(e){return this.#t.match(e)}nonEmpty(){return this.#t.nonEmpty()}unwrap(e){return this.#t.unwrap(e)}unwrapOrElse(e){return this.#t.unwrapOrElse(e)}unwrapOrNull(){return this.#t.unwrapOrNull()}unwrapOrUndefined(){return this.#t.unwrapOrUndefined()}subscribe(e){return this.#e.subscribe(()=>e(this))}catchupAndSubscribe(e){return e(this),this.#e.subscribe(()=>e(this))}terminate(){this.#e.terminate()}};var tn=class{#e;#t=b.None;#r;constructor(e,r){this.#e=new fe,this.#r=r?.guard(e)??e,this.#t=b.wrap(r)}setValue(e){this.#t.nonEmpty()&&(e=this.#t.unwrap().guard(e)),this.#r!==e&&(this.#r=e,this.#e.notify(this))}getValue(){return this.#r}subscribe(e){return this.#e.subscribe(e)}catchupAndSubscribe(e){return e(this),this.#e.subscribe(e)}terminate(){this.#e.terminate()}toString(){return`{DefaultObservableValue value: ${this.#r}`}};var U0=class{#e;#t;constructor(e,r){re(e<r,"Linear is inverse"),this.#e=e,this.#t=r}x(e){return e<=this.#e?0:e>=this.#t?1:(e-this.#e)/(this.#t-this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:this.#e+e*(this.#t-this.#e)}clamp(e){return Fe(e,this.#e,this.#t)}floating(){return!0}},j0=class{#e;#t;#r;constructor(e,r){this.#e=Fe(Math.round(e),Mr.MIN_VALUE,Mr.MAX_VALUE),this.#t=Fe(Math.round(r),Mr.MIN_VALUE,Mr.MAX_VALUE),this.#r=this.#t-this.#e}x(e){return(this.clamp(e)-this.#e)/this.#r}y(e){return this.#e+Math.round(Fe(e,0,1)*this.#r)}clamp(e){return Fe(Math.round(e),this.#e,this.#t)}floating(){return!1}},K0=class{#e;#t;constructor(e,r){re(e<r,"Exponential is inverse"),this.#e=e,this.#t=r}x(e){return e<=this.#e?0:e>=this.#t?1:Math.log(e/this.#e)/Math.log(this.#t/this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:Math.exp(e*Math.log(this.#t/this.#e))*this.#e}clamp(e){return Math.min(this.#t,Math.max(this.#e,e))}floating(){return!0}},pg=class{#e;#t;#r;#i;constructor(e,r,n){re(r!==n,"Power min === max"),this.#e=e,this.#t=r,this.#r=n,this.#i=n-r}x(e){return e<=this.#t?0:e>=this.#r?1:Math.pow((e-this.#t)/this.#i,1/this.#e)}y(e){return e<=0?this.#t:e>=1?this.#r:this.#t+Math.pow(e,this.#e)*this.#i}clamp(e){return Math.min(this.#r,Math.max(this.#t,e))}floating(){return!0}},W0=class{#e;constructor(e){this.#e=e}x(e){let r=this.#e.findIndex(n=>n===e);return r===-1?j(`Could not find index for ${e}`):r/(this.#e.length-1)}y(e){let r=Math.round(Fe(e,0,1)*(this.#e.length-1));return r>-1?Ke(this.#e.at(r),`Could not find value for ${e}`):j(`Index ${r} is out of box.`)}clamp(e){return e}floating(){return!1}},L0=class{#e;#t;#r;#i;#n;constructor(e,r,n){this.#e=e,this.#t=n;let i=e*e,a=n*n,o=r*r,s=e+n-2*r,c=n-r;this.#r=((2*n-r)*e-r*n)/s,this.#i=(c*i+(o-a)*e+r*a-o*n)/(i+(2*n-4*r)*e+a-4*r*n+4*o),this.#n=-c/s}y(e){return e<=0?Number.NEGATIVE_INFINITY:e>=1?this.#t:this.#r-this.#i/(e+this.#n)}x(e){return this.#e>=e?0:this.#t<=e?1:-this.#i/(e-this.#r)-this.#n}clamp(e){return Math.min(this.#t,e)}floating(){return!0}},F;(function(t){t.linear=(a,o)=>new U0(a,o),t.linearInteger=(a,o)=>new j0(a,o),t.exponential=(a,o)=>new K0(a,o),t.power=(a,o,s)=>new pg(a,o,s),t.powerByCenter=(a,o,s)=>{let c=Math.log((s-o)/(a-o))/Math.log(2);if(Number.isNaN(c))throw new Error(`powerByCenter: invalid center=${a}, min=${o}, max=${s}`);return new pg(c,o,s)},t.values=a=>new W0(a),t.decibel=(a,o,s)=>new L0(a,o,s);let e=new class{x(a){return a?1:0}y(a){return a>=.5}clamp(a){return a}floating(){return!1}},r=t.linear(0,1),n=t.linear(-1,1);t.bool=e;let i=t.decibel(-72,-12,0);t.unipolar=()=>r,t.bipolar=()=>n,t.DefaultDecibel=i})(F||(F={}));var E;(function(t){t.percent=({bipolar:a,fractionDigits:o}={})=>new e("%",o,!1,a),t.numeric=({unit:a,fractionDigits:o,unitPrefix:s,bipolar:c}={})=>new e(a,o,s,c),t.indices=(a,o)=>new class{x(s){return{unit:a,value:o[s]}}y(s){let c=o.indexOf(s);return c===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:c}}},t.oneBasedIndex=(a="")=>new class{x(o){return{unit:a,value:String(o+1)}}y(o){let s=parseInt(o.trim(),10);return isNaN(s)?{type:"unknown",value:o.trim()}:{type:"explicit",value:s-1}}},t.values=(a,o,s)=>new class{x(c){return{unit:a,value:s.at(o.indexOf(c))??"N/A"}}y(c){let u=s.indexOf(c);return u===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:o[u]}}},t.bool=new class{y(a){switch(a.trim()){case"on":case"yes":case"true":return{type:"explicit",value:!0};default:return{type:"explicit",value:!1}}}x(a){return{value:a?"On":"Off",unit:""}}},t.boolValues=(a,o)=>new class{y(s){switch(s.trim()){case o:case"on":case"yes":case"true":return{type:"explicit",value:!0};case a:default:return{type:"explicit",value:!1}}}x(s){return{value:s?"On":"Off",unit:""}}};class e{#e;#t;#r;#i;constructor(o,s,c,u){this.#e=o??"",this.#t=s??0,this.#r=c??!1,this.#i=u??!1}y(o){let s=o.trim();this.#e.length>0&&this.#e!=="%"&&s.endsWith(this.#e)&&(s=s.slice(0,-this.#e.length).trim());let c=parseFloat(s);if(isNaN(c))return{type:"unknown",value:o.trim()};if(this.#e==="%")return{type:"explicit",value:c/100};if(s.endsWith("%"))return{type:"unitValue",value:this.#i?Fe(c/200+.5,0,1):Fe(c/100,0,1)};{let f=/(\d+)(\D+)/.exec(s)?.at(2)?.at(0);if(K(f)){let v=r.indexOf(f);if(v>-1)return{type:"explicit",value:c*Math.pow(10,(v-4)*3)}}return{type:"explicit",value:c}}}x(o){if(Number.isNaN(o))return{value:"\u{1F4A3}",unit:this.#e};if(Number.isFinite(o)){if(this.#e==="%")return this.#i?{value:(o*200-100).toFixed(this.#t),unit:this.#e}:{value:(o*100).toFixed(this.#t),unit:this.#e};if(this.#r){let{value:s,prefix:c}=i(o);return{value:s.toFixed(this.#t),unit:`${c}${this.#e}`}}else return{value:o.toFixed(this.#t),unit:this.#e}}else return{value:o===Number.POSITIVE_INFINITY?"\u221E":"-\u221E",unit:this.#e}}}let r=Object.freeze(["p","n","\u03BC","m","","k","M","G","T"]),n=a=>Math.log(a)/Math.log(9.999999999999998),i=a=>{let o=Math.floor(n(a)/3),s=r[o+4];return K(s)?{value:a*Math.pow(10,o*-3),prefix:s}:{value:a,prefix:""}};t.decible=t.numeric({unit:"db",fractionDigits:2}),t.panning=t.percent({unit:"%",fractionDigits:0})})(E||(E={}));var Dc;(function(t){t.alwaysTrue=()=>!0,t.alwaysFalse=()=>!1,t.definedPredicate=e=>e!=null})(Dc||(Dc={}));var fg;(function(t){t.create=(e=252854082)=>new Z0(e),t.monotoneAscending=(e,r=128,n=t.create())=>{let i=e.length;if(i<2)return j("Array must have at least 2 elements");let a=0;for(let s=1;s<i;s++){let c=Math.floor(n.uniform()*(1+r))+1;e[s]=c,a+=c}let o=0;e[0]=0;for(let s=1;s<i;s++)o+=e[s],e[s]=o/a;return e}})(fg||(fg={}));var Z0=class{#e=0;constructor(e){this.setSeed(e)}setSeed(e){this.#e=e&4294967295}nextDouble(e,r){return e+this.uniform()*(r-e)}nextInt(e,r){return e+Math.floor(this.uniform()*(r-e))}nextElement(e){return e[Math.floor(this.uniform()*e.length)]}nextBoolean(){return this.uniform()<.5}uniform(){let e=this.#e+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}};var ki;(function(t){class e{}t.createBuilder=n=>{let i=a=>{let o=a instanceof Array?[]:{};return Object.entries(a).forEach(([s,c])=>{c instanceof e?o[s]=c.initialValue():typeof c=="object"&&(o[s]=i(c))}),o};return()=>new r(n,Object.seal(i(n)))},t.bool=new class extends e{read(n){return n.readByte()===1}write(n,i){n.writeByte(i?1:0)}initialValue(){return!1}},t.int8=new class extends e{read(n){return n.readByte()}write(n,i){n.writeByte(i)}initialValue(){return 0}},t.int16=new class extends e{read(n){return n.readShort()}write(n,i){n.writeShort(i)}initialValue(){return 0}},t.int32=new class extends e{read(n){return n.readInt()}write(n,i){n.writeInt(i)}initialValue(){return 0}},t.float=new class extends e{read(n){return n.readFloat()}write(n,i){n.writeFloat(i)}initialValue(){return 0}},t.double=new class extends e{read(n){return n.readDouble()}write(n,i){n.writeDouble(i)}initialValue(){return 0}},t.int64=new class extends e{read(n){return n.readLong()}write(n,i){n.writeLong(i)}initialValue(){return 0n}},t.floats=n=>new class extends e{read(i,a){for(let o=0;o<a.length;o++)a[o]=i.readFloat();return a}write(i,a){for(let o=0;o<a.length;o++)i.writeFloat(a[o])}initialValue(){return new Float32Array(n)}},t.doubles=n=>new class extends e{read(i,a){for(let o=0;o<a.length;o++)a[o]=i.readDouble();return a}write(i,a){for(let o=0;o<a.length;o++)i.writeDouble(a[o])}initialValue(){return new Float64Array(n)}};class r{#e;#t;#r;constructor(i,a){this.#e=i,this.#t=a,this.#r=this.#i()}get object(){return this.#t}get bytesTotal(){return this.#r}read(i){let a=(o,s)=>{Object.entries(o).forEach(([c,u])=>{let f=s;u instanceof e?f[c]=u.read(i,f[c]):typeof u=="object"&&a(u,f[c])})};a(this.#e,this.#t)}write(i){let a=(o,s)=>{Object.entries(o).forEach(([c,u])=>{let f=s;u instanceof e?u.write(i,f[c]):typeof u=="object"&&a(u,f[c])})};a(this.#e,this.#t)}#i(){let i=new Ic;return this.write(i),i.count}}})(ki||(ki={}));var Rc=class{#e;#t;#r;constructor(e,r){this.#e=e,this.#t=r,this.#r=[]}add(e,r=!1){let n=this.#e(e),i=vt.leftMostMapped(this.#r,n,this.#t,this.#e),a=this.#r[i];return K(a)&&this.#t(this.#e(a),n)===0?r?(this.#r.splice(i,1,e),!0):!1:(this.#r.splice(i,0,e),!0)}getOrCreate(e,r){let n=vt.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[n];if(K(i)&&this.#t(this.#e(i),e)===0)return i;let a=r(e);return this.#r.splice(n,0,a),a}addMany(e){for(let r of e)this.#r.push(r);try{return this.#r.sort((r,n)=>{let i=this.#t(this.#e(r),this.#e(n));if(i===0)throw"cancel";return i}),!0}catch(r){if(r==="cancel"){let n=new Map(this.entries());return this.#r.splice(0,this.#r.length,...n.values()),this.#r.sort((i,a)=>this.#t(this.#e(i),this.#e(a))),!1}return j(r)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let r=vt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return K(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(r,1),n):j(`Could not remove ${e}`)}removeByKeyIfExist(e){let r=vt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return K(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(r,1),n):null}removeRange(e,r){this.#r.splice(e,(r??this.#r.length)-e)}removeByPredicate(e){let r=0,n=this.#r.length;for(;--n>=0;)e(this.#r[n])&&(this.#r.splice(n,1),r++);return r}get(e,r){return Ke(this.#i(e),r??`Unknown key: ${e}`)}getOrThrow(e,r){let n=this.#i(e);if(K(n))return n;throw r()}opt(e){return b.wrap(this.#i(e))}getOrNull(e){return this.#i(e)??null}getByIndex(e){return this.#r[e]}hasKey(e){return K(this.#i(e))}hasValue(e){return K(this.#i(this.#e(e)))}size(){return this.#r.length}isEmpty(){return this.#r.length===0}forEach(e){this.values().forEach(e)}values(){return this.#r}entries(){return this.#r.map(e=>[this.#e(e),e])}clear(){de.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let r=vt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[r];return K(n)&&this.#t(this.#e(n),e)===0?n:void 0}};var Ep;(function(t){t.hyphenToCamelCase=e=>e.replace(/-([a-z])/g,r=>r[1].toUpperCase()),t.capitalize=e=>e.replace(/(^|\s)(\S)/g,(r,n,i)=>n+i.toUpperCase()),t.nonEmpty=e=>K(e)&&e.trim().length>0,t.fallback=(e,r)=>t.nonEmpty(e)?e:r,t.endsWithDigit=e=>/\d$/.test(e),t.toArrayBuffer=e=>{let r=new ArrayBuffer(e.length),n=new Uint8Array(r);for(let i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return r},t.getUniqueName=(e,r)=>{let n=new Set(e);if(!n.has(r))return r;let i=r.match(/^(.*\S)\s+(\d+)$/),a=K(i)?i[1]:r,o=K(i)?parseInt(i[2],10)+1:2,s=`${a} ${o}`;for(;n.has(s);)s=`${a} ${++o}`;return s}})(Ep||(Ep={}));var Cc=(()=>{let t=b.None;return{info:e=>t.match({none:()=>Promise.resolve(),some:r=>r.info(e)}),approve:e=>t.match({none:()=>Promise.resolve(!0),some:r=>r.approve(e)}),progress:e=>t.match({none:()=>({message:"",terminate:_p}),some:r=>r.progress(e)}),notify:e=>t.match({none:_p,some:r=>r.notify(e)}),install:e=>{re(t.isEmpty(),"RuntimeNotification already installed"),t=b.wrap(e)}}})();var Sp=class t{static createEstimator=()=>{let e=performance.now(),r=t.millis(Number.POSITIVE_INFINITY),n=0;return i=>{if(i===0)return t.POSITIVE_INFINITY;if(i>=1)return t.millis(0);let a=performance.now()-e;return a>n*1e3&&(r=t.millis(a/i-a),n++),r}};static POSITIVE_INFINITY=new t(Number.POSITIVE_INFINITY);static millis=e=>new t(e);static seconds=e=>new t(e*t.#e);static minutes=e=>new t(e*t.#t);static hours=e=>new t(e*t.#r);static days=e=>new t(e*t.#i);static toHHMMSS=e=>((e/3600|0)+100).toString().slice(1)+":"+((e/60|0)%60+100).toString().slice(1)+":"+(e%60+100).toString().slice(1);static#e=1e3;static#t=6e4;static#r=36e5;static#i=864e5;#n;constructor(e){this.#n=e}millis(){return this.#n}absSeconds(){return Math.abs(this.#n)/t.#e}absMinutes(){return Math.abs(this.#n)/t.#t}absHours(){return Math.abs(this.#n)/t.#r}absDays(){return Math.abs(this.#n)/t.#i}split(){return{d:Math.floor(this.absDays()),h:Math.floor(this.absHours())%24,m:Math.floor(this.absMinutes())%60,s:Math.floor(this.absSeconds())%60}}isNow(){return this.#n===0}isPast(){return this.#n<0}isFuture(){return this.#n>0}toUnitString(){let e,r,n=Math.floor(Math.abs(this.#n)/1e3),i=Math.floor(n/60),a=Math.floor(i/60),o=Math.floor(a/24);return n<60?(e=n,r="second"):i<60?(e=i,r="minute"):a<24?(e=a,r="hour"):(e=o,r="day"),new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"long"}).format(e*Math.sign(this.#n),r)}toString(){if(isNaN(this.#n))return"NaN";if(!isFinite(this.#n))return"\u221E";let{d:e,h:r,m:n,s:i}=this.split();return e>0?[t.#a("d",e),t.#a("h",r),t.#a("m",n),t.#a("s",i)].join(", "):r>0?[t.#a("h",r),t.#a("m",n),t.#a("s",i)].join(", "):n>0?[t.#a("m",n),t.#a("s",i)].join(", "):i>0?t.#a("s",i):"now"}static#a=(e,r)=>{switch(e){case"d":return`${r} ${r<2?"day":"days"}`;case"h":return`${r} ${r<2?"hour":"hours"}`;case"m":return`${r} ${r<2?"minute":"minutes"}`;case"s":return`${r} ${r<2?"second":"seconds"}`;default:return ig(e)}}};var mg;(function(t){let e;(function(r){r[r.READING=0]="READING",r[r.READ=1]="READ",r[r.WRITING=2]="WRITING",r[r.WRITTEN=3]="WRITTEN"})(e||(e={})),t.writer=(r,n,i)=>{if(r.bytesTotal+1>n.byteLength)return j("Insufficient memory allocated.");let a=new Uint8Array(n),o=ir.use(n,1);return Atomics.store(a,0,e.READ),{tryWrite:()=>Atomics.compareExchange(a,0,e.READ,e.WRITING)===e.WRITING?(i(r.object),o.position=0,r.write(o),Atomics.store(a,0,e.WRITTEN),!0):!1}},t.reader=(r,n)=>{let i=new SharedArrayBuffer(r.bytesTotal+1),a=new Uint8Array(i),o=new it(i,1);return{buffer:i,tryRead:()=>Atomics.compareExchange(a,0,e.WRITTEN,e.READING)===e.READING?(o.position=0,r.read(o),n(r.object),Atomics.store(a,0,e.READ),!0):!1}}})(mg||(mg={}));var B;(function(t){t.length=16,t.generate=()=>r(crypto.getRandomValues(new Uint8Array(t.length))),t.sha256=async n=>{let i=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",i?new Uint8Array(n.slice(0)):n).then(a=>r(new Uint8Array(a.slice(0,t.length))))},t.validateBytes=n=>t.parse(t.toString(n)),t.validateString=n=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(n),t.asString=n=>t.validateString(n)?n:j(`Invalid UUID format: ${n}`),t.fromDataInput=n=>{let i=new Uint8Array(t.length);return n.readBytes(new Int8Array(i.buffer)),i},t.toDataOutput=(n,i)=>n.writeBytes(new Int8Array(i.buffer));let e=de.create(n=>(n+256).toString(16).substring(1),256);t.toString=n=>e[n[0]]+e[n[1]]+e[n[2]]+e[n[3]]+"-"+e[n[4]]+e[n[5]]+"-"+e[n[6]]+e[n[7]]+"-"+e[n[8]]+e[n[9]]+"-"+e[n[10]]+e[n[11]]+e[n[12]]+e[n[13]]+e[n[14]]+e[n[15]],t.parse=n=>{let i=n.replace(/-/g,"").toLowerCase();if(i.length!==32)return j(`Invalid UUID format (${n})`);let a=new Uint8Array(t.length);for(let o=0,s=0;o<32;o+=2,s++)a[s]=parseInt(i.slice(o,o+2),16);return a},t.Comparator=(n,i)=>{if(n.length!==t.length||i.length!==t.length)return j("Unexpected array length for uuid(v4)");for(let a=0;a<t.length;a++){let o=n[a]-i[a];if(o!==0)return o}return 0},t.equals=(n,i)=>t.Comparator(n,i)===0,t.newSet=n=>new Rc(n,t.Comparator),t.Lowest=t.parse("00000000-0000-4000-8000-000000000000"),t.Highest=t.parse("FFFFFFFF-FFFF-4FFF-BFFF-FFFFFFFFFFFF"),t.fromInt=n=>{let i=new Uint8Array(t.Lowest),a=new Uint8Array(new Uint32Array([n]).buffer);for(let o=0;o<4;o++)i[o]=a[o];return i},t.zType=n=>n.string().refine(i=>t.validateString(i),{message:"Invalid UUID format (Zod)"}).transform(i=>i);let r=n=>(re(n.length===t.length,"UUID must be 16 bytes long"),n[6]=n[6]&15|64,n[8]=n[8]&63|128,n)})(B||(B={}));var hg=class{#e=new Y;#t;#r;#i;constructor(e){this.#r=e,this.#t=this.#e.own(new fe),this.#i=this.#o(e,[])}get data(){return this.#r}get proxy(){return this.#i}subscribe(e,...r){let n=()=>r.reduce((i,a)=>i[a],this.#i);return this.#t.subscribe(i=>{this.#n(i,r)&&e(n())})}catchupAndSubscribe(e,...r){return e(r.reduce((i,a)=>i[a],this.#i)),this.subscribe(e,...r)}subscribeAll(e){return this.#t.subscribe(r=>e(r[0]))}createMutableObservableValue(...e){let r=this.#e.own(new Y),n=r.own(new fe),i=()=>e.slice(0,-1).reduce((s,c)=>s[c],this.#i),a=e[e.length-1],o={getValue:()=>e.reduce((s,c)=>s[c],this.#i),setValue:s=>i()[a]=s,subscribe:s=>n.subscribe(s),catchupAndSubscribe:s=>(s(o),n.subscribe(s)),terminate:()=>r.terminate()};return r.own(this.subscribe(()=>n.notify(o),...e)),o}update(e){let r=new Set;this.#a(this.#r,e,r);for(let n of r)this.#t.notify([n])}terminate(){this.#e.terminate(),this.#t.terminate()}#n=(e,r)=>{let n=Math.min(e.length,r.length);for(let i=0;i<n;i++)if(e[i]!==r[i])return!1;return!0};#a=(e,r,n,i)=>{for(let a of Object.keys(r)){let o=i??a,s=r[a],c=e[a];s!==null&&typeof s=="object"&&!Array.isArray(s)?this.#a(e[a],s,n,o):c!==s&&(e[a]=s,n.add(o))}};#o=(e,r)=>new Proxy(e,{get:(n,i)=>{let a=n[i];return a!==null&&typeof a=="object"&&!Array.isArray(a)?this.#o(a,[...r,i]):a},set:(n,i,a)=>(n[i]=a,this.#t.notify([...r,i]),!0),preventExtensions:()=>!1})};var gg=class t{static DEFAULT_SIZE=512;static DEFAULT_DECAY=.9;#e;#t;#r;#i;#n;#a;#o;#s;#u;#l=0;decay=!1;constructor({size:e,decay:r}={}){e??=t.DEFAULT_SIZE,this.#u=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=Pp.create(Pp.Type.Blackman,this.#e),this.#t=e,this.#o=new Float32Array(e),this.#s=new Float32Array(e)}clear(){this.#o.fill(0),this.#i.fill(0),this.#s.fill(0),this.#l=0}reset(){this.#l=0}numBins(){return this.#t}bins(){return this.#o}waveform(){return this.#s}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.#c()}#c(){for(let r=0;r<this.#t;++r)this.#s[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.#o[r]<a?this.#o[r]=a:this.decay&&(this.#o[r]*=this.#u)}this.#l=0,this.#n.fill(0),this.decay=!1}};var G0=(t,e)=>Math.floor(3840/e)*t,gM=(t,e=4,r=4)=>{let n=G0(1,r),i=Math.floor(t/n),a=Math.floor(i/e),s=(Math.floor(t)-G0(a*e,r))%n,c=Math.floor(s/240),u=s%240;return{bars:a,beats:i-a*e,semiquavers:c,ticks:u}},vM=(t,e)=>t*e/60*960,xM=(t,e)=>t*60/960/e,mD=(t,e)=>e*60/960/t,hD=(t,e,r)=>vM(t/r,e),gD=(t,e,r)=>xM(t,e)*r,Te={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:G0,toParts:gM,secondsToPulses:vM,pulsesToSeconds:xM,secondsToBpm:mD,samplesToPulses:hD,pulsesToSamples:gD,toString:(t,e=4,r=4)=>{let{bars:n,beats:i,semiquavers:a,ticks:o}=gM(t|0,e,r);return`${n+1}.${i+1}.${a+1}:${o}`}};var ha=128,xg=Te.fromSignature(1,48);var Mp=class{a1=0;a2=0;b0=0;b1=0;b2=0;constructor(){this.identity()}identity(){this.setNormalizedCoefficients(1,0,0,1,0,0)}setLowpassParams(e,r=Math.SQRT1_2){if(e=Fe(e,0,1),e>=.5)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let n=oo*e,i=Math.sin(n)/(2*r),a=Math.cos(n),o=(1-a)/2,s=o,c=2*o,u=o,f=1+i,v=-2*a,h=1-i;this.setNormalizedCoefficients(s,c,u,f,v,h)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}setHighpassParams(e,r=Math.SQRT1_2){if(e=Fe(e,0,1),e===1)this.setNormalizedCoefficients(0,0,0,1,0,0);else if(e>0){let n=oo*e,i=Math.sin(n)/(2*r),a=Math.cos(n),o=(1+a)/2,s=o,c=-2*o,u=o,f=1+i,v=-2*a,h=1-i;this.setNormalizedCoefficients(s,c,u,f,v,h)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNormalizedCoefficients(e,r,n,i,a,o){let s=1/i;return this.b0=e*s,this.b1=r*s,this.b2=n*s,this.a1=a*s,this.a2=o*s,this}setLowShelfParams(e,r){e=Fe(e,0,1);let n=Math.pow(10,r/40);if(e===1)this.setNormalizedCoefficients(n*n,0,0,1,0,0);else if(e>0){let i=oo*e,o=.5*Math.sin(i)*Math.sqrt((n+1/n)*(1/1-1)+2),s=Math.cos(i),c=2*Math.sqrt(n)*o,u=n+1,f=n-1,v=n*(u-f*s+c),h=2*n*(f-u*s),y=n*(u-f*s-c),_=u+f*s+c,$=-2*(f+u*s),S=u+f*s-c;this.setNormalizedCoefficients(v,h,y,_,$,S)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setHighShelfParams(e,r){e=Fe(e,0,1);let n=Math.pow(10,r/40);if(e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let i=oo*e,o=.5*Math.sin(i)*Math.sqrt((n+1/n)*(1/1-1)+2),s=Math.cos(i),c=2*Math.sqrt(n)*o,u=n+1,f=n-1,v=n*(u+f*s+c),h=-2*n*(f+u*s),y=n*(u+f*s-c),_=u-f*s+c,$=2*(f-u*s),S=u-f*s-c;this.setNormalizedCoefficients(v,h,y,_,$,S)}else this.setNormalizedCoefficients(n*n,0,0,1,0,0);return this}setPeakingParams(e,r,n){e=Fe(e,0,1),r=Math.max(0,r);let i=Math.pow(10,n/40);if(e>0&&e<1)if(r>0){let a=oo*e,o=Math.sin(a)/(2*r),s=Math.cos(a),c=1+o*i,u=-2*s,f=1-o*i,v=1+o/i,h=-2*s,y=1-o/i;this.setNormalizedCoefficients(c,u,f,v,h,y)}else this.setNormalizedCoefficients(i*i,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setAllpassParams(e,r){if(e=Fe(e,0,1),r=Math.max(0,r),e>0&&e<1)if(r>0){let n=oo*e,i=Math.sin(n)/(2*r),a=Math.cos(n),o=1-i,s=-2*a,c=1+i,u=1+i,f=-2*a,v=1-i;this.setNormalizedCoefficients(o,s,c,u,f,v)}else this.setNormalizedCoefficients(-1,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNotchParams(e,r){if(e=Fe(e,0,1),r=Math.max(0,r),e>0&&e<1)if(r>0){let n=oo*e,i=Math.sin(n)/(2*r),a=Math.cos(n),o=1,s=-2*a,c=1,u=1+i,f=-2*a,v=1-i;this.setNormalizedCoefficients(o,s,c,u,f,v)}else this.setNormalizedCoefficients(0,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setBandpassParams(e,r){if(e=Math.max(0,e),r=Math.max(0,r),e>0&&e<1){let n=oo*e;if(r>0){let i=Math.sin(n)/(2*r),a=Math.cos(n),o=i,s=0,c=-i,u=1+i,f=-2*a,v=1-i;this.setNormalizedCoefficients(o,s,c,u,f,v)}else this.setNormalizedCoefficients(1,0,0,1,0,0)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}getFrequencyResponse(e,r,n){re(e.length===r.length&&e.length===n.length,"Array lengths do not match");let i=this.b0,a=this.b1,o=this.b2,s=this.a1,c=this.a2;for(let u=0;u<e.length;++u){let f=-Math.PI*2*e[u],v=Math.cos(f),h=Math.sin(f),y=i+((a+o*v)*v-o*h*h),_=(a+o*v)*h+o*h*v,$=1+((s+c*v)*v-c*h*h),S=(s+c*v)*h+c*h*v,z=$*$+S*S,O=(y*$+_*S)/z,J=(_*$-y*S)/z;r[u]=Math.sqrt(O*O+J*J),n[u]=Math.atan2(J,O)}}};var Ys=class{#e=0;#t=0;#r=0;#i=0;reset(){this.#e=0,this.#t=0,this.#r=0,this.#i=0}process({a1:e,a2:r,b0:n,b1:i,b2:a},o,s,c,u){let f=this.#e,v=this.#t,h=this.#r,y=this.#i;for(let _=c;_<u;_++){let $=o[_],S=s[_]=n*$+i*f+a*v-e*h-r*y+1e-18-1e-18;v=f,f=$,y=h,h=S}this.#e=f,this.#t=v,this.#r=h,this.#i=y}processFrame({a1:e,a2:r,b0:n,b1:i,b2:a},o){let s=n*o+i*this.#e+a*this.#t-e*this.#r-r*this.#i+1e-18-1e-18;return this.#t=this.#e,this.#e=o,this.#i=this.#r,this.#r=s,s}};var Np;(function(t){t.Comparator=(e,r)=>e.position-r.position,t.PositionExtractor=e=>e.position})(Np||(Np={}));var $p;(function(t){t.complete=e=>e.position+e.duration,t.DescendingComparator=(e,r)=>t.complete(r)-t.complete(e)})($p||($p={}));var co;(function(t){t.globalToLocal=(r,n)=>Js(n-r.position+r.loopOffset,r.loopDuration),t.locateLoop=({position:r,complete:n,loopOffset:i,loopDuration:a},o,s)=>{if(!(a>0))return b.None;let c=r-i,u=c+a;if(c>=s||u<=o)return b.None;let f=Math.max(c,o),v=Math.min(u,s);return b.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),h=c+v*a;for(;h<f;){let y=h+a,_=Math.max(h,r),$=Math.min(y,n),S=Math.max(h,u),z=Math.min(y,f),O=h<S?(S-h)/a:0,J=y>z?(z-h)/a:1;yield{index:v++,rawStart:h,rawEnd:y,regionStart:_,regionEnd:$,resultStart:S,resultEnd:z,resultStartValue:O,resultEndValue:J},h=y}}t.locateLoops=e})(co||(co={}));var Vr=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 yg(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()?lo.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r,n){return this.#e.isEmpty()?lo.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()}},Ko=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 yg(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()?lo.empty():this.#e.iterateFrom(e,r)}iterateRange(e,r){if(this.#e.isEmpty())return lo.empty();let n=Math.max(0,this.#e.floorLastIndex(e)),i=this.#e.optAt(n);if(i===null)return lo.empty();for(;i.position+i.duration<=e;)if(i=this.#e.optAt(++n),i===null||i.position>=r)return lo.empty();return this.#e.iterate(n,r)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}};var yg=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,jo,Np.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,de.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,jo,Np.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),vt.leftMostMapped(this.#e,e,jo,Np.PositionExtractor)}iterateFrom(e,r){let n=this.floorLastIndex(e),i=n;if(i<0)return this.iterate(0,Mr.MAX_VALUE,r);for(;i>=0;){let a=this.optAt(i);if(a!==null&&r!==void 0&&r(a))return this.iterate(i,Mr.MAX_VALUE,r);i--}return this.iterate(n,Mr.MAX_VALUE,r)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,r,n=Dc.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;(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=tr.normalizedAt(e/i,o));let f=r-a;if(a>0&&e>f){let v=(e-f)/a;u=1-tr.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 h=(n-r)/a;if(s>0&&r<s){let y=Math.min(n,s),_=Math.min(a,Math.ceil((y-r)/h));if(_>0){let $=r/s,S=y/s,z=tr.walk(u,_,$,S);for(let O=0;O<_;O++)e[O]=z.next().value}}if(c>0&&n>v){let y=Math.max(r,v),_=Math.max(0,Math.floor((y-r)/h)),$=a-_;if($>0){let S=(y-v)/c,z=(n-v)/c,O=tr.walk(f,$,1-S,1-z);for(let J=_;J<a;J++)e[J]=Math.min(e[J],O.next().value)}}}})(wg||(wg={}));var 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 h=n+f;for(i=n,a=0;i<h;i++,a=a+v|0){let y=i+f|0,_=s[a],$=c[a],S=e[y],z=r[y],O=S*_+z*$,J=z*_-S*$,te=e[i],me=r[i];e[y]=te-O,r[y]=me-J,e[i]=te+O,r[i]=me+J}}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 Wo;(function(t){t.builder=()=>new e,t.toDouble=([r,n])=>r/n,t.toPPQN=([r,n])=>Te.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))}}})(Wo||(Wo={}));var yM;(function(t){t.Identity={warp:e=>e,unwarp:e=>e}})(yM||(yM={}));var bg=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=O0(r,n),a=(r-i)/n,o=e?this.#e.fx(a):this.#e.fy(a);return i+o*n}};var ga;(function(t){t[t.sine=0]="sine",t[t.triangle=1]="triangle",t[t.saw=2]="saw",t[t.square=3]="square"})(ga||(ga={}));var zc;(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)=>ag((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)]})(zc||(zc={}));var Oc;(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=$p.complete(e)-$p.complete(r);return n!==0?n:e.pitch-r.pitch}})(Oc||(Oc={}));var _g=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 Ag=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],h=Math.max(Math.abs(f),Math.abs(v));if(c=h>c?i*(c-h)+h:a*(c-h)+h,c>1){let y=1/c;o[u]=f*y,s[u]=v*y}}this.#n=c}};var ti;(function(t){t.Musical="musical",t.Seconds="seconds"})(ti||(ti={}));var Xs;(function(t){function e(r,n,i){return new H0(r,n,i)}t.aware=e})(Xs||(Xs={}));var H0=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()===ti.Musical)return r;let n=this.#e.ppqnToSeconds(e),i=n+r;return this.#e.intervalToPPQN(n,i)}fromPPQN(e,r){if(this.getTimeBase()===ti.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()===ti.Seconds?r:this.#e.intervalToSeconds(e,e+r)}toSamples(e,r){return this.toSeconds(e)*r}rawValue(){return this.#r.getValue()}getTimeBase(){return ao(this.#t.getValue(),ti)}};var wM=Te.fromSignature(1,384);var Ur={None:{type:"none"},Linear:{type:"linear"},Curve:t=>t===.5?Ur.Linear:{type:"curve",slope:t}},Fg;(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:j(`${i} and ${a} are identical in terms of comparison`)};function*e(i,a,o){if(i.isEmpty())return rr.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===Ur.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,h=f;if(h.position>a){for(;a<h.position;)if(yield{position:a,value:h.value},a+=v,a>o)return;h.position<=o&&(yield h)}for(;a<=o;){let{done:y,value:_}=c.next();if(y)break;for(;a<_.position;){if(a>o)return;yield{position:a,value:n(h,_,a)},a+=v}_.position<o&&(h.interpolation===Ur.None&&(yield{position:_.position,value:h.value}),yield _),h=_}for(;a<=o;)yield{position:a,value:h.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"?tr.valueAt({slope:o.slope,steps:s.position-a,y0:i,y1:s.value},c-a):j("Unknown interpolation")})(Fg||(Fg={}));var Pp;(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}}}})(Pp||(Pp={}));var va;(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(rr.map(c,f=>({value:n(f)})))},u)};dispatchAndReturn=(s,...c)=>new Promise((u,f)=>{let v=rr.reduce(c,(y,_,$)=>(typeof _=="function"&&y.push([$,_]),y),[]);this.#t.set(this.#i,{executorTuple:{resolve:u,reject:f},callbacks:new Map(v)});let h=r(c);this.#e.send({type:"send",returnId:this.#i,func:s.name,args:Array.from(rr.map(c,(y,_)=>typeof y=="function"?{callback:_}:{value:n(y)}))},h),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):j(`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=>{re(s.type==="send",()=>"Message type must be 'send'");let c=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),u=Ke(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:j(`${s.func.toString()} has no promise.`)));else try{u.apply(this.#t,s.args.map(h=>"callback"in h?(...y)=>this.#o(f,h.callback,y):h.value)).then(h=>{try{this.#n(f,h)}catch(y){this.#a(f,y)}},h=>this.#a(f,h))}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});#o=(s,c,u)=>this.#e.send({type:"callback",returnId:s,funcAt:c,args:u})}t.Executor=a})(va||(va={}));var bM={for:t=>new q0(t)},vD=[],q0=class{#e;#t=new fe;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??vD)}channel(e){return new J0(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},J0=class t{#e;#t;#r=new fe;#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()}};var kp;(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}=Lt(()=>e.next());if(a==="success"){let{done:c,value:u}=o;c&&(clearInterval(i),r(u))}else clearInterval(i),n(s)},0)})})(kp||(kp={}));var Y0=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)}},Eg;(function(t){class e{value;status="resolved";constructor(s){this.value=s}error=bp("Cannot access error when promise is resolved")}t.ResolveResult=e;class r{error;status="rejected";constructor(s){this.error=s}value=bp("Cannot access value when promise is rejected")}t.RejectedResult=r,t.makeAbortable=async(o,s)=>{let c=!0;return o.own(pe.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 Y0(3,Sp.seconds(3));t.retry=(o,s=n)=>o().catch(c=>new Promise((u,f)=>{let v=h=>{s.retry(h,()=>o().then(y=>u(y),v))||f(h)};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 kp.timeSpan(Sp.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 Cc.approve(s(u)))return c();throw u}};return c()},t.delay=(o,s)=>Promise.all([o,kp.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,h=setTimeout(()=>{v=!1,f(new Error(c??"timeout"))},s.millis());o.then(y=>{v&&u(y)},y=>{v&&f(y)}).finally(()=>clearTimeout(h))}),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(en(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 h=u++;try{let y=await o[h]();f||(c[h]=y)}catch(y){throw f=!0,y}}};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 h=await o[v]();c[v]={status:"fulfilled",value:h}}catch(h){c[v]={status:"rejected",reason:h}}}};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(re(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=b.None;constructor(s,c,u){this.#e=s,this.#t=c,this.#r=u}update(s){this.#i=b.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(),N(this.#r))})}terminate(){this.#i=b.None}}t.Latest=a})(Eg||(Eg={}));var Ce=class t{static newSet(e){return new Rc(e,t.Comparator)}static compose=(e,...r)=>{let n=r.length===0?this.#e:new Int16Array(r);return re(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 re(r.length>0,"Unable to parse Address"),t.compose(B.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,B.Comparator,n),o=i.length;if(a<0||a>=o)return null;for(let s=a;s<o;s++)if(B.Comparator(n(i[s]),r)!==0)return a<s?[a,s]:null;return[a,o]}static Comparator=(e,r)=>{let n=B.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=B.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=B.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 B.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(B.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,B.length),e.buffer}toString(){return[B.toString(this.#t),...this.#r].join("/")}static read(e){let r=B.fromDataInput(e),n=e.readByte();return t.compose(r,...de.create(()=>e.readShort(),n))}},Qs;(function(t){t.AddressReader=e=>e.address,t.Comparator=({address:e},{address:r})=>Ce.Comparator(e,r),t.equals=(e,r)=>{let[n,i]=vt.rangeMapped(r,e,Ce.Comparator,t.AddressReader);return r.slice(n,i+1)},t.startsWith=(e,r)=>{let[n,i]=vt.rangeMapped(r,e,Ce.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,Ce.LengthComparator,t.AddressReader),i=vt.rightMostMapped(r,e,Ce.MinimalComparator,t.AddressReader);return r.slice(n,i+1).filter(a=>e.startsWith(a.address))}})(Qs||(Qs={}));var xa=class t{static validate(e,r){if(e.address.equals(r.address))return b.wrap(`PointerField cannot point to itself: ${e}`);if(!r.pointerRules.accepts.some(n=>n===e.pointerType)){let n=r.pointerRules.accepts.join(", ");return b.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${n}).`)}return b.None}#e;#t;constructor(e){this.#e=e,this.#t=new nr}subscribe(e,...r){return this.#r(this.#t,e,r)}catchupAndSubscribe(e,...r){let n=Ce.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=>{dM(n.removeByKeyIfExist(i.address))&&e.onRemoved(i)}},...r)}filter(...e){return e.length===0?this.incoming():rr.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 j(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 X0=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},Vc=function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},L=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 N(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 xa(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 de.empty()}record(){return ug.empty()}getField(e){return j()}optField(e){return b.None}read(e){}write(e){}toJSON(){}fromJSON(e){return j("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()}`}};X0([Tc,Vc("design:type",xa),Vc("design:paramtypes",[])],L.prototype,"pointerHub",null);X0([Tc,Vc("design:type",Ce),Vc("design:paramtypes",[])],L.prototype,"address",null);X0([Tc,Vc("design:type",String),Vc("design:paramtypes",[])],L.prototype,"debugPath",null);var p=Object.freeze({mandatory:!1,exclusive:!1,accepts:[]});var Vn=class t extends L{static create(e,r,n){return new t(e,r,n)}#e;constructor(e,r,n){super(e),this.#e=de.create(i=>r({parent:this,fieldKey:i,fieldName:String(i),pointerRules:p,deprecated:e.deprecated}),n)}accept(e){return N(e.visitArrayField,this)}fields(){return this.#e}record(){return de.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return Ke(this.#e[e])}optField(e){return b.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 j("Type mismatch")}};var Lo;(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=ir.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)=>{re(r.readInt()===1179403347,"Serializer header is corrupt");let i=r.readShort();for(let a=0;a<i;a++){let o=r.readShort();if(tg(n[o]))continue;let s=r.readInt(),c=new Int8Array(s);r.readBytes(c);let{status:u,error:f}=Lt(()=>n[o]?.read(new it(c.buffer)));u==="failure"&&console.warn(n,f)}}})(Lo||(Lo={}));var xD=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},_M=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;#o;#s=t.Index++;constructor({uuid:e,graph:r,name:n,pointerRules:i,resource:a,ephemeral:o}){this.#e=Ce.compose(e),this.#t=r,this.#r=n,this.#i=i,this.#n=a,this.#a=o===!0,this.#o=this.initializeFields(),(i.mandatory||i.exclusive)&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#o)}record(){return this.#o}getField(e){return Ke(this.#o[e],()=>`Field ${String(e)} not found in ${this.toString()}`)}optField(e){return b.wrap(this.#o[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.#s}get pointerHub(){return new xa(this)}estimateMemory(){let e=new Ic;return this.write(e),e.count}isBox(){return!0}asBox(e){return Re(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){Lo.readFields(e,this.#o)}write(e){Lo.writeFields(e,this.#o)}serialize(){let e=ir.create();return e.writeInt(this.#s),e.writeString(this.name),e.writeBytes(new Int8Array(this.address.uuid.buffer)),this.write(e),e.toArrayBuffer()}toArrayBuffer(){let e=ir.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#o).reduce((e,[r,n])=>{let i=n.toJSON();return K(i)&&(e[r]=i),e},{})}fromJSON(e){if(rg(e))Object.entries(e).forEach(([r,n])=>{let i=this.#o[parseInt(r)];K(n)&&i.fromJSON(n)});else return j("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...r){if(r.length===0)return de.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 b.wrap(this);let r=this.optField(e[0]);if(r.isEmpty())return b.None;for(let n=1;n<e.length;n++)if(r=r.unwrap().optField(e[n]),r.isEmpty())return b.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(`
2
2
  `)),console.debug(" unstages",[...e].map(n=>n.toString()).join(`
3
- `),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()}`}};xD([Tc,_M("design:type",xa),_M("design:paramtypes",[])],D.prototype,"pointerHub",null);var Bp;(function(t){t.clampInt32=(e,r)=>r,t.clampFloat32=(e,r)=>r})(Bp||(Bp={}));var ze;(function(t){t[t.This=0]="This",t[t.Parent=1]="Parent",t[t.Children=2]="Children"})(ze||(ze={}));var Sg;(function(t){t.create=()=>new Q0})(Sg||(Sg={}));var Q0=class{#e=new Ip(Qs.equals);#t=new Ip(Qs.startsWith);#r=new Ip(Qs.endsWith);#i=[];#n=0;#a=!1;subscribe(e,r,n){let i=new e_(r,e,this.#n++,n);if(this.#a){let a=new t_(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 ze.This:return this.#e.subscribe(e);case ze.Parent:return this.#t.subscribe(e);case ze.Children:return this.#r.subscribe(e);default:return ig(r)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},e_=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: ${ze[this.propagation]}, order: ${this.order} }`}},Ip=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(Qs.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},t_=class{monitor;propagation;#e=new Y;#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()}};var Pt;(function(t){t.Boolean="boolean",t.Float32="float32",t.Int32="int32",t.String="string",t.Bytes="bytes"})(Pt||(Pt={}));var tl={[Pt.Boolean]:{type:Pt.Boolean,encode:(t,e)=>t.writeBoolean(e),decode:t=>t.readBoolean()},[Pt.Float32]:{type:Pt.Float32,encode:(t,e)=>t.writeFloat(e),decode:t=>t.readFloat()},[Pt.Int32]:{type:Pt.Int32,encode:(t,e)=>t.writeInt(e),decode:t=>t.readInt()},[Pt.String]:{type:Pt.String,encode:(t,e)=>t.writeString(e),decode:t=>t.readString()},[Pt.Bytes]:{type:Pt.Bytes,encode:(t,e)=>{t.writeInt(e.length),t.writeBytes(e)},decode:t=>{let e=new Int8Array(t.readInt());return t.readBytes(e),e}}},el=class extends L{#e;#t;#r;constructor(e,r,n){super(e),this.#e=r,this.#t=n,this.#r=this.#t}accept(e){return N(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(ze.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){re(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){re(!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)?j("not implemented"):e}fromJSON(e){return j("Type mismatch")}reset(){this.setValue(this.#t)}},I=class t extends el{static create(e,r=!1){return new t(e,r)}constructor(e,r){super(e,Pt.Boolean,r)}toggle(){this.setValue(!this.getValue())}serialization(){return tl[Pt.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){re(!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()))}},A=class t extends el{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,Pt.Float32,i),this.#e=r,this.#t=n}serialization(){return tl[Pt.Float32]}equals(e){return this.getValue()===e}clamp(e){return Bp.clampFloat32(this.#e,so.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){re(!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()))}},M=class t extends el{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,Pt.Int32,i),this.#e=r,this.#t=n}serialization(){return tl[Pt.Int32]}equals(e){return this.getValue()===e}clamp(e){return Bp.clampInt32(this.#e,Mr.toInt(e))}read(e){this.setValue(e.readInt())}write(e){re(!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>=Mr.MIN_VALUE&&e<=Mr.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},T=class t extends el{static create(e,r=""){return new t(e,r)}constructor(e,r){super(e,Pt.String,r)}serialization(){return tl[Pt.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){re(!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()))}},AM=class t extends el{static create(e,r=this.#e){return new t(e,r)}static#e=Object.freeze(new Int8Array(0));constructor(e,r){super(e,Pt.Bytes,r)}serialization(){return tl[Pt.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){re(!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()))}};var EM=t=>{let e=B.newSet(i=>i),r=B.newSet(i=>i);for(let i of t)i instanceof rl?e.add(i.uuid):i instanceof al&&r.add(i.uuid);let n=B.newSet(i=>i);for(let i of e.values())r.hasKey(i)&&n.add(i);return n.isEmpty()?t:t.filter(i=>i instanceof rl||i instanceof al?!n.hasKey(i.uuid):i instanceof nl||i instanceof il?!n.hasKey(i.address.uuid):!0)},FM;(function(t){t.decode=e=>{let r=e.readInt();return de.create(()=>{switch(e.readString()){case"new":{let i=B.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new rl(i,a,o.buffer)}case"pointer":{let i=Ce.read(e),a=e.readBoolean()?b.wrap(Ce.read(e)):b.None,o=e.readBoolean()?b.wrap(Ce.read(e)):b.None;return new nl(i,a,o)}case"primitive":{let i=Ce.read(e),a=e.readString(),o=tl[a],s=o.decode(e),c=o.decode(e);return new il(i,o,s,c)}case"delete":{let i=B.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new al(i,a,o.buffer)}}},r)}})(FM||(FM={}));var rl=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 it(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),B.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${B.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},il=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}`}},nl=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()}`}},al=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 it(this.#r)))}write(e){e.writeString(this.type),B.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${B.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var FU=Symbol("Unreferenceable"),k=class t extends L{static create(e,r,n){return new t(e,r,n)}static encodeWith(e,r){re(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=b.wrap(e);let n=Lt(r);if(this.#e=b.None,n.status==="failure")throw n.error;return n.value}static decodeWith(e,r){re(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=b.wrap(e);let n=Lt(r);if(this.#t=b.None,n.status==="failure")throw n.error;return n.value}static#e=b.None;static#t=b.None;#r;#i;#n=b.None;#a=b.None;constructor(e,r,n){super(e),this.#r=r,this.#i=n,n&&this.graph.edges().watchVertex(this)}get pointerHub(){return j(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return N(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(ze.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}refer(e){this.targetVertex=b.wrap(e)}defer(){this.targetVertex=b.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=xa.validate(this,e.unwrap());r.nonEmpty()&&j(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()?b.wrap(Ce.read(e)):b.None;this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}write(e){re(!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(en(e)||typeof e=="string"){let r=b.wrap(en(e)?null:Ce.decode(e));this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}else return j(`Pointer at (${this.address}) has type mismatch. value (${e}) must be a string, but is ${typeof e}.`)}};var Pg=class{#e;#t;#r;#i;#n;#a;constructor(){this.#e=Ce.newSet(e=>e.address),this.#t=Ce.newSet(e=>e.address),this.#r=Ce.newSet(e=>e.address),this.#i=Ce.newSet(([e])=>e),this.#n=Ce.newSet(([e])=>e.address),this.#a=B.newSet(e=>e)}watchVertex(e){if(gt(e,k)){if(!e.mandatory)return j("watchVertex called but has no edge requirement");this.#e.add(e)}else{let{mandatory:r,exclusive:n}=e.pointerRules;if(!r&&!n)return j("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.#s(this.#e,n,r),this.#s(this.#t,n,r),this.#s(this.#r,n,r);for(let n of e){let i=this.outgoingEdgesOf(n);if(i.length>0)return j(`${n} has outgoing edges: ${i.map(([o,s])=>`[${o.toString()}, ${s.toString()}]`)}`);let a=this.incomingEdgesOf(n);if(a.length>0)return j(`${n} has incoming edges from: ${a.map(o=>o.toString())}`)}}forgetVerticesOf(e){let r=({box:{address:{uuid:i}}})=>i,{address:{uuid:n}}=e;this.#s(this.#e,n,r),this.#s(this.#t,n,r),this.#s(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");de.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.#o(this.#n,e.address.uuid,([{box:{address:{uuid:r}}}])=>r)}incomingEdgesOf(e){return e.isBox()?this.#o(this.#i,e.address.uuid,([{uuid:r}])=>r).flatMap(([r,n])=>n):this.#i.opt(e.address).mapOr(([r,n])=>n,de.empty())}clearAffected(){this.#a.clear()}tryValidateAffected(){let e=({box:{address:{uuid:r}}})=>r;for(let r of this.#a.values()){let n=this.#o(this.#e,r,e);for(let o of n)if(o.isEmpty())return this.#a.clear(),o.mandatory?b.wrap(new Error(`Pointer ${o.toString()} requires an edge.`)):b.wrap(new Error(`Illegal state: ${o} has no edge requirements.`));let i=this.#o(this.#t,r,e);for(let o of i)if(o.pointerHub.isEmpty())return this.#a.clear(),o.pointerRules.mandatory?b.wrap(new Error(`Target ${o.toString()} requires an edge.`)):b.wrap(new Error(`Illegal state: ${o} has no edge requirements.`));let a=this.#o(this.#r,r,e);for(let o of a){let s=o.pointerHub.size();if(s>1)return this.#a.clear(),b.wrap(new Error(`Target ${o.toString()} is exclusive but has ${s} incoming pointers.`))}}return this.#a.clear(),b.None}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?(console.warn(`[GraphEdges] Validation failed: Pointer ${e.toString()} requires an edge.`),j(`Pointer ${e.toString()} requires an edge.`)):j(`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.`),j(`Target ${e.toString()} requires an edge.`)):j(`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.`),j(`Target ${e.toString()} is exclusive but has ${r} incoming pointers.`)})}#o(e,r,n){let i=Ce.boxRange(e,r,n);return K(i)?e.values().slice(i[0],i[1]):de.empty()}#s(e,r,n){let i=Ce.boxRange(e,r,n);K(i)&&e.removeRange(i[0],i[1])}};var uo=class{#e;#t;#r;#i;#n;#a;#o;#s;#u;#l;#c;#d;#p;#g=!1;#v=!1;#m=!1;constructor(e=b.None){this.#e=e,this.#t=B.newSet(r=>r.address.uuid),this.#r=[],this.#i=[],this.#n=[],this.#u=Sg.create(),this.#a=new nr,this.#o=new nr,this.#s=new nr,this.#l=new Pg,this.#c=Ce.newSet(({pointer:r})=>r.address),this.#d=[],this.#p=B.newSet(r=>r.uuid)}beginTransaction(){re(!this.#g,"Transaction already in progress"),this.#g=!0,this.#n.length=0,this.#s.proxy.onBeginTransaction()}abortTransaction(){re(this.#g,"No transaction in progress"),this.#A(),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>this.#y(e,r)),this.#r.length=0),this.#f()}endTransaction(){re(this.#g,"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.#m&&this.#e.nonEmpty()&&this.#l.tryValidateAffected().ifSome(e=>{throw this.#A(),this.#f(),e}),this.#x(),this.#f()}inTransaction(){return this.#g}constructingBox(){return this.#v}createBox(e,r,n){return this.#e.unwrap("No box-factory installed")(e,this,r,n)}stageBox(e,r){if(this.#w(),re(!this.#v,"Cannot construct box while other box is constructing"),K(r)){this.#v=!0;let a=Lt(()=>r(e));if(this.#v=!1,a.status==="failure")throw this.#F(e),a.error}if(!this.#t.add(e))return this.#F(e),j(`${e.name} ${e.address.toString()} already staged`);let i=new rl(e.address.uuid,e.name,e.toArrayBuffer());return this.#m||this.#n.push(i),this.#a.proxy.onUpdate(i),this.#o.proxy.onUpdate(i),e}subscribeTransaction(e){return this.#s.subscribe(e)}subscribeToAllUpdates(e){return this.#a.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#o.subscribe(e)}subscribeVertexUpdates(e,r,n){return this.#u.subscribe(e,r,n)}subscribeEndTransaction(e){this.#d.push(e)}subscribeDeletion(e,r){let n=this.#p.getOrCreate(e,()=>({uuid:e,listeners:new Set}));return n.listeners.add(r),{terminate:()=>{n.listeners.delete(r),n.listeners.size===0&&this.#p.removeByKeyIfExist(e)}}}unstageBox(e){this.#w();let r=this.#t.removeByKey(e.address.uuid);re(r===e,`${e} could not be found to unstage`),this.#l.unwatchVerticesOf(e);let n=new al(e.address.uuid,e.name,e.toArrayBuffer());this.#m||this.#n.push(n),this.#p.removeByKeyIfExist(e.address.uuid)?.listeners.forEach(i=>i()),this.#a.proxy.onUpdate(n),this.#o.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 lg;return this.boxes().forEach(r=>r.write(e)),e.result()}onPrimitiveValueUpdate(e,r,n){if(this.#w(),e.isAttached()&&!this.#v){let i=new il(e.address,e.serialization(),r,n);this.#m||this.#n.push(i),this.#u.dispatch(i),this.#a.proxy.onUpdate(i),this.#o.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 nl(e.address,r,n);this.#v?this.#r.push({pointerField:e,update:i}):(this.#m||this.#n.push(i),this.#y(e,i),this.#o.proxy.onUpdate(i))}#y(e,r){let{oldAddress:n,newAddress:i}=r;e.resolvedTo(i.flatMap(o=>this.findVertex(o))),this.#c.opt(e.address).match({none:()=>this.#c.add({pointer:e,initial:n,final:i,index:this.#c.size()}),some:o=>o.final=i}),this.#u.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.#c.opt(e.address).match({none:()=>this.#c.add({pointer:e,initial:n,final:i,index:this.#c.size()}),some:o=>o.final=i}),this.#i.push({pointerField:e,update:r})}#x(){for(let{update:e}of this.#i)this.#u.dispatch(e),this.#a.proxy.onUpdate(e);this.#i.length=0}#f(){for(this.#c.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.#c.clear(),this.#g=!1;this.#d.length>0;)this.#d.splice(0).forEach(e=>e()),this.#d.length>0&&console.debug(`${this.#d.length} new observers while notifying`);this.#s.proxy.onEndTransaction(this.#m),this.#m=!1}#A(){this.#m=!0;for(let{update:r}of this.#r)this.#n.push(r);this.#r.length=0;let e=EM(this.#n.splice(0));for(let r=e.length-1;r>=0;r--){let n=e[r];if((n instanceof nl||n instanceof il)&&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.#c.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.#S(e);return this.boxes().filter(n=>!r.has(n))}#S(e){let r=new Set,n=[e];for(;n.length>0;){let i=n.pop();if(!r.has(i)){r.add(i),this.#_(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){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:Dc.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(h=>{s.add(h);let y=h.targetAddress.mapOr(_=>!_.isBox(),!1);if(h.mandatory&&y){if(f.resource==="shared"&&h.targetAddress.flatMap($=>this.findVertex($)).mapOr($=>$.pointerRules.mandatory,!1))return;c(h.box)}});return}f.outgoingEdges().filter(([h])=>!s.has(h)).forEach(([h,y])=>{let _=this.findVertex(y).unwrap(`Could not find target of ${h.toString()}`);if(s.add(h),_.pointerRules.mandatory&&(i||_.pointerHub.incoming().filter($=>$.targetAddress.mapOr(S=>S.equals(y),!1)).every($=>s.has($))))return c(_.box)}),f.incomingEdges().forEach(h=>{s.add(h),h.mandatory&&c(h.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();re(o,`pointer ${a.address} is broken`),re(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[B.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:j("Unknown address"))))}toArrayBuffer(){let e=ir.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){re(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let n=new it(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 it(c.buffer),f=u.readInt(),v=u.readString(),h=B.fromDataInput(u);a.push({creationIndex:f,name:v,uuid:h,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.#f())}toJSON(){let e={};for(let r of this.#t.values())e[r.address.toString()]={name:r.name,fields:Ke(r.toJSON())};return e}fromJSON(e,r=!0){if(typeof e!="object"||e===null||Array.isArray(e))return j("Expected object");this.beginTransaction();let n=Object.entries(e);for(let[i,{name:a,fields:o}]of n)this.createBox(a,B.parse(i),s=>{let c=Lt(()=>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.#f())}#w(){re(this.#g,()=>"Modification only prohibited in transaction mode.")}};var pi;(function(t){t.insertOrder=(e,r=Number.MAX_SAFE_INTEGER)=>{let n=t.collectIndexedBoxes(e),i=Fe(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=Fe(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=Fe(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,h=0;for(let y=0;y<i.length;y++){let _=i[y],$=a.has(y)?c+v++:y<n?f++:u+h++;_.index.setValue($)}},t.isIndexedBox=e=>"index"in e&&e.index instanceof M,t.collectIndexedBoxes=(e,r)=>e.pointerHub.incoming().map(({box:n})=>t.isIndexedBox(n)&&(r===void 0||n instanceof r)?n:j(`${n} has no index field`)).sort((n,i)=>n.index.getValue()-i.index.getValue())})(pi||(pi={}));var $e=class extends L{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return N(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return Ke(this.#e[e])}optField(e){return b.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(ze.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){Lo.readFields(e,this.#e)}write(e){Lo.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(rg(e))Object.entries(e).forEach(([r,n])=>{let i=this.#e[parseInt(r)];K(n)&&i.fromJSON(n)});else return j("Type mismatch")}};var Zo;(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"})(Zo||(Zo={}));var Tp;(function(t){t[t.WRITE=0]="WRITE",t[t.READ=1]="READ"})(Tp||(Tp={}));var Uc;(function(t){t[t.ID=15793935]="ID",t[t.START=15790320]="START",t[t.END=986895]="END"})(Uc||(Uc={}));var Mg=class t{static create(e,r){return new t(e.channel(r))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#n=ir.create(0);#a=b.None;#o=b.None;#s=b.None;#u=-1;#l=-1;#c=!1;#d=!1;#p=0;constructor(e){this.#i=va.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.#d||(this.#i.sendShareLock(this.#t),this.#d=!0),this.#i.sendUpdateStructure(e.unwrap());let r=this.#e.length,n=this.#v(),i=r+n;if(this.#a.isEmpty()||this.#a.unwrap().byteLength<i||r!==this.#p){let o=og(i),s=new SharedArrayBuffer(o);this.#o=b.wrap(new Uint8Array(s,0,r)),this.#n=ir.use(s,r),this.#a=b.wrap(s),this.#p=r,this.#i.sendUpdateData(s)}}this.#a.isEmpty()||Atomics.load(this.#r,0)===Tp.WRITE&&(this.#m(this.#n),this.#n.position=0,Atomics.store(this.#r,0,Tp.READ))}broadcastFloat(e,r){return this.#h(new class{type=Zo.Float;address=e;capacity=8;put(n,i){n.writeFloat(r())}})}broadcastInteger(e,r){return this.#h(new class{type=Zo.Integer;address=e;capacity=8;put(n,i){n.writeInt(r())}})}broadcastFloats(e,r,n){return this.#h(new class{type=Zo.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=Zo.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=Zo.ByteArray;address=e;capacity=4+r.byteLength;put(i,a){n(a),i.writeInt(r.byteLength),i.writeBytes(r)}})}#g(){if(this.#c){try{this.#s=b.wrap(this.#f())}catch(e){throw e}this.#c=!1}if(this.#s.nonEmpty()){let e=this.#s;return this.#s=b.None,e}return b.None}#v(){return this.#l===-1&&(this.#l=this.#y()+12),this.#l}terminate(){de.clear(this.#e),this.#s=b.None,this.#c=!1,this.#l=0}#m(e){re(!this.#c&&this.#s.isEmpty(),"Cannot flush while update is available");let r=this.#v();re(e.remaining>=r,"Insufficient data"),e.writeInt(this.#u),e.writeInt(Uc.START);let n=this.#o;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(Uc.END)}#y(){return this.#e.reduce((e,r)=>e+r.capacity,0)}#h(e){return this.#e.push(e),this.#x(),{terminate:()=>{de.removeOpt(this.#e,e),this.#x()}}}#x(){this.#l=-1,this.#c=!0}#f(){let e=ir.create();e.writeInt(Uc.ID),e.writeInt(++this.#u),e.writeInt(this.#e.length);for(let{address:r,type:n}of this.#e)r.write(e),e.writeByte(n);return e.toArrayBuffer()}};var Dp=class{#e=new Y;#t;constructor(e,r){this.#t=this.#e.own(new hg(r)),this.#e.own(va.executor(e,{updateSettings:n=>this.#t.update(n)}))}get settings(){return this.#t.data}catchupAndSubscribe(e,...r){return this.#t.catchupAndSubscribe(e,...r)}terminate(){this.#e.terminate(),this.#t.terminate()}};var SM;(function(t){t.NoSync="nosync",t.Pitch="pitch",t.Timestretch="timestretch",t.AudioFit="audiofit"})(SM||(SM={}));var PM;(function(t){t[t.Pre=0]="Pre",t[t.Post=1]="Post"})(PM||(PM={}));var Mt;(function(t){t.Instrument="instrument",t.Bus="bus",t.Aux="aux",t.Output="output"})(Mt||(Mt={}));var Go={white:new er(0,0,100),blue:new er(189,100,65),green:new er(150,77,69),yellow:new er(60,100,84),cream:new er(65,20,83),orange:new er(31,100,73),red:new er(354,100,65),purple:new er(314,100,78),bright:new er(197,5,95),gray:new er(197,31,88),dark:new er(197,15,70),shadow:new er(197,10,55),black:new er(197,10,25),background:new er(197,8,9),panelBackground:new er(197,14,12),panelBackgroundBright:new er(197,13,19),panelBackgroundDark:new er(197,14,11)};var Oe;(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"})(Oe||(Oe={}));(function(t){t.toName=e=>t[e],t.fromName=e=>t[e]??t.Rectangle})(Oe||(Oe={}));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 Ng;(function(t){t[t.Once=0]="Once",t[t.Repeat=1]="Repeat",t[t.Pingpong=2]="Pingpong"})(Ng||(Ng={}));var ya;(function(t){t[t.Monophonic=0]="Monophonic",t[t.Polyphonic=1]="Polyphonic"})(ya||(ya={}));var MM=(t,e)=>{if(t===e)return 0;let r=t-e;return r===0?j(`Indices cannot be equal (${t}, ${e})`):r};var po=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},$r=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)},$g,Un,Ho,kg,fo,Rt=class t{static create(e,r,n){return new t(e,r,n)}constructor(e,r,n){$g.set(this,void 0),Un.set(this,void 0),Ho.set(this,void 0),kg.set(this,void 0),fo.set(this,null),po(this,$g,e,"f"),po(this,Un,B.newSet(i=>i.adapter.uuid),"f"),po(this,Ho,new nr,"f"),po(this,kg,e.pointerHub.catchupAndSubscribe({onAdded:i=>{po(this,fo,null,"f");let a=r(i.box),o=a.indexField.subscribe(()=>{po(this,fo,null,"f"),$r(this,Ho,"f").proxy.onReorder(a)}),s=$r(this,Un,"f").add({adapter:a,subscription:o});re(s,`Could not add ${a}`),$r(this,Ho,"f").proxy.onAdd(a)},onRemoved:i=>{po(this,fo,null,"f");let a=i.box.address.uuid,{adapter:o,subscription:s}=$r(this,Un,"f").removeByKey(a);s.terminate(),$r(this,Ho,"f").proxy.onRemove(o)}},n),"f")}field(){return $r(this,$g,"f")}subscribe(e){return $r(this,Ho,"f").subscribe(e)}catchupAndSubscribe(e){return $r(this,Un,"f").forEach(({adapter:r})=>e.onAdd(r)),this.subscribe(e)}getAdapterByIndex(e){let r=vt.exactMapped(this.adapters(),e,MM,n=>n.indexField.getValue());return r===-1?b.None:b.wrap(this.adapters()[r])}getAdapterById(e){return $r(this,Un,"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 $r(this,fo,"f")===null&&po(this,fo,$r(this,Un,"f").values().map(({adapter:e})=>e).filter(e=>e.box.isAttached()).sort((e,r)=>e.indexField.getValue()-r.indexField.getValue()),"f"),$r(this,fo,"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=Fe(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 $r(this,Un,"f").size()}isEmpty(){return this.size()===0}terminate(){po(this,fo,null,"f"),$r(this,Un,"f").forEach(({subscription:e})=>e.terminate()),$r(this,Un,"f").clear(),$r(this,Ho,"f").terminate(),$r(this,kg,"f").terminate()}};$g=new WeakMap,Un=new WeakMap,Ho=new WeakMap,kg=new WeakMap,fo=new WeakMap;var mo;(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 jn.create(r,n,i);case"ProjectMetaBox":return Bg.create(r,n,i);case"RootBox":return qo.create(r,n,i);case"SelectionBox":return wa.create(r,n,i);case"UserInterfaceBox":return ho.create(r,n,i);case"UploadFileBox":return Ig.create(r,n,i);case"ShadertoyBox":return Tg.create(r,n,i);case"MIDIControllerBox":return Dg.create(r,n,i);case"TimelineBox":return ol.create(r,n,i);case"TrackBox":return fi.create(r,n,i);case"NoteEventBox":return Jo.create(r,n,i);case"NoteEventRepeatBox":return Rg.create(r,n,i);case"NoteEventCollectionBox":return go.create(r,n,i);case"NoteRegionBox":return sl.create(r,n,i);case"NoteClipBox":return jc.create(r,n,i);case"ValueEventBox":return Kn.create(r,n,i);case"ValueEventCollectionBox":return Wn.create(r,n,i);case"ValueEventCurveBox":return Yo.create(r,n,i);case"ValueRegionBox":return ll.create(r,n,i);case"ValueClipBox":return Kc.create(r,n,i);case"SignatureEventBox":return Wc.create(r,n,i);case"AudioRegionBox":return Xo.create(r,n,i);case"AudioClipBox":return Lc.create(r,n,i);case"AudioPitchStretchBox":return Zc.create(r,n,i);case"AudioTimeStretchBox":return Gc.create(r,n,i);case"AudioSignalsmithBox":return Hc.create(r,n,i);case"TransientMarkerBox":return Cg.create(r,n,i);case"WarpMarkerBox":return ba.create(r,n,i);case"MarkerBox":return qc.create(r,n,i);case"AudioFileBox":return rn.create(r,n,i);case"SoundfontFileBox":return _a.create(r,n,i);case"NeuralAmpModelBox":return zg.create(r,n,i);case"AudioUnitBox":return Xe.create(r,n,i);case"CaptureAudioBox":return Aa.create(r,n,i);case"CaptureMidiBox":return Fa.create(r,n,i);case"AudioBusBox":return Ln.create(r,n,i);case"AuxSendBox":return Jc.create(r,n,i);case"GrooveShuffleBox":return Yc.create(r,n,i);case"UnknownAudioEffectDeviceBox":return Og.create(r,n,i);case"UnknownMidiEffectDeviceBox":return Vg.create(r,n,i);case"DeviceInterfaceKnobBox":return Ug.create(r,n,i);case"ModularDeviceBox":return jg.create(r,n,i);case"StereoToolDeviceBox":return Kg.create(r,n,i);case"MaximizerDeviceBox":return Xc.create(r,n,i);case"CompressorDeviceBox":return Wg.create(r,n,i);case"GateDeviceBox":return Lg.create(r,n,i);case"DelayDeviceBox":return Zg.create(r,n,i);case"AutotuneDeviceBox":return Gg.create(r,n,i);case"CrusherDeviceBox":return Hg.create(r,n,i);case"DattorroReverbDeviceBox":return qg.create(r,n,i);case"VelocityDeviceBox":return Jg.create(r,n,i);case"FoldDeviceBox":return Yg.create(r,n,i);case"TidalDeviceBox":return Xg.create(r,n,i);case"RevampDeviceBox":return Qg.create(r,n,i);case"ReverbDeviceBox":return ev.create(r,n,i);case"VaporisateurDeviceBox":return Qc.create(r,n,i);case"MIDIOutputDeviceBox":return eu.create(r,n,i);case"MIDIOutputBox":return Qo.create(r,n,i);case"MIDIOutputParameterBox":return cl.create(r,n,i);case"SoundfontDeviceBox":return tu.create(r,n,i);case"NeonDeviceBox":return ru.create(r,n,i);case"NanoDeviceBox":return iu.create(r,n,i);case"PlayfieldDeviceBox":return nu.create(r,n,i);case"PlayfieldSampleBox":return Ea.create(r,n,i);case"TapeDeviceBox":return au.create(r,n,i);case"ArpeggioDeviceBox":return tv.create(r,n,i);case"PitchDeviceBox":return rv.create(r,n,i);case"ZeitgeistDeviceBox":return iv.create(r,n,i);case"NeuralAmpDeviceBox":return nv.create(r,n,i);case"VocoderDeviceBox":return av.create(r,n,i);case"WaveshaperDeviceBox":return ov.create(r,n,i);case"WerkstattDeviceBox":return sv.create(r,n,i);case"WerkstattParameterBox":return Sa.create(r,n,i);case"WerkstattSampleBox":return ul.create(r,n,i);case"SpielwerkDeviceBox":return lv.create(r,n,i);case"ApparatDeviceBox":return ou.create(r,n,i);case"CubedDeviceBox":return su.create(r,n,i);case"NoopInstrumentBox":return lu.create(r,n,i);case"CompositeDeviceBox":return cv.create(r,n,i);case"CompositeCellBox":return uv.create(r,n,i);case"AudioEffectCompositeBox":return dv.create(r,n,i);case"AudioEffectCompositeCellBox":return cu.create(r,n,i);case"StereoCompositeBox":return pv.create(r,n,i);case"FrequencySplitBox":return fv.create(r,n,i);case"ModularBox":return mv.create(r,n,i);case"ModuleConnectionBox":return hv.create(r,n,i);case"ModularAudioInputBox":return gv.create(r,n,i);case"ModularAudioOutputBox":return vv.create(r,n,i);case"ModuleDelayBox":return xv.create(r,n,i);case"ModuleMultiplierBox":return yv.create(r,n,i);case"ModuleGainBox":return wv.create(r,n,i);default:return j(`Unknown box class '${e}'`)}},t.deserialize=(e,r)=>{let n=new it(r),i=n.readString(),a=B.fromDataInput(n),o=t.create(i,e,a);return o.read(n),o}})(mo||(mo={}));var jn=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 N(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:k.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},"{}")}}};var Bg=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 N(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})}}};var bv=class t extends $e{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:M.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:p},{length:4},"",0),2:A.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:p},{min:1,max:64,scaling:"linear"},"",8),3:A.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:p},{min:.5,max:2,scaling:"linear"},"",1),4:I.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:p},!1),5:M.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-48,max:48},"st",0)}}};var qo=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:p},l.Timeline,!0),2:L.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:k.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0),5:A.create({parent:this,fieldKey:5,fieldName:"baseFrequency",deprecated:!1,pointerRules:p},{min:400,max:480,scaling:"linear"},"Hz",440),10:L.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!1,exclusive:!1}}),20:L.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[l.AudioUnits],mandatory:!1,exclusive:!1}}),21:L.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[l.AudioBusses],mandatory:!1,exclusive:!1}}),30:L.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!0,exclusive:!1}}),35:L.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!1,exclusive:!1}}),40:bv.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:p}),100:k.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:p},l.Shadertoy,!1),101:k.create({parent:this,fieldKey:101,fieldName:"projectMeta",deprecated:!1,pointerRules:p},l.ProjectMeta,!1),111:k.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:p},l.Editing,!1)}}};var wa=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 N(e.visitSelectionBox,this)}get tags(){return t.Tags}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:p},l.Selection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:p},l.Selection,!0)}}};var ho=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.User,!0),10:L.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[l.FileUploadState],mandatory:!1,exclusive:!1}}),21:k.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:p},l.Editing,!1),22:k.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:p},l.Editing,!1),23:k.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:p},l.Editing,!1),30:L.hook({parent:this,fieldKey:30,fieldName:"midiControllers",deprecated:!1,pointerRules:{accepts:[l.MIDIControllers],mandatory:!1,exclusive:!1}})}}};var Ig=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 N(e.visitUploadFileBox,this)}get tags(){return t.Tags}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:p},l.FileUploadState,!0),2:k.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.FileUploadState,!0)}}};var Tg=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 N(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:I.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:p},!0)}}};var Dg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"controllers",deprecated:!1,pointerRules:p},l.MIDIControllers,!0),2:k.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:M.create({parent:this,fieldKey:4,fieldName:"deviceChannel",deprecated:!1,pointerRules:p},{min:0,max:127},""),5:M.create({parent:this,fieldKey:5,fieldName:"controlId",deprecated:!1,pointerRules:p},{min:0,max:127},"")}}};var _v=class t extends $e{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:M.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4),2:M.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4)}}};var Av=class t extends $e{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),2:M.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:p},"any","ppqn",0),3:M.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:p},"any","ppqn",15360)}}};var Fv=class t extends $e{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:L.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),10:M.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var Ev=class t extends $e{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:k.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!1),10:M.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",2),15:M.create({parent:this,fieldKey:15,fieldName:"minBpm",deprecated:!1,pointerRules:p},{min:30,max:999},"bpm",60),16:M.create({parent:this,fieldKey:16,fieldName:"maxBpm",deprecated:!1,pointerRules:p},{min:31,max:1e3},"bpm",240),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var Sv=class t extends $e{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:L.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.SignatureAutomation],mandatory:!1,exclusive:!1}}),10:M.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",1),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var ol=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 N(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:L.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[l.Timeline],mandatory:!0,exclusive:!1}}),10:_v.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:p}),11:Av.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:p}),20:L.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!0,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),21:Fv.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:p}),22:Ev.create({parent:this,fieldKey:22,fieldName:"tempoTrack",deprecated:!1,pointerRules:p}),23:Sv.create({parent:this,fieldKey:23,fieldName:"signatureTrack",deprecated:!1,pointerRules:p}),30:M.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:p},"positive","ppqn",491520),31:A.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:p},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var fi=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:p},l.TrackCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:p},l.Automation,!0),3:L.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[l.RegionCollection],mandatory:!1,exclusive:!1}}),4:L.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[l.ClipCollection],mandatory:!1,exclusive:!1}}),10:M.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),11:M.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:p},{values:[0,1,2,3]},""),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),30:I.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:p},!1)}}};var Jo=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEvents,!0),10:M.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn",240),20:M.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),21:A.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:p},"unipolar","%",.7874015748031497),22:M.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),23:A.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:p},"bipolar","%",0),24:A.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:p},{min:-50,max:50,scaling:"linear"},"ct",0),25:M.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:p},{min:0,max:100},"",100)}}};var Rg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.NoteEventFeature,!0),2:M.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),3:A.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:p},"bipolar","%",0),4:A.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:p},"unipolar","%",1)}}};var go=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 N(e.visitNoteEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.NoteEvents],mandatory:!1,exclusive:!1}}),2:L.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.NoteEventCollection],mandatory:!0,exclusive:!1}})}}};var sl=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),10:M.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:M.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:M.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:M.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:p},"any","ppqn"),15:I.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:M.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var es=class t extends $e{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:I.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:p},!0),2:I.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:p}),4:M.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:p},"non-negative",""),5:M.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:p},"non-negative",""),6:M.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:p},"non-negative","")}}};var jc=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:es.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:M.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:I.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:M.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Kn=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEvents,!0),10:M.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:M.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[l.ValueInterpolation],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),13:A.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:p},"any",""),14:A.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:p},"any","",NaN)}}};var Wn=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 N(e.visitValueEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.ValueEvents],mandatory:!1,exclusive:!1}}),2:L.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.ValueEventCollection],mandatory:!0,exclusive:!1}})}}};var Yo=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 N(e.visitValueEventCurveBox,this)}get tags(){return t.Tags}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.ValueInterpolation,!0),2:A.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:p},"unipolar","%",.5)}}};var ll=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),10:M.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:M.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:M.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:I.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:M.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Kc=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:es.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:M.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:I.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:M.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Wc=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.SignatureAutomation,!0),9:M.create({parent:this,fieldKey:9,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),10:M.create({parent:this,fieldKey:10,fieldName:"relativePosition",deprecated:!1,pointerRules:p},"positive","bars",1),21:M.create({parent:this,fieldKey:21,fieldName:"nominator",deprecated:!1,pointerRules:p},"positive","",4),22:M.create({parent:this,fieldKey:22,fieldName:"denominator",deprecated:!1,pointerRules:p},"positive","",4)}}};var Pv=class t extends $e{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:A.create({parent:this,fieldKey:1,fieldName:"in",deprecated:!1,pointerRules:p},"positive","ppqn",0),2:A.create({parent:this,fieldKey:2,fieldName:"out",deprecated:!1,pointerRules:p},"positive","ppqn",0),3:A.create({parent:this,fieldKey:3,fieldName:"inSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.75),4:A.create({parent:this,fieldKey:4,fieldName:"outSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.25)}}};var Xo=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:k.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:k.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:k.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:A.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:k.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:M.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:A.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","mixed"),12:A.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","mixed"),13:A.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"any","mixed"),14:I.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:M.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),17:A.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),18:Pv.create({parent:this,fieldKey:18,fieldName:"fading",deprecated:!1,pointerRules:p})}}};var Lc=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:es.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),5:k.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:k.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:A.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:k.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:A.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"any","ppqn"),11:I.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:M.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),14:A.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")}}};var Zc=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 N(e.visitAudioPitchStretchBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}})}}};var Gc=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 N(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:L.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:M.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:p},"positive","enum",2),3:A.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:p},"positive","ratio",1)}}};var Hc=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 N(e.visitAudioSignalsmithBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}get transpose(){return this.getField(2)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:A.create({parent:this,fieldKey:2,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-24,max:24,scaling:"linear"},"st",0)}}};var Cg=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 N(e.visitTransientMarkerBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get position(){return this.getField(2)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.TransientMarkers,!0),2:A.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};var ba=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.WarpMarkers,!0),2:M.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:A.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};var qc=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:p},l.MarkerTrack,!0),2:M.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:M.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:M.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var rn=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 N(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:A.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),2:A.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:L.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[l.TransientMarkers],mandatory:!1,exclusive:!1}})}}};var _a=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 N(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})}}};var zg=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 N(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})}}};var Mv=class t extends $e{static create(e){return new t(e)}constructor(e){super(e)}get automationCollapsed(){return this.getField(1)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"automationCollapsed",deprecated:!1,pointerRules:p})}}};var Xe=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 N(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:k.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioUnits,!0),3:L.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:M.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:A.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:A.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),14:I.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:I.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:L.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[l.TrackCollection],mandatory:!1,exclusive:!1}}),21:L.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),22:L.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost,l.AudioOutput],mandatory:!1,exclusive:!0}}),23:L.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),24:L.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[l.AuxSend],mandatory:!1,exclusive:!1}}),25:k.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!1),26:k.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:p},l.Capture,!1),30:Mv.create({parent:this,fieldKey:30,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};var Aa=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 N(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:M.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:p},"any","",2),11:A.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:p},"decibel","dB",0),12:A.create({parent:this,fieldKey:12,fieldName:"inputLatency",deprecated:!1,pointerRules:p},"any","s",-2)}}};var Fa=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 N(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:M.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:p},"any","",-1)}}};var Ln=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioBusses,!0),2:k.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:L.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!1,exclusive:!1}}),4:I.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:I.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:p})}}};var Jc=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:p},l.AuxSend,!0),2:k.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:M.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:p},{values:[0,1]},"",1),5:A.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB"),6:A.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var Yc=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 N(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:A.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6),11:M.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)}}};var Og=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.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})}}};var Vg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.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})}}};var Ug=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:p},l.DeviceUserInterface,!0),2:k.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.ParameterController,!0),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),10:A.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})}}};var Nv=class t extends $e{static create(e){return new t(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[l.DeviceUserInterface],mandatory:!1,exclusive:!1}})}}};var jg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:p},l.ModularSetup,!0),11:Nv.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};var Kg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:A.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),12:A.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),13:I.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),14:I.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:I.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:M.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:p},{values:[0,1]},"",0)}}};var Xc=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:p},!0),11:A.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)}}};var Wg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),11:I.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!0),12:I.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),13:I.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),14:A.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:A.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:A.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:A.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:A.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:A.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:A.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:A.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),30:k.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var Lg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:A.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:A.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:A.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:A.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:A.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:I.create({parent:this,fieldKey:16,fieldName:"inverse",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),30:k.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var Zg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.create({parent:this,fieldKey:10,fieldName:"delayMusical",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",13),11:A.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),12:A.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:A.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:A.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:A.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:A.create({parent:this,fieldKey:16,fieldName:"preSyncTimeLeft",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",8),17:A.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:A.create({parent:this,fieldKey:19,fieldName:"preSyncTimeRight",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",0),20:A.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:A.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:A.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:A.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:M.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var Gg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:M.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:M.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:A.create({parent:this,fieldKey:12,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:A.create({parent:this,fieldKey:13,fieldName:"retune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),14:A.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:A.create({parent:this,fieldKey:15,fieldName:"smooth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6)}}};var Hg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),11:M.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:A.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:A.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)}}};var qg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:A.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.9999),12:A.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),13:A.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.625),14:A.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),15:A.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),16:A.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),17:A.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.005),18:A.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),19:A.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),20:A.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:A.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var Jg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:A.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:M.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",2048),13:A.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),14:A.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),15:A.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var Yg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:M.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:p},{length:3},"",0),12:A.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)}}};var Xg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",-.25),11:A.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),20:A.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:A.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","",1),22:A.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:A.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)}}};var Rp=class t extends $e{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:A.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:M.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},""),12:A.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 Cp=class t extends $e{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:A.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:A.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 uu=class t extends $e{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:A.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:A.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:A.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 Qg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Rp.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:p}),11:Cp.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:p}),12:uu.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:p}),13:uu.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:p}),14:uu.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:p}),15:Cp.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:p}),16:Rp.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:p}),17:A.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")}}};var ev=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:A.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:A.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),13:A.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:A.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:A.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var $v=class t extends $e{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:M.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:A.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:M.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:A.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 kv=class t extends $e{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:M.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:A.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:I.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),10:A.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),11:A.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),12:A.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%")}}};var Bv=class t extends $e{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:A.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:A.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:A.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:A.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 Qc=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:M.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","oct"),12:A.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","ct"),13:M.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),14:A.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:A.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:A.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:A.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:A.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),19:A.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:A.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),21:A.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),22:M.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:M.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:A.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:A.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),26:M.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:A.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),30:kv.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:p}),40:Vn.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:p},e=>$v.create(e),2),50:Bv.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:p}),99:M.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var Iv=class t extends $e{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 eu=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Iv.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:p}),11:M.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:p},{min:0,max:15},"ch"),12:M.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:p},"any","ms",10),13:L.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),14:k.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:p},l.MIDIDevice,!1)}}};var Qo=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.MIDIDevice,!0),2:L.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:M.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:p},{min:0,max:500},"ms",10),6:I.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:p},!0)}}};var cl=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 N(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:k.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:M.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:p},{min:0,max:127},"#",64),4:A.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!0,exclusive:!1}},"unipolar","%")}}};var tu=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:p},l.SoundfontFile,!1),11:M.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:p},{min:0,max:65535},"")}}};var Tv=class t extends $e{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:M.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:M.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:A.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:A.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 Dv=class t extends $e{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:A.create({parent:this,fieldKey:1,fieldName:"rate1",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),2:A.create({parent:this,fieldKey:2,fieldName:"rate2",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),3:A.create({parent:this,fieldKey:3,fieldName:"rate3",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),4:A.create({parent:this,fieldKey:4,fieldName:"rate4",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),5:A.create({parent:this,fieldKey:5,fieldName:"rate5",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),6:A.create({parent:this,fieldKey:6,fieldName:"rate6",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),7:A.create({parent:this,fieldKey:7,fieldName:"rate7",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),8:A.create({parent:this,fieldKey:8,fieldName:"rate8",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),11:A.create({parent:this,fieldKey:11,fieldName:"level1",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),12:A.create({parent:this,fieldKey:12,fieldName:"level2",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),13:A.create({parent:this,fieldKey:13,fieldName:"level3",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),14:A.create({parent:this,fieldKey:14,fieldName:"level4",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),15:A.create({parent:this,fieldKey:15,fieldName:"level5",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),16:A.create({parent:this,fieldKey:16,fieldName:"level6",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),17:A.create({parent:this,fieldKey:17,fieldName:"level7",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),18:A.create({parent:this,fieldKey:18,fieldName:"level8",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),20:M.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:p},{min:0,max:8},"",0),21:M.create({parent:this,fieldKey:21,fieldName:"end",deprecated:!1,pointerRules:p},{min:1,max:8},"",1)}}};var Rv=class t extends $e{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:M.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:A.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:A.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:A.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 ru=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:M.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:M.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:M.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:A.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:A.create({parent:this,fieldKey:15,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),16:A.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:M.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:Rv.create({parent:this,fieldKey:20,fieldName:"vibrato",deprecated:!1,pointerRules:p}),30:Vn.create({parent:this,fieldKey:30,fieldName:"lines",deprecated:!1,pointerRules:p},e=>Tv.create(e),2),40:Vn.create({parent:this,fieldKey:40,fieldName:"envelopes",deprecated:!1,pointerRules:p},e=>Dv.create(e),6)}}};var iu=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:k.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1),20:A.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)}}};var nu=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var Ea=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 N(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:k.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:p},l.Sample,!0),11:k.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),12:L.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),13:L.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),15:M.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:I.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),23:I.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:I.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),41:I.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),42:I.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),43:I.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),44:M.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:A.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:A.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),47:A.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),48:A.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:A.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:A.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:A.create({parent:this,fieldKey:51,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var au=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),11:A.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:A.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),13:A.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%")}}};var tv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:M.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:M.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:M.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:A.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:M.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:A.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","",0)}}};var rv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:M.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:A.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:M.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)}}};var iv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0)}}};var nv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.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:A.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:A.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:I.create({parent:this,fieldKey:13,fieldName:"mono",deprecated:!1,pointerRules:p},!0),14:A.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:k.create({parent:this,fieldKey:20,fieldName:"model",deprecated:!1,pointerRules:p},l.NeuralAmpModel,!1)}}};var av=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:A.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:A.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:A.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:A.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:A.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:A.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:A.create({parent:this,fieldKey:17,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),18:M.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:A.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:A.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:k.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var ov=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.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:A.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:A.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:A.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var sv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.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:L.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var Sa=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 N(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:k.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:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:A.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),5:A.create({parent:this,fieldKey:5,fieldName:"defaultValue",deprecated:!1,pointerRules:p},"any","")}}};var ul=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 N(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:k.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:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:k.create({parent:this,fieldKey:4,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1)}}};var lv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.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:L.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var ou=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.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:L.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var Cv=class t extends $e{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:M.create({parent:this,fieldKey:1,fieldName:"length",deprecated:!1,pointerRules:p},{min:1,max:64},"",16),2:Vn.create({parent:this,fieldKey:2,fieldName:"steps",deprecated:!1,pointerRules:p},e=>M.create(e,"any","",60),64)}}};var su=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:A.create({parent:this,fieldKey:11,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),12:A.create({parent:this,fieldKey:12,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:A.create({parent:this,fieldKey:13,fieldName:"envMod",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),14:A.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),15:A.create({parent:this,fieldKey:15,fieldName:"accent",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),16:A.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:M.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:M.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:Vn.create({parent:this,fieldKey:30,fieldName:"patterns",deprecated:!1,pointerRules:p},e=>Cv.create(e),16),99:M.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var lu=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1)}}};var cv=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"cells",deprecated:!1,pointerRules:{accepts:[l.CompositeCell],mandatory:!1,exclusive:!1}})}}};var uv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"composite",deprecated:!1,pointerRules:p},l.CompositeCell,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"instrument",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost],mandatory:!0,exclusive:!1}}),3:L.hook({parent:this,fieldKey:3,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),4:L.hook({parent:this,fieldKey:4,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),5:M.create({parent:this,fieldKey:5,fieldName:"index",deprecated:!1,pointerRules:p},"index","")}}};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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:A.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:A.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var cu=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"composite",deprecated:!1,pointerRules:p},l.AudioEffectCompositeCell,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),3:M.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:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:A.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:I.create({parent:this,fieldKey:41,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),42:I.create({parent:this,fieldKey:42,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),43:A.create({parent:this,fieldKey:43,fieldName:"pan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var pv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:A.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:A.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var fv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:A.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:A.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:A.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:A.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:A.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)}}};var mv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModularSetup,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!0,exclusive:!1}}),3:L.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[l.ModuleCollection],mandatory:!1,exclusive:!1}}),12:L.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})}}};var hv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ConnectionCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:p},l.VoltageConnection,!0),3:k.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:p},l.VoltageConnection,!0)}}};var nn=class t extends $e{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:k.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:M.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:p},"any","x"),4:M.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:p},"any","y"),5:I.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:p},!1),6:I.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:p},!0)}}};var gv=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 N(e.visitModularAudioInputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:nn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var vv=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 N(e.visitModularAudioOutputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:nn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var xv=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 N(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:nn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:A.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)}}};var yv=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 N(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:nn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:A.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:p},"unipolar","%")}}};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 N(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:nn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:A.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1,exclusive:!1}},"decibel","dB")}}};var mi;(function(t){t.map=e=>e===Pt.Int32||e===Pt.Boolean?Ur.None:Ur.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)?(C0(n,Yo),n.slope.setValue(r.slope)):Yo.create(e.box.graph,B.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)?(C0(r,Yo),{type:"curve",slope:r.slope.getValue()}):e.getValue()===0?Ur.None:e.getValue()===1?Ur.Linear:j("Unknown Interpolation value")}})(mi||(mi={}));var ts=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},et=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)},zp,du,Ct,Op,rs,Vp,vo=class t{constructor(e,r){this.type="value-event",zp.set(this,new Y),du.set(this,void 0),Ct.set(this,void 0),Op.set(this,void 0),rs.set(this,void 0),Vp.set(this,!1),ts(this,du,e,"f"),ts(this,Ct,r,"f"),ts(this,Op,et(this,zp,"f").own(new ng(()=>mi.read(et(this,Ct,"f").interpolation))),"f");let n=()=>{et(this,Op,"f").invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};et(this,zp,"f").ownAll(et(this,Ct,"f").subscribe(ze.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let a=this.collection.unwrap(),o=i.address.fieldKeys,s=de.equals(et(this,Ct,"f").index.address.fieldKeys,o),c=de.equals(et(this,Ct,"f").position.address.fieldKeys,o);s||c?a.requestSorting():a.onEventPropertyChanged()}}),et(this,Ct,"f").interpolation.subscribe(n),et(this,Ct,"f").interpolation.pointerHub.subscribe({onAdded:({box:i})=>{et(this,rs,"f").terminate(),ts(this,rs,i.subscribe(ze.Children,n),"f"),n()},onRemoved:()=>{et(this,rs,"f").terminate(),ts(this,rs,pe.Empty,"f"),n()}})),ts(this,rs,et(this,Ct,"f").interpolation.pointerHub.filter(l.ValueInterpolation).at(0)?.box.subscribe(ze.Children,n)??pe.Empty,"f")}onSelected(){ts(this,Vp,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){ts(this,Vp,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){et(this,rs,"f").terminate(),et(this,zp,"f").terminate()}get box(){return et(this,Ct,"f")}get uuid(){return et(this,Ct,"f").address.uuid}get address(){return et(this,Ct,"f").address}get position(){return et(this,Ct,"f").position.getValue()}get index(){return et(this,Ct,"f").index.getValue()}set interpolation(e){mi.write(et(this,Ct,"f").interpolation,e)}get interpolation(){return et(this,Op,"f").get()}get value(){return et(this,Ct,"f").value.getValue()}get isSelected(){return et(this,Vp,"f")}get collection(){return et(this,Ct,"f").events.targetVertex.map(e=>et(this,du,"f").boxAdapters.adapterFor(e.box,kr))}copyTo(e){let r=e?.position??this.position,n=e?.index??this.index,i=Kn.create(et(this,du,"f").boxGraph,B.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 mi.write(i.interpolation,e?.interpolation??this.interpolation),et(this,du,"f").boxAdapters.adapterFor(i,t)}copyFrom(e){return et(this,Ct,"f").position.setValue(e?.position??this.position),et(this,Ct,"f").index.setValue(e?.index??this.index),et(this,Ct,"f").events.refer(e?.events??this.collection.unwrap("collection").box.events),et(this,Ct,"f").value.setValue(e?.value??this.value),mi.write(et(this,Ct,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};zp=new WeakMap,du=new WeakMap,Ct=new WeakMap,Op=new WeakMap,rs=new WeakMap,Vp=new WeakMap;vo.Comparator=(t,e)=>{if(t===e)return j(`${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:j(`${t} and ${e} are identical in terms of comparison`)};var Up=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)},jp,Kp,is,an,dl,pu,xo,zv,kr=class t{constructor(e,r){jp.add(this),Kp.set(this,new Y),is.set(this,void 0),an.set(this,void 0),dl.set(this,void 0),pu.set(this,void 0),xo.set(this,void 0),Up(this,is,e,"f"),Up(this,an,r,"f"),Up(this,dl,new fe,"f"),Up(this,pu,B.newSet(i=>i.uuid),"f"),Up(this,xo,Vr.create(vo.Comparator),"f");let n=i=>{let a=Ke(i.accept({visitValueEventBox:o=>Qe(this,is,"f").boxAdapters.adapterFor(o,vo)}),`Could not find adapter for ${i}`);Qe(this,pu,"f").add(a)&&(Qe(this,xo,"f").add(a),Qe(this,jp,"m",zv).call(this))};Qe(this,an,"f").events.pointerHub.incoming().forEach(({box:i})=>n(i)),Qe(this,Kp,"f").own(Qe(this,an,"f").events.pointerHub.subscribe({onAdded:({box:i})=>n(i),onRemoved:({box:{address:{uuid:i}}})=>{Qe(this,xo,"f").remove(Qe(this,pu,"f").removeByKey(i)),Qe(this,jp,"m",zv).call(this)}})),Qe(this,Kp,"f").own(Qe(this,an,"f").owners.pointerHub.subscribe({onAdded:()=>Qe(this,dl,"f").notify(this),onRemoved:()=>Qe(this,dl,"f").notify(this)}))}valueAt(e,r){return Fg.valueAt(Qe(this,xo,"f"),e,r)}copy(){let e=Qe(this,is,"f").boxGraph,r=Wn.create(e,B.generate());return Qe(this,xo,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Qe(this,is,"f").boxAdapters.adapterFor(r,t)}cut(e,r=F.unipolar()){let n=this.events.lowerEqual(e),i=this.events.greaterEqual(e);if(i===null)return n===null?b.None:b.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n===null)return b.wrap(this.createEvent({position:e,value:i.value,index:i.index,interpolation:i.interpolation}));if(n.position===e)return b.wrap(n);if(i.position===e)return b.wrap(i);if(n.interpolation.type==="none")return b.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=fM(s,c,(e-a)/(o-a));return b.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=tr.byHalf(u,s,tr.valueAt({slope:n.interpolation.slope,steps:u,y0:s,y1:c},u*.5),c),h=tr.valueAt(v,f),y=tr.slopeByHalf(s,tr.valueAt(v,f*.5),h);return mi.write(n.box.interpolation,Ur.Curve(y)),b.wrap(this.createEvent({position:e,value:r.y(h),index:0,interpolation:Ur.Curve(tr.slopeByHalf(h,tr.valueAt(v,(f+u)*.5),c))}))}return j("Unknown interpolation type")}subscribeChange(e){return Qe(this,dl,"f").subscribe(e)}createEvent({position:e,index:r,value:n,interpolation:i}){let a=Math.trunc(e),o=Qe(this,pu,"f").values().find(c=>c.position===a&&c.index===r);if(K(o)&&o.box.isAttached())return o.box.value.setValue(n),mi.write(o.box.interpolation,i),o;let s=Kn.create(Qe(this,is,"f").boxGraph,B.generate(),c=>{c.position.setValue(e),c.index.setValue(r),c.value.setValue(n),c.events.refer(Qe(this,an,"f").events)});return mi.write(s.interpolation,i),Qe(this,is,"f").boxAdapters.adapterFor(s,vo)}requestSorting(){Qe(this,xo,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Qe(this,jp,"m",zv).call(this)}terminate(){Qe(this,Kp,"f").terminate()}get box(){return Qe(this,an,"f")}get uuid(){return Qe(this,an,"f").address.uuid}get address(){return Qe(this,an,"f").address}get numOwners(){return Qe(this,an,"f").owners.pointerHub.filter(l.ValueEventCollection).length}get events(){return Qe(this,xo,"f")}toString(){return`{ValueEventCollectionBox ${B.toString(Qe(this,an,"f").address.uuid)}}`}};Kp=new WeakMap,is=new WeakMap,an=new WeakMap,dl=new WeakMap,pu=new WeakMap,xo=new WeakMap,jp=new WeakSet,zv=function(){Qe(this,dl,"f").notify(this)};var pl=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)},fl,ns,ml,ar,hl,Zp,Wp,Lp,fu,as=class{constructor(e,r){fl.add(this),this.type="value-clip",ns.set(this,new Y),ml.set(this,void 0),ar.set(this,void 0),hl.set(this,void 0),Zp.set(this,void 0),Wp.set(this,void 0),Lp.set(this,pe.Empty),pl(this,ml,e,"f"),pl(this,ar,r,"f"),pl(this,Wp,!0,"f"),pl(this,hl,je(this,ns,"f").own(new tn(!1)),"f"),pl(this,Zp,je(this,ns,"f").own(new fe),"f"),je(this,ns,"f").own(je(this,ar,"f").pointerHub.subscribe({onAdded:()=>je(this,fl,"m",fu).call(this),onRemoved:()=>je(this,fl,"m",fu).call(this)})),je(this,ns,"f").own(je(this,ar,"f").subscribe(ze.Children,n=>je(this,fl,"m",fu).call(this))),je(this,ns,"f").own(je(this,ar,"f").events.catchupAndSubscribe(({targetVertex:n})=>{je(this,Lp,"f").terminate(),pl(this,Lp,n.match({none:()=>pe.Empty,some:({box:i})=>je(this,ml,"f").boxAdapters.adapterFor(i,kr).subscribeChange(()=>je(this,fl,"m",fu).call(this))}),"f"),je(this,fl,"m",fu).call(this)})),pl(this,Wp,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(e%this.duration,r)}catchupAndSubscribeSelected(e){return je(this,hl,"f").catchupAndSubscribe(e)}subscribeChange(e){return je(this,Zp,"f").subscribe(e)}accept(e){return N(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&je(this,ar,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:je(this,ar,"f").events.targetVertex.unwrap("events.target");Kc.create(je(this,ml,"f").boxGraph,B.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(je(this,ar,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){je(this,hl,"f").setValue(!0)}onDeselected(){je(this,hl,"f").setValue(!1)}get isSelected(){return je(this,hl,"f").getValue()}terminate(){je(this,Lp,"f").terminate(),je(this,ns,"f").terminate()}get box(){return je(this,ar,"f")}get uuid(){return je(this,ar,"f").address.uuid}get address(){return je(this,ar,"f").address}get indexField(){return je(this,ar,"f").index}get duration(){return je(this,ar,"f").duration.getValue()}get mute(){return je(this,ar,"f").mute.getValue()}get hue(){return je(this,ar,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return je(this,ar,"f").events.targetVertex.map(e=>je(this,ml,"f").boxAdapters.adapterFor(e.box,kr))}get label(){return je(this,ar,"f").label.getValue()}get trackBoxAdapter(){return je(this,Wp,"f")?b.None:je(this,ar,"f").clips.targetVertex.map(e=>je(this,ml,"f").boxAdapters.adapterFor(e.box,or))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${B.toString(je(this,ar,"f").address.uuid)} d: ${Te.toString(this.duration)}}`}};ns=new WeakMap,ml=new WeakMap,ar=new WeakMap,hl=new WeakMap,Zp=new WeakMap,Wp=new WeakMap,Lp=new WeakMap,fl=new WeakSet,fu=function(){je(this,Zp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Ov=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},on=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)},Gp,Vv,gl,qp,Hp,Uv,mu=class{constructor(e){Gp.add(this),this.type="transient-marker",Vv.set(this,new Y),gl.set(this,void 0),qp.set(this,void 0),Hp.set(this,!1),Ov(this,gl,e,"f"),Ov(this,qp,new fe,"f"),on(this,Vv,"f").own(e.subscribe(ze.Children,()=>on(this,Gp,"m",Uv).call(this)))}onSelected(){Ov(this,Hp,!0,"f"),on(this,Gp,"m",Uv).call(this)}onDeselected(){Ov(this,Hp,!1,"f"),on(this,Gp,"m",Uv).call(this)}get box(){return on(this,gl,"f")}get uuid(){return on(this,gl,"f").address.uuid}get address(){return on(this,gl,"f").address}get position(){return on(this,gl,"f").position.getValue()}get isSelected(){return on(this,Hp,"f")}subscribe(e){return on(this,qp,"f").subscribe(e)}terminate(){on(this,Vv,"f").terminate()}};Vv=new WeakMap,gl=new WeakMap,qp=new WeakMap,Hp=new WeakMap,Gp=new WeakSet,Uv=function(){on(this,qp,"f").notify()};var Jp=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)},jv,Yp,Pa,Xp,hu,Kv,Zn=class t{constructor(e,r){jv.set(this,new Y),Yp.set(this,void 0),Pa.set(this,void 0),Xp.set(this,void 0),hu.set(this,void 0),Kv.set(this,void 0),Jp(this,Yp,e,"f"),Jp(this,Pa,r,"f"),Jp(this,Xp,B.newSet(({uuid:n})=>n),"f"),Jp(this,hu,Vr.create(t.Comparator),"f"),Jp(this,Kv,Eg.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"),Br(this,jv,"f").ownAll(r.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Br(this,Yp,"f").boxAdapters.adapterFor(n.box,mu);Br(this,Xp,"f").add(i)&&Br(this,hu,"f").add(i)},onRemoved:({box:{address:{uuid:n}}})=>{Br(this,hu,"f").remove(Br(this,Xp,"f").removeByKey(n))}}))}get box(){return Br(this,Pa,"f")}get uuid(){return Br(this,Pa,"f").address.uuid}get address(){return Br(this,Pa,"f").address}get startInSeconds(){return Br(this,Pa,"f").startInSeconds.getValue()}get endInSeconds(){return Br(this,Pa,"f").endInSeconds.getValue()}get transients(){return Br(this,hu,"f")}get fileName(){return Br(this,Pa,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return Br(this,Kv,"f").call(this)}getOrCreateLoader(){return Br(this,Yp,"f").sampleManager.getOrCreate(Br(this,Pa,"f").address.uuid)}terminate(){Br(this,jv,"f").terminate()}};jv=new WeakMap,Yp=new WeakMap,Pa=new WeakMap,Xp=new WeakMap,hu=new WeakMap,Kv=new WeakMap;Zn.Comparator=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),j("Events at the same position: "+t.position+", "+e.position)):r};var Qp=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)},ef,Wv,Lv,yo,rf,tf,Zv,Ma=class{constructor(e,r){ef.add(this),this.type="warp-marker",Wv.set(this,new Y),Lv.set(this,void 0),yo.set(this,void 0),rf.set(this,void 0),tf.set(this,!1),Qp(this,Lv,e,"f"),Qp(this,yo,r,"f"),Qp(this,rf,new fe,"f"),ri(this,Wv,"f").own(r.subscribe(ze.Children,()=>ri(this,ef,"m",Zv).call(this)))}onSelected(){Qp(this,tf,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),ri(this,ef,"m",Zv).call(this)}onDeselected(){Qp(this,tf,!1,"f"),ri(this,ef,"m",Zv).call(this)}get box(){return ri(this,yo,"f")}get uuid(){return ri(this,yo,"f").address.uuid}get address(){return ri(this,yo,"f").address}get position(){return ri(this,yo,"f").position.getValue()}get seconds(){return ri(this,yo,"f").seconds.getValue()}get isSelected(){return ri(this,tf,"f")}get optWarping(){return ri(this,yo,"f").owner.targetVertex.map(e=>ri(this,Lv,"f").boxAdapters.adapterFor(e.box,Na.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return ri(this,rf,"f").subscribe(e)}terminate(){ri(this,Wv,"f").terminate()}};Wv=new WeakMap,Lv=new WeakMap,yo=new WeakMap,rf=new WeakMap,tf=new WeakMap,ef=new WeakSet,Zv=function(){ri(this,rf,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var gu=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),j("Events at the same position: "+t.position+", "+e.position)):r};var nf=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)},Gv,Hv,vl,xl,af,vu,$a=class{constructor(e,r){Gv.set(this,new Y),Hv.set(this,void 0),vl.set(this,void 0),xl.set(this,void 0),af.set(this,void 0),vu.set(this,void 0),nf(this,Hv,e,"f"),nf(this,vl,r,"f"),nf(this,xl,new fe,"f"),nf(this,af,B.newSet(({uuid:n})=>n),"f"),nf(this,vu,Vr.create(gu),"f"),jr(this,Gv,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=jr(this,Hv,"f").boxAdapters.adapterFor(n.box,Ma);jr(this,af,"f").add(i)&&(jr(this,vu,"f").add(i),jr(this,xl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{jr(this,vu,"f").remove(jr(this,af,"f").removeByKey(n)),jr(this,xl,"f").notify()}}))}get box(){return jr(this,vl,"f")}get uuid(){return jr(this,vl,"f").address.uuid}get address(){return jr(this,vl,"f").address}get warpMarkers(){return jr(this,vu,"f")}clone(){let e=Zc.create(jr(this,vl,"f").graph,B.generate());return this.warpMarkers.asArray().forEach(r=>ba.create(e.graph,B.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return jr(this,xl,"f").subscribe(e)}onChanged(){jr(this,xl,"f").notify()}terminate(){jr(this,Gv,"f").terminate()}};Gv=new WeakMap,Hv=new WeakMap,vl=new WeakMap,xl=new WeakMap,af=new WeakMap,vu=new WeakMap;var of=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)},qv,Jv,Gn,yl,sf,xu,ka=class{constructor(e,r){qv.set(this,new Y),Jv.set(this,void 0),Gn.set(this,void 0),yl.set(this,void 0),sf.set(this,void 0),xu.set(this,void 0),of(this,Jv,e,"f"),of(this,Gn,r,"f"),of(this,yl,new fe,"f"),of(this,sf,B.newSet(({uuid:n})=>n),"f"),of(this,xu,Vr.create(gu),"f"),sr(this,qv,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=sr(this,Jv,"f").boxAdapters.adapterFor(n.box,Ma);sr(this,sf,"f").add(i)&&(sr(this,xu,"f").add(i),sr(this,yl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{sr(this,xu,"f").remove(sr(this,sf,"f").removeByKey(n)),sr(this,yl,"f").notify()}}))}get box(){return sr(this,Gn,"f")}get uuid(){return sr(this,Gn,"f").address.uuid}get address(){return sr(this,Gn,"f").address}get warpMarkers(){return sr(this,xu,"f")}get playbackRate(){return sr(this,Gn,"f").playbackRate.getValue()}get cents(){return Math.log2(sr(this,Gn,"f").playbackRate.getValue())*1200}set cents(e){sr(this,Gn,"f").playbackRate.setValue(Fe(2**(e/1200),.5,2))}get transientPlayMode(){return ao(sr(this,Gn,"f").transientPlayMode.getValue(),Ng)}clone(){let e=Gc.create(sr(this,Gn,"f").graph,B.generate(),r=>{r.transientPlayMode.setValue(this.transientPlayMode),r.playbackRate.setValue(this.playbackRate),r.warpMarkers});return this.warpMarkers.asArray().forEach(r=>ba.create(e.graph,B.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return sr(this,yl,"f").subscribe(e)}onChanged(){sr(this,yl,"f").notify()}terminate(){sr(this,qv,"f").terminate()}};qv=new WeakMap,Jv=new WeakMap,Gn=new WeakMap,yl=new WeakMap,sf=new WeakMap,xu=new WeakMap;var lf=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)},Yv,Xv,sn,wl,cf,yu,Ba=class{constructor(e,r){Yv.set(this,new Y),Xv.set(this,void 0),sn.set(this,void 0),wl.set(this,void 0),cf.set(this,void 0),yu.set(this,void 0),lf(this,Xv,e,"f"),lf(this,sn,r,"f"),lf(this,wl,new fe,"f"),lf(this,cf,B.newSet(({uuid:n})=>n),"f"),lf(this,yu,Vr.create(gu),"f"),Zt(this,Yv,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Zt(this,Xv,"f").boxAdapters.adapterFor(n.box,Ma);Zt(this,cf,"f").add(i)&&(Zt(this,yu,"f").add(i),Zt(this,wl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Zt(this,yu,"f").remove(Zt(this,cf,"f").removeByKey(n)),Zt(this,wl,"f").notify()}}))}get box(){return Zt(this,sn,"f")}get uuid(){return Zt(this,sn,"f").address.uuid}get address(){return Zt(this,sn,"f").address}get warpMarkers(){return Zt(this,yu,"f")}get transpose(){return Zt(this,sn,"f").transpose.getValue()}set transpose(e){Zt(this,sn,"f").transpose.setValue(e)}get cents(){return Zt(this,sn,"f").transpose.getValue()*100}set cents(e){Zt(this,sn,"f").transpose.setValue(e/100)}clone(){let e=Hc.create(Zt(this,sn,"f").graph,B.generate());return e.transpose.setValue(Zt(this,sn,"f").transpose.getValue()),this.warpMarkers.asArray().forEach(r=>ba.create(e.graph,B.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Zt(this,wl,"f").subscribe(e)}onChanged(){Zt(this,wl,"f").notify()}terminate(){Zt(this,Yv,"f").terminate()}};Yv=new WeakMap,Xv=new WeakMap,sn=new WeakMap,wl=new WeakMap,cf=new WeakMap,yu=new WeakMap;var Na;(function(t){t.isAudioPlayMode=e=>e instanceof $a||e instanceof ka||e instanceof Ba})(Na||(Na={}));var Bi=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)},bl,wu,_l,zt,Al,Fl,uf,pf,df,os,bu,_u,Au,Fu=class{constructor(e,r){bl.add(this),this.type="audio-clip",wu.set(this,new Y),_l.set(this,void 0),zt.set(this,void 0),Al.set(this,void 0),Fl.set(this,void 0),uf.set(this,void 0),pf.set(this,void 0),df.set(this,void 0),os.set(this,b.None),bu.set(this,b.None),_u.set(this,pe.Empty),Bi(this,_l,e,"f"),Bi(this,zt,r,"f"),Bi(this,df,!0,"f"),Bi(this,Al,new Nr,"f"),Bi(this,Fl,we(this,wu,"f").own(new tn(!1)),"f"),Bi(this,uf,Xs.aware(e.tempoMap,r.timeBase,r.duration),"f"),Bi(this,pf,we(this,wu,"f").own(new fe),"f"),we(this,wu,"f").ownAll(we(this,zt,"f").pointerHub.subscribe({onAdded:()=>we(this,bl,"m",Au).call(this),onRemoved:()=>we(this,bl,"m",Au).call(this)}),we(this,zt,"f").playMode.catchupAndSubscribe(({targetVertex:n})=>{we(this,_u,"f").terminate(),n.match({none:()=>we(this,Al,"f").clear(),some:({box:i})=>{let a=we(this,_l,"f").boxAdapters.adapterFor(i,Na.isAudioPlayMode);Bi(this,_u,a.subscribe(()=>we(this,bl,"m",Au).call(this)),"f"),we(this,Al,"f").wrap(a)}})}),we(this,zt,"f").file.catchupAndSubscribe(n=>{Bi(this,os,n.targetVertex.map(i=>we(this,_l,"f").boxAdapters.adapterFor(i.box,Zn)),"f"),we(this,bu,"f").ifSome(i=>i.terminate()),Bi(this,bu,we(this,os,"f").map(i=>i.getOrCreateLoader().subscribe(()=>we(this,bl,"m",Au).call(this))),"f")}),we(this,zt,"f").subscribe(ze.Children,n=>we(this,bl,"m",Au).call(this))),Bi(this,df,!1,"f")}catchupAndSubscribeSelected(e){return we(this,Fl,"f").catchupAndSubscribe(e)}subscribeChange(e){return we(this,pf,"f").subscribe(e)}accept(e){return N(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){let r=this.observableOptPlayMode.map(n=>n.clone());Lc.create(we(this,_l,"f").boxGraph,B.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(we(this,zt,"f").clips.targetVertex.unwrap("clips.target")),n.file.refer(we(this,zt,"f").file.targetVertex.unwrap("file.target")),n.events.refer(we(this,zt,"f").events.targetVertex.unwrap("events.target")),r.ifSome(i=>n.playMode.refer(i))})}onSelected(){we(this,Fl,"f").setValue(!0)}onDeselected(){we(this,Fl,"f").setValue(!1)}get isSelected(){return we(this,Fl,"f").getValue()}get box(){return we(this,zt,"f")}get uuid(){return we(this,zt,"f").address.uuid}get address(){return we(this,zt,"f").address}get indexField(){return we(this,zt,"f").index}get duration(){return we(this,uf,"f").toPPQN(0)}set duration(e){we(this,uf,"f").fromPPQN(e,0)}get mute(){return we(this,zt,"f").mute.getValue()}get hue(){return we(this,zt,"f").hue.getValue()}get gain(){return we(this,zt,"f").gain}get file(){return we(this,os,"f").unwrap("Cannot access file.")}get optFile(){return we(this,os,"f")}get observableOptPlayMode(){return we(this,Al,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return b.None}get timeBase(){return ao(we(this,zt,"f").timeBase.getValue(),ti)}get waveformOffset(){return we(this,zt,"f").waveformOffset}get isPlayModeNoStretch(){return we(this,zt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>gt(e,$a)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>gt(e,ka)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>gt(e,Ba)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>Na.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(we(this,os,"f").isEmpty())return"No Audio File";let e=we(this,os,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):we(this,zt,"f").label.getValue()}get trackBoxAdapter(){return we(this,df,"f")?b.None:we(this,zt,"f").clips.targetVertex.map(e=>we(this,_l,"f").boxAdapters.adapterFor(e.box,or))}get isMirrowed(){return!1}get canMirror(){return!1}get canResize(){return we(this,Al,"f").nonEmpty()}terminate(){we(this,bu,"f").ifSome(e=>e.terminate()),Bi(this,bu,b.None,"f"),we(this,_u,"f").terminate(),Bi(this,_u,pe.Empty,"f"),we(this,wu,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${B.toString(we(this,zt,"f").address.uuid)} d: ${Te.toString(this.duration)}}`}};wu=new WeakMap,_l=new WeakMap,zt=new WeakMap,Al=new WeakMap,Fl=new WeakMap,uf=new WeakMap,pf=new WeakMap,df=new WeakMap,os=new WeakMap,bu=new WeakMap,_u=new WeakMap,bl=new WeakSet,Au=function(){we(this,pf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};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},Gt=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)},Eu,hr,Qv,mf,El=class t{constructor(e,r){this.type="note-event",Eu.set(this,void 0),hr.set(this,void 0),Qv.set(this,void 0),mf.set(this,!1),ff(this,Eu,e,"f"),ff(this,hr,r,"f"),ff(this,Qv,Gt(this,hr,"f").subscribe(ze.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.collection.unwrap(),a=n.address.fieldKeys,o=de.equals(Gt(this,hr,"f").pitch.address.fieldKeys,a),s=de.equals(Gt(this,hr,"f").position.address.fieldKeys,a);o||s?i.requestSorting():i.onEventPropertyChanged()}}),"f")}onSelected(){ff(this,mf,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){ff(this,mf,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Gt(this,Qv,"f").terminate()}get box(){return Gt(this,hr,"f")}get uuid(){return Gt(this,hr,"f").address.uuid}get address(){return Gt(this,hr,"f").address}get position(){return Gt(this,hr,"f").position.getValue()}get duration(){return Gt(this,hr,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return Gt(this,hr,"f").velocity.getValue()}get pitch(){return Gt(this,hr,"f").pitch.getValue()}get cent(){return Gt(this,hr,"f").cent.getValue()}get chance(){return Gt(this,hr,"f").chance.getValue()}get playCount(){return Gt(this,hr,"f").playCount.getValue()}get playCurve(){return Gt(this,hr,"f").playCurve.getValue()}get isSelected(){return Gt(this,mf,"f")}get collection(){return Gt(this,hr,"f").events.targetVertex.map(e=>Gt(this,Eu,"f").boxAdapters.adapterFor(e.box,ln))}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 Gt(this,Eu,"f").boxAdapters.adapterFor(Jo.create(Gt(this,Eu,"f").boxGraph,B.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 Oc.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,r=this.collection.unwrap("collection").box.events,n=de.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 Gt(this,hr,"f").delete(),n}};Eu=new WeakMap,hr=new WeakMap,Qv=new WeakMap,mf=new WeakMap;var Ia=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},Pe=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)},wo,hf,ss,Hn,Sl,gf,hi,tx,rx,ix,ls,ex,vf,ln=class t{constructor(e,r){wo.add(this),hf.set(this,new Y),ss.set(this,void 0),Hn.set(this,void 0),Sl.set(this,void 0),gf.set(this,void 0),hi.set(this,void 0),tx.set(this,60),rx.set(this,60),ix.set(this,0),ls.set(this,!1),Ia(this,ss,e,"f"),Ia(this,Hn,r,"f"),Ia(this,Sl,new fe,"f"),Ia(this,gf,B.newSet(n=>n.uuid),"f"),Ia(this,hi,Vr.create(Oc.Comparator),"f"),Pe(this,hf,"f").own(Pe(this,Hn,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=Pe(this,ss,"f").boxAdapters.adapterFor(n,El);Pe(this,gf,"f").add(i)&&(Pe(this,hi,"f").add(i),Pe(this,wo,"m",ex).call(this))},onRemoved:({box:{address:{uuid:n}}})=>{Pe(this,hi,"f").remove(Pe(this,gf,"f").removeByKey(n)),Pe(this,wo,"m",ex).call(this)}})),Pe(this,hf,"f").own(Pe(this,Hn,"f").owners.pointerHub.subscribe({onAdded:()=>Pe(this,Sl,"f").notify(this),onRemoved:()=>Pe(this,Sl,"f").notify(this)}))}copy(){let e=Pe(this,ss,"f").boxGraph,r=go.create(e,B.generate());return Pe(this,hi,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Pe(this,ss,"f").boxAdapters.adapterFor(r,t)}createEvent({position:e,duration:r,velocity:n,pitch:i,chance:a,playCount:o,cent:s}){return Pe(this,ss,"f").boxAdapters.adapterFor(Jo.create(Pe(this,ss,"f").boxGraph,B.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(Pe(this,Hn,"f").events)}),El)}subscribeChange(e){return Pe(this,Sl,"f").subscribe(e)}selectable(){return Pe(this,hi,"f").asArray()}selectableAt(e){for(let r of Pe(this,hi,"f").asArray())if(r.position<=e.u&&e.u<r.complete&&r.pitch===e.v)return rr.one(r);return rr.empty()}selectablesBetween(e,r){let n=[],i=Pe(this,hi,"f").asArray(),a=Pe(this,hi,"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 Pe(this,hi,"f").asArray())a.pitch===n&&a.complete>e&&a.position<r&&i.push(a);return i}requestSorting(){Pe(this,hi,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Pe(this,wo,"m",ex).call(this)}terminate(){Pe(this,hf,"f").terminate()}get box(){return Pe(this,Hn,"f")}get uuid(){return Pe(this,Hn,"f").address.uuid}get address(){return Pe(this,Hn,"f").address}get numOwners(){return Pe(this,Hn,"f").owners.pointerHub.filter(l.NoteEventCollection).length}get events(){return Pe(this,ls,"f")||Pe(this,wo,"m",vf).call(this),Pe(this,hi,"f")}get minPitch(){return Pe(this,ls,"f")||Pe(this,wo,"m",vf).call(this),Pe(this,tx,"f")}get maxPitch(){return Pe(this,ls,"f")||Pe(this,wo,"m",vf).call(this),Pe(this,rx,"f")}get maxDuration(){return Pe(this,ls,"f")||Pe(this,wo,"m",vf).call(this),Pe(this,ix,"f")}toString(){return`{NoteEventCollectionBox ${B.toString(Pe(this,Hn,"f").address.uuid)}}`}};hf=new WeakMap,ss=new WeakMap,Hn=new WeakMap,Sl=new WeakMap,gf=new WeakMap,hi=new WeakMap,tx=new WeakMap,rx=new WeakMap,ix=new WeakMap,ls=new WeakMap,wo=new WeakSet,ex=function(){Ia(this,ls,!1,"f"),Pe(this,Sl,"f").notify(this)},vf=function(){let e=127,r=0,n=0;Pe(this,hi,"f").asArray().forEach(({pitch:i,duration:a})=>{e=Math.min(e,i),r=Math.max(r,i),n=Math.max(n,a)}),Ia(this,tx,e,"f"),Ia(this,rx,r,"f"),Ia(this,ix,n,"f"),Ia(this,ls,!0,"f")};var Pl=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)},Ml,Su,Nl,lr,$l,wf,xf,yf,Pu,Mu=class{constructor(e,r){Ml.add(this),this.type="note-clip",Su.set(this,new Y),Nl.set(this,void 0),lr.set(this,void 0),$l.set(this,void 0),wf.set(this,void 0),xf.set(this,void 0),yf.set(this,pe.Empty),Pl(this,Nl,e,"f"),Pl(this,lr,r,"f"),Pl(this,xf,!0,"f"),Pl(this,$l,We(this,Su,"f").own(new tn(!1)),"f"),Pl(this,wf,We(this,Su,"f").own(new fe),"f"),We(this,Su,"f").ownAll(We(this,lr,"f").pointerHub.subscribe({onAdded:()=>We(this,Ml,"m",Pu).call(this),onRemoved:()=>We(this,Ml,"m",Pu).call(this)}),We(this,lr,"f").subscribe(ze.Children,n=>We(this,Ml,"m",Pu).call(this)),We(this,lr,"f").events.catchupAndSubscribe(({targetVertex:n})=>{We(this,yf,"f").terminate(),Pl(this,yf,n.match({none:()=>pe.Empty,some:({box:i})=>We(this,Nl,"f").boxAdapters.adapterFor(i,ln).subscribeChange(()=>We(this,Ml,"m",Pu).call(this))}),"f"),We(this,Ml,"m",Pu).call(this)})),Pl(this,xf,!1,"f")}catchupAndSubscribeSelected(e){return We(this,$l,"f").catchupAndSubscribe(e)}subscribeChange(e){return We(this,wf,"f").subscribe(e)}accept(e){return N(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&We(this,lr,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:We(this,lr,"f").events.targetVertex.unwrap("events.target");jc.create(We(this,Nl,"f").boxGraph,B.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(We(this,lr,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){We(this,$l,"f").setValue(!0)}onDeselected(){We(this,$l,"f").setValue(!1)}get isSelected(){return We(this,$l,"f").getValue()}terminate(){We(this,yf,"f").terminate(),We(this,Su,"f").terminate()}get box(){return We(this,lr,"f")}get uuid(){return We(this,lr,"f").address.uuid}get address(){return We(this,lr,"f").address}get indexField(){return We(this,lr,"f").index}get duration(){return We(this,lr,"f").duration.getValue()}get mute(){return We(this,lr,"f").mute.getValue()}get hue(){return We(this,lr,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return We(this,lr,"f").events.targetVertex.map(e=>We(this,Nl,"f").boxAdapters.adapterFor(e.box,ln))}get label(){return We(this,lr,"f").label.getValue()}get trackBoxAdapter(){return We(this,xf,"f")?b.None:We(this,lr,"f").clips.targetVertex.map(e=>We(this,Nl,"f").boxAdapters.adapterFor(e.box,or))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${B.toString(We(this,lr,"f").address.uuid)} d: ${Te.toString(this.duration)}}`}};Su=new WeakMap,Nl=new WeakMap,lr=new WeakMap,$l=new WeakMap,wf=new WeakMap,xf=new WeakMap,yf=new WeakMap,Ml=new WeakSet,Pu=function(){We(this,wf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var NM={for:(t,e)=>Ke(e.accept({visitNoteClipBox:r=>t.adapterFor(r,Mu),visitValueClipBox:r=>t.adapterFor(r,as),visitAudioClipBox:r=>t.adapterFor(r,Fu)}),"")};var nx=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},cs=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)},ax,Nu,bf,_f,ox=class{constructor(e,r){ax.set(this,void 0),Nu.set(this,void 0),bf.set(this,void 0),_f.set(this,void 0),nx(this,ax,e,"f"),nx(this,Nu,new Y,"f"),nx(this,bf,cs(this,Nu,"f").own(new fe),"f"),nx(this,_f,cs(this,Nu,"f").own(Rt.create(e.box.clips,n=>NM.for(r,n),l.ClipCollection)),"f"),cs(this,_f,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return cs(this,ax,"f")}get collection(){return cs(this,_f,"f")}dispatchChange(){cs(this,bf,"f").notify()}subscribeChanges(e){return cs(this,bf,"f").subscribe(e)}terminate(){cs(this,Nu,"f").terminate()}};ax=new WeakMap,Nu=new WeakMap,bf=new WeakMap,_f=new WeakMap;var yD=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},cn=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)},ii,sx=class{constructor(e){ii.set(this,void 0),yD(this,ii,e,"f")}get inField(){return cn(this,ii,"f").in}get outField(){return cn(this,ii,"f").out}get inSlopeField(){return cn(this,ii,"f").inSlope}get outSlopeField(){return cn(this,ii,"f").outSlope}get in(){return cn(this,ii,"f").in.getValue()}get out(){return cn(this,ii,"f").out.getValue()}get inSlope(){return cn(this,ii,"f").inSlope.getValue()}get outSlope(){return cn(this,ii,"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(){cn(this,ii,"f").in.setValue(0),cn(this,ii,"f").out.setValue(0),cn(this,ii,"f").inSlope.setValue(.75),cn(this,ii,"f").outSlope.setValue(.25)}};ii=new WeakMap;var xt=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},Q=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)},Ii,Af,un,tt,$u,ku,Bu,Ff,qn,Ef,us,Iu,Tu,Du,Ru,Cu,zu,Ou,dn,Vu=class t{constructor(e,r){Ii.add(this),this.type="audio-region",Af.set(this,void 0),un.set(this,void 0),tt.set(this,void 0),$u.set(this,void 0),ku.set(this,void 0),Bu.set(this,void 0),Ff.set(this,void 0),qn.set(this,void 0),Ef.set(this,void 0),us.set(this,b.None),Iu.set(this,pe.Empty),Tu.set(this,pe.Empty),Du.set(this,pe.Empty),Ru.set(this,pe.Empty),Cu.set(this,void 0),zu.set(this,Number.NaN),Ou.set(this,Number.NaN),xt(this,un,e,"f"),xt(this,tt,r,"f"),xt(this,Af,new Y,"f");let{timeBase:n,duration:i,loopDuration:a}=r;xt(this,$u,Xs.aware(e.tempoMap,n,i),"f"),xt(this,ku,Xs.aware(e.tempoMap,n,a),"f"),xt(this,Bu,new Nr,"f"),xt(this,Ff,new fe,"f"),xt(this,qn,new sx(r.fading),"f"),xt(this,Cu,!1,"f"),xt(this,Ef,!0,"f"),Q(this,Af,"f").ownAll(Q(this,tt,"f").pointerHub.subscribe({onAdded:()=>Q(this,Ii,"m",dn).call(this),onRemoved:()=>Q(this,Ii,"m",dn).call(this)}),Q(this,tt,"f").file.catchupAndSubscribe(o=>{xt(this,us,o.targetVertex.map(s=>Q(this,un,"f").boxAdapters.adapterFor(s.box,Zn)),"f"),Q(this,Iu,"f").terminate(),xt(this,Iu,Q(this,us,"f").mapOr(s=>s.getOrCreateLoader().subscribe(()=>Q(this,Ii,"m",dn).call(this)),pe.Empty),"f")}),Q(this,tt,"f").playMode.catchupAndSubscribe(({targetVertex:o})=>{Q(this,Tu,"f").terminate(),o.match({none:()=>Q(this,Bu,"f").clear(),some:({box:s})=>{let c=Q(this,un,"f").boxAdapters.adapterFor(s,Na.isAudioPlayMode);xt(this,Tu,c.subscribe(()=>Q(this,Ii,"m",dn).call(this)),"f"),Q(this,Bu,"f").wrap(c)}})}),Q(this,tt,"f").timeBase.catchupAndSubscribe(o=>{Q(this,Du,"f").terminate(),ao(o.getValue(),ti)===ti.Seconds&&xt(this,Du,e.tempoMap.subscribe(()=>Q(this,Ii,"m",dn).call(this)),"f")}),Q(this,tt,"f").subscribe(ze.Children,o=>{if(!this.trackBoxAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let s=this.trackBoxAdapter.unwrap();Q(this,tt,"f").position.address.equals(o.address)?(s.regions.onIndexingChanged(),Q(this,Ii,"m",dn).call(this)):Q(this,Ii,"m",dn).call(this)}}),Q(this,tt,"f").events.catchupAndSubscribe(({targetVertex:o})=>{Q(this,Ru,"f").terminate(),xt(this,Ru,o.match({none:()=>pe.Empty,some:({box:s})=>Q(this,un,"f").boxAdapters.adapterFor(s,kr).subscribeChange(()=>Q(this,Ii,"m",dn).call(this))}),"f"),Q(this,Ii,"m",dn).call(this)})),xt(this,Ef,!1,"f")}subscribeChange(e){return Q(this,Ff,"f").subscribe(e)}accept(e){return N(e.visitAudioRegionBoxAdapter,this)}onSelected(){xt(this,Cu,!0,"f"),Q(this,Ii,"m",dn).call(this)}onDeselected(){xt(this,Cu,!1,"f"),Q(this,Ii,"m",dn).call(this)}get isSelected(){return Q(this,Cu,"f")}get box(){return Q(this,tt,"f")}get uuid(){return Q(this,tt,"f").address.uuid}get address(){return Q(this,tt,"f").address}get position(){return Q(this,tt,"f").position.getValue()}get duration(){return Number.isNaN(Q(this,zu,"f"))&&xt(this,zu,Q(this,$u,"f").toPPQN(this.position),"f"),Q(this,zu,"f")}get complete(){return this.position+this.duration}get loopOffset(){return Q(this,tt,"f").loopOffset.getValue()}get loopDuration(){return Number.isNaN(Q(this,Ou,"f"))&&xt(this,Ou,Q(this,ku,"f").toPPQN(this.position),"f"),Q(this,Ou,"f")}isNoteRegion(){return!1}isAudioRegion(){return!0}isValueRegion(){return!1}resolveDuration(e){return Q(this,$u,"f").toPPQN(e)}resolveComplete(e){return e+this.resolveDuration(e)}resolveLoopDuration(e){return Q(this,ku,"f").toPPQN(e)}get offset(){return this.position-this.loopOffset}get mute(){return Q(this,tt,"f").mute.getValue()}get hue(){return Q(this,tt,"f").hue.getValue()}get gain(){return Q(this,tt,"f").gain}get fading(){return Q(this,qn,"f")}get file(){return Q(this,us,"f").unwrap("Cannot access file.")}get optFile(){return Q(this,us,"f")}get observableOptPlayMode(){return Q(this,Bu,"f")}get timeBase(){return ao(Q(this,tt,"f").timeBase.getValue(),ti)}get waveformOffset(){return Q(this,tt,"f").waveformOffset}get isPlayModeNoStretch(){return Q(this,tt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>gt(e,$a)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>gt(e,ka)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>gt(e,Ba)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>Na.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(Q(this,us,"f").isEmpty())return"No Audio File";let e=Q(this,us,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):Q(this,tt,"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 Q(this,tt,"f").regions.targetVertex.map(e=>Q(this,un,"f").boxAdapters.adapterFor(e.box,or))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Q(this,tt,"f").events.targetVertex.map(e=>Q(this,un,"f").boxAdapters.adapterFor(e.box,kr))}set position(e){Q(this,tt,"f").position.setValue(e)}set duration(e){Q(this,$u,"f").fromPPQN(e,this.position);let r=Q(this,qn,"f").in+Q(this,qn,"f").out;if(r>e){let n=e/r;Q(this,qn,"f").inField.setValue(Q(this,qn,"f").in*n),Q(this,qn,"f").outField.setValue(Q(this,qn,"f").out*n)}}set loopOffset(e){Q(this,tt,"f").loopOffset.setValue(Js(e,this.loopDuration))}set loopDuration(e){Q(this,ku,"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===ti.Seconds){let i=e>=0?Q(this,un,"f").tempoMap.intervalToSeconds(r,n):-Q(this,un,"f").tempoMap.intervalToSeconds(n,r);Q(this,tt,"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=Q(this,un,"f").boxAdapters.adapterFor(Xo.create(Q(this,un,"f").boxGraph,B.generate(),o=>{o.timeBase.setValue(Q(this,tt,"f").timeBase.getValue()),o.position.setValue(e?.position??Q(this,tt,"f").position.getValue()),o.regions.refer(e?.target??Q(this,tt,"f").regions.targetVertex.unwrap("regions.target")),o.file.refer(Q(this,tt,"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)),Q(this,qn,"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&&de.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){return b.None}terminate(){Q(this,Iu,"f").terminate(),xt(this,Iu,pe.Empty,"f"),Q(this,Du,"f").terminate(),xt(this,Du,pe.Empty,"f"),Q(this,Tu,"f").terminate(),xt(this,Tu,pe.Empty,"f"),Q(this,Ru,"f").terminate(),xt(this,Ru,pe.Empty,"f"),Q(this,Af,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${B.toString(Q(this,tt,"f").address.uuid)}}`}};Af=new WeakMap,un=new WeakMap,tt=new WeakMap,$u=new WeakMap,ku=new WeakMap,Bu=new WeakMap,Ff=new WeakMap,qn=new WeakMap,Ef=new WeakMap,us=new WeakMap,Iu=new WeakMap,Tu=new WeakMap,Du=new WeakMap,Ru=new WeakMap,Cu=new WeakMap,zu=new WeakMap,Ou=new WeakMap,Ii=new WeakSet,dn=function(){xt(this,zu,Number.NaN,"f"),xt(this,Ou,Number.NaN,"f"),!Q(this,Ef,"f")&&(Q(this,Ff,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var bo=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},ke=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)},Ta,lx,Da,yt,Mf,Sf,Uu,Pf,_o,ju=class t{constructor(e,r){Ta.add(this),this.type="note-region",lx.set(this,new Y),Da.set(this,void 0),yt.set(this,void 0),Mf.set(this,void 0),Sf.set(this,void 0),Uu.set(this,void 0),Pf.set(this,pe.Empty),bo(this,Da,e,"f"),bo(this,yt,r,"f"),bo(this,Mf,new fe,"f"),bo(this,Uu,!1,"f"),bo(this,Sf,!0,"f"),ke(this,lx,"f").ownAll(ke(this,yt,"f").pointerHub.subscribe({onAdded:()=>ke(this,Ta,"m",_o).call(this),onRemoved:()=>ke(this,Ta,"m",_o).call(this)}),ke(this,yt,"f").subscribe(ze.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();ke(this,yt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),ke(this,Ta,"m",_o).call(this)):ke(this,Ta,"m",_o).call(this)}}),ke(this,yt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{ke(this,Pf,"f").terminate(),bo(this,Pf,n.match({none:()=>pe.Empty,some:({box:i})=>ke(this,Da,"f").boxAdapters.adapterFor(i,ln).subscribeChange(()=>ke(this,Ta,"m",_o).call(this))}),"f"),ke(this,Ta,"m",_o).call(this)})),bo(this,Sf,!1,"f")}set position(e){ke(this,yt,"f").position.setValue(e)}set duration(e){ke(this,yt,"f").duration.setValue(e)}set loopOffset(e){ke(this,yt,"f").loopOffset.setValue(e)}set loopDuration(e){ke(this,yt,"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 ke(this,Mf,"f").subscribe(e)}accept(e){return N(e.visitNoteRegionBoxAdapter,this)}onSelected(){bo(this,Uu,!0,"f"),ke(this,Ta,"m",_o).call(this)}onDeselected(){bo(this,Uu,!1,"f"),ke(this,Ta,"m",_o).call(this)}get isSelected(){return ke(this,Uu,"f")}*iterateActiveNotesAt(e){let r=this.optCollection;if(r.isEmpty())return;let n=r.unwrap(),i=co.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(){ke(this,Pf,"f").terminate(),ke(this,lx,"f").terminate()}get box(){return ke(this,yt,"f")}get uuid(){return ke(this,yt,"f").address.uuid}get address(){return ke(this,yt,"f").address}get position(){return ke(this,yt,"f").position.getValue()}get duration(){return ke(this,yt,"f").duration.getValue()}get loopOffset(){return ke(this,yt,"f").loopOffset.getValue()}get loopDuration(){return ke(this,yt,"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 ke(this,yt,"f").mute.getValue()}get hue(){return ke(this,yt,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return ke(this,yt,"f").events.targetVertex.map(e=>ke(this,Da,"f").boxAdapters.adapterFor(e.box,ln))}get label(){return ke(this,yt,"f").label.getValue()}get trackBoxAdapter(){return ke(this,Sf,"f")?b.None:ke(this,yt,"f").regions.targetVertex.map(e=>ke(this,Da,"f").boxAdapters.adapterFor(e.box,or))}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 ke(this,Da,"f").boxAdapters.adapterFor(sl.create(ke(this,Da,"f").boxGraph,B.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??ke(this,yt,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let r=ke(this,Da,"f").boxGraph,n=go.create(r,B.generate());e.events.asArray().forEach(i=>i.copyTo({events:n.events})),ke(this,yt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&de.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 b.None;let r=ke(this,Da,"f").boxGraph,n=e.toSorted(Ko.Comparator),i=de.getFirst(n,"Internal error (no first)"),a=de.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,c=i.trackBoxAdapter.unwrap("trackBoxAdapter"),u=go.create(r,B.generate()),f=Array.from(c.regions.collection.iterateRange(o,s));return f.filter(v=>v.isSelected).forEach(v=>{let h=v;for(let{resultStart:y,resultEnd:_,rawStart:$}of co.locateLoops(h,h.position,h.complete)){let S=Math.floor(y-$),z=Math.floor(_-$);for(let O of h.optCollection.unwrap("optCollection").events.iterateRange(S,z))O.copyTo({position:O.position+$-i.position,events:u.events})}}),f.forEach(({box:v})=>v.delete()),b.wrap(sl.create(r,B.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 ${B.toString(ke(this,yt,"f").address.uuid)} p: ${Te.toString(this.position)}, c: ${Te.toString(this.complete)}}`}};lx=new WeakMap,Da=new WeakMap,yt=new WeakMap,Mf=new WeakMap,Sf=new WeakMap,Uu=new WeakMap,Pf=new WeakMap,Ta=new WeakSet,_o=function(){ke(this,Mf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var Ao=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},Ee=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)},Jn,Ku,Ra,wt,kf,Wu,Nf,$f,Ca,Fo=class t{constructor(e,r){Jn.add(this),this.type="value-region",Ku.set(this,new Y),Ra.set(this,void 0),wt.set(this,void 0),kf.set(this,void 0),Wu.set(this,void 0),Nf.set(this,void 0),$f.set(this,pe.Empty),Ao(this,Ra,e,"f"),Ao(this,wt,r,"f"),Ao(this,Nf,!0,"f"),Ao(this,kf,new fe,"f"),Ao(this,Wu,!1,"f"),Ee(this,Ku,"f").own(Ee(this,wt,"f").pointerHub.subscribe({onAdded:()=>Ee(this,Jn,"m",Ca).call(this),onRemoved:()=>Ee(this,Jn,"m",Ca).call(this)})),Ee(this,Ku,"f").own(Ee(this,wt,"f").subscribe(ze.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Ee(this,wt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Ee(this,Jn,"m",Ca).call(this)):Ee(this,Jn,"m",Ca).call(this)}})),Ee(this,Ku,"f").own(Ee(this,wt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ee(this,$f,"f").terminate(),Ao(this,$f,n.match({none:()=>pe.Empty,some:({box:i})=>Ee(this,Ra,"f").boxAdapters.adapterFor(i,kr).subscribeChange(()=>Ee(this,Jn,"m",Ca).call(this))}),"f"),Ee(this,Jn,"m",Ca).call(this)})),Ao(this,Nf,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(co.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(co.globalToLocal(this,this.complete),e)}subscribeChange(e){return Ee(this,kf,"f").subscribe(e)}accept(e){return N(e.visitValueRegionBoxAdapter,this)}onSelected(){Ao(this,Wu,!0,"f"),Ee(this,Jn,"m",Ca).call(this)}onDeselected(){Ao(this,Wu,!1,"f"),Ee(this,Jn,"m",Ca).call(this)}get isSelected(){return Ee(this,Wu,"f")}onValuesPropertyChanged(){Ee(this,Jn,"m",Ca).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){Ee(this,$f,"f").terminate(),Ee(this,Ku,"f").terminate()}get box(){return Ee(this,wt,"f")}get uuid(){return Ee(this,wt,"f").address.uuid}get address(){return Ee(this,wt,"f").address}get position(){return Ee(this,wt,"f").position.getValue()}get duration(){return Ee(this,wt,"f").duration.getValue()}get loopOffset(){return Ee(this,wt,"f").loopOffset.getValue()}get loopDuration(){return Ee(this,wt,"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 Ee(this,wt,"f").mute.getValue()}get hue(){return Ee(this,wt,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Ee(this,wt,"f").events.targetVertex.map(e=>Ee(this,Ra,"f").boxAdapters.adapterFor(e.box,kr))}get label(){return Ee(this,wt,"f").label.getValue()}get trackBoxAdapter(){return Ee(this,Nf,"f")?b.None:Ee(this,wt,"f").regions.targetVertex.map(e=>Ee(this,Ra,"f").boxAdapters.adapterFor(e.box,or))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}set position(e){Ee(this,wt,"f").position.setValue(e)}set duration(e){Ee(this,wt,"f").duration.setValue(e)}set loopOffset(e){Ee(this,wt,"f").loopOffset.setValue(e)}set loopDuration(e){Ee(this,wt,"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 Ee(this,Ra,"f").boxAdapters.adapterFor(ll.create(Ee(this,Ra,"f").boxGraph,B.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??Ee(this,wt,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let r=Ee(this,Ra,"f").boxGraph,n=Wn.create(r,B.generate());e.asArray().forEach(i=>i.copyTo({events:n.events})),Ee(this,wt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&de.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 b.None;let r=Ee(this,Ra,"f").boxGraph,n=e.toSorted(Ko.Comparator),i=de.getFirst(n,"Internal error (no first)"),a=de.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(_=>_.isSelected).forEach(_=>{let $=_,S=$.optCollection.unwrap("optCollection"),z=S.events;for(let{rawStart:O,regionStart:J,regionEnd:te}of co.locateLoops($,$.position,$.complete)){let me=J-O,he=te-O,be=z.greaterEqual(me);if(!K(be)||be.position!==me){let Se=z.lowerEqual(me);K(Se)&&f.push({position:J-o,value:S.valueAt(me,0),interpolation:Se.interpolation})}let ue=!1;for(let Se of z.iterateRange(me,Mr.MAX_VALUE)){let Ut=Se.position+O;if(Ut<te)f.push({position:Ut-o,value:Se.value,interpolation:Se.interpolation});else if(Ut===te){f.push({position:Ut-o,value:Se.value,interpolation:Ur.None}),ue=!0;break}else{f.push({position:te-o,value:S.valueAt(he,0),interpolation:Ur.None}),ue=!0;break}}ue||f.push({position:te-o,value:S.valueAt(he,0),interpolation:Ur.None})}});let v=[];for(let _ of f){let $=v.length>0?v[v.length-1]:void 0;K($)&&$.position===_.position&&$.value===_.value?v[v.length-1]=_:v.push(_)}let h=Wn.create(r,B.generate()),y=0;for(;y<v.length;){let _=y+1;for(;_<v.length&&v[_].position===v[y].position;)_++;let $=v[y],S=v[_-1],z=Kn.create(r,B.generate(),O=>{O.position.setValue($.position),O.index.setValue(0),O.value.setValue($.value),O.events.refer(h.events)});if(mi.write(z.interpolation,_-y>1?Ur.None:$.interpolation),_-y>1){let O=Kn.create(r,B.generate(),J=>{J.position.setValue(S.position),J.index.setValue(1),J.value.setValue(S.value),J.events.refer(h.events)});mi.write(O.interpolation,S.interpolation)}y=_}return u.forEach(({box:_})=>_.delete()),b.wrap(ll.create(r,B.generate(),_=>{_.position.setValue(o),_.duration.setValue(s-o),_.loopDuration.setValue(s-o),_.loopOffset.setValue(0),_.hue.setValue(this.hue),_.mute.setValue(this.mute),_.label.setValue(this.label),_.events.refer(h.owners),_.regions.refer(c.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${B.toString(Ee(this,wt,"f").address.uuid)} p: ${Te.toString(this.position)}, c: ${Te.toString(this.complete)}}`}};Ku=new WeakMap,Ra=new WeakMap,wt=new WeakMap,kf=new WeakMap,Wu=new WeakMap,Nf=new WeakMap,$f=new WeakMap,Jn=new WeakSet,Ca=function(){Ee(this,kf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var $M=(t,e)=>t.position-e.position,kM={for:(t,e)=>Ke(e.accept({visitNoteRegionBox:r=>t.adapterFor(r,ju),visitAudioRegionBox:r=>t.adapterFor(r,Vu),visitValueRegionBox:r=>t.adapterFor(r,Fo)}),"")};var Lu=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},cr=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)},Zu,kl,Bf,Gu,ds,Hu,cx=class{constructor(e,r){Zu.set(this,void 0),kl.set(this,void 0),Bf.set(this,void 0),Gu.set(this,void 0),ds.set(this,void 0),Hu.set(this,void 0),Lu(this,Zu,e,"f"),Lu(this,kl,new Y,"f"),Lu(this,Bf,cr(this,kl,"f").own(new fe),"f"),Lu(this,Gu,cr(this,kl,"f").own(new nr),"f"),Lu(this,ds,Ko.create($M),"f"),Lu(this,Hu,B.newSet(n=>n.uuid),"f"),cr(this,kl,"f").ownAll(cr(this,Zu,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=kM.for(r,n),a=cr(this,Hu,"f").add(i);re(a,`Cannot add ${n}`),cr(this,ds,"f").add(i);for(let o of cr(this,ds,"f").iterateRange(i.position,i.complete))if(o!==i&&o.position<i.complete&&o.complete>i.position){console.warn("[TrackRegions] Overlapping region added",{track:cr(this,Zu,"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}cr(this,Gu,"f").forEach(o=>o.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:n}}})=>{let i=cr(this,Hu,"f").removeByKey(n);cr(this,ds,"f").remove(i),cr(this,Gu,"f").forEach(a=>a.onRemoved(i)),this.dispatchChange()}},l.RegionCollection))}get trackBoxAdapter(){return cr(this,Zu,"f")}get collection(){return cr(this,ds,"f")}get adapters(){return cr(this,Hu,"f")}onIndexingChanged(){cr(this,ds,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),cr(this,Gu,"f").subscribe(e)}subscribeChanges(e){return cr(this,Bf,"f").subscribe(e)}dispatchChange(){cr(this,Bf,"f").notify()}terminate(){cr(this,kl,"f").terminate()}};Zu=new WeakMap,kl=new WeakMap,Bf=new WeakMap,Gu=new WeakMap,ds=new WeakMap,Hu=new WeakMap;var ge;(function(t){t[t.Undefined=0]="Undefined",t[t.Notes=1]="Notes",t[t.Audio=2]="Audio",t[t.Value=3]="Value"})(ge||(ge={}));(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 Oe.Waveform;case t.Notes:return Oe.Piano;case t.Value:return Oe.Automation;case t.Undefined:return Oe.AudioBus;default:return Oe.Unknown}}})(ge||(ge={}));var ux;(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&&gt(e.host,k)?e.host:j(`Could not find 'host' field in '${e?.name}'`),t.lookupLabelField=e=>K(e)&&"label"in e&&gt(e.label,T)?e.label:j(`Could not find 'label' field in '${e?.name}'`),t.lookupEnabledField=e=>K(e)&&"enabled"in e&&gt(e.enabled,I)?e.enabled:j(`Could not find 'enabled' field in '${e?.name}'`),t.lookupMinimizedField=e=>K(e)&&"minimized"in e&&gt(e.minimized,I)?e.minimized:j(`Could not find 'minimized' field in '${e?.name}'`),t.lookupIndexField=e=>K(e)&&"index"in e&&gt(e.index,M)?e.index:j(`Could not find 'index' field in '${e?.name}'`)})(ux||(ux={}));var BM;(function(t){t.toTrackType=e=>{switch(e){case"midi":return ge.Notes;case"audio":return ge.Audio;default:return j()}}})(BM||(BM={}));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 ee;(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;re(de.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})=>ux.lookupIndexField(a)).filter(a=>e.some(o=>B.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())}})(ee||(ee={}));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},Er=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)},qu,px,Yn,Bl,fx,mx=class{constructor(e,r){qu.set(this,void 0),px.set(this,new fe),Yn.set(this,void 0),Bl.set(this,void 0),fx.set(this,void 0),dx(this,qu,e,"f"),dx(this,Yn,Rt.create(e.box.tracks,n=>r.adapterFor(n,or),l.TrackCollection),"f"),dx(this,Bl,B.newSet(({uuid:n})=>n),"f"),dx(this,fx,Er(this,Yn,"f").catchupAndSubscribe({onAdd:n=>Er(this,Bl,"f").add({uuid:n.uuid,subscription:n.regions.subscribeChanges(()=>Er(this,px,"f").notify())}),onRemove:({uuid:n})=>Er(this,Bl,"f").removeByKey(n).subscription.terminate(),onReorder:n=>{}}),"f")}create(e,r,n){let i=Er(this,qu,"f").box.graph,a=Er(this,qu,"f").box.tracks;fi.create(i,B.generate(),o=>{o.index.setValue(n??Er(this,Yn,"f").getMinFreeIndex()),o.type.setValue(e),o.tracks.refer(a),o.target.refer(r)})}controls(e){return b.wrap(Er(this,Yn,"f").adapters().find(r=>r.target.targetVertex.contains(e),!1))}delete(e){let r=Er(this,Yn,"f").adapters(),n=r.indexOf(e);if(n===-1)return j(`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 Er(this,qu,"f").box}get collection(){return Er(this,Yn,"f")}values(){return Er(this,Yn,"f").adapters()}catchupAndSubscribe(e){return Er(this,Yn,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return Er(this,px,"f").subscribe(e)}terminate(){Er(this,Yn,"f").terminate(),Er(this,fx,"f").terminate(),Er(this,Bl,"f").forEach(({subscription:e})=>e.terminate()),Er(this,Bl,"f").clear()}};qu=new WeakMap,px=new WeakMap,Yn=new WeakMap,Bl=new WeakMap,fx=new WeakMap;var ie;(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"})(ie||(ie={}));var IM=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},Xn=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)},hx,Ti,Di=class{constructor(e,r){this.type="bus",this.accepts="audio",this.manualUrl=ie.AudioBus,hx.set(this,void 0),Ti.set(this,void 0),IM(this,hx,e,"f"),IM(this,Ti,r,"f")}catchupAndSubscribe(e){return e(this),Xn(this,Ti,"f").subscribe(ze.Children,()=>e(this))}get uuid(){return Xn(this,Ti,"f").address.uuid}get address(){return Xn(this,Ti,"f").address}get box(){return Xn(this,Ti,"f")}get enabledField(){return Xn(this,Ti,"f").enabled}get minimizedField(){return Xn(this,Ti,"f").minimized}get iconField(){return Xn(this,Ti,"f").icon}get labelField(){return Xn(this,Ti,"f").label}get colorField(){return Xn(this,Ti,"f").color}get iconSymbol(){return Oe.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return Xn(this,hx,"f").boxAdapters.adapterFor(Xn(this,Ti,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}toString(){return`{${this.constructor.name}}`}};hx=new WeakMap,Ti=new WeakMap;var If=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},Bt=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,Ju,Yu,Ri,Tf,gx=class{constructor(e,r){Eo.set(this,void 0),Ju.set(this,void 0),Yu.set(this,void 0),Ri.set(this,void 0),Tf.set(this,pe.Empty),If(this,Eo,new Y,"f"),If(this,Ju,Bt(this,Eo,"f").own(new fe),"f"),If(this,Yu,Bt(this,Eo,"f").own(new tn(Oe.Unknown)),"f"),If(this,Ri,Bt(this,Eo,"f").own(new Nr),"f"),Bt(this,Eo,"f").own(Bt(this,Ri,"f").subscribe(n=>{Bt(this,Tf,"f").terminate(),If(this,Tf,n.match({none:()=>(Bt(this,Ju,"f").notify(b.None),pe.Empty),some:({labelField:i,iconField:a})=>pe.many(a.catchupAndSubscribe(o=>Bt(this,Yu,"f").setValue(Oe.fromName(o.getValue()))),i.catchupAndSubscribe(o=>Bt(this,Ju,"f").notify(b.wrap(o.getValue()))))}),"f")})),Bt(this,Eo,"f").own(e.catchupAndSubscribe({onAdded:({box:n,pointerType:i})=>{if(Bt(this,Ri,"f").nonEmpty()){let o=Bt(this,Ri,"f").unwrap();j(`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 Ln?r.adapterFor(n,Di):r.adapterFor(n,ee.isInstrument);Bt(this,Ri,"f").unwrapOrNull()!==a&&Bt(this,Ri,"f").wrap(a)},onRemoved:({box:n})=>{re(Bt(this,Ri,"f").unwrap("Cannot remove").box.address.equals(n.address),"Unexpected value to remove"),Bt(this,Ri,"f").clear()}},l.InstrumentHost,l.AudioOutput))}adapter(){return Bt(this,Ri,"f")}subscribe(e){return Bt(this,Ri,"f").subscribe(e)}catchupAndSubscribe(e){return e(Bt(this,Ri,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),Bt(this,Ju,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return Bt(this,Yu,"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(Oe.toName(e)))}get icon(){return this.adapter().match({none:()=>Oe.Unknown,some:e=>Oe.fromName(e.iconField.getValue())})}get iconValue(){return Bt(this,Yu,"f")}terminate(){Bt(this,Eo,"f").terminate(),Bt(this,Tf,"f").terminate()}};Eo=new WeakMap,Ju=new WeakMap,Yu=new WeakMap,Ri=new WeakMap,Tf=new WeakMap;var TM=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},Il=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,So,oe=class{constructor(e){vx.set(this,void 0),So.set(this,void 0),TM(this,vx,e,"f"),TM(this,So,Ce.newSet(r=>r.address),"f")}terminate(){Il(this,So,"f").forEach(e=>e.terminate()),Il(this,So,"f").clear()}parameters(){return Il(this,So,"f").values()}parameterAt(e){return Il(this,So,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,r,n,i,a,o){let s=new Tl(Il(this,vx,"f"),e,r,n,i,a,o),c=Il(this,So,"f").add(s);return re(c,`Could not add adapter for ${e}`),s}removeParameter(e){return Il(this,So,"f").removeByKey(e)}};vx=new WeakMap,So=new WeakMap;var Dl=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)},Rl,pn,ps,Xu,xx,yx,Df,Qu=class{constructor(e,r){Rl.set(this,void 0),pn.set(this,void 0),ps.set(this,void 0),Xu.set(this,void 0),xx.set(this,void 0),yx.set(this,void 0),Df.set(this,pe.Empty),Dl(this,Rl,e,"f"),Dl(this,pn,r,"f"),Dl(this,ps,new Y,"f"),Dl(this,Xu,Nt(this,ps,"f").own(new fe),"f"),Nt(this,ps,"f").own(r.targetBus.catchupAndSubscribe(()=>{Nt(this,Df,"f").terminate(),Dl(this,Df,this.optTargetBus.match({none:()=>(Nt(this,Xu,"f").notify(b.None),pe.Empty),some:n=>n.catchupAndSubscribe(i=>Nt(this,Xu,"f").notify(b.wrap(i)))}),"f")})),Dl(this,xx,Nt(this,ps,"f").own(new Tl(Nt(this,Rl,"f"),Nt(this,pn,"f").sendPan,F.bipolar(),E.percent({unit:"%",fractionDigits:0}),"panning")),"f"),Dl(this,yx,Nt(this,ps,"f").own(new Tl(Nt(this,Rl,"f"),Nt(this,pn,"f").sendGain,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),Nt(this,Xu,"f").subscribe(e)}get uuid(){return Nt(this,pn,"f").address.uuid}get address(){return Nt(this,pn,"f").address}get box(){return Nt(this,pn,"f")}get indexField(){return Nt(this,pn,"f").index}get sendPan(){return Nt(this,xx,"f")}get sendGain(){return Nt(this,yx,"f")}get targetBus(){return Nt(this,Rl,"f").boxAdapters.adapterFor(Nt(this,pn,"f").targetBus.targetVertex.unwrap("no audioUnit").box,Di)}get optTargetBus(){return Nt(this,pn,"f").targetBus.targetVertex.flatMap(e=>b.wrap(e.box.accept({visitAudioBusBox:r=>Nt(this,Rl,"f").boxAdapters.adapterFor(r,Di)})))}delete(){Nt(this,pn,"f").delete()}terminate(){Nt(this,ps,"f").terminate(),Nt(this,Df,"f").terminate()}};Rl=new WeakMap,pn=new WeakMap,ps=new WeakMap,Xu=new WeakMap,xx=new WeakMap,yx=new WeakMap,Df=new WeakMap;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},za=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,bx,ed,td,Cf,_x=class{constructor(e,r){wx.set(this,void 0),bx.set(this,void 0),ed.set(this,void 0),td.set(this,void 0),Cf.set(this,pe.Empty),Rf(this,wx,e,"f"),Rf(this,bx,r,"f"),Rf(this,ed,new Y,"f"),Rf(this,td,za(this,ed,"f").own(new fe),"f"),za(this,ed,"f").own(e.catchupAndSubscribe(()=>{za(this,Cf,"f").terminate(),Rf(this,Cf,this.adapter.match({none:()=>(za(this,td,"f").notify(b.None),pe.Empty),some:n=>n.catchupAndSubscribe(i=>za(this,td,"f").notify(b.wrap(i)))}),"f")}))}subscribe(e){return za(this,td,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return za(this,wx,"f").targetVertex.flatMap(e=>b.wrap(e.box.accept({visitAudioBusBox:r=>za(this,bx,"f").adapterFor(r,Di)})))}terminate(){za(this,ed,"f").terminate(),za(this,Cf,"f").terminate()}};wx=new WeakMap,bx=new WeakMap,ed=new WeakMap,td=new WeakMap,Cf=new WeakMap;var Po=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)},Ax,DM,Oa,Ci,Ot,zl,rd,Cl,Fx,zf,Ex,Sx,RM,CM,fn=class{constructor(e,r){Ax.add(this),this.class="device-host",Oa.set(this,new Y),Ci.set(this,void 0),Ot.set(this,void 0),zl.set(this,void 0),rd.set(this,void 0),Cl.set(this,void 0),Fx.set(this,void 0),zf.set(this,void 0),Ex.set(this,void 0),Sx.set(this,void 0),Po(this,Ci,e,"f"),Po(this,Ot,r,"f"),Po(this,zl,xe(this,Oa,"f").own(new oe(xe(this,Ci,"f"))),"f"),Po(this,rd,xe(this,Oa,"f").own(new mx(this,xe(this,Ci,"f").boxAdapters)),"f"),Po(this,Cl,xe(this,Oa,"f").own(new gx(xe(this,Ot,"f").input.pointerHub,xe(this,Ci,"f").boxAdapters)),"f"),Po(this,Fx,xe(this,Oa,"f").own(Rt.create(xe(this,Ot,"f").midiEffects,n=>xe(this,Ci,"f").boxAdapters.adapterFor(n,ee.isMidiEffect),l.MIDIEffectHost)),"f"),Po(this,zf,xe(this,Oa,"f").own(Rt.create(xe(this,Ot,"f").audioEffects,n=>xe(this,Ci,"f").boxAdapters.adapterFor(n,ee.isAudioEffect),l.AudioEffectHost)),"f"),Po(this,Ex,xe(this,Oa,"f").own(Rt.create(xe(this,Ot,"f").auxSends,n=>xe(this,Ci,"f").boxAdapters.adapterFor(n,Qu),l.AuxSend)),"f"),Po(this,Sx,xe(this,Oa,"f").own(new _x(xe(this,Ot,"f").output,xe(this,Ci,"f").boxAdapters)),"f"),this.namedParameter=xe(this,Ax,"m",RM).call(this,r),xe(this,Ax,"m",CM).call(this)}get box(){return xe(this,Ot,"f")}get uuid(){return xe(this,Ot,"f").address.uuid}get address(){return xe(this,Ot,"f").address}get indexField(){return xe(this,Ot,"f").index}get type(){return xe(this,Ot,"f").type.getValue()}get captureBox(){return xe(this,Ot,"f").capture.targetVertex}get tracks(){return xe(this,rd,"f")}get input(){return xe(this,Cl,"f")}get midiEffects(){return b.wrap(xe(this,Fx,"f"))}get audioEffects(){return b.wrap(xe(this,zf,"f"))}get inputAdapter(){return xe(this,Cl,"f").adapter()}get auxSends(){return xe(this,Ex,"f")}get output(){return xe(this,Sx,"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 xe(this,Ot,"f").output.targetVertex.mapOr(e=>e.box.address.equals(xe(this,Ci,"f").rootBoxAdapter.address),!1)}get automationCollapsed(){return xe(this,Ot,"f").userInterface.automationCollapsed}get midiEffectsField(){return b.wrap(xe(this,Ot,"f").midiEffects)}get inputField(){return xe(this,Ot,"f").input}get audioEffectsField(){return b.wrap(xe(this,Ot,"f").audioEffects)}get tracksField(){return xe(this,Ot,"f").tracks}get minimizedField(){return xe(this,Cl,"f").adapter().unwrap("input.adapter").minimizedField}get isAudioUnit(){return!0}get hostsInstrument(){return!0}get label(){return xe(this,Cl,"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 xe(this,zf,"f").adapters())yield*r.labeledAudioOutputs();yield{address:this.address,label:"Channelstrip",children:()=>b.None}}indicesLimit(){let e=xe(this,Ci,"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){xe(this,Ci,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,r){xe(this,rd,"f").collection.move(e,r)}deleteTrack(e){xe(this,rd,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){xe(this,Oa,"f").terminate()}};DM=fn,Oa=new WeakMap,Ci=new WeakMap,Ot=new WeakMap,zl=new WeakMap,rd=new WeakMap,Cl=new WeakMap,Fx=new WeakMap,zf=new WeakMap,Ex=new WeakMap,Sx=new WeakMap,Ax=new WeakSet,RM=function(e){return{volume:xe(this,zl,"f").createParameter(e.volume,DM.VolumeMapper,E.decible,"Volume"),panning:xe(this,zl,"f").createParameter(e.panning,F.bipolar(),E.panning,"Panning",.5),mute:xe(this,zl,"f").createParameter(e.mute,F.bool,E.bool,"Mute"),solo:xe(this,zl,"f").createParameter(e.solo,F.bool,E.bool,"Solo")}},CM=function(){let e=this.address.toString(),r=xe(this,Ot,"f").capture.targetAddress.unwrapOrUndefined(),n=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${xe(this,Ot,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${r}`;re(this.type!==Mt.Instrument||xe(this,Ot,"f").capture.targetAddress.nonEmpty(),n)};fn.VolumeMapper=F.decibel(-96,-9,6);var id=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},Le=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,Wr,Kr,Ol,Px,Mx,Of,zM,OM,Nx,or=class{constructor(e,r){Vl.add(this),Wr.set(this,void 0),Kr.set(this,void 0),Ol.set(this,void 0),Px.set(this,void 0),Mx.set(this,void 0),Of.set(this,void 0),id(this,Wr,e,"f"),id(this,Kr,r,"f"),id(this,Ol,new Y,"f"),id(this,Of,Le(this,Ol,"f").own(new tn(-1)),"f"),id(this,Px,Le(this,Ol,"f").own(new ox(this,e.boxAdapters)),"f"),id(this,Mx,Le(this,Ol,"f").own(new cx(this,e.boxAdapters)),"f")}catchupAndSubscribePath(e){let r=[b.None,b.None],n=()=>{r.every(i=>i.nonEmpty())?e(b.wrap(r.map(i=>i.unwrap()))):e(b.None)};return pe.many(Le(this,Vl,"m",zM).call(this,i=>{r[0].equals(i)||(r[0]=i,n())}),Le(this,Vl,"m",OM).call(this,i=>{r[1].equals(i)||(r[1]=i,n())}))}get context(){return Le(this,Wr,"f")}set targetName(e){Le(this,Kr,"f").target.targetVertex.ifSome(r=>{let n=r.box;if(n instanceof Xe){Le(this,Wr,"f").boxAdapters.adapterFor(n,fn).input.adapter().ifSome(a=>a.labelField.setValue(e));return}Le(this,Wr,"f").boxAdapters.optAdapter(n).ifSome(i=>{"labelField"in i&&i.labelField instanceof T&&i.labelField.setValue(e)}),Le(this,Vl,"m",Nx).call(this,n).flatMap(i=>Le(this,Wr,"f").boxAdapters.optAdapter(i)).ifSome(i=>{"labelField"in i&&i.labelField instanceof T&&i.labelField.setValue(e)})})}get targetName(){return Le(this,Kr,"f").target.targetVertex.flatMap(e=>{let r=e.box;if(r instanceof Xe)return Le(this,Wr,"f").boxAdapters.adapterFor(r,fn).input.label;let n=Le(this,Wr,"f").boxAdapters.optAdapter(r);if(n.nonEmpty()){let a=n.unwrap();if("labelField"in a&&a.labelField instanceof T)return b.wrap(a.labelField.getValue())}let i=Le(this,Vl,"m",Nx).call(this,r).flatMap(a=>Le(this,Wr,"f").boxAdapters.optAdapter(a));if(i.nonEmpty()){let a=i.unwrap();if("labelField"in a&&a.labelField instanceof T)return b.wrap(a.labelField.getValue())}return b.wrap(r.name)})}terminate(){Le(this,Ol,"f").terminate()}get audioUnit(){return Re(Le(this,Kr,"f").tracks.targetVertex.unwrap("track has no audioUnit").box,Xe)}get target(){return Le(this,Kr,"f").target}get clips(){return Le(this,Px,"f")}get regions(){return Le(this,Mx,"f")}get enabled(){return Le(this,Kr,"f").enabled}get indexField(){return Le(this,Kr,"f").index}get type(){return Le(this,Kr,"f").type.getValue()}get box(){return Le(this,Kr,"f")}get uuid(){return Le(this,Kr,"f").address.uuid}get address(){return Le(this,Kr,"f").address}get listIndex(){return Le(this,Of,"f").getValue()}set listIndex(e){Le(this,Of,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===ge.Audio;case"note-clip":return this.type===ge.Notes;case"value-clip":return this.type===ge.Value;case"audio-region":return this.type===ge.Audio;case"note-region":return this.type===ge.Notes;case"value-region":return this.type===ge.Value}}valueAt(e,r){if(!this.enabled.getValue())return r;let n=r,i=Le(this,Wr,"f").clipSequencing.iterate(this.uuid,e,e+wM);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 gt(c,Fo)?c.incomingValue(r):r}else if(gt(s,Fo))return e<s.complete?s.valueAt(e,r):s.outgoingValue(r);return r},some:s=>o===e&&gt(s,as)&&!s.mute?s.valueAt(e,r):r});return n}get targetControlName(){return this.type!==ge.Value?b.None:Le(this,Kr,"f").target.targetVertex.flatMap(e=>e.isField()?Le(this,Wr,"f").parameterFieldAdapters.opt(e.address).map(r=>r.name):e.isBox()?b.wrap(e.name):j("Illegal State. Vertex is not a field nor box."))}};Wr=new WeakMap,Kr=new WeakMap,Ol=new WeakMap,Px=new WeakMap,Mx=new WeakMap,Of=new WeakMap,Vl=new WeakSet,zM=function(e){let r=Le(this,Kr,"f").target.targetVertex;if(r.nonEmpty()){let n=r.unwrap().box;if(n instanceof Xe)return Le(this,Wr,"f").boxAdapters.adapterFor(n,fn).input.catchupAndSubscribeLabelChange(s=>e(s));let i=Le(this,Wr,"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(b.wrap(s.getValue())))}let a=Le(this,Vl,"m",Nx).call(this,n).flatMap(o=>Le(this,Wr,"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(b.wrap(s.getValue())))}return e(b.wrap(n.name)),pe.Empty}return e(b.None),pe.Empty},OM=function(e){let r=this.type;switch(r){case ge.Audio:case ge.Notes:return e(b.wrap(ge[r])),pe.Empty;case ge.Value:{let n=Le(this,Kr,"f").target.targetVertex.flatMap(i=>i.isField()?Le(this,Wr,"f").parameterFieldAdapters.opt(i.address):b.None);return n.isEmpty()?(e(this.targetControlName),pe.Empty):n.unwrap().catchupAndSubscribeName(i=>e(b.wrap(i)))}case ge.Undefined:return e(b.wrap("")),pe.Empty;default:return e(b.None),pe.Empty}},Nx=function(e){for(let[r]of e.outgoingEdges())if(r.pointerType===l.Parameter)return r.targetVertex.map(n=>n.box);return b.None};var Ht=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},ve=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)},zi,Oi,Vf,$x,kx,Ul,Mo,fs,ms,hs,gs,jl,vs,Uf,VM=[l.Automation,l.Modulation,l.MIDIControl,l.ParameterController],Tl=class{constructor(e,r,n,i,a,o,s){zi.set(this,void 0),Oi.set(this,void 0),Vf.set(this,void 0),$x.set(this,void 0),kx.set(this,void 0),Ul.set(this,new Y),Mo.set(this,void 0),fs.set(this,void 0),ms.set(this,void 0),hs.set(this,void 0),gs.set(this,b.None),jl.set(this,b.None),vs.set(this,null),Uf.set(this,!1),Ht(this,zi,e,"f"),Ht(this,Oi,r,"f"),Ht(this,ms,n,"f"),Ht(this,hs,i,"f"),Ht(this,Vf,typeof a=="string"?dg.seal(a):a,"f"),Ht(this,$x,o??0,"f"),Ht(this,kx,b.wrap(s),"f"),ve(this,Ul,"f").own(ve(this,zi,"f").parameterFieldAdapters.register(this)),Ht(this,Mo,ve(this,Ul,"f").own(new fe),"f"),Ht(this,fs,new nr,"f"),ve(this,Ul,"f").own(ve(this,Oi,"f").subscribe(()=>ve(this,Mo,"f").notify(this))),ve(this,Ul,"f").own(ve(this,Oi,"f").pointerHub.catchupAndSubscribe({onAdded:c=>{ve(this,fs,"f").proxy.onControlSourceAdd(i_(c.pointerType)),c.box.accept({visitTrackBox:u=>{re(ve(this,gs,"f").isEmpty(),"Already assigned");let f=ve(this,zi,"f").boxAdapters.adapterFor(u,or);Ht(this,gs,b.wrap(f),"f"),ve(this,zi,"f").isMainThread&&Ht(this,jl,b.wrap(ve(this,zi,"f").liveStreamReceiver.subscribeFloat(ve(this,Oi,"f").address,v=>{if(isNaN(v)){if(en(ve(this,vs,"f")))return;Ht(this,vs,null,"f"),ve(this,Mo,"f").notify(this);return}ve(this,vs,"f")!==v&&(Ht(this,vs,v,"f"),ve(this,Mo,"f").notify(this))})),"f")}})},onRemoved:c=>{ve(this,fs,"f").proxy.onControlSourceRemove(i_(c.pointerType)),c.box.accept({visitTrackBox:u=>{re(ve(this,gs,"f").unwrapOrNull()?.address?.equals(u.address)===!0,`Unknown ${u}`),Ht(this,gs,b.None,"f"),ve(this,zi,"f").isMainThread&&(ve(this,jl,"f").ifSome(f=>f.terminate()),Ht(this,jl,b.None,"f"),Ht(this,vs,null,"f"),ve(this,Mo,"f").notify(this))}})}},...VM)),r.getValue(),n.clamp(r.getValue())}registerMidiControl(){return ve(this,fs,"f").proxy.onControlSourceAdd("midi"),Ht(this,Uf,!0,"f"),{terminate:()=>{Ht(this,Uf,!1,"f"),ve(this,fs,"f").proxy.onControlSourceRemove("midi")}}}get field(){return ve(this,Oi,"f")}get valueMapping(){return ve(this,ms,"f")}get stringMapping(){return ve(this,hs,"f")}get name(){return ve(this,Vf,"f").getValue()}get anchor(){return ve(this,$x,"f")}get type(){return ve(this,Oi,"f").type}get address(){return ve(this,Oi,"f").address}get track(){return ve(this,gs,"f")}catchupAndSubscribeName(e){return ve(this,Vf,"f").catchupAndSubscribe(r=>e(r.getValue()))}registerTracks(e){return ve(this,zi,"f").parameterFieldAdapters.registerTracks(this.address,e)}touchStart(){ve(this,zi,"f").parameterFieldAdapters.touchStart(this.address),ve(this,zi,"f").parameterFieldAdapters.notifyWrite(this,this.getUnitValue())}touchEnd(){ve(this,zi,"f").parameterFieldAdapters.touchEnd(this.address)}updateMappings(e,r){Ht(this,ms,e,"f"),Ht(this,hs,r,"f"),ve(this,Mo,"f").notify(this)}valueAt(e){let r=ve(this,gs,"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 ve(this,Mo,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return ve(this,Uf,"f")&&e.onControlSourceAdd("midi"),ve(this,Oi,"f").pointerHub.filter(...VM).forEach(r=>e.onControlSourceAdd(i_(r.pointerType))),ve(this,fs,"f").subscribe(e)}getValue(){return ve(this,Oi,"f").getValue()}setValue(e){if(e===this.getValue())return;let r=this.getUnitValue();ve(this,Oi,"f").setValue(e),ve(this,zi,"f").parameterFieldAdapters.notifyWrite(this,r)}setUnitValue(e){this.setValue(ve(this,ms,"f").y(e))}getUnitValue(){return ve(this,ms,"f").x(this.getValue())}getControlledValue(){return ve(this,ms,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return ve(this,vs,"f")??this.getUnitValue()}getControlledPrintValue(){return ve(this,hs,"f").x(this.getControlledValue())}getPrintValue(){return ve(this,hs,"f").x(this.getValue())}setPrintValue(e){let r=ve(this,hs,"f").y(e);r.type==="unitValue"?this.setUnitValue(Fe(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(ve(this,kx,"f").unwrapOrElse(ve(this,Oi,"f").initValue))}terminate(){ve(this,jl,"f").ifSome(e=>e.terminate()),Ht(this,jl,b.None,"f"),ve(this,Ul,"f").terminate()}};zi=new WeakMap,Oi=new WeakMap,Vf=new WeakMap,$x=new WeakMap,kx=new WeakMap,Ul=new WeakMap,Mo=new WeakMap,fs=new WeakMap,ms=new WeakMap,hs=new WeakMap,gs=new WeakMap,jl=new WeakMap,vs=new WeakMap,Uf=new WeakMap;var i_=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 j(`${t.toString()} is an unknown pointer type`)}};var Bx={min:400,max:480,default:440};var n_=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},Qn=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)},No,Kl,Ix,Tx=class{constructor(e,r,n){No.set(this,void 0),Kl.set(this,void 0),Ix.set(this,void 0),n_(this,No,B.newSet(i=>i.uuid),"f"),n_(this,Kl,new nr,"f"),n_(this,Ix,e.catchupAndSubscribe({onAdded:i=>{let a=r(i.box),o=Qn(this,No,"f").add(a);re(o,`Could not add ${a}`),Qn(this,Kl,"f").proxy.onAdd(a)},onRemoved:i=>{let a=i.box.address.uuid;Qn(this,Kl,"f").proxy.onRemove(Qn(this,No,"f").removeByKey(a))}},n),"f")}subscribe(e){return Qn(this,Kl,"f").subscribe(e)}catchupAndSubscribe(e){return Qn(this,No,"f").forEach(r=>e.onAdd(r)),this.subscribe(e)}adapters(){return Qn(this,No,"f").values()}size(){return Qn(this,No,"f").size()}isEmpty(){return this.size()===0}terminate(){Qn(this,No,"f").clear(),Qn(this,Kl,"f").terminate(),Qn(this,Ix,"f").terminate()}};No=new WeakMap,Kl=new WeakMap,Ix=new WeakMap;var a_=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},bt=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)},o_,gi,jf,mn,Ir,UM,ea=class{constructor(e,r){o_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Delay,jf.set(this,void 0),mn.set(this,void 0),Ir.set(this,void 0),a_(this,jf,e,"f"),a_(this,mn,r,"f"),a_(this,Ir,new oe(bt(this,jf,"f")),"f"),this.namedParameter=bt(this,o_,"m",UM).call(this,r)}get box(){return bt(this,mn,"f")}get uuid(){return bt(this,mn,"f").address.uuid}get address(){return bt(this,mn,"f").address}get indexField(){return bt(this,mn,"f").index}get labelField(){return bt(this,mn,"f").label}get enabledField(){return bt(this,mn,"f").enabled}get minimizedField(){return bt(this,mn,"f").minimized}get host(){return bt(this,mn,"f").host}deviceHost(){return bt(this,jf,"f").boxAdapters.adapterFor(bt(this,mn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){bt(this,Ir,"f").terminate()}};gi=ea,jf=new WeakMap,mn=new WeakMap,Ir=new WeakMap,o_=new WeakSet,UM=function(e){return{preSyncTimeLeft:bt(this,Ir,"f").createParameter(e.preSyncTimeLeft,F.linearInteger(0,gi.Fractions.length-1),gi.FractionsStringMapping,"Pre Sync L"),preMillisTimeLeft:bt(this,Ir,"f").createParameter(e.preMillisTimeLeft,F.powerByCenter(100,0,gi.MAX_MILLIS_TIME),E.numeric({unit:"ms",fractionDigits:1}),"Pre MS L"),preSyncTimeRight:bt(this,Ir,"f").createParameter(e.preSyncTimeRight,F.linearInteger(0,gi.Fractions.length-1),gi.FractionsStringMapping,"Pre Sync R"),preMillisTimeRight:bt(this,Ir,"f").createParameter(e.preMillisTimeRight,F.powerByCenter(100,0,gi.MAX_MILLIS_TIME),E.numeric({unit:"ms",fractionDigits:1}),"Pre MS R"),delay:bt(this,Ir,"f").createParameter(e.delayMusical,F.linearInteger(0,gi.Fractions.length-1),gi.FractionsStringMapping,"Delay"),millisTime:bt(this,Ir,"f").createParameter(e.delayMillis,F.powerByCenter(100,0,gi.MAX_MILLIS_TIME),E.numeric({unit:"ms",fractionDigits:1}),"MS"),feedback:bt(this,Ir,"f").createParameter(e.feedback,F.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"Feedback"),cross:bt(this,Ir,"f").createParameter(e.cross,F.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"Cross"),lfoSpeed:bt(this,Ir,"f").createParameter(e.lfoSpeed,F.exponential(gi.LFO_SPEED_MIN,gi.LFO_SPEED_MAX),E.numeric({unit:"Hz",fractionDigits:2}),"LFO Speed"),lfoDepth:bt(this,Ir,"f").createParameter(e.lfoDepth,F.power(4,0,gi.LFO_DEPTH_MAX),E.numeric({unit:"ms",fractionDigits:1}),"LFO Depth"),filter:bt(this,Ir,"f").createParameter(e.filter,F.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"Filter",.5),dry:bt(this,Ir,"f").createParameter(e.dry,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Dry"),wet:bt(this,Ir,"f").createParameter(e.wet,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Wet")}};ea.Fractions=Wo.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();ea.FractionsStringMapping=E.indices("",gi.Fractions.map(([t,e])=>t===0?"Off":`${t}/${e}`));ea.MAX_MILLIS_TIME=1e3;ea.LFO_SPEED_MIN=.1;ea.LFO_SPEED_MAX=5;ea.LFO_DEPTH_MAX=50;var s_=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)},l_,Kf,hn,Va,jM,Dx=class{constructor(e,r){l_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Reverb,Kf.set(this,void 0),hn.set(this,void 0),Va.set(this,void 0),s_(this,Kf,e,"f"),s_(this,hn,r,"f"),s_(this,Va,new oe(gr(this,Kf,"f")),"f"),this.namedParameter=gr(this,l_,"m",jM).call(this,r)}get box(){return gr(this,hn,"f")}get uuid(){return gr(this,hn,"f").address.uuid}get address(){return gr(this,hn,"f").address}get indexField(){return gr(this,hn,"f").index}get labelField(){return gr(this,hn,"f").label}get enabledField(){return gr(this,hn,"f").enabled}get minimizedField(){return gr(this,hn,"f").minimized}get host(){return gr(this,hn,"f").host}deviceHost(){return gr(this,Kf,"f").boxAdapters.adapterFor(gr(this,hn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){gr(this,Va,"f").terminate()}};Kf=new WeakMap,hn=new WeakMap,Va=new WeakMap,l_=new WeakSet,jM=function(e){return{decay:gr(this,Va,"f").createParameter(e.decay,F.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:gr(this,Va,"f").createParameter(e.preDelay,F.exponential(.001,.5),E.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:gr(this,Va,"f").createParameter(e.damp,F.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"Damping"),filter:gr(this,Va,"f").createParameter(e.filter,F.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"Filter"),dry:gr(this,Va,"f").createParameter(e.dry,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Dry"),wet:gr(this,Va,"f").createParameter(e.wet,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Wet")}};var c_=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)},d_,Wf,Vi,ta,LM,Rx=class{constructor(e,r){d_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Revamp,Wf.set(this,void 0),Vi.set(this,void 0),ta.set(this,void 0),c_(this,Wf,e,"f"),c_(this,Vi,r,"f"),c_(this,ta,new oe(qt(this,Wf,"f")),"f"),this.namedParameter=qt(this,d_,"m",LM).call(this,r)}get box(){return qt(this,Vi,"f")}get uuid(){return qt(this,Vi,"f").address.uuid}get address(){return qt(this,Vi,"f").address}get indexField(){return qt(this,Vi,"f").index}get labelField(){return qt(this,Vi,"f").label}get enabledField(){return qt(this,Vi,"f").enabled}get minimizedField(){return qt(this,Vi,"f").minimized}get host(){return qt(this,Vi,"f").host}get spectrum(){return qt(this,Vi,"f").address.append(4095)}deviceHost(){return qt(this,Wf,"f").boxAdapters.adapterFor(qt(this,Vi,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){qt(this,ta,"f").terminate()}};Wf=new WeakMap,Vi=new WeakMap,ta=new WeakMap,d_=new WeakSet,LM=function(e){return{highPass:KM(qt(this,ta,"f"),e.highPass,"High-Pass"),lowShelf:WM(qt(this,ta,"f"),e.lowShelf,"Low-Shelf"),lowBell:u_(qt(this,ta,"f"),e.lowBell,"Low-Bell"),midBell:u_(qt(this,ta,"f"),e.midBell,"Mid-Bell"),highBell:u_(qt(this,ta,"f"),e.highBell,"High-Bell"),highShelf:WM(qt(this,ta,"f"),e.highShelf,"High-Shelf"),lowPass:KM(qt(this,ta,"f"),e.lowPass,"Low-Pass")}};var p_=F.exponential(20,2e4),ZM=F.linear(-24,24),GM=F.exponential(.01,10),KM=(t,e,r)=>({enabled:t.createParameter(e.enabled,F.bool,E.bool,"Enabled"),frequency:t.createParameter(e.frequency,p_,E.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),order:t.createParameter(e.order,F.linearInteger(0,3),E.indices("db",["12","24","36","48"]),`${r} Order`),q:t.createParameter(e.q,GM,E.numeric({fractionDigits:3}),`${r} Q`)}),WM=(t,e,r)=>({enabled:t.createParameter(e.enabled,F.bool,E.bool,"Enabled"),frequency:t.createParameter(e.frequency,p_,E.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,ZM,E.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5)}),u_=(t,e,r)=>({enabled:t.createParameter(e.enabled,F.bool,E.bool,"Enabled"),frequency:t.createParameter(e.frequency,p_,E.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,ZM,E.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5),q:t.createParameter(e.q,GM,E.numeric({fractionDigits:3}),`${r} Q`)});var HM=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},vi=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)},Cx,zx,xi,xs=class{constructor(e,r){this.type="marker-event",Cx.set(this,new Y),zx.set(this,void 0),xi.set(this,void 0),HM(this,zx,e,"f"),HM(this,xi,r,"f"),vi(this,Cx,"f").own(vi(this,xi,"f").subscribe(ze.Children,n=>{if(!this.trackAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackAdapter.unwrap();vi(this,xi,"f").position.address.equals(n.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return vi(this,xi,"f")}get uuid(){return vi(this,xi,"f").address.uuid}get address(){return vi(this,xi,"f").address}get position(){return vi(this,xi,"f").position.getValue()}get plays(){return vi(this,xi,"f").plays.getValue()}get hue(){return vi(this,xi,"f").hue.getValue()}get label(){return vi(this,xi,"f").label.getValue()}get trackAdapter(){return vi(this,xi,"f").track.targetVertex.map(e=>vi(this,zx,"f").boxAdapters.adapterFor(e.box,Ua).markerTrack)}terminate(){vi(this,Cx,"f").terminate()}toString(){return`{MarkerBoxAdapter ${B.toString(vi(this,xi,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};Cx=new WeakMap,zx=new WeakMap,xi=new WeakMap;xs.Comparator=(t,e)=>t.position-e.position;var Lf=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},gn=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)},Zf,nd,Gf,Wl,Ox,Vx=class{constructor(e,r){Zf.set(this,void 0),nd.set(this,void 0),Gf.set(this,void 0),Wl.set(this,void 0),Ox.set(this,void 0),Lf(this,Zf,e,"f"),Lf(this,nd,r,"f"),this.changeNotifier=new fe,Lf(this,Gf,B.newSet(n=>n.uuid),"f"),Lf(this,Wl,Vr.create(xs.Comparator),"f"),Lf(this,Ox,gn(this,nd,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{if(n instanceof qc){let i=gn(this,Zf,"f").boxAdapters.adapterFor(n,xs),a=gn(this,Gf,"f").add(i);re(a,"Could not add adapter"),gn(this,Wl,"f").add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:n}}})=>{gn(this,Wl,"f").remove(gn(this,Gf,"f").removeByKey(n)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return gn(this,Zf,"f")}get enabled(){return gn(this,nd,"f").enabled.getValue()}get events(){return gn(this,Wl,"f")}get object(){return gn(this,nd,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){gn(this,Wl,"f").onIndexingChanged(),this.dispatchChange()}terminate(){gn(this,Ox,"f").terminate()}};Zf=new WeakMap,nd=new WeakMap,Gf=new WeakMap,Wl=new WeakMap,Ox=new WeakMap;var qM=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},Ui=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,jx,ji,Ll=class{constructor(e,r){this.type="signature-event",Ux.set(this,new Y),jx.set(this,void 0),ji.set(this,void 0),qM(this,jx,e,"f"),qM(this,ji,r,"f"),Ui(this,Ux,"f").own(Ui(this,ji,"f").subscribe(ze.Children,n=>this.trackAdapter.ifSome(i=>i.dispatchChange())))}get box(){return Ui(this,ji,"f")}get uuid(){return Ui(this,ji,"f").address.uuid}get address(){return Ui(this,ji,"f").address}get index(){return Ui(this,ji,"f").index.getValue()}get indexField(){return Ui(this,ji,"f").index}get relativePosition(){return Ui(this,ji,"f").relativePosition.getValue()}get nominator(){return Ui(this,ji,"f").nominator.getValue()}get denominator(){return Ui(this,ji,"f").denominator.getValue()}get trackAdapter(){return Ui(this,ji,"f").events.targetVertex.map(e=>Ui(this,jx,"f").boxAdapters.adapterFor(e.box,Ua).signatureTrack)}terminate(){Ui(this,Ux,"f").terminate()}toString(){return`{SignatureEventBoxAdapter ${this.nominator}/${this.denominator}}`}};Ux=new WeakMap,jx=new WeakMap,ji=new WeakMap;Ll.Comparator=(t,e)=>t.index-e.index;var Kx=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)},ys,Hf,qf,Zl,$o,ws,JM,ad,Wx=class{constructor(e,r,n){ys.add(this),Hf.set(this,new Y),qf.set(this,void 0),Zl.set(this,void 0),$o.set(this,void 0),ws.set(this,void 0),Kx(this,qf,e,"f"),Kx(this,Zl,r,"f"),Kx(this,$o,n,"f"),this.changeNotifier=new fe,Kx(this,ws,_t(this,Hf,"f").own(Rt.create(_t(this,$o,"f").events,i=>e.boxAdapters.adapterFor(i,Ll),l.SignatureAutomation)),"f"),_t(this,Hf,"f").ownAll(_t(this,Zl,"f").subscribe(()=>this.dispatchChange()),_t(this,$o,"f").enabled.subscribe(()=>this.dispatchChange()),_t(this,ws,"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 _t(this,qf,"f")}get enabled(){return _t(this,$o,"f").enabled.getValue()}get object(){return _t(this,$o,"f")}get size(){return _t(this,ws,"f").size()}get storageSignature(){let{nominator:e,denominator:r}=_t(this,Zl,"f");return[e.getValue(),r.getValue()]}nonEmpty(){return _t(this,ws,"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},!!_t(this,$o,"f").enabled.getValue())for(let a of _t(this,ws,"f").adapters())e+=Te.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);_t(this,Zl,"f").nominator.setValue(e),_t(this,Zl,"f").denominator.setValue(r);let a=0,o=0,s=Te.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 h=(i[c]-a)/s,y=Math.floor(h),_=h-y;o+=_;let $=y;o>=1&&($++,o--),$=Math.max(1,$),f.unwrap().box.relativePosition.setValue($),a+=$*s,s=Te.fromSignature(u.nominator,u.denominator)}}deleteAdapter(e){let r=e.index,n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(y=>y.index===r);if(i===-1)return;let a=n.slice(i+1),o=a.map(y=>y.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,h=Te.fromSignature(c,u);for(let y=0;y<a.length;y++){let _=a[y],$=this.adapterAt(_.index);if($.isEmpty())continue;let z=(o[y]-v)/h,O=Math.max(1,Math.round(z));$.unwrap().box.relativePosition.setValue(O),v+=O*h,h=Te.fromSignature(_.nominator,_.denominator)}}createEvent(e,r,n){let i=Array.from(this.iterateAll()),a=i[0],o=0;for(let $=1;$<i.length&&!(i[$].accumulatedPpqn>e);$++)a=i[$],o=$;let s=Te.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),h=a.accumulatedPpqn+u*s,y=Te.fromSignature(r,n),_=v.map($=>({event:$,adapter:this.adapterAt($.index)})).filter(({adapter:$})=>$.nonEmpty()).map(({event:$,adapter:S})=>({event:$,adapter:S.unwrap()}));for(let $=0;$<_.length;$++){let{event:S,adapter:z}=_[$];if(z.box.index.setValue(S.index+1),$===0){let O=(S.accumulatedPpqn-h)/y;z.box.relativePosition.setValue(Math.max(1,Math.round(O)))}}Wc.create(_t(this,qf,"f").boxGraph,B.generate(),$=>{$.index.setValue(f),$.relativePosition.setValue(u),$.nominator.setValue(r),$.denominator.setValue(n),$.events.refer(_t(this,$o,"f").events)})}adapterAt(e){return _t(this,ws,"f").getAdapterByIndex(e)}moveEvent(e,r){let n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(h=>h.index===e.index);if(i===-1)return;let a=n[i];if(r===a.accumulatedPpqn)return;let o=n.map(h=>h.accumulatedBars),s=_t(this,ys,"m",JM).call(this,r,a.index);if(s===a.accumulatedBars)return;let c=[...o];c[i]=s;let u=c.map((h,y)=>({bar:h,i:y})).sort((h,y)=>h.bar-y.bar).map(h=>h.i),f=n.map(h=>this.adapterAt(h.index).unwrap("adapterAt"));for(let h=0;h<u.length;h++)f[u[h]].box.index.setValue(h);let v=0;for(let h=0;h<u.length;h++){let y=u[h],_=f[y],$=c[y],S=Math.max(1,$-v);_.box.relativePosition.setValue(S),v=$}}floorToBar(e){let{event:r,barPpqn:n}=_t(this,ys,"m",ad).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}ceilToBar(e){let{event:r,barPpqn:n}=_t(this,ys,"m",ad).call(this,e),i=Math.ceil((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}roundToBar(e){let{event:r,barPpqn:n}=_t(this,ys,"m",ad).call(this,e),i=Math.round((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}toParts(e){let{event:r}=_t(this,ys,"m",ad).call(this,e),n=Te.toParts(e-r.accumulatedPpqn,r.nominator,r.denominator);return{...n,bars:n.bars+r.accumulatedBars}}barLengthAt(e){let[r,n]=this.signatureAt(e);return Te.fromSignature(r,n)}getBarInterval(e){let{event:r,barPpqn:n}=_t(this,ys,"m",ad).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n),a=r.accumulatedPpqn+i*n;return{position:a,complete:a+n}}terminate(){_t(this,Hf,"f").terminate()}};Hf=new WeakMap,qf=new WeakMap,Zl=new WeakMap,$o=new WeakMap,ws=new WeakMap,ys=new WeakSet,JM=function(e,r){let n=null;for(let o of this.iterateAll())if(o.index!==r){if(o.accumulatedPpqn>e)break;n=o}if(en(n)){let[o,s]=this.storageSignature,c=Te.fromSignature(o,s);return Math.max(1,Math.round(e/c))}let i=Te.fromSignature(n.nominator,n.denominator),a=Math.round((e-n.accumulatedPpqn)/i);return Math.max(1,n.accumulatedBars+a)},ad=function(e){let r=null;for(let n of this.iterateAll()){if(n.accumulatedPpqn>e)break;r=n}if(en(r)){let[n,i]=this.storageSignature;return{event:{index:-1,accumulatedPpqn:0,accumulatedBars:0,nominator:n,denominator:i},barPpqn:Te.fromSignature(n,i)}}return{event:r,barPpqn:Te.fromSignature(r.nominator,r.denominator)}};var Jf=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},jt=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)},Yf,ja,Lx,Zx,ko,Xf,Gx,Ua=class{constructor(e,r){Yf.set(this,new Y),ja.set(this,void 0),Lx.set(this,void 0),Zx.set(this,void 0),ko.set(this,void 0),Xf.set(this,void 0),Gx.set(this,()=>{let{tempoTrack:{enabled:s}}=jt(this,ja,"f");return s.getValue()?jt(this,ko,"f").isEmpty()?b.None:jt(this,ko,"f").unwrap().events.isEmpty()?b.None:jt(this,ko,"f"):b.None}),Jf(this,ja,r,"f"),Jf(this,Lx,new Vx(e,r.markerTrack),"f"),Jf(this,Zx,new Wx(e,r.signature,r.signatureTrack),"f"),Jf(this,ko,new Nr,"f"),Jf(this,Xf,new fe,"f");let n=jt(this,Yf,"f").own(new Y),i=()=>jt(this,Xf,"f").notify(jt(this,Gx,"f").call(this)),{tempoTrack:{events:a,enabled:o}}=r;jt(this,Yf,"f").own(a.catchupAndSubscribe(({targetVertex:s})=>{n.terminate(),s.match({none:()=>jt(this,ko,"f").clear(),some:({box:c})=>{let u=e.boxAdapters.adapterFor(c,kr);jt(this,ko,"f").wrap(u),n.ownAll(u.subscribeChange(i),o.subscribe(i))}})}))}catchupAndSubscribeTempoAutomation(e){return e(jt(this,Gx,"f").call(this)),jt(this,Xf,"f").subscribe(e)}get box(){return jt(this,ja,"f")}get uuid(){return jt(this,ja,"f").address.uuid}get address(){return jt(this,ja,"f").address}get markerTrack(){return jt(this,Lx,"f")}get signatureTrack(){return jt(this,Zx,"f")}get tempoTrackEvents(){return jt(this,ko,"f")}get signature(){let{nominator:e,denominator:r}=jt(this,ja,"f").signature;return[e.getValue(),r.getValue()]}get signatureDuration(){let{nominator:e,denominator:r}=jt(this,ja,"f").signature;return Te.fromSignature(e.getValue(),r.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),jt(this,ja,"f").signature.subscribe(()=>e(this.signature))}terminate(){jt(this,Yf,"f").terminate()}};Yf=new WeakMap,ja=new WeakMap,Lx=new WeakMap,Zx=new WeakMap,ko=new WeakMap,Xf=new WeakMap,Gx=new WeakMap;var wD=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},Qf=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)},bs,_s=class{constructor(e,r){bs.set(this,void 0),wD(this,bs,r,"f")}get box(){return Qf(this,bs,"f")}get uuid(){return Qf(this,bs,"f").address.uuid}get address(){return Qf(this,bs,"f").address}get source(){return Qf(this,bs,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return Qf(this,bs,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};bs=new WeakMap;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},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)},Hx,Hl,ql,qx,Jx,em,xn=class{constructor(e,r){Hx.set(this,void 0),Hl.set(this,void 0),ql.set(this,void 0),qx.set(this,void 0),Jx.set(this,void 0),em.set(this,!1),Gl(this,Hx,e,"f"),Gl(this,Hl,r,"f"),Gl(this,ql,new Y,"f"),Gl(this,qx,r.attributes,"f"),Gl(this,Jx,vn(this,ql,"f").own(new oe(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return vn(this,ql,"f").own(e)}ownAll(...e){vn(this,ql,"f").ownAll(...e)}onSelected(){Gl(this,em,!0,"f")}onDeselected(){Gl(this,em,!1,"f")}isSelected(){return vn(this,em,"f")}get box(){return vn(this,Hl,"f")}get attributes(){return vn(this,qx,"f")}get uuid(){return vn(this,Hl,"f").address.uuid}get address(){return vn(this,Hl,"f").address}get parameters(){return vn(this,Jx,"f")}get modular(){return vn(this,Hx,"f").boxAdapters.adapterFor(vn(this,Hl,"f").attributes.collection.targetVertex.unwrap("attributes.target").box,As)}terminate(){vn(this,ql,"f").terminate()}};Hx=new WeakMap,Hl=new WeakMap,ql=new WeakMap,qx=new WeakMap,Jx=new WeakMap,em=new WeakMap;var Yx=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},Bo=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)},Xx,Fs,tm,Qx,Lr;(function(t){t.Input="input",t.Output="output"})(Lr||(Lr={}));var Zr=class t{static create(e,r,n,i){return new t(e,r,n,i??r.fieldName)}constructor(e,r,n,i){Xx.set(this,void 0),Fs.set(this,void 0),tm.set(this,void 0),Qx.set(this,void 0),Yx(this,Xx,e,"f"),Yx(this,Fs,r,"f"),Yx(this,tm,n,"f"),Yx(this,Qx,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 Bo(this,Fs,"f").pointerHub.isEmpty()?de.empty():Bo(this,Fs,"f").pointerHub.filter(l.VoltageConnection).map(({box:e})=>Bo(this,Xx,"f").adapterFor(e,_s))}get field(){return Bo(this,Fs,"f")}get address(){return Bo(this,Fs,"f").address}get direction(){return Bo(this,tm,"f")}get name(){return Bo(this,Qx,"f")}toString(){return`{ModuleConnectorAdapter address: ${Bo(this,Fs,"f").address.toString()}, direction: ${Bo(this,tm,"f")}}`}};Xx=new WeakMap,Fs=new WeakMap,tm=new WeakMap,Qx=new WeakMap;var f_=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)},ey,im,nm,od=class extends xn{constructor(e,r){super(e,r),ey.set(this,void 0),im.set(this,void 0),nm.set(this,void 0),f_(this,ey,this.parameters.createParameter(r.time,F.exponential(1,1e4),E.numeric({unit:"ms"}),"Time"),"f"),f_(this,im,Zr.create(e.boxAdapters,r.voltageInput,Lr.Input,"Input"),"f"),f_(this,nm,Zr.create(e.boxAdapters,r.voltageOutput,Lr.Output,"Output"),"f")}get parameterTime(){return rm(this,ey,"f")}get voltageInput(){return rm(this,im,"f")}get voltageOutput(){return rm(this,nm,"f")}get inputs(){return[rm(this,im,"f")]}get outputs(){return[rm(this,nm,"f")]}};ey=new WeakMap,im=new WeakMap,nm=new WeakMap;var bD=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},YM=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)},am,sd=class extends xn{constructor(e,r){super(e,r),am.set(this,void 0),bD(this,am,Zr.create(e.boxAdapters,r.input,Lr.Input,"Input"),"f")}get voltageInput(){return YM(this,am,"f")}get inputs(){return[YM(this,am,"f")]}get outputs(){return de.empty()}};am=new WeakMap;var m_=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},om=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)},ty,sm,lm,ld=class extends xn{constructor(e,r){super(e,r),ty.set(this,void 0),sm.set(this,void 0),lm.set(this,void 0),m_(this,ty,this.parameters.createParameter(r.gain,F.DefaultDecibel,E.numeric({unit:"db"}),"Gain"),"f"),m_(this,sm,Zr.create(e.boxAdapters,r.voltageInput,Lr.Input,"Input"),"f"),m_(this,lm,Zr.create(e.boxAdapters,r.voltageOutput,Lr.Output,"Output"),"f")}get parameterGain(){return om(this,ty,"f")}get voltageInput(){return om(this,sm,"f")}get voltageOutput(){return om(this,lm,"f")}get inputs(){return[om(this,sm,"f")]}get outputs(){return[om(this,lm,"f")]}};ty=new WeakMap,sm=new WeakMap,lm=new WeakMap;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},g_=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)},ry,iy,ny,cd=class extends xn{constructor(e,r){super(e,r),ry.set(this,void 0),iy.set(this,void 0),ny.set(this,void 0),h_(this,ry,Zr.create(e.boxAdapters,r.voltageInputX,Lr.Input,"X"),"f"),h_(this,iy,Zr.create(e.boxAdapters,r.voltageInputY,Lr.Input,"Y"),"f"),h_(this,ny,Zr.create(e.boxAdapters,r.voltageOutput,Lr.Output,"Result"),"f")}get inputs(){return[g_(this,ry,"f"),g_(this,iy,"f")]}get outputs(){return[g_(this,ny,"f")]}};ry=new WeakMap,iy=new WeakMap,ny=new WeakMap;var _D=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},XM=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)},cm,ud=class extends xn{constructor(e,r){super(e,r),cm.set(this,void 0),_D(this,cm,Zr.create(e.boxAdapters,r.output,Lr.Output,"Output"),"f")}get voltageOutput(){return XM(this,cm,"f")}get inputs(){return de.empty()}get outputs(){return[XM(this,cm,"f")]}};cm=new WeakMap;var dd;(function(t){t.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,t.adapterFor=(e,r)=>Ke(r.accept({visitModuleGainBox:n=>e.adapterFor(n,ld),visitModuleDelayBox:n=>e.adapterFor(n,od),visitModuleMultiplierBox:n=>e.adapterFor(n,cd),visitModularAudioInputBox:n=>e.adapterFor(n,ud),visitModularAudioOutputBox:n=>e.adapterFor(n,sd)}),`Could not find ModuleAdapter for ${r.name}`)})(dd||(dd={}));var QM=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},Jl=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,oy,Yl,v_,pd=class{constructor(e,r){ay.add(this),oy.set(this,void 0),Yl.set(this,void 0),QM(this,oy,e,"f"),QM(this,Yl,r,"f")}get box(){return Jl(this,Yl,"f")}get uuid(){return Jl(this,Yl,"f").address.uuid}get address(){return Jl(this,Yl,"f").address}get moduleAdapter(){return dd.adapterFor(Jl(this,oy,"f").boxAdapters,Jl(this,ay,"a",v_).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(Jl(this,ay,"a",v_).address)}terminate(){}};oy=new WeakMap,Yl=new WeakMap,ay=new WeakSet,v_=function(){return Jl(this,Yl,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var eN=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},yi=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)},fd,wi,md=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Modular,fd.set(this,void 0),wi.set(this,void 0),eN(this,fd,e,"f"),eN(this,wi,r,"f")}get box(){return yi(this,wi,"f")}get uuid(){return yi(this,wi,"f").address.uuid}get address(){return yi(this,wi,"f").address}get indexField(){return yi(this,wi,"f").index}get labelField(){return yi(this,wi,"f").label}get enabledField(){return yi(this,wi,"f").enabled}get minimizedField(){return yi(this,wi,"f").minimized}get host(){return yi(this,wi,"f").host}parameterAt(e){return j("Not yet implemented")}deviceHost(){return yi(this,fd,"f").boxAdapters.adapterFor(yi(this,wi,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return yi(this,fd,"f").boxAdapters.adapterFor(yi(this,wi,"f").modularSetup.targetVertex.unwrap("No Modular found").box,As)}elements(){return yi(this,wi,"f").userInterface.elements.pointerHub.filter(l.DeviceUserInterface).map(e=>yi(this,fd,"f").boxAdapters.adapterFor(e.box,pd))}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}};fd=new WeakMap,wi=new WeakMap;var um=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},ot=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)},hd,Es,gd,Ki,Xl,Ql,As=class{constructor(e,r){hd.set(this,new Y),Es.set(this,void 0),gd.set(this,void 0),Ki.set(this,void 0),Xl.set(this,void 0),Ql.set(this,void 0),um(this,gd,e,"f"),um(this,Ki,r,"f"),um(this,Es,ot(this,hd,"f").own(new nr),"f"),um(this,Xl,B.newSet(s=>s.uuid),"f"),um(this,Ql,B.newSet(s=>s.uuid),"f");let n=s=>{let c=dd.adapterFor(ot(this,gd,"f").boxAdapters,s.box);ot(this,Xl,"f").add(c)&&ot(this,Es,"f").proxy.onModuleAdded(c)},i=s=>ot(this,Es,"f").proxy.onModuleRemoved(ot(this,Xl,"f").removeByKey(s.address.uuid)),a=s=>{let c=ot(this,gd,"f").boxAdapters.adapterFor(s.box,_s);ot(this,Ql,"f").add(c)&&ot(this,Es,"f").proxy.onConnectionAdded(c)},o=s=>ot(this,Es,"f").proxy.onConnectionRemoved(ot(this,Ql,"f").removeByKey(s.address.uuid));ot(this,Ki,"f").modules.pointerHub.filter(l.ModuleCollection).forEach(n),ot(this,Ki,"f").connections.pointerHub.filter(l.ConnectionCollection).forEach(a),ot(this,hd,"f").own(ot(this,Ki,"f").modules.pointerHub.subscribe({onAdded:n,onRemoved:i},l.ModuleCollection)),ot(this,hd,"f").own(ot(this,Ki,"f").connections.pointerHub.subscribe({onAdded:a,onRemoved:o},l.ConnectionCollection))}catchupAndSubscribe(e){return R0(e.onModuleAdded,r=>ot(this,Xl,"f").forEach(n=>r(n))),R0(e.onConnectionAdded,r=>ot(this,Ql,"f").forEach(n=>r(n))),ot(this,Es,"f").subscribe(e)}get box(){return ot(this,Ki,"f")}get address(){return ot(this,Ki,"f").address}get uuid(){return ot(this,Ki,"f").address.uuid}get editingField(){return ot(this,Ki,"f").editing}get labelField(){return ot(this,Ki,"f").label}get modules(){return ot(this,Xl,"f").values()}get connections(){return ot(this,Ql,"f").values()}get device(){return ot(this,gd,"f").boxAdapters.adapterFor(Ke(ot(this,Ki,"f").device.pointerHub.incoming().at(0),"No device found").box,md)}terminate(){console.debug(`terminate ${this}`),ot(this,hd,"f").terminate()}};hd=new WeakMap,Es=new WeakMap,gd=new WeakMap,Ki=new WeakMap,Xl=new WeakMap,Ql=new WeakMap;var dm=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)},x_,xd,pm,sy,vd,mm,ly,fm,cy,tN,Ka=class{constructor(e,r){x_.add(this),this.type="groove-adapter",pm.set(this,new Y),sy.set(this,void 0),vd.set(this,void 0),mm.set(this,void 0),ly.set(this,new bg({duration:()=>ni(this,cy,"f"),fx:n=>V0(n,ni(this,fm,"f")),fy:n=>V0(n,1-ni(this,fm,"f"))})),fm.set(this,0),cy.set(this,Te.SemiQuaver*2),dm(this,sy,e,"f"),dm(this,vd,r,"f"),dm(this,mm,ni(this,pm,"f").own(new oe(ni(this,sy,"f"))),"f"),this.namedParameter=ni(this,x_,"m",tN).call(this,r),ni(this,pm,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(n=>dm(this,cy,n.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(n=>dm(this,fm,pM(n.getValue(),.01),"f")))}unwarp(e){return ni(this,ly,"f").unwarp(e)}warp(e){return ni(this,ly,"f").warp(e)}get box(){return ni(this,vd,"f")}get uuid(){return ni(this,vd,"f").address.uuid}get address(){return ni(this,vd,"f").address}terminate(){ni(this,pm,"f").terminate()}};xd=Ka,pm=new WeakMap,sy=new WeakMap,vd=new WeakMap,mm=new WeakMap,ly=new WeakMap,fm=new WeakMap,cy=new WeakMap,x_=new WeakSet,tN=function(e){return{duration:ni(this,mm,"f").createParameter(e.duration,F.values(xd.DurationPPQNs),E.values("",xd.DurationPPQNs,xd.DurationStrings),"Duration"),amount:ni(this,mm,"f").createParameter(e.amount,F.unipolar(),E.percent({fractionDigits:0}),"Amount")}};Ka.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];Ka.DurationPPQNs=xd.Durations.map(([t,e])=>Te.fromSignature(t,e));Ka.DurationStrings=xd.Durations.map(([t,e])=>`${t}/${e}`);var yd=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},Vt=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)},Wa,Ss,wd,uy,dy,hm,gm,y_,Ps=class{constructor(e,r,n,i,a){Wa.set(this,void 0),Ss.set(this,void 0),wd.set(this,void 0),uy.set(this,void 0),dy.set(this,void 0),hm.set(this,new Y),gm.set(this,void 0),y_.set(this,b.None),yd(this,Wa,e,"f"),yd(this,Ss,r,"f"),yd(this,wd,n,"f"),yd(this,uy,i,"f"),yd(this,dy,a??0,"f"),yd(this,gm,Vt(this,hm,"f").own(new fe),"f"),Vt(this,hm,"f").own(Vt(this,Wa,"f").subscribe(()=>Vt(this,gm,"f").notify(this))),e.getValue(),r.clamp(e.getValue())}get field(){return Vt(this,Wa,"f")}get valueMapping(){return Vt(this,Ss,"f")}get stringMapping(){return Vt(this,wd,"f")}get name(){return Vt(this,uy,"f")}get anchor(){return Vt(this,dy,"f")}get type(){return Vt(this,Wa,"f").type}get address(){return Vt(this,Wa,"f").address}get track(){return Vt(this,y_,"f")}subscribe(e){return Vt(this,gm,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return Vt(this,Wa,"f").getValue()}setValue(e){Vt(this,Wa,"f").setValue(Vt(this,Ss,"f").clamp(e))}setUnitValue(e){this.setValue(Vt(this,Ss,"f").y(e))}getUnitValue(){return Vt(this,Ss,"f").x(this.getValue())}getPrintValue(){return Vt(this,wd,"f").x(this.getValue())}setPrintValue(e){let r=Vt(this,wd,"f").y(e);r.type==="unitValue"?this.setUnitValue(Fe(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(Vt(this,Ss,"f").clamp(Vt(this,Wa,"f").initValue))}terminate(){Vt(this,hm,"f").terminate()}};Wa=new WeakMap,Ss=new WeakMap,wd=new WeakMap,uy=new WeakMap,dy=new WeakMap,hm=new WeakMap,gm=new WeakMap,y_=new WeakMap;var bd=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},yn=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)},La,py,fy,my,hy,gy,vy=class{constructor(e){La.set(this,void 0),py.set(this,void 0),fy.set(this,void 0),my.set(this,void 0),hy.set(this,void 0),gy.set(this,void 0),bd(this,La,e,"f"),bd(this,py,new Ps(yn(this,La,"f").keyboard,F.values([88,76,61,49]),E.numeric({fractionDigits:1}),"Keyboard Type"),"f"),bd(this,fy,new Ps(yn(this,La,"f").timeRangeInQuarters,F.exponential(1,64),E.numeric({fractionDigits:1}),"Time-Range"),"f"),bd(this,my,new Ps(yn(this,La,"f").noteScale,F.exponential(.5,2),E.numeric({fractionDigits:1}),"Note Scale"),"f"),bd(this,hy,new Ps(yn(this,La,"f").noteLabels,F.bool,E.bool,"Note Labels"),"f"),bd(this,gy,new Ps(yn(this,La,"f").transpose,F.linearInteger(-48,48),E.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return yn(this,La,"f").box.subscribe(ze.Children,()=>e(this))}get object(){return yn(this,La,"f")}get keyboard(){return yn(this,py,"f")}get timeRangeInQuarters(){return yn(this,fy,"f")}get noteScale(){return yn(this,my,"f")}get noteLabels(){return yn(this,hy,"f")}get transpose(){return yn(this,gy,"f")}};La=new WeakMap,py=new WeakMap,fy=new WeakMap,my=new WeakMap,hy=new WeakMap,gy=new WeakMap;var vm=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},ur=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)},ec,Wi,tc,xy,yy,wy=class{constructor(e,r){ec.set(this,void 0),Wi.set(this,void 0),tc.set(this,void 0),xy.set(this,void 0),yy.set(this,void 0),vm(this,ec,e,"f"),vm(this,Wi,r,"f"),vm(this,tc,Rt.create(ur(this,Wi,"f").audioUnits,n=>ur(this,ec,"f").boxAdapters.adapterFor(n,fn),l.AudioUnits),"f"),vm(this,xy,new Tx(ur(this,Wi,"f").audioBusses.pointerHub,n=>ur(this,ec,"f").boxAdapters.adapterFor(n,Di),l.AudioBusses),"f"),vm(this,yy,new vy(ur(this,Wi,"f").pianoMode),"f")}get uuid(){return ur(this,Wi,"f").address.uuid}get address(){return ur(this,Wi,"f").address}get box(){return ur(this,Wi,"f")}get audioBusses(){return ur(this,xy,"f")}get audioUnits(){return ur(this,tc,"f")}get clips(){return ur(this,tc,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return ur(this,ec,"f").boxAdapters.adapterFor(ur(this,Wi,"f").groove.targetVertex.unwrap("no groove").box,Ka)}get timeline(){return ur(this,ec,"f").boxAdapters.adapterFor(ur(this,Wi,"f").timeline.targetVertex.unwrap("no timeline").box,Ua)}get pianoMode(){return ur(this,yy,"f")}get created(){return new Date(ur(this,Wi,"f").created.getValue())}get midiOutputDevices(){return ur(this,Wi,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>Re(e,Qo))}*labeledAudioOutputs(){for(let e of ur(this,tc,"f").adapters())yield{label:e.label,address:e.address,children:()=>b.wrap(e.labeledAudioOutputs())}}terminate(){ur(this,tc,"f").terminate()}};ec=new WeakMap,Wi=new WeakMap,tc=new WeakMap,xy=new WeakMap,yy=new WeakMap;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},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)},b_,xm,ra,Ms,rN,by=class{constructor(e,r){b_.add(this),this.type="instrument",this.accepts="audio",this.manualUrl=ie.Tape,xm.set(this,void 0),ra.set(this,void 0),Ms.set(this,void 0),w_(this,xm,e,"f"),w_(this,ra,r,"f"),w_(this,Ms,new oe(Gr(this,xm,"f")),"f"),this.namedParameter=Gr(this,b_,"m",rN).call(this,r)}get box(){return Gr(this,ra,"f")}get uuid(){return Gr(this,ra,"f").address.uuid}get address(){return Gr(this,ra,"f").address}get labelField(){return Gr(this,ra,"f").label}get iconField(){return Gr(this,ra,"f").icon}get defaultTrackType(){return ge.Audio}get enabledField(){return Gr(this,ra,"f").enabled}get minimizedField(){return Gr(this,ra,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return Gr(this,xm,"f").boxAdapters.adapterFor(Gr(this,ra,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Gr(this,Ms,"f").terminate()}};xm=new WeakMap,ra=new WeakMap,Ms=new WeakMap,b_=new WeakSet,rN=function(e){return{flutter:Gr(this,Ms,"f").createParameter(e.flutter,F.unipolar(),E.percent(),"Flutter"),wow:Gr(this,Ms,"f").createParameter(e.wow,F.unipolar(),E.percent(),"Wow"),noise:Gr(this,Ms,"f").createParameter(e.noise,F.unipolar(),E.percent(),"Noise"),saturation:Gr(this,Ms,"f").createParameter(e.saturation,F.unipolar(),E.percent(),"Saturation")}};var rc=(()=>{let r=[1,2,3,4],n=["12","24","36","48"],i=[ga.sine,ga.triangle,ga.saw,ga.square],a=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:F.exponential(20,2e4),CUTOFF_STRING_MAPPING:E.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:r,FILTER_ORDER_STRINGS:n,FILTER_ORDER_VALUE_MAPPING:F.values(r),FILTER_ORDER_STRING_MAPPING:E.values("db",r,n),LFO_WAVEFORM_VALUES:i,LFO_WAVEFORM_STRINGS:a,LFO_WAVEFORM_VALUE_MAPPING:F.values(i),LFO_WAVEFORM_STRING_MAPPING:E.values("",i,a)}})();var __=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},Ze=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)},A_,ym,ia,nt,iN,_y=class{constructor(e,r){A_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ie.Vaporisateur,ym.set(this,void 0),ia.set(this,void 0),nt.set(this,void 0),__(this,ym,e,"f"),__(this,ia,r,"f"),__(this,nt,new oe(Ze(this,ym,"f")),"f"),this.namedParameter=Ze(this,A_,"m",iN).call(this,r)}get box(){return Ze(this,ia,"f")}get uuid(){return Ze(this,ia,"f").address.uuid}get address(){return Ze(this,ia,"f").address}get labelField(){return Ze(this,ia,"f").label}get iconField(){return Ze(this,ia,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return Ze(this,ia,"f").enabled}get minimizedField(){return Ze(this,ia,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ze(this,ym,"f").boxAdapters.adapterFor(Ze(this,ia,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Ze(this,nt,"f").terminate()}};ym=new WeakMap,ia=new WeakMap,nt=new WeakMap,A_=new WeakSet,iN=function(e){let r=[ya.Monophonic,ya.Polyphonic];return{oscillators:e.oscillators.fields().map(n=>({waveform:Ze(this,nt,"f").createParameter(n.waveform,F.linearInteger(0,3),E.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:Ze(this,nt,"f").createParameter(n.volume,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:Ze(this,nt,"f").createParameter(n.octave,F.linearInteger(-3,3),E.numeric({unit:"oct"}),"Octave",.5),tune:Ze(this,nt,"f").createParameter(n.tune,F.linear(-1200,1200),E.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:Ze(this,nt,"f").createParameter(e.noise.volume,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:Ze(this,nt,"f").createParameter(e.noise.attack,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:Ze(this,nt,"f").createParameter(e.noise.hold,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Hold"),release:Ze(this,nt,"f").createParameter(e.noise.release,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:Ze(this,nt,"f").createParameter(e.filterOrder,rc.FILTER_ORDER_VALUE_MAPPING,rc.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:Ze(this,nt,"f").createParameter(e.cutoff,rc.CUTOFF_VALUE_MAPPING,rc.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:Ze(this,nt,"f").createParameter(e.resonance,F.exponential(.01,10),E.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:Ze(this,nt,"f").createParameter(e.attack,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:Ze(this,nt,"f").createParameter(e.decay,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:Ze(this,nt,"f").createParameter(e.sustain,F.unipolar(),E.percent({fractionDigits:1}),"Sustain"),release:Ze(this,nt,"f").createParameter(e.release,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:Ze(this,nt,"f").createParameter(e.filterEnvelope,F.bipolar(),E.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:Ze(this,nt,"f").createParameter(e.filterKeyboard,F.bipolar(),E.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:Ze(this,nt,"f").createParameter(e.voicingMode,F.values(r),E.values("",r,["mono","poly"]),"Play Mode",.5),glideTime:Ze(this,nt,"f").createParameter(e.glideTime,F.unipolar(),E.percent({fractionDigits:1}),"Glide time",0),unisonCount:Ze(this,nt,"f").createParameter(e.unisonCount,F.values([1,3,5]),E.values("#",[1,3,5],[1,3,5].map(n=>String(n))),"Unisono",0),unisonDetune:Ze(this,nt,"f").createParameter(e.unisonDetune,F.exponential(1,1200),E.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:Ze(this,nt,"f").createParameter(e.unisonStereo,F.unipolar(),E.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:Ze(this,nt,"f").createParameter(e.lfo.waveform,rc.LFO_WAVEFORM_VALUE_MAPPING,rc.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:Ze(this,nt,"f").createParameter(e.lfo.rate,F.exponential(1e-4,30),E.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:Ze(this,nt,"f").createParameter(e.lfo.targetTune,F.bipolar(),E.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:Ze(this,nt,"f").createParameter(e.lfo.targetVolume,F.bipolar(),E.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:Ze(this,nt,"f").createParameter(e.lfo.targetCutoff,F.bipolar(),E.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};var F_=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)},E_,Ay,wm,wn,Za,nN,ic=class{constructor(e,r){E_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=ie.Arpeggio,wm.set(this,void 0),wn.set(this,void 0),Za.set(this,void 0),F_(this,wm,e,"f"),F_(this,wn,r,"f"),F_(this,Za,new oe(vr(this,wm,"f")),"f"),this.namedParameter=vr(this,E_,"m",nN).call(this,r)}get box(){return vr(this,wn,"f")}get uuid(){return vr(this,wn,"f").address.uuid}get address(){return vr(this,wn,"f").address}get indexField(){return vr(this,wn,"f").index}get labelField(){return vr(this,wn,"f").label}get enabledField(){return vr(this,wn,"f").enabled}get minimizedField(){return vr(this,wn,"f").minimized}get host(){return vr(this,wn,"f").host}deviceHost(){return vr(this,wm,"f").boxAdapters.adapterFor(vr(this,wn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){vr(this,Za,"f").terminate()}};Ay=ic,wm=new WeakMap,wn=new WeakMap,Za=new WeakMap,E_=new WeakSet,nN=function(e){return{modeIndex:vr(this,Za,"f").createParameter(e.modeIndex,F.linearInteger(0,2),E.indices("",["Up","Down","UpDown"]),"Mode"),numOctaves:vr(this,Za,"f").createParameter(e.numOctaves,F.linearInteger(1,5),E.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:vr(this,Za,"f").createParameter(e.rateIndex,F.linearInteger(0,Ay.RateFractions.length-1),Ay.RateStringMapping,"Rate"),gate:vr(this,Za,"f").createParameter(e.gate,F.linear(0,2),E.percent({fractionDigits:0}),"Gate"),repeat:vr(this,Za,"f").createParameter(e.repeat,F.linearInteger(1,16),E.numeric({fractionDigits:0}),"Repeat"),velocity:vr(this,Za,"f").createParameter(e.velocity,F.bipolar(),E.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};ic.RateFractions=Wo.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();ic.RateStringMapping=E.indices("",Ay.RateFractions.map(([t,e])=>`${t}/${e}`));var S_=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)},P_,bm,bn,nc,aN,Fy=class{constructor(e,r){P_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=ie.Pitch,bm.set(this,void 0),bn.set(this,void 0),nc.set(this,void 0),S_(this,bm,e,"f"),S_(this,bn,r,"f"),S_(this,nc,new oe(Hr(this,bm,"f")),"f"),this.namedParameter=Hr(this,P_,"m",aN).call(this,r)}get box(){return Hr(this,bn,"f")}get uuid(){return Hr(this,bn,"f").address.uuid}get address(){return Hr(this,bn,"f").address}get indexField(){return Hr(this,bn,"f").index}get labelField(){return Hr(this,bn,"f").label}get enabledField(){return Hr(this,bn,"f").enabled}get minimizedField(){return Hr(this,bn,"f").minimized}get host(){return Hr(this,bn,"f").host}deviceHost(){return Hr(this,bm,"f").boxAdapters.adapterFor(Hr(this,bn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Hr(this,nc,"f").terminate()}};bm=new WeakMap,bn=new WeakMap,nc=new WeakMap,P_=new WeakSet,aN=function(e){return{octaves:Hr(this,nc,"f").createParameter(e.octaves,F.linearInteger(-7,7),E.numeric({unit:"oct",fractionDigits:0}),"Octaves"),semiTones:Hr(this,nc,"f").createParameter(e.semiTones,F.linearInteger(-36,36),E.numeric({unit:"st",fractionDigits:0}),"Semi-Tones"),cent:Hr(this,nc,"f").createParameter(e.cents,F.linear(-50,50),E.numeric({unit:"cents",fractionDigits:1}),"Cents")}};var AD=/^\/\/ @label .+$/m,oN=/^\/\/ @param .+$/gm,sN=/^\/\/ @sample .+$/gm;var lN=/^\/\/ @(group|param|sample) .+$/gm,cN=/^\/\/ @(?:param|sample) \S+/gm,FD=/^\/\/ @no-pass\b(.*)$/m,_d=1e-6,ED=["linear","exp","int","bool"],SD=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}}},uN=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<_d)throw new Error(`Malformed @param: '${t}' \u2014 min (${u}) must be less than max (${f})`);if(i<u-_d||i>f+_d)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(!ED.includes(s))throw new Error(`Malformed @param: '${t}' \u2014 unknown mapping '${s}' (expected: linear, exp, int, bool)`);if(s!=="bool"&&o-a<_d)throw new Error(`Malformed @param: '${t}' \u2014 min (${a}) must be less than max (${o})`);if(i<a-_d||i>o+_d)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}},dN=(t,e)=>t.mapping===e.mapping&&t.min===e.min&&t.max===e.max&&t.unit===e.unit,PD=(t,e)=>dN(t,e)&&Math.abs(t.defaultValue-e.defaultValue)<1e-6,xr;(function(t){t.isEqual=PD,t.parseLabel=e=>{let r=AD.exec(e);if(r===null)return b.None;let n=r[0].replace(/^\/\/ @label\s+/,"").trim();if(n.length===0)throw new Error("Malformed @label: expected: // @label <name>");return b.wrap(n)},t.parsePassThrough=e=>{let r=FD.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(oN.lastIndex=0;(n=oN.exec(e))!==null;)r.push(uN(n[0]));return r},t.parseSamples=e=>{let r=[],n;for(sN.lastIndex=0;(n=sN.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;cN.lastIndex=0;let i=0;for(;(n=cN.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=[];lN.lastIndex=0;let a;for(;(a=lN.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:uN(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 F.unipolar();case"linear":return F.linear(e.min,e.max);case"exp":return F.exponential(e.min,e.max);case"int":return F.linearInteger(e.min,e.max);case"bool":return F.linearInteger(0,1)}},t.resolveStringMapping=e=>{switch(e.mapping){case"unipolar":return E.percent();case"linear":return E.numeric({unit:e.unit,fractionDigits:2});case"exp":return E.numeric({unit:e.unit,fractionDigits:2});case"int":return E.numeric({unit:e.unit,fractionDigits:0});case"bool":return SD}},t.resolveParamMappings=e=>({valueMapping:t.resolveValueMapping(e),stringMapping:t.resolveStringMapping(e)}),t.subscribeScriptParams=(e,r,n)=>{let i=new Map,a=new fe;return{terminable:pe.many(n.pointerHub.catchupAndSubscribe({onAdded:(({box:s})=>{let c=Re(s,Sa),u=c.label.getValue(),v=t.parseParams(r.getValue()).find(_=>_.label===u),{valueMapping:h,stringMapping:y}=K(v)?t.resolveParamMappings(v):{valueMapping:F.unipolar(),stringMapping:E.percent({fractionDigits:1})};e.createParameter(c.value,h,y,Ep.capitalize(u),void 0,c.defaultValue.getValue()),K(v)&&i.set(u,v)}),onRemoved:(({box:s})=>{let c=Re(s,Sa);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(y=>Ep.capitalize(y.label)===c.name);if(!K(u))continue;let f=i.get(u.label);if(K(f)&&dN(f,u))continue;let{valueMapping:v,stringMapping:h}=t.resolveParamMappings(u);c.updateMappings(v,h),i.set(u.label,u)}a.notify()}),a),codeChanged:a}}})(xr||(xr={}));var Ey=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)},_m,Am,_n,Fm,Sy,Py=class{constructor(e,r){_m.set(this,new Y),this.type="midi-effect",this.accepts="midi",this.manualUrl=ie.Spielwerk,Am.set(this,void 0),_n.set(this,void 0),Fm.set(this,void 0),Sy.set(this,void 0),Ey(this,Am,e,"f"),Ey(this,_n,r,"f"),Ey(this,Fm,Tr(this,_m,"f").own(new oe(Tr(this,Am,"f"))),"f");let{terminable:n,codeChanged:i}=xr.subscribeScriptParams(Tr(this,Fm,"f"),r.code,r.parameters);Tr(this,_m,"f").own(n),Ey(this,Sy,i,"f")}get box(){return Tr(this,_n,"f")}get uuid(){return Tr(this,_n,"f").address.uuid}get address(){return Tr(this,_n,"f").address}get indexField(){return Tr(this,_n,"f").index}get labelField(){return Tr(this,_n,"f").label}get enabledField(){return Tr(this,_n,"f").enabled}get minimizedField(){return Tr(this,_n,"f").minimized}get host(){return Tr(this,_n,"f").host}get parameters(){return Tr(this,Fm,"f")}get codeChanged(){return Tr(this,Sy,"f")}deviceHost(){return Tr(this,Am,"f").boxAdapters.adapterFor(Tr(this,_n,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Tr(this,_m,"f").terminate()}};_m=new WeakMap,Am=new WeakMap,_n=new WeakMap,Fm=new WeakMap,Sy=new WeakMap;var My=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},qr=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)},Em,Sm,na,Pm,Ny,$y=class{constructor(e,r){Em.set(this,new Y),this.type="instrument",this.accepts="midi",this.manualUrl=ie.Apparat,Sm.set(this,void 0),na.set(this,void 0),Pm.set(this,void 0),Ny.set(this,void 0),My(this,Sm,e,"f"),My(this,na,r,"f"),My(this,Pm,qr(this,Em,"f").own(new oe(qr(this,Sm,"f"))),"f");let{terminable:n,codeChanged:i}=xr.subscribeScriptParams(qr(this,Pm,"f"),r.code,r.parameters);qr(this,Em,"f").own(n),My(this,Ny,i,"f")}get box(){return qr(this,na,"f")}get uuid(){return qr(this,na,"f").address.uuid}get address(){return qr(this,na,"f").address}get labelField(){return qr(this,na,"f").label}get iconField(){return qr(this,na,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return qr(this,na,"f").enabled}get minimizedField(){return qr(this,na,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return qr(this,Pm,"f")}get codeChanged(){return qr(this,Ny,"f")}deviceHost(){return qr(this,Sm,"f").boxAdapters.adapterFor(qr(this,na,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){qr(this,Em,"f").terminate()}};Em=new WeakMap,Sm=new WeakMap,na=new WeakMap,Pm=new WeakMap,Ny=new WeakMap;var Io;(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})})(Io||(Io={}));var Mm;(function(t){t.Contours=["free","walk","rise","fall"],t.Motifs=[0,2,3,4,8],t.Default={root:0,scale:zc.StockScales[1],octave:1,octaves:3,density:.6,accent:.3,slide:.2,motif:0,contour:"free",rootFirst:!0};let e=r=>{let n=de.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=y=>{let _=Fe(y,0,o-1);return Fe(s+i[_%i.length]+Math.floor(_/i.length)*12,0,127)},u=r.motif>0?Math.min(r.motif,n):n,f=y=>Math.round((Math.random()*2-1)*y),v=new Array(u);for(let y=0;y<u;y++){let _=u<2?0:y/(u-1)*(o-1);v[y]=r.rootFirst&&y===0?0:Fe(r.contour==="walk"?y===0?o>>1:v[y-1]+f(2):r.contour==="rise"?Math.round(_)+f(1):r.contour==="fall"?Math.round(o-1-_)+f(1):Math.floor(Math.random()*o),0,o-1)}let h=de.create(y=>Io.pack({note:c(v[y]),active:r.rootFirst&&y===0||Math.random()<r.density,slide:Math.random()<r.slide,accent:Math.random()<r.accent}),u);return de.create(y=>h[y%u],n)}})(Mm||(Mm={}));var M_=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)},$_,Nm,Li,To,pN,N_=Io.pack({note:Io.DefaultNote,active:!1,slide:!1,accent:!1}),ky=class{constructor(e,r){$_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl="manuals/devices/instruments/cubed",Nm.set(this,void 0),Li.set(this,void 0),To.set(this,void 0),M_(this,Nm,e,"f"),M_(this,Li,r,"f"),M_(this,To,new oe(yr(this,Nm,"f")),"f"),this.namedParameter=yr(this,$_,"m",pN).call(this,r)}get box(){return yr(this,Li,"f")}get uuid(){return yr(this,Li,"f").address.uuid}get address(){return yr(this,Li,"f").address}get labelField(){return yr(this,Li,"f").label}get iconField(){return yr(this,Li,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return yr(this,Li,"f").enabled}get minimizedField(){return yr(this,Li,"f").minimized}get acceptsMidiEvents(){return!0}currentPattern(){return yr(this,Li,"f").patterns.getField(yr(this,Li,"f").patternIndex.getValue())}readCurrentPattern(){let e=this.currentPattern(),r=e.length.getValue();return{length:r,steps:e.steps.fields().slice(0,r).map(n=>Io.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?Io.pack(r[s]):N_)),n.length.setValue(Fe(e,1,i.length))}clearCurrentPattern(){this.currentPattern().steps.fields().forEach(e=>e.setValue(N_))}randomizeCurrentPattern(e=Mm.Default){let r=this.currentPattern(),n=r.length.getValue(),i=Mm.steps(e,n);r.steps.fields().forEach((a,o)=>a.setValue(o<n?i[o]:N_))}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 yr(this,Nm,"f").boxAdapters.adapterFor(yr(this,Li,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){yr(this,To,"f").terminate()}};Nm=new WeakMap,Li=new WeakMap,To=new WeakMap,$_=new WeakSet,pN=function(e){let r=(n,i,a)=>yr(this,To,"f").createParameter(n,F.unipolar(),E.percent({fractionDigits:0}),i,a);return{tuning:yr(this,To,"f").createParameter(e.tuning,F.linear(-1200,1200),E.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:yr(this,To,"f").createParameter(e.volume,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Volume"),waveform:yr(this,To,"f").createParameter(e.waveform,F.linearInteger(0,1),E.indices("",["Sawtooth","Square"]),"Waveform",.5),patternIndex:yr(this,To,"f").createParameter(e.patternIndex,F.linearInteger(0,e.patterns.fields().length-1),E.oneBasedIndex(),"Pattern")}};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},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)},B_,$m,An,Dr,fN,Ns;(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)})(Ns||(Ns={}));var By=class{constructor(e,r){B_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ie.Neon,$m.set(this,void 0),An.set(this,void 0),Dr.set(this,void 0),k_(this,$m,e,"f"),k_(this,An,r,"f"),k_(this,Dr,new oe(At(this,$m,"f")),"f"),this.namedParameter=At(this,B_,"m",fN).call(this,r)}get box(){return At(this,An,"f")}get uuid(){return At(this,An,"f").address.uuid}get address(){return At(this,An,"f").address}get labelField(){return At(this,An,"f").label}get iconField(){return At(this,An,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return At(this,An,"f").enabled}get minimizedField(){return At(this,An,"f").minimized}get acceptsMidiEvents(){return!0}envelope(e,r){return At(this,An,"f").envelopes.fields()[Ns.envelopeIndex(e,r)]}deviceHost(){return At(this,$m,"f").boxAdapters.adapterFor(At(this,An,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){At(this,Dr,"f").terminate()}};$m=new WeakMap,An=new WeakMap,Dr=new WeakMap,B_=new WeakSet,fN=function(e){let r=[ya.Monophonic,ya.Polyphonic],n=(i,a)=>At(this,Dr,"f").createParameter(i,F.linear(0,99),E.numeric({unit:"",fractionDigits:0}),a);return{lineSelect:At(this,Dr,"f").createParameter(e.lineSelect,F.linearInteger(0,3),E.indices("",Ns.LineSelect),"Line"),modulation:At(this,Dr,"f").createParameter(e.modulation,F.linearInteger(0,2),E.indices("",Ns.Modulation),"Mod"),octave:At(this,Dr,"f").createParameter(e.octave,F.linearInteger(-3,3),E.numeric({unit:"oct"}),"Octave",.5),detune:At(this,Dr,"f").createParameter(e.detune,F.linear(-4800,4800),E.numeric({unit:"ct",fractionDigits:0}),"Detune",.5),tune:At(this,Dr,"f").createParameter(e.tune,F.linear(-1200,1200),E.numeric({unit:"ct",fractionDigits:0}),"Tune",.5),glideTime:At(this,Dr,"f").createParameter(e.glideTime,F.unipolar(),E.percent({fractionDigits:1}),"Glide time",0),voicingMode:At(this,Dr,"f").createParameter(e.voicingMode,F.values(r),E.values("",r,["mono","poly"]),"Play Mode",.5),vibrato:{wave:At(this,Dr,"f").createParameter(e.vibrato.wave,F.linearInteger(0,3),E.indices("",Ns.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:At(this,Dr,"f").createParameter(i.wave1,F.linearInteger(0,7),E.indices("",Ns.Waves),"Wave 1"),wave2:At(this,Dr,"f").createParameter(i.wave2,F.linearInteger(0,8),E.indices("",["Off",...Ns.Waves]),"Wave 2"),dcwKeyFollow:At(this,Dr,"f").createParameter(i.dcwKeyFollow,F.linear(0,9),E.numeric({unit:"",fractionDigits:1}),"DCW Key Follow"),dcaKeyFollow:At(this,Dr,"f").createParameter(i.dcaKeyFollow,F.linear(0,9),E.numeric({unit:"",fractionDigits:1}),"DCA Key Follow")}))}};var I_=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},bi=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)},T_,km,aa,Ad,mN,Iy=class{constructor(e,r){T_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ie.Nano,km.set(this,void 0),aa.set(this,void 0),Ad.set(this,void 0),I_(this,km,e,"f"),I_(this,aa,r,"f"),I_(this,Ad,new oe(bi(this,km,"f")),"f"),this.namedParameter=bi(this,T_,"m",mN).call(this,r)}get box(){return bi(this,aa,"f")}get uuid(){return bi(this,aa,"f").address.uuid}get address(){return bi(this,aa,"f").address}get labelField(){return bi(this,aa,"f").label}get iconField(){return bi(this,aa,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return bi(this,aa,"f").enabled}get minimizedField(){return bi(this,aa,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return bi(this,km,"f").boxAdapters.adapterFor(bi(this,aa,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){bi(this,Ad,"f").terminate()}};km=new WeakMap,aa=new WeakMap,Ad=new WeakMap,T_=new WeakSet,mN=function(e){return{volume:bi(this,Ad,"f").createParameter(e.volume,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Volume"),release:bi(this,Ad,"f").createParameter(e.release,F.exponential(.001,8),E.numeric({unit:"s",fractionDigits:3}),"Release")}};var Fd=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},se=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_,ac,$s,Me,Ty,Bm,ai,oc,hN,Ed=class{constructor(e,r){D_.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",this.manualUrl="manuals/devices/instruments/playfield",ac.set(this,new Y),$s.set(this,void 0),Me.set(this,void 0),Ty.set(this,void 0),Bm.set(this,void 0),ai.set(this,void 0),oc.set(this,b.None),Fd(this,$s,e,"f"),Fd(this,Me,r,"f"),Fd(this,Ty,se(this,ac,"f").own(Rt.create(se(this,Me,"f").midiEffects,n=>se(this,$s,"f").boxAdapters.adapterFor(n,ee.isMidiEffect),l.MIDIEffectHost)),"f"),Fd(this,Bm,se(this,ac,"f").own(Rt.create(se(this,Me,"f").audioEffects,n=>se(this,$s,"f").boxAdapters.adapterFor(n,ee.isAudioEffect),l.AudioEffectHost)),"f"),Fd(this,ai,se(this,ac,"f").own(new oe(se(this,$s,"f"))),"f"),this.namedParameter=se(this,D_,"m",hN).call(this,r),se(this,ac,"f").own(se(this,Me,"f").file.catchupAndSubscribe(n=>{Fd(this,oc,n.targetVertex.map(({box:i})=>se(this,$s,"f").boxAdapters.adapterFor(i,Zn)),"f"),se(this,oc,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return se(this,Me,"f")}get uuid(){return se(this,Me,"f").address.uuid}get address(){return se(this,Me,"f").address}get peakAddress(){return se(this,Me,"f").address.append(1001)}get indexField(){return se(this,Me,"f").index}get gate(){return se(this,Me,"f").gate.getValue()}get exclude(){return se(this,Me,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${se(this,oc,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get fileLabel(){return`${se(this,oc,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return se(this,Me,"f").icon}get defaultTrackType(){return ge.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return b.wrap(se(this,Me,"f").midiEffects)}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return b.wrap(se(this,Me,"f").audioEffects)}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}get hostsInstrument(){return!0}file(){return se(this,oc,"f")}fileUUID(){return se(this,Me,"f").file.targetAddress.unwrap("file.targetAddr").uuid}resetParameters(){se(this,Me,"f").mute.reset(),se(this,Me,"f").solo.reset(),se(this,Me,"f").exclude.reset(),se(this,Me,"f").polyphone.reset(),se(this,Me,"f").pitch.reset(),se(this,Me,"f").attack.reset(),se(this,Me,"f").release.reset(),se(this,Me,"f").sampleStart.reset(),se(this,Me,"f").sampleEnd.reset(),se(this,Me,"f").gate.reset(),se(this,Me,"f").volume.reset(),se(this,Me,"f").panning.reset()}copyToIndex(e){Ea.create(se(this,Me,"f").graph,B.generate(),r=>{r.file.refer(se(this,Me,"f").file.targetVertex.unwrap("file.target")),r.device.refer(se(this,Me,"f").device.targetVertex.unwrap("device.target")),r.index.setValue(e),r.mute.setValue(se(this,Me,"f").mute.getValue()),r.solo.setValue(se(this,Me,"f").solo.getValue()),r.sampleStart.setValue(se(this,Me,"f").sampleStart.getValue()),r.sampleEnd.setValue(se(this,Me,"f").sampleEnd.getValue()),r.attack.setValue(se(this,Me,"f").attack.getValue()),r.release.setValue(se(this,Me,"f").release.getValue()),r.pitch.setValue(se(this,Me,"f").pitch.getValue()),r.exclude.setValue(se(this,Me,"f").exclude.getValue()),r.gate.setValue(se(this,Me,"f").gate.getValue()),r.volume.setValue(se(this,Me,"f").volume.getValue()),r.panning.setValue(se(this,Me,"f").panning.getValue())})}get midiEffects(){return b.wrap(se(this,Ty,"f"))}get inputAdapter(){return b.wrap(this)}get audioEffects(){return b.wrap(se(this,Bm,"f"))}get labelField(){return Re(se(this,Me,"f").file.targetVertex.unwrap("file.target").box,rn).fileName}get enabledField(){return se(this,Me,"f").enabled}get minimizedField(){return se(this,Me,"f").minimized}device(){return se(this,$s,"f").boxAdapters.adapterFor(se(this,Me,"f").device.targetVertex.unwrap("device.target").box,Sd)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.fileLabel,children:()=>b.None};for(let e of se(this,Bm,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){se(this,ac,"f").terminate()}};ac=new WeakMap,$s=new WeakMap,Me=new WeakMap,Ty=new WeakMap,Bm=new WeakMap,ai=new WeakMap,oc=new WeakMap,D_=new WeakSet,hN=function(e){return{gate:se(this,ai,"f").createParameter(e.gate,F.linearInteger(0,2),E.indices("",["Off","On","Loop"]),"Gate"),mute:se(this,ai,"f").createParameter(e.mute,F.bool,E.bool,"Mute"),solo:se(this,ai,"f").createParameter(e.solo,F.bool,E.bool,"Solo"),polyphone:se(this,ai,"f").createParameter(e.polyphone,F.bool,E.bool,"Polyphone"),exclude:se(this,ai,"f").createParameter(e.exclude,F.bool,E.bool,"Exclude"),pitch:se(this,ai,"f").createParameter(e.pitch,F.linear(-1200,1200),E.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:se(this,ai,"f").createParameter(e.sampleStart,F.unipolar(),E.percent(),"Start",0),sampleEnd:se(this,ai,"f").createParameter(e.sampleEnd,F.unipolar(),E.percent(),"End",1),attack:se(this,ai,"f").createParameter(e.attack,F.exponential(.001,5),E.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:se(this,ai,"f").createParameter(e.release,F.exponential(.001,5),E.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release"),volume:se(this,ai,"f").createParameter(e.volume,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Volume"),panning:se(this,ai,"f").createParameter(e.panning,F.bipolar(),E.panning,"Pan",.5)}};var Dy=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)},sc,Fn,lc,Ry,Sd=class{constructor(e,r){this.type="instrument",this.accepts="midi",this.manualUrl=ie.Playfield,sc.set(this,void 0),Fn.set(this,void 0),lc.set(this,void 0),Ry.set(this,void 0),Dy(this,sc,e,"f"),Dy(this,Fn,r,"f"),Dy(this,lc,Rt.create(r.samples,n=>e.boxAdapters.adapterFor(n,Ed),l.Sample),"f"),Dy(this,Ry,new oe(Sr(this,sc,"f")),"f")}reset(){Sr(this,lc,"f").adapters().forEach(e=>e.box.delete())}chop({file:e,startKey:r,slices:n}){let i=r+n.length-1;Sr(this,lc,"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)=>{Ea.create(Sr(this,sc,"f").boxGraph,B.generate(),c=>{c.file.refer(e),c.device.refer(Sr(this,Fn,"f").samples),c.index.setValue(r+s),c.sampleStart.setValue(a),c.sampleEnd.setValue(o),c.exclude.setValue(!0)})})}get box(){return Sr(this,Fn,"f")}get uuid(){return Sr(this,Fn,"f").address.uuid}get address(){return Sr(this,Fn,"f").address}get labelField(){return Sr(this,Fn,"f").label}get iconField(){return Sr(this,Fn,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return Sr(this,Fn,"f").enabled}get minimizedField(){return Sr(this,Fn,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return Sr(this,lc,"f")}get context(){return Sr(this,sc,"f")}deviceHost(){return Sr(this,sc,"f").boxAdapters.adapterFor(Sr(this,Fn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None};for(let e of Sr(this,lc,"f").adapters())yield{address:e.address,label:e.fileLabel,children:()=>b.wrap(e.labeledAudioOutputs())}}terminate(){Sr(this,Ry,"f").terminate()}};sc=new WeakMap,Fn=new WeakMap,lc=new WeakMap,Ry=new WeakMap;var R_=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)},C_,Im,En,Ga,gN,Cy=class{constructor(e,r){C_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.StereoTool,Im.set(this,void 0),En.set(this,void 0),Ga.set(this,void 0),R_(this,Im,e,"f"),R_(this,En,r,"f"),R_(this,Ga,new oe(wr(this,Im,"f")),"f"),this.namedParameter=wr(this,C_,"m",gN).call(this,r)}get box(){return wr(this,En,"f")}get uuid(){return wr(this,En,"f").address.uuid}get address(){return wr(this,En,"f").address}get indexField(){return wr(this,En,"f").index}get labelField(){return wr(this,En,"f").label}get enabledField(){return wr(this,En,"f").enabled}get minimizedField(){return wr(this,En,"f").minimized}get host(){return wr(this,En,"f").host}deviceHost(){return wr(this,Im,"f").boxAdapters.adapterFor(wr(this,En,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){wr(this,Ga,"f").terminate()}};Im=new WeakMap,En=new WeakMap,Ga=new WeakMap,C_=new WeakSet,gN=function(e){return{volume:wr(this,Ga,"f").createParameter(e.volume,F.decibel(-72,0,12),E.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:wr(this,Ga,"f").createParameter(e.panning,F.bipolar(),E.panning,"Panning",.5),stereo:wr(this,Ga,"f").createParameter(e.stereo,F.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"Stereo",.5),invertL:wr(this,Ga,"f").createParameter(e.invertL,F.bool,E.bool,"Invert Left"),invertR:wr(this,Ga,"f").createParameter(e.invertR,F.bool,E.bool,"Invert Right"),swap:wr(this,Ga,"f").createParameter(e.swap,F.bool,E.bool,"Swap")}};var zy=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)},z_,Tm,Pd,dr,Dm,cc,vN,Md=class{constructor(e,r){z_.add(this),this.class="device-host",Tm.set(this,new Y),Pd.set(this,void 0),dr.set(this,void 0),Dm.set(this,void 0),cc.set(this,void 0),zy(this,Pd,e,"f"),zy(this,dr,r,"f"),zy(this,Dm,st(this,Tm,"f").own(Rt.create(st(this,dr,"f").audioEffects,n=>st(this,Pd,"f").boxAdapters.adapterFor(n,ee.isAudioEffect),l.AudioEffectHost)),"f"),zy(this,cc,st(this,Tm,"f").own(new oe(st(this,Pd,"f"))),"f"),this.namedParameter=st(this,z_,"m",vN).call(this,r)}get box(){return st(this,dr,"f")}get uuid(){return st(this,dr,"f").address.uuid}get address(){return st(this,dr,"f").address}get indexField(){return st(this,dr,"f").index}get labelField(){return st(this,dr,"f").label}get minimizedField(){return st(this,dr,"f").minimized}get label(){return st(this,dr,"f").label.getValue()}get audioEffects(){return b.wrap(st(this,Dm,"f"))}get midiEffects(){return b.None}get audioEffectsField(){return b.wrap(st(this,dr,"f").audioEffects)}get midiEffectsField(){return b.None}get inputAdapter(){return b.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 st(this,Pd,"f").boxAdapters.adapterFor(st(this,dr,"f").composite.targetVertex.unwrap("composite.target").box,Ha)}deviceHost(){return this.compositeDevice().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.label,children:()=>b.None};for(let e of st(this,Dm,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){st(this,Tm,"f").terminate()}copyToIndex(e){cu.create(st(this,dr,"f").graph,B.generate(),r=>{r.composite.refer(st(this,dr,"f").composite.targetVertex.unwrap("composite.target")),r.index.setValue(e),r.label.setValue(st(this,dr,"f").label.getValue()),r.gain.setValue(st(this,dr,"f").gain.getValue()),r.pan.setValue(st(this,dr,"f").pan.getValue()),r.mute.setValue(st(this,dr,"f").mute.getValue()),r.solo.setValue(st(this,dr,"f").solo.getValue())})}};Tm=new WeakMap,Pd=new WeakMap,dr=new WeakMap,Dm=new WeakMap,cc=new WeakMap,z_=new WeakSet,vN=function(e){return{gain:st(this,cc,"f").createParameter(e.gain,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Gain"),pan:st(this,cc,"f").createParameter(e.pan,F.bipolar(),E.panning,"Pan",.5),mute:st(this,cc,"f").createParameter(e.mute,F.bool,E.bool,"Mute"),solo:st(this,cc,"f").createParameter(e.solo,F.bool,E.bool,"Solo")}};var Oy=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},Jt=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)},O_,Rm,Nd,_i,Vy,Cm,xN,Ha=class{constructor(e,r){O_.add(this),this.type="audio-effect",this.accepts="audio",Rm.set(this,new Y),Nd.set(this,void 0),_i.set(this,void 0),Vy.set(this,void 0),Cm.set(this,void 0),Oy(this,Nd,e,"f"),Oy(this,_i,r,"f"),Oy(this,Vy,Jt(this,Rm,"f").own(Rt.create(Jt(this,_i,"f").entries,n=>Jt(this,Nd,"f").boxAdapters.adapterFor(n,Md),l.AudioEffectCompositeCell)),"f"),Oy(this,Cm,Jt(this,Rm,"f").own(new oe(Jt(this,Nd,"f"))),"f"),this.namedParameter=Jt(this,O_,"m",xN).call(this,r)}get box(){return Jt(this,_i,"f")}get uuid(){return Jt(this,_i,"f").address.uuid}get address(){return Jt(this,_i,"f").address}get indexField(){return Jt(this,_i,"f").index}get labelField(){return Jt(this,_i,"f").label}get enabledField(){return Jt(this,_i,"f").enabled}get minimizedField(){return Jt(this,_i,"f").minimized}get host(){return Jt(this,_i,"f").host}get entries(){return Jt(this,Vy,"f")}get inputField(){return Jt(this,_i,"f").input}deviceHost(){return Jt(this,Nd,"f").boxAdapters.adapterFor(Jt(this,_i,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Jt(this,Rm,"f").terminate()}};Rm=new WeakMap,Nd=new WeakMap,_i=new WeakMap,Vy=new WeakMap,Cm=new WeakMap,O_=new WeakSet,xN=function(e){return{dry:Jt(this,Cm,"f").createParameter(e.dry,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Dry"),wet:Jt(this,Cm,"f").createParameter(e.wet,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Wet")}};var Uy=class extends Ha{constructor(e,r){super(e,r)}get entriesFixed(){return!1}get manualUrl(){return ie.AudioEffectComposite}};var jy=class extends Ha{constructor(e,r){super(e,r)}get entriesFixed(){return!0}get manualUrl(){return ie.StereoComposite}};var MD=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},V_=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,U_=F.exponential(20,2e4),j_=E.numeric({unit:"Hz",fractionDigits:0}),zm=class extends Ha{constructor(e,r){super(e,r),$d.set(this,void 0),MD(this,$d,new oe(e),"f"),this.crossover=[V_(this,$d,"f").createParameter(r.crossover1,U_,j_,"Crossover 1"),V_(this,$d,"f").createParameter(r.crossover2,U_,j_,"Crossover 2"),V_(this,$d,"f").createParameter(r.crossover3,U_,j_,"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 ie.FrequencySplit}};$d=new WeakMap;zm.MAX_BANDS=4;var Om;(function(t){t.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(Om||(Om={}));var yN=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},Ai=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)},kd,Fi,Ky=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl=ie.Zeitgeist,kd.set(this,void 0),Fi.set(this,void 0),yN(this,kd,e,"f"),yN(this,Fi,r,"f"),this.groove()}get box(){return Ai(this,Fi,"f")}get uuid(){return Ai(this,Fi,"f").address.uuid}get address(){return Ai(this,Fi,"f").address}get indexField(){return Ai(this,Fi,"f").index}get labelField(){return Ai(this,Fi,"f").label}get enabledField(){return Ai(this,Fi,"f").enabled}get minimizedField(){return Ai(this,Fi,"f").minimized}get host(){return Ai(this,Fi,"f").host}deviceHost(){return Ai(this,kd,"f").boxAdapters.adapterFor(Ai(this,Fi,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}groove(){return Ai(this,kd,"f").boxAdapters.adapterFor(Ai(this,Fi,"f").groove.targetVertex.unwrap("no groove").box,Om.checkType)}catchupAndSubscribeGroove(e){return Ai(this,Fi,"f").groove.catchupAndSubscribe(r=>e(Ai(this,kd,"f").boxAdapters.adapterFor(r.targetVertex.unwrap("No groove found").box,Om.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};kd=new WeakMap,Fi=new WeakMap;var wN=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},oa=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)},Wy,Zi,Ly=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl="",Wy.set(this,void 0),Zi.set(this,void 0),wN(this,Wy,e,"f"),wN(this,Zi,r,"f")}get box(){return oa(this,Zi,"f")}get uuid(){return oa(this,Zi,"f").address.uuid}get address(){return oa(this,Zi,"f").address}get indexField(){return oa(this,Zi,"f").index}get labelField(){return oa(this,Zi,"f").label}get enabledField(){return oa(this,Zi,"f").enabled}get minimizedField(){return oa(this,Zi,"f").minimized}get host(){return oa(this,Zi,"f").host}get commentField(){return oa(this,Zi,"f").comment}deviceHost(){return oa(this,Wy,"f").boxAdapters.adapterFor(oa(this,Zi,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}};Wy=new WeakMap,Zi=new WeakMap;var bN=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)},Zy,Gi,Gy=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl="",Zy.set(this,void 0),Gi.set(this,void 0),bN(this,Zy,e,"f"),bN(this,Gi,r,"f")}get box(){return sa(this,Gi,"f")}get uuid(){return sa(this,Gi,"f").address.uuid}get address(){return sa(this,Gi,"f").address}get indexField(){return sa(this,Gi,"f").index}get labelField(){return sa(this,Gi,"f").label}get enabledField(){return sa(this,Gi,"f").enabled}get minimizedField(){return sa(this,Gi,"f").minimized}get host(){return sa(this,Gi,"f").host}get commentField(){return sa(this,Gi,"f").comment}deviceHost(){return sa(this,Zy,"f").boxAdapters.adapterFor(sa(this,Gi,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Zy=new WeakMap,Gi=new WeakMap;var ks=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)},K_,W_,Vm,Ei,Hy,Bd,la,Sn,Id,_N,L_,qy=class{constructor(e,r){K_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ie.Soundfont,W_.set(this,new Y),Vm.set(this,void 0),Ei.set(this,void 0),Hy.set(this,void 0),Bd.set(this,void 0),la.set(this,void 0),Sn.set(this,void 0),Id.set(this,pe.Empty),L_.set(this,n=>n.match({none:()=>{Ge(this,Sn,"f").clear(),Ge(this,la,"f").clear()},some:i=>i.soundfont.match({none:()=>{Ge(this,Sn,"f").clear(),Ge(this,la,"f").clear(),Ge(this,Id,"f").terminate(),ks(this,Id,i.subscribe(a=>{if(a.type==="loaded"){let o=i.soundfont.unwrap("soundfont");Ge(this,Sn,"f").wrap(o.presets[this.presetIndex]??o.presets[0]),Ge(this,la,"f").wrap(o)}else a.type==="error"?(Ge(this,Sn,"f").clear(),Ge(this,la,"f").clear()):a.type==="idle"&&(Ge(this,Sn,"f").clear(),Ge(this,la,"f").clear())}),"f")},some:a=>{Ge(this,la,"f").wrap(a),Ge(this,Sn,"f").wrap(a.presets[this.presetIndex]??a.presets[0])}})})),ks(this,Vm,e,"f"),ks(this,Ei,r,"f"),ks(this,Hy,new oe(Ge(this,Vm,"f")),"f"),this.namedParameter=Ge(this,K_,"m",_N).call(this,r),ks(this,Bd,new Nr,"f"),ks(this,la,new Nr,"f"),ks(this,Sn,new Nr,"f"),Ge(this,W_,"f").ownAll(Ge(this,Bd,"f").subscribe(Ge(this,L_,"f")),Ge(this,Ei,"f").file.catchupAndSubscribe(({targetVertex:n})=>Ge(this,Bd,"f").wrapOption(n.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),Ge(this,Ei,"f").presetIndex.catchupAndSubscribe(n=>Ge(this,la,"f").match({none:()=>Ge(this,Sn,"f").clear(),some:i=>Ge(this,Sn,"f").wrap(i.presets[n.getValue()]??i.presets[0])})))}get loader(){return Ge(this,Bd,"f")}get soundfont(){return Ge(this,la,"f")}get preset(){return Ge(this,Sn,"f")}get presetIndex(){return Ge(this,Ei,"f").presetIndex.getValue()}get box(){return Ge(this,Ei,"f")}get uuid(){return Ge(this,Ei,"f").address.uuid}get address(){return Ge(this,Ei,"f").address}get labelField(){return Ge(this,Ei,"f").label}get iconField(){return Ge(this,Ei,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return Ge(this,Ei,"f").enabled}get minimizedField(){return Ge(this,Ei,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ge(this,Vm,"f").boxAdapters.adapterFor(Ge(this,Ei,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Ge(this,Id,"f").terminate(),ks(this,Id,pe.Empty,"f"),Ge(this,Hy,"f").terminate()}};W_=new WeakMap,Vm=new WeakMap,Ei=new WeakMap,Hy=new WeakMap,Bd=new WeakMap,la=new WeakMap,Sn=new WeakMap,Id=new WeakMap,L_=new WeakMap,K_=new WeakSet,_N=function(e){return{}};var AN=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},Um=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)},Jy,uc,Yy=class{constructor(e,r){Jy.set(this,void 0),uc.set(this,void 0),AN(this,Jy,e,"f"),AN(this,uc,r,"f")}get box(){return Um(this,uc,"f")}get uuid(){return Um(this,uc,"f").address.uuid}get address(){return Um(this,uc,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return Um(this,Jy,"f").soundfontManager.getOrCreate(Um(this,uc,"f").address.uuid)}terminate(){}};Jy=new WeakMap,uc=new WeakMap;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},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)},G_,jm,Pn,Km,FN,Xy=class{constructor(e,r){G_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Maximizer,jm.set(this,void 0),Pn.set(this,void 0),Km.set(this,void 0),Z_(this,jm,e,"f"),Z_(this,Pn,r,"f"),Z_(this,Km,new oe(Si(this,jm,"f")),"f"),this.namedParameter=Si(this,G_,"m",FN).call(this,r)}get box(){return Si(this,Pn,"f")}get uuid(){return Si(this,Pn,"f").address.uuid}get address(){return Si(this,Pn,"f").address}get indexField(){return Si(this,Pn,"f").index}get labelField(){return Si(this,Pn,"f").label}get enabledField(){return Si(this,Pn,"f").enabled}get minimizedField(){return Si(this,Pn,"f").minimized}get host(){return Si(this,Pn,"f").host}deviceHost(){return Si(this,jm,"f").boxAdapters.adapterFor(Si(this,Pn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Si(this,Km,"f").terminate()}};jm=new WeakMap,Pn=new WeakMap,Km=new WeakMap,G_=new WeakSet,FN=function(e){return{threshold:Si(this,Km,"f").createParameter(e.threshold,F.linear(-24,0),E.decible,"Threshold")}};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},Ft=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)},q_,Wm,Hi,Jr,EN,Qy=class{constructor(e,r){q_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Compressor,Wm.set(this,void 0),Hi.set(this,void 0),Jr.set(this,void 0),H_(this,Wm,e,"f"),H_(this,Hi,r,"f"),H_(this,Jr,new oe(Ft(this,Wm,"f")),"f"),this.namedParameter=Ft(this,q_,"m",EN).call(this,r)}get box(){return Ft(this,Hi,"f")}get uuid(){return Ft(this,Hi,"f").address.uuid}get address(){return Ft(this,Hi,"f").address}get indexField(){return Ft(this,Hi,"f").index}get labelField(){return Ft(this,Hi,"f").label}get enabledField(){return Ft(this,Hi,"f").enabled}get minimizedField(){return Ft(this,Hi,"f").minimized}get host(){return Ft(this,Hi,"f").host}get sideChain(){return Ft(this,Hi,"f").sideChain}deviceHost(){return Ft(this,Wm,"f").boxAdapters.adapterFor(Ft(this,Hi,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Ft(this,Jr,"f").terminate()}};Wm=new WeakMap,Hi=new WeakMap,Jr=new WeakMap,q_=new WeakSet,EN=function(e){return{lookahead:Ft(this,Jr,"f").createParameter(e.lookahead,F.bool,E.bool,"Lookahead"),automakeup:Ft(this,Jr,"f").createParameter(e.automakeup,F.bool,E.bool,"Auto Makeup"),autoattack:Ft(this,Jr,"f").createParameter(e.autoattack,F.bool,E.bool,"Auto Attack"),autorelease:Ft(this,Jr,"f").createParameter(e.autorelease,F.bool,E.bool,"Auto Release"),inputgain:Ft(this,Jr,"f").createParameter(e.inputgain,F.linear(-30,30),E.decible,"Input Gain"),threshold:Ft(this,Jr,"f").createParameter(e.threshold,F.linear(-60,0),E.decible,"Threshold"),ratio:Ft(this,Jr,"f").createParameter(e.ratio,F.exponential(1,24),E.numeric({fractionDigits:1}),"Ratio"),knee:Ft(this,Jr,"f").createParameter(e.knee,F.linear(0,24),E.decible,"Knee"),attack:Ft(this,Jr,"f").createParameter(e.attack,F.linear(0,100),E.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:Ft(this,Jr,"f").createParameter(e.release,F.linear(5,1500),E.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:Ft(this,Jr,"f").createParameter(e.makeup,F.linear(-40,40),E.decible,"Makeup Gain"),mix:Ft(this,Jr,"f").createParameter(e.mix,F.unipolar(),E.percent(),"Dry/Wet")}};var J_=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},Yt=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_,Lm,qi,ca,SN,ew=class{constructor(e,r){Y_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Gate,Lm.set(this,void 0),qi.set(this,void 0),ca.set(this,void 0),J_(this,Lm,e,"f"),J_(this,qi,r,"f"),J_(this,ca,new oe(Yt(this,Lm,"f")),"f"),this.namedParameter=Yt(this,Y_,"m",SN).call(this,r)}get box(){return Yt(this,qi,"f")}get uuid(){return Yt(this,qi,"f").address.uuid}get address(){return Yt(this,qi,"f").address}get indexField(){return Yt(this,qi,"f").index}get labelField(){return Yt(this,qi,"f").label}get enabledField(){return Yt(this,qi,"f").enabled}get minimizedField(){return Yt(this,qi,"f").minimized}get host(){return Yt(this,qi,"f").host}get sideChain(){return Yt(this,qi,"f").sideChain}deviceHost(){return Yt(this,Lm,"f").boxAdapters.adapterFor(Yt(this,qi,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Yt(this,ca,"f").terminate()}};Lm=new WeakMap,qi=new WeakMap,ca=new WeakMap,Y_=new WeakSet,SN=function(e){return{inverse:Yt(this,ca,"f").createParameter(e.inverse,F.bool,E.bool,"Inverse"),threshold:Yt(this,ca,"f").createParameter(e.threshold,F.linear(-80,0),E.decible,"Threshold"),return:Yt(this,ca,"f").createParameter(e.return,F.linear(0,24),E.decible,"Return"),attack:Yt(this,ca,"f").createParameter(e.attack,F.linear(0,1e3),E.numeric({unit:"ms",fractionDigits:1}),"Attack"),hold:Yt(this,ca,"f").createParameter(e.hold,F.linear(0,500),E.numeric({unit:"ms",fractionDigits:1}),"Hold"),release:Yt(this,ca,"f").createParameter(e.release,F.linear(1,2e3),E.numeric({unit:"ms",fractionDigits:1}),"Release"),floor:Yt(this,ca,"f").createParameter(e.floor,F.decibel(-72,-12,0),E.decible,"Floor")}};var X_=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)},Q_,Zm,Mn,qa,PN,tw=class{constructor(e,r){Q_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Autotune,Zm.set(this,void 0),Mn.set(this,void 0),qa.set(this,void 0),X_(this,Zm,e,"f"),X_(this,Mn,r,"f"),X_(this,qa,new oe(br(this,Zm,"f")),"f"),this.namedParameter=br(this,Q_,"m",PN).call(this,r)}get box(){return br(this,Mn,"f")}get uuid(){return br(this,Mn,"f").address.uuid}get address(){return br(this,Mn,"f").address}get indexField(){return br(this,Mn,"f").index}get labelField(){return br(this,Mn,"f").label}get enabledField(){return br(this,Mn,"f").enabled}get minimizedField(){return br(this,Mn,"f").minimized}get host(){return br(this,Mn,"f").host}deviceHost(){return br(this,Zm,"f").boxAdapters.adapterFor(br(this,Mn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){br(this,qa,"f").terminate()}};Zm=new WeakMap,Mn=new WeakMap,qa=new WeakMap,Q_=new WeakSet,PN=function(e){return{key:br(this,qa,"f").createParameter(e.key,F.linearInteger(0,11),E.indices("",["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]),"Key"),scale:br(this,qa,"f").createParameter(e.scale,F.linearInteger(0,7),E.indices("",["Chrom","Major","Minor","MajPent","MinPent","Blues","Dorian","Mixo"]),"Scale"),amount:br(this,qa,"f").createParameter(e.amount,F.unipolar(),E.percent(),"Amount"),retune:br(this,qa,"f").createParameter(e.retune,F.unipolar(),E.percent(),"Retune"),smooth:br(this,qa,"f").createParameter(e.smooth,F.unipolar(),E.percent(),"Smooth"),shift:br(this,qa,"f").createParameter(e.shift,F.linear(-12,12),E.numeric({unit:"st"}),"Shift")}};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},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)},t1,Gm,Nn,Bs,MN,rw=class{constructor(e,r){t1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Crusher,Gm.set(this,void 0),Nn.set(this,void 0),Bs.set(this,void 0),e1(this,Gm,e,"f"),e1(this,Nn,r,"f"),e1(this,Bs,new oe(Rr(this,Gm,"f")),"f"),this.namedParameter=Rr(this,t1,"m",MN).call(this,r)}get box(){return Rr(this,Nn,"f")}get uuid(){return Rr(this,Nn,"f").address.uuid}get address(){return Rr(this,Nn,"f").address}get indexField(){return Rr(this,Nn,"f").index}get labelField(){return Rr(this,Nn,"f").label}get enabledField(){return Rr(this,Nn,"f").enabled}get minimizedField(){return Rr(this,Nn,"f").minimized}get host(){return Rr(this,Nn,"f").host}deviceHost(){return Rr(this,Gm,"f").boxAdapters.adapterFor(Rr(this,Nn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Rr(this,Bs,"f").terminate()}};Gm=new WeakMap,Nn=new WeakMap,Bs=new WeakMap,t1=new WeakSet,MN=function(e){return{crush:Rr(this,Bs,"f").createParameter(e.crush,F.unipolar(),E.percent(),"Crush"),bits:Rr(this,Bs,"f").createParameter(e.bits,F.linearInteger(1,16),E.numeric(),"Bits"),boost:Rr(this,Bs,"f").createParameter(e.boost,F.linear(0,24),E.decible,"Boost"),mix:Rr(this,Bs,"f").createParameter(e.mix,F.exponential(.001,1),E.percent(),"Mix")}};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},oi=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,Hm,$n,Td,NN,iw=class{constructor(e,r){i1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Fold,Hm.set(this,void 0),$n.set(this,void 0),Td.set(this,void 0),r1(this,Hm,e,"f"),r1(this,$n,r,"f"),r1(this,Td,new oe(oi(this,Hm,"f")),"f"),this.namedParameter=oi(this,i1,"m",NN).call(this,r)}get box(){return oi(this,$n,"f")}get uuid(){return oi(this,$n,"f").address.uuid}get address(){return oi(this,$n,"f").address}get indexField(){return oi(this,$n,"f").index}get labelField(){return oi(this,$n,"f").label}get enabledField(){return oi(this,$n,"f").enabled}get minimizedField(){return oi(this,$n,"f").minimized}get host(){return oi(this,$n,"f").host}deviceHost(){return oi(this,Hm,"f").boxAdapters.adapterFor(oi(this,$n,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){oi(this,Td,"f").terminate()}};Hm=new WeakMap,$n=new WeakMap,Td=new WeakMap,i1=new WeakSet,NN=function(e){return{drive:oi(this,Td,"f").createParameter(e.drive,F.linear(0,30),E.decible,"Drive"),volume:oi(this,Td,"f").createParameter(e.volume,F.linear(-18,0),E.decible,"Volume")}};var nw=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)},qm,Jm,kn,Dd,Rd,ND=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 pe.many(t.label.subscribe(()=>e(this)),t.controller.subscribe(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}},aw=class{constructor(e,r){qm.set(this,new Y),this.type="instrument",this.accepts="midi",this.manualUrl=ie.MIDIOutput,Jm.set(this,void 0),kn.set(this,void 0),Dd.set(this,void 0),Rd.set(this,void 0),nw(this,Jm,e,"f"),nw(this,kn,r,"f"),nw(this,Dd,new Nr,"f"),nw(this,Rd,pr(this,qm,"f").own(new oe(pr(this,Jm,"f"))),"f"),pr(this,qm,"f").ownAll(r.parameters.pointerHub.catchupAndSubscribe({onAdded:(({box:n})=>{let i=Re(n,cl);pr(this,Rd,"f").createParameter(i.value,F.unipolar(),E.percent({fractionDigits:1}),ND(i),0)}),onRemoved:(({box:n})=>pr(this,Rd,"f").removeParameter(Re(n,cl).value.address))}),pr(this,kn,"f").device.catchupAndSubscribe(({targetVertex:n})=>n.match({none:()=>pr(this,Dd,"f").clear(),some:({box:i})=>pr(this,Dd,"f").wrap(Re(i,Qo))})))}get box(){return pr(this,kn,"f")}get uuid(){return pr(this,kn,"f").address.uuid}get address(){return pr(this,kn,"f").address}get labelField(){return pr(this,kn,"f").label}get iconField(){return pr(this,kn,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return pr(this,kn,"f").enabled}get minimizedField(){return pr(this,kn,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return pr(this,Rd,"f")}get midiDevice(){return pr(this,Dd,"f")}deviceHost(){return pr(this,Jm,"f").boxAdapters.adapterFor(pr(this,kn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){pr(this,qm,"f").terminate()}};qm=new WeakMap,Jm=new WeakMap,kn=new WeakMap,Dd=new WeakMap,Rd=new WeakMap;var ow=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)},n1,Ym,Bn,Ja,Xm,$N,sw=class{constructor(e,r){n1.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=ie.Velocity,Ym.set(this,void 0),Bn.set(this,void 0),Ja.set(this,void 0),Xm.set(this,void 0),ow(this,Ym,e,"f"),ow(this,Bn,r,"f"),ow(this,Ja,new oe(Xt(this,Ym,"f")),"f"),ow(this,Xm,fg.create(),"f"),this.namedParameter=Xt(this,n1,"m",$N).call(this,r)}computeVelocity(e,r){let{magnetPosition:n,magnetStrength:i,randomSeed:a,randomAmount:o,offset:s,mix:c}=this.namedParameter;Xt(this,Xm,"f").setSeed(a.valueAt(e)+e);let u=r+(n.valueAt(e)-r)*i.valueAt(e),f=(Xt(this,Xm,"f").uniform()*2-1)*o.valueAt(e),v=s.valueAt(e),h=c.valueAt(e);return r*(1-h)+ag(u+f+v)*h}get box(){return Xt(this,Bn,"f")}get uuid(){return Xt(this,Bn,"f").address.uuid}get address(){return Xt(this,Bn,"f").address}get indexField(){return Xt(this,Bn,"f").index}get labelField(){return Xt(this,Bn,"f").label}get enabledField(){return Xt(this,Bn,"f").enabled}get minimizedField(){return Xt(this,Bn,"f").minimized}get host(){return Xt(this,Bn,"f").host}deviceHost(){return Xt(this,Ym,"f").boxAdapters.adapterFor(Xt(this,Bn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Xt(this,Ja,"f").terminate()}};Ym=new WeakMap,Bn=new WeakMap,Ja=new WeakMap,Xm=new WeakMap,n1=new WeakSet,$N=function(e){return{magnetPosition:Xt(this,Ja,"f").createParameter(e.magnetPosition,F.unipolar(),E.percent(),"Position"),magnetStrength:Xt(this,Ja,"f").createParameter(e.magnetStrength,F.unipolar(),E.percent(),"Strength"),randomSeed:Xt(this,Ja,"f").createParameter(e.randomSeed,F.linearInteger(0,65535),E.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:Xt(this,Ja,"f").createParameter(e.randomAmount,F.unipolar(),E.percent(),"Amount"),offset:Xt(this,Ja,"f").createParameter(e.offset,F.bipolar(),E.percent(),"Offset"),mix:Xt(this,Ja,"f").createParameter(e.mix,F.unipolar(),E.percent(),"Mix")}};var a1=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},_r=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)},o1,s1,Qm,In,Ya,kN,dc=class{constructor(e,r){o1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Tidal,Qm.set(this,void 0),In.set(this,void 0),Ya.set(this,void 0),a1(this,Qm,e,"f"),a1(this,In,r,"f"),a1(this,Ya,new oe(_r(this,Qm,"f")),"f"),this.namedParameter=_r(this,o1,"m",kN).call(this,r)}get box(){return _r(this,In,"f")}get uuid(){return _r(this,In,"f").address.uuid}get address(){return _r(this,In,"f").address}get indexField(){return _r(this,In,"f").index}get labelField(){return _r(this,In,"f").label}get enabledField(){return _r(this,In,"f").enabled}get minimizedField(){return _r(this,In,"f").minimized}get host(){return _r(this,In,"f").host}deviceHost(){return _r(this,Qm,"f").boxAdapters.adapterFor(_r(this,In,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){_r(this,Ya,"f").terminate()}};s1=dc,Qm=new WeakMap,In=new WeakMap,Ya=new WeakMap,o1=new WeakSet,kN=function(e){let{RateFractions:r,RateStringMapping:n}=s1;return{slope:_r(this,Ya,"f").createParameter(e.slope,F.bipolar(),E.percent({fractionDigits:1}),"Slope",.5),symmetry:_r(this,Ya,"f").createParameter(e.symmetry,F.unipolar(),E.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:_r(this,Ya,"f").createParameter(e.rate,F.values(r.map((i,a)=>a)),n,"Rate",0),depth:_r(this,Ya,"f").createParameter(e.depth,F.unipolar(),E.percent({fractionDigits:1}),"Depth",0),offset:_r(this,Ya,"f").createParameter(e.offset,F.linear(-180,180),E.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:_r(this,Ya,"f").createParameter(e.channelOffset,F.linear(-180,180),E.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};dc.RateFractions=Wo.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();dc.RateStringMapping=E.indices("",s1.RateFractions.map(([t,e])=>`${t}/${e}`));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},Et=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,eh,si,Pi,BN,lw=class{constructor(e,r){c1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Vocoder,eh.set(this,void 0),si.set(this,void 0),Pi.set(this,void 0),l1(this,eh,e,"f"),l1(this,si,r,"f"),l1(this,Pi,new oe(Et(this,eh,"f")),"f"),this.namedParameter=Et(this,c1,"m",BN).call(this,r)}get box(){return Et(this,si,"f")}get uuid(){return Et(this,si,"f").address.uuid}get address(){return Et(this,si,"f").address}get indexField(){return Et(this,si,"f").index}get labelField(){return Et(this,si,"f").label}get enabledField(){return Et(this,si,"f").enabled}get minimizedField(){return Et(this,si,"f").minimized}get host(){return Et(this,si,"f").host}get sideChain(){return Et(this,si,"f").sideChain}get modulatorSpectrum(){return Et(this,si,"f").address.append(4094)}get carrierSpectrum(){return Et(this,si,"f").address.append(4095)}deviceHost(){return Et(this,eh,"f").boxAdapters.adapterFor(Et(this,si,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Et(this,Pi,"f").terminate()}};eh=new WeakMap,si=new WeakMap,Pi=new WeakMap,c1=new WeakSet,BN=function(e){let r=F.exponential(20,2e4),n=E.numeric({unit:"Hz",fractionDigits:0}),i=F.exponential(1,60),a=E.numeric({fractionDigits:1});return{carrierMinFreq:Et(this,Pi,"f").createParameter(e.carrierMinFreq,r,n,"Carrier Min"),carrierMaxFreq:Et(this,Pi,"f").createParameter(e.carrierMaxFreq,r,n,"Carrier Max"),modulatorMinFreq:Et(this,Pi,"f").createParameter(e.modulatorMinFreq,r,n,"Mod Min"),modulatorMaxFreq:Et(this,Pi,"f").createParameter(e.modulatorMaxFreq,r,n,"Mod Max"),qStart:Et(this,Pi,"f").createParameter(e.qStart,i,a,"Q Start"),qEnd:Et(this,Pi,"f").createParameter(e.qEnd,i,a,"Q End"),envAttack:Et(this,Pi,"f").createParameter(e.envAttack,F.exponential(.1,100),E.numeric({unit:"ms",fractionDigits:1}),"Attack"),envRelease:Et(this,Pi,"f").createParameter(e.envRelease,F.exponential(1,1e3),E.numeric({unit:"ms",fractionDigits:0}),"Release"),gain:Et(this,Pi,"f").createParameter(e.gain,F.linear(-20,20),E.decible,"Gain"),mix:Et(this,Pi,"f").createParameter(e.mix,F.unipolar(),E.percent(),"Mix")}};var u1=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)},d1,th,Tn,Yr,IN,cw=class{constructor(e,r){d1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.DattorroReverb,th.set(this,void 0),Tn.set(this,void 0),Yr.set(this,void 0),u1(this,th,e,"f"),u1(this,Tn,r,"f"),u1(this,Yr,new oe($t(this,th,"f")),"f"),this.namedParameter=$t(this,d1,"m",IN).call(this,r)}get box(){return $t(this,Tn,"f")}get uuid(){return $t(this,Tn,"f").address.uuid}get address(){return $t(this,Tn,"f").address}get indexField(){return $t(this,Tn,"f").index}get labelField(){return $t(this,Tn,"f").label}get enabledField(){return $t(this,Tn,"f").enabled}get minimizedField(){return $t(this,Tn,"f").minimized}get host(){return $t(this,Tn,"f").host}deviceHost(){return $t(this,th,"f").boxAdapters.adapterFor($t(this,Tn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){$t(this,Yr,"f").terminate()}};th=new WeakMap,Tn=new WeakMap,Yr=new WeakMap,d1=new WeakSet,IN=function(e){return{preDelay:$t(this,Yr,"f").createParameter(e.preDelay,F.linear(0,1e3),E.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:$t(this,Yr,"f").createParameter(e.bandwidth,F.unipolar(),E.percent(),"Bandwidth"),inputDiffusion1:$t(this,Yr,"f").createParameter(e.inputDiffusion1,F.unipolar(),E.percent(),"Tank 1"),inputDiffusion2:$t(this,Yr,"f").createParameter(e.inputDiffusion2,F.unipolar(),E.percent(),"Tank 2"),decay:$t(this,Yr,"f").createParameter(e.decay,F.unipolar(),E.percent(),"Decay"),decayDiffusion1:$t(this,Yr,"f").createParameter(e.decayDiffusion1,F.unipolar(),E.percent(),"Tank 1"),decayDiffusion2:$t(this,Yr,"f").createParameter(e.decayDiffusion2,F.unipolar(),E.percent(),"Tank 2"),damping:$t(this,Yr,"f").createParameter(e.damping,F.unipolar(),E.percent(),"Damping"),excursionRate:$t(this,Yr,"f").createParameter(e.excursionRate,F.unipolar(),E.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:$t(this,Yr,"f").createParameter(e.excursionDepth,F.unipolar(),E.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:$t(this,Yr,"f").createParameter(e.wet,F.DefaultDecibel,E.decible,"Wet"),dry:$t(this,Yr,"f").createParameter(e.dry,F.DefaultDecibel,E.decible,"Dry")}};var TN=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},Cd=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,Do,zd=class{constructor(e,r){p1.set(this,void 0),Do.set(this,void 0),TN(this,p1,e,"f"),TN(this,Do,r,"f")}get box(){return Cd(this,Do,"f")}get uuid(){return Cd(this,Do,"f").address.uuid}get address(){return Cd(this,Do,"f").address}get labelField(){return Cd(this,Do,"f").label}get modelField(){return Cd(this,Do,"f").model}getModelJson(){return Cd(this,Do,"f").model.getValue()}terminate(){}};p1=new WeakMap,Do=new WeakMap;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},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)},m1,Od,Cr,pc,DN,uw=class{constructor(e,r){m1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.NeuralAmp,Od.set(this,void 0),Cr.set(this,void 0),pc.set(this,void 0),f1(this,Od,e,"f"),f1(this,Cr,r,"f"),f1(this,pc,new oe(Kt(this,Od,"f")),"f"),this.namedParameter=Kt(this,m1,"m",DN).call(this,r)}get box(){return Kt(this,Cr,"f")}get uuid(){return Kt(this,Cr,"f").address.uuid}get address(){return Kt(this,Cr,"f").address}get indexField(){return Kt(this,Cr,"f").index}get labelField(){return Kt(this,Cr,"f").label}get enabledField(){return Kt(this,Cr,"f").enabled}get minimizedField(){return Kt(this,Cr,"f").minimized}get host(){return Kt(this,Cr,"f").host}get modelField(){return Kt(this,Cr,"f").model}get monoField(){return Kt(this,Cr,"f").mono}get spectrum(){return Kt(this,Cr,"f").address.append(4095)}getModelAdapter(){let e=Kt(this,Cr,"f").model.targetVertex;return e.isEmpty()?b.None:b.wrap(Kt(this,Od,"f").boxAdapters.adapterFor(e.unwrap().box,zd))}getModelJson(){let e=this.getModelAdapter();return e.nonEmpty()?e.unwrap().getModelJson():Kt(this,Cr,"f").modelJson.getValue()}deviceHost(){return Kt(this,Od,"f").boxAdapters.adapterFor(Kt(this,Cr,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Kt(this,pc,"f").terminate()}};Od=new WeakMap,Cr=new WeakMap,pc=new WeakMap,m1=new WeakSet,DN=function(e){return{inputGain:Kt(this,pc,"f").createParameter(e.inputGain,F.decibel(-72,0,12),E.numeric({unit:"dB",fractionDigits:1}),"Input"),outputGain:Kt(this,pc,"f").createParameter(e.outputGain,F.decibel(-72,0,12),E.numeric({unit:"dB",fractionDigits:1}),"Output"),mix:Kt(this,pc,"f").createParameter(e.mix,F.linear(0,1),E.percent(),"Mix")}};var h1=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},Xr=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)},g1,rh,Dn,fc,RN,dw=class{constructor(e,r){g1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Waveshaper,rh.set(this,void 0),Dn.set(this,void 0),fc.set(this,void 0),h1(this,rh,e,"f"),h1(this,Dn,r,"f"),h1(this,fc,new oe(Xr(this,rh,"f")),"f"),this.namedParameter=Xr(this,g1,"m",RN).call(this,r)}get box(){return Xr(this,Dn,"f")}get uuid(){return Xr(this,Dn,"f").address.uuid}get address(){return Xr(this,Dn,"f").address}get indexField(){return Xr(this,Dn,"f").index}get labelField(){return Xr(this,Dn,"f").label}get enabledField(){return Xr(this,Dn,"f").enabled}get minimizedField(){return Xr(this,Dn,"f").minimized}get host(){return Xr(this,Dn,"f").host}deviceHost(){return Xr(this,rh,"f").boxAdapters.adapterFor(Xr(this,Dn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Xr(this,fc,"f").terminate()}};rh=new WeakMap,Dn=new WeakMap,fc=new WeakMap,g1=new WeakSet,RN=function(e){return{inputGain:Xr(this,fc,"f").createParameter(e.inputGain,F.linear(0,40),E.decible,"Input"),outputGain:Xr(this,fc,"f").createParameter(e.outputGain,F.linear(-24,24),E.decible,"Output"),mix:Xr(this,fc,"f").createParameter(e.mix,F.unipolar(),E.percent(),"Mix")}};var pw=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)},ih,nh,Rn,ah,fw,mw=class{constructor(e,r){ih.set(this,new Y),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Werkstatt,nh.set(this,void 0),Rn.set(this,void 0),ah.set(this,void 0),fw.set(this,void 0),pw(this,nh,e,"f"),pw(this,Rn,r,"f"),pw(this,ah,zr(this,ih,"f").own(new oe(zr(this,nh,"f"))),"f");let{terminable:n,codeChanged:i}=xr.subscribeScriptParams(zr(this,ah,"f"),r.code,r.parameters);zr(this,ih,"f").own(n),pw(this,fw,i,"f")}get box(){return zr(this,Rn,"f")}get uuid(){return zr(this,Rn,"f").address.uuid}get address(){return zr(this,Rn,"f").address}get indexField(){return zr(this,Rn,"f").index}get labelField(){return zr(this,Rn,"f").label}get enabledField(){return zr(this,Rn,"f").enabled}get minimizedField(){return zr(this,Rn,"f").minimized}get host(){return zr(this,Rn,"f").host}get parameters(){return zr(this,ah,"f")}get codeChanged(){return zr(this,fw,"f")}deviceHost(){return zr(this,nh,"f").boxAdapters.adapterFor(zr(this,Rn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){zr(this,ih,"f").terminate()}};ih=new WeakMap,nh=new WeakMap,Rn=new WeakMap,ah=new WeakMap,fw=new WeakMap;var ce=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,le,kD,BD,ID,TD;le=new WeakMap,kD=new WeakMap,BD=new WeakMap,ID=new WeakMap,$D=new WeakSet,TD=function(e){return Ke(e.accept({visitArpeggioDeviceBox:r=>new ic(ce(this,le,"f"),r),visitAudioBusBox:r=>new Di(ce(this,le,"f"),r),visitAudioClipBox:r=>new Fu(ce(this,le,"f"),r),visitAudioFileBox:r=>new Zn(ce(this,le,"f"),r),visitAudioTimeStretchBox:r=>new ka(ce(this,le,"f"),r),visitAudioPitchStretchBox:r=>new $a(ce(this,le,"f"),r),visitAudioSignalsmithBox:r=>new Ba(ce(this,le,"f"),r),visitTransientMarkerBox:r=>new mu(r),visitWarpMarkerBox:r=>new Ma(ce(this,le,"f"),r),visitApparatDeviceBox:r=>new $y(ce(this,le,"f"),r),visitCubedDeviceBox:r=>new ky(ce(this,le,"f"),r),visitAudioRegionBox:r=>new Vu(ce(this,le,"f"),r),visitAudioUnitBox:r=>new fn(ce(this,le,"f"),r),visitAuxSendBox:r=>new Qu(ce(this,le,"f"),r),visitMaximizerDeviceBox:r=>new Xy(ce(this,le,"f"),r),visitCompressorDeviceBox:r=>new Qy(ce(this,le,"f"),r),visitGateDeviceBox:r=>new ew(ce(this,le,"f"),r),visitAutotuneDeviceBox:r=>new tw(ce(this,le,"f"),r),visitCrusherDeviceBox:r=>new rw(ce(this,le,"f"),r),visitDattorroReverbDeviceBox:r=>new cw(ce(this,le,"f"),r),visitDelayDeviceBox:r=>new ea(ce(this,le,"f"),r),visitDeviceInterfaceKnobBox:r=>new pd(ce(this,le,"f"),r),visitTidalDeviceBox:r=>new dc(ce(this,le,"f"),r),visitFoldDeviceBox:r=>new iw(ce(this,le,"f"),r),visitGrooveShuffleBox:r=>new Ka(ce(this,le,"f"),r),visitMarkerBox:r=>new xs(ce(this,le,"f"),r),visitSignatureEventBox:r=>new Ll(ce(this,le,"f"),r),visitMIDIOutputDeviceBox:r=>new aw(ce(this,le,"f"),r),visitModularAudioInputBox:r=>new ud(ce(this,le,"f"),r),visitModularAudioOutputBox:r=>new sd(ce(this,le,"f"),r),visitModularBox:r=>new As(ce(this,le,"f"),r),visitModularDeviceBox:r=>new md(ce(this,le,"f"),r),visitModuleConnectionBox:r=>new _s(ce(this,le,"f"),r),visitModuleDelayBox:r=>new od(ce(this,le,"f"),r),visitModuleGainBox:r=>new ld(ce(this,le,"f"),r),visitModuleMultiplierBox:r=>new cd(ce(this,le,"f"),r),visitNeonDeviceBox:r=>new By(ce(this,le,"f"),r),visitNanoDeviceBox:r=>new Iy(ce(this,le,"f"),r),visitNeuralAmpDeviceBox:r=>new uw(ce(this,le,"f"),r),visitNeuralAmpModelBox:r=>new zd(ce(this,le,"f"),r),visitNoteClipBox:r=>new Mu(ce(this,le,"f"),r),visitNoteEventBox:r=>new El(ce(this,le,"f"),r),visitNoteEventCollectionBox:r=>new ln(ce(this,le,"f"),r),visitNoteRegionBox:r=>new ju(ce(this,le,"f"),r),visitPitchDeviceBox:r=>new Fy(ce(this,le,"f"),r),visitPlayfieldDeviceBox:r=>new Sd(ce(this,le,"f"),r),visitPlayfieldSampleBox:r=>new Ed(ce(this,le,"f"),r),visitAudioEffectCompositeBox:r=>new Uy(ce(this,le,"f"),r),visitAudioEffectCompositeCellBox:r=>new Md(ce(this,le,"f"),r),visitStereoCompositeBox:r=>new jy(ce(this,le,"f"),r),visitFrequencySplitBox:r=>new zm(ce(this,le,"f"),r),visitRevampDeviceBox:r=>new Rx(ce(this,le,"f"),r),visitReverbDeviceBox:r=>new Dx(ce(this,le,"f"),r),visitRootBox:r=>new wy(ce(this,le,"f"),r),visitSoundfontDeviceBox:r=>new qy(ce(this,le,"f"),r),visitSoundfontFileBox:r=>new Yy(ce(this,le,"f"),r),visitSpielwerkDeviceBox:r=>new Py(ce(this,le,"f"),r),visitStereoToolDeviceBox:r=>new Cy(ce(this,le,"f"),r),visitTapeDeviceBox:r=>new by(ce(this,le,"f"),r),visitTimelineBox:r=>new Ua(ce(this,le,"f"),r),visitTrackBox:r=>new or(ce(this,le,"f"),r),visitUnknownAudioEffectDeviceBox:r=>new Ly(ce(this,le,"f"),r),visitUnknownMidiEffectDeviceBox:r=>new Gy(ce(this,le,"f"),r),visitValueClipBox:r=>new as(ce(this,le,"f"),r),visitValueEventBox:r=>new vo(ce(this,le,"f"),r),visitValueEventCollectionBox:r=>new kr(ce(this,le,"f"),r),visitValueRegionBox:r=>new Fo(ce(this,le,"f"),r),visitVaporisateurDeviceBox:r=>new _y(ce(this,le,"f"),r),visitVocoderDeviceBox:r=>new lw(ce(this,le,"f"),r),visitWaveshaperDeviceBox:r=>new dw(ce(this,le,"f"),r),visitWerkstattDeviceBox:r=>new mw(ce(this,le,"f"),r),visitVelocityDeviceBox:r=>new sw(ce(this,le,"f"),r),visitZeitgeistDeviceBox:r=>new Ky(ce(this,le,"f"),r)}),`Could not find factory for ${e}`)};var Xa;(function(t){t.PEAKS=Ce.compose(B.Lowest).append(0),t.SPECTRUM=Ce.compose(B.Lowest).append(1),t.WAVEFORM=Ce.compose(B.Lowest).append(2),t.STEREO=Ce.compose(B.Lowest).append(3),t.GONIO=Ce.compose(B.Lowest).append(4),t.LOUDNESS=Ce.compose(B.Lowest).append(5),t.HEAP=Ce.compose(B.Lowest).append(6)})(Xa||(Xa={}));var CN;(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)))}})(CN||(CN={}));var hw=512,zN=ki.createBuilder({position:ki.float,bpm:ki.float,playbackTimestamp:ki.float,countInBeatsRemaining:ki.float,isPlaying:ki.bool,isCountingIn:ki.bool,isRecording:ki.bool,perfIndex:ki.int32,perfBuffer:ki.floats(hw)});var ON;(function(t){t.store=(e,r,n)=>{if(n==="")return j("MetaData.store: origin must be unique to your app.");let i=e.pointerHub.filter(l.MetaData).map(({box:o})=>o).find(o=>o instanceof jn&&o.origin.getValue()===n),a=o=>{o.target.refer(e),o.origin.setValue(n),o.value.setValue(JSON.stringify(r))};T0(i)?a(i):jn.create(e.graph,B.generate(),a)},t.read=(e,r)=>{if(r==="")return j("MetaData.read: origin must be unique to your app.");let n=e.pointerHub.filter(l.MetaData).map(({box:i})=>i).find(i=>i instanceof jn&&i.origin.getValue()===r);if(T0(n)){let{status:i,value:a,error:o}=Lt(()=>JSON.parse(n.value.getValue()));if(i==="success")return a;console.warn(o)}return null},t.clear=(e,r)=>{if(r==="")return j("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(l.MetaData).map(({box:n})=>n).filter(n=>n instanceof jn&&n.origin.getValue()===r).forEach(n=>n.delete())},t.catchupAndSubscribe=(e,r,n)=>{if(r==="")return j("MetaData.catchupAndSubscribe: origin must be unique to your app.");let i=B.newSet(s=>s.uuid),a=s=>{let{status:c,value:u,error:f}=Lt(()=>JSON.parse(s.value.getValue()));c==="success"?n(b.wrap(u)):(console.warn(f),n(b.None))},o=e.pointerHub.catchupAndSubscribe({onAdded:({box:s})=>{if(!(s instanceof jn)||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 jn)||s.origin.getValue()!==r)return;i.removeByKey(s.address.uuid).subscription.terminate(),n(b.None)}},l.MetaData);return{terminate:()=>{o.terminate(),i.forEach(({subscription:s})=>s.terminate()),i.clear()}}}})(ON||(ON={}));var DD,RD,CD,zD;DD=new WeakMap,RD=new WeakMap,CD=new WeakMap,zD=new WeakMap;var Is;(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)=>{en(r)||(t.isNoteOn(r)?N(n.noteOn,t.readPitch(r),t.readVelocity(r)):t.isNoteOff(r)?N(n.noteOff,t.readPitch(r)):t.isPitchWheel(r)?N(n.pitchBend,t.asPitchBend(r)):t.isController(r)?N(n.controller,t.readParam1(r),t.readParam2(r)/127):t.isClock(r)?N(n.clock):t.isStart(r)?N(n.start):t.isContinue(r)?N(n.continue):t.isStop(r)?N(n.stop):t.isPosition(r)&&N(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"})(Is||(Is={}));var Ro;(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(Is.isNoteOn(n)){let i=Is.readPitch(n),a=Is.readVelocity(n);return{type:"note-on",uuid:r,pitch:i,velocity:a}}else if(Is.isNoteOff(n)){let i=Is.readPitch(n);return{type:"note-off",uuid:r,pitch:i}}return j("Unknown MIDI event")}})(Ro||(Ro={}));var VN;(function(t){t.start=(e,r,n,i=1)=>{let a=!0;return e(Ro.on(r,n,i)),{terminate:()=>{a&&(e(Ro.off(r,n)),a=!1)}}}})(VN||(VN={}));var UN=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)},OD,VD,jN,KN,UD,jD;VD=new WeakMap,jN=new WeakMap,KN=new WeakMap,UD=new WeakMap,OD=new WeakSet,jD=function(e,r){return e.subscribeIntegers(r,n=>{UN(this,jN,"f").replace(n.buffer)&&UN(this,KN,"f").notify(this)})};var KD,WD,LD,ZD,GD,HD;KD=new WeakMap,WD=new WeakMap,LD=new WeakMap,ZD=new WeakMap,GD=new WeakMap,HD=new WeakMap;var ua={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})??j("Could not cast to AnyRegionBox"),isLoopableRegionBox:t=>t.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var gw={min:30,max:1e3,default:120};var vw;(function(t){t.isTimeSignatureValid=(e,r)=>!Number.isInteger(e)||e<1||e>31?Pr.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(r)||r<1||r>32||(r&r-1)!==0?Pr.err("Denominator must be a power of two between 1 and 32"):Pr.ok([e,r]),t.clampBpm=e=>Number.isFinite(e)?Fe(e,gw.min,gw.max):gw.default,t.clampBaseFrequency=e=>Number.isFinite(e)?Fe(e,Bx.min,Bx.max):Bx.default,t.hasOverlappingRegions=e=>e.boxes().some(r=>r.accept({visitTrackBox:n=>{for(let[i,a]of de.iterateAdjacent(n.regions.pointerHub.incoming().map(({box:o})=>ua.asRegionBox(o)).sort(({position:o},{position:s})=>o.getValue()-s.getValue()))){if(i instanceof Xo&&i.timeBase.getValue()===ti.Seconds)return!1;if(i.position.getValue()+i.duration.getValue()>a.position.getValue())return!0}return!1}})??!1)})(vw||(vw={}));var WN;(function(t){t.parseTimeSignature=e=>{let[r,n]=e.split("/"),i=parseInt(r,10),a=parseInt(n,10);return vw.isTimeSignatureValid(i,a)}})(WN||(WN={}));var LN;(function(t){t.reader=(e,r)=>{let n=`
3
+ `),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()}`}};xD([Tc,_M("design:type",xa),_M("design:paramtypes",[])],D.prototype,"pointerHub",null);var Bp;(function(t){t.clampInt32=(e,r)=>r,t.clampFloat32=(e,r)=>r})(Bp||(Bp={}));var ze;(function(t){t[t.This=0]="This",t[t.Parent=1]="Parent",t[t.Children=2]="Children"})(ze||(ze={}));var Sg;(function(t){t.create=()=>new Q0})(Sg||(Sg={}));var Q0=class{#e=new Ip(Qs.equals);#t=new Ip(Qs.startsWith);#r=new Ip(Qs.endsWith);#i=[];#n=0;#a=!1;subscribe(e,r,n){let i=new e_(r,e,this.#n++,n);if(this.#a){let a=new t_(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 ze.This:return this.#e.subscribe(e);case ze.Parent:return this.#t.subscribe(e);case ze.Children:return this.#r.subscribe(e);default:return ig(r)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},e_=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: ${ze[this.propagation]}, order: ${this.order} }`}},Ip=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(Qs.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},t_=class{monitor;propagation;#e=new Y;#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()}};var Pt;(function(t){t.Boolean="boolean",t.Float32="float32",t.Int32="int32",t.String="string",t.Bytes="bytes"})(Pt||(Pt={}));var tl={[Pt.Boolean]:{type:Pt.Boolean,encode:(t,e)=>t.writeBoolean(e),decode:t=>t.readBoolean()},[Pt.Float32]:{type:Pt.Float32,encode:(t,e)=>t.writeFloat(e),decode:t=>t.readFloat()},[Pt.Int32]:{type:Pt.Int32,encode:(t,e)=>t.writeInt(e),decode:t=>t.readInt()},[Pt.String]:{type:Pt.String,encode:(t,e)=>t.writeString(e),decode:t=>t.readString()},[Pt.Bytes]:{type:Pt.Bytes,encode:(t,e)=>{t.writeInt(e.length),t.writeBytes(e)},decode:t=>{let e=new Int8Array(t.readInt());return t.readBytes(e),e}}},el=class extends L{#e;#t;#r;constructor(e,r,n){super(e),this.#e=r,this.#t=n,this.#r=this.#t}accept(e){return N(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(ze.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){re(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){re(!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)?j("not implemented"):e}fromJSON(e){return j("Type mismatch")}reset(){this.setValue(this.#t)}},I=class t extends el{static create(e,r=!1){return new t(e,r)}constructor(e,r){super(e,Pt.Boolean,r)}toggle(){this.setValue(!this.getValue())}serialization(){return tl[Pt.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){re(!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()))}},A=class t extends el{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,Pt.Float32,i),this.#e=r,this.#t=n}serialization(){return tl[Pt.Float32]}equals(e){return this.getValue()===e}clamp(e){return Bp.clampFloat32(this.#e,so.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){re(!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()))}},M=class t extends el{static create(e,r,n,i=0){return new t(e,r,n,i)}#e;#t;constructor(e,r,n,i){super(e,Pt.Int32,i),this.#e=r,this.#t=n}serialization(){return tl[Pt.Int32]}equals(e){return this.getValue()===e}clamp(e){return Bp.clampInt32(this.#e,Mr.toInt(e))}read(e){this.setValue(e.readInt())}write(e){re(!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>=Mr.MIN_VALUE&&e<=Mr.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},T=class t extends el{static create(e,r=""){return new t(e,r)}constructor(e,r){super(e,Pt.String,r)}serialization(){return tl[Pt.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){re(!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()))}},AM=class t extends el{static create(e,r=this.#e){return new t(e,r)}static#e=Object.freeze(new Int8Array(0));constructor(e,r){super(e,Pt.Bytes,r)}serialization(){return tl[Pt.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){re(!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()))}};var EM=t=>{let e=B.newSet(i=>i),r=B.newSet(i=>i);for(let i of t)i instanceof rl?e.add(i.uuid):i instanceof al&&r.add(i.uuid);let n=B.newSet(i=>i);for(let i of e.values())r.hasKey(i)&&n.add(i);return n.isEmpty()?t:t.filter(i=>i instanceof rl||i instanceof al?!n.hasKey(i.uuid):i instanceof nl||i instanceof il?!n.hasKey(i.address.uuid):!0)},FM;(function(t){t.decode=e=>{let r=e.readInt();return de.create(()=>{switch(e.readString()){case"new":{let i=B.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new rl(i,a,o.buffer)}case"pointer":{let i=Ce.read(e),a=e.readBoolean()?b.wrap(Ce.read(e)):b.None,o=e.readBoolean()?b.wrap(Ce.read(e)):b.None;return new nl(i,a,o)}case"primitive":{let i=Ce.read(e),a=e.readString(),o=tl[a],s=o.decode(e),c=o.decode(e);return new il(i,o,s,c)}case"delete":{let i=B.fromDataInput(e),a=e.readString(),o=new Int8Array(e.readInt());return e.readBytes(o),new al(i,a,o.buffer)}}},r)}})(FM||(FM={}));var rl=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 it(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),B.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${B.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},il=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}`}},nl=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()}`}},al=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 it(this.#r)))}write(e){e.writeString(this.type),B.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${B.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var FU=Symbol("Unreferenceable"),k=class t extends L{static create(e,r,n){return new t(e,r,n)}static encodeWith(e,r){re(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=b.wrap(e);let n=Lt(r);if(this.#e=b.None,n.status==="failure")throw n.error;return n.value}static decodeWith(e,r){re(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=b.wrap(e);let n=Lt(r);if(this.#t=b.None,n.status==="failure")throw n.error;return n.value}static#e=b.None;static#t=b.None;#r;#i;#n=b.None;#a=b.None;constructor(e,r,n){super(e),this.#r=r,this.#i=n,n&&this.graph.edges().watchVertex(this)}get pointerHub(){return j(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return N(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(ze.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}refer(e){this.targetVertex=b.wrap(e)}defer(){this.targetVertex=b.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=xa.validate(this,e.unwrap());r.nonEmpty()&&j(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()?b.wrap(Ce.read(e)):b.None;this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}write(e){re(!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(en(e)||typeof e=="string"){let r=b.wrap(en(e)?null:Ce.decode(e));this.targetAddress=t.#t.match({none:()=>r,some:n=>n.map(this,r)})}else return j(`Pointer at (${this.address}) has type mismatch. value (${e}) must be a string, but is ${typeof e}.`)}};var Pg=class{#e;#t;#r;#i;#n;#a;constructor(){this.#e=Ce.newSet(e=>e.address),this.#t=Ce.newSet(e=>e.address),this.#r=Ce.newSet(e=>e.address),this.#i=Ce.newSet(([e])=>e),this.#n=Ce.newSet(([e])=>e.address),this.#a=B.newSet(e=>e)}watchVertex(e){if(gt(e,k)){if(!e.mandatory)return j("watchVertex called but has no edge requirement");this.#e.add(e)}else{let{mandatory:r,exclusive:n}=e.pointerRules;if(!r&&!n)return j("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.#s(this.#e,n,r),this.#s(this.#t,n,r),this.#s(this.#r,n,r);for(let n of e){let i=this.outgoingEdgesOf(n);if(i.length>0)return j(`${n} has outgoing edges: ${i.map(([o,s])=>`[${o.toString()}, ${s.toString()}]`)}`);let a=this.incomingEdgesOf(n);if(a.length>0)return j(`${n} has incoming edges from: ${a.map(o=>o.toString())}`)}}forgetVerticesOf(e){let r=({box:{address:{uuid:i}}})=>i,{address:{uuid:n}}=e;this.#s(this.#e,n,r),this.#s(this.#t,n,r),this.#s(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");de.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.#o(this.#n,e.address.uuid,([{box:{address:{uuid:r}}}])=>r)}incomingEdgesOf(e){return e.isBox()?this.#o(this.#i,e.address.uuid,([{uuid:r}])=>r).flatMap(([r,n])=>n):this.#i.opt(e.address).mapOr(([r,n])=>n,de.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.#o(this.#e,r,e);for(let o of n)if(o.isEmpty())return this.#a.clear(),o.mandatory?b.wrap(new Error(`Pointer ${o.toString()} requires an edge.`)):b.wrap(new Error(`Illegal state: ${o} has no edge requirements.`));let i=this.#o(this.#t,r,e);for(let o of i)if(o.pointerHub.isEmpty())return this.#a.clear(),o.pointerRules.mandatory?b.wrap(new Error(`Target ${o.toString()} requires an edge.`)):b.wrap(new Error(`Illegal state: ${o} has no edge requirements.`));let a=this.#o(this.#r,r,e);for(let o of a){let s=o.pointerHub.size();if(s>1)return this.#a.clear(),b.wrap(new Error(`Target ${o.toString()} is exclusive but has ${s} incoming pointers.`))}}return this.#a.clear(),b.None}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?(console.warn(`[GraphEdges] Validation failed: Pointer ${e.toString()} requires an edge.`),j(`Pointer ${e.toString()} requires an edge.`)):j(`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.`),j(`Target ${e.toString()} requires an edge.`)):j(`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.`),j(`Target ${e.toString()} is exclusive but has ${r} incoming pointers.`)})}#o(e,r,n){let i=Ce.boxRange(e,r,n);return K(i)?e.values().slice(i[0],i[1]):de.empty()}#s(e,r,n){let i=Ce.boxRange(e,r,n);K(i)&&e.removeRange(i[0],i[1])}};var uo=class{#e;#t;#r;#i;#n;#a;#o;#s;#u;#l;#c;#d;#p;#f=!1;#v=!1;#m=!1;constructor(e=b.None){this.#e=e,this.#t=B.newSet(r=>r.address.uuid),this.#r=[],this.#i=[],this.#n=[],this.#u=Sg.create(),this.#a=new nr,this.#o=new nr,this.#s=new nr,this.#l=new Pg,this.#c=Ce.newSet(({pointer:r})=>r.address),this.#d=[],this.#p=B.newSet(r=>r.uuid)}beginTransaction(){re(!this.#f,"Transaction already in progress"),this.#f=!0,this.#n.length=0,this.#s.proxy.onBeginTransaction()}abortTransaction(){re(this.#f,"No transaction in progress"),this.#F(),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>this.#y(e,r)),this.#r.length=0),this.#g()}endTransaction(){re(this.#f,"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.#m&&this.#e.nonEmpty()&&this.#l.tryValidateAffected().ifSome(e=>{throw this.#F(),this.#g(),e}),this.#x(),this.#g()}inTransaction(){return this.#f}constructingBox(){return this.#v}createBox(e,r,n){return this.#e.unwrap("No box-factory installed")(e,this,r,n)}stageBox(e,r){if(this.#_(),re(!this.#v,"Cannot construct box while other box is constructing"),K(r)){this.#v=!0;let a=Lt(()=>r(e));if(this.#v=!1,a.status==="failure")throw this.#E(e),a.error}if(!this.#t.add(e))return this.#E(e),j(`${e.name} ${e.address.toString()} already staged`);let i=new rl(e.address.uuid,e.name,e.toArrayBuffer());return this.#m||this.#n.push(i),this.#a.proxy.onUpdate(i),this.#o.proxy.onUpdate(i),e}subscribeTransaction(e){return this.#s.subscribe(e)}subscribeToAllUpdates(e){return this.#a.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#o.subscribe(e)}subscribeVertexUpdates(e,r,n){return this.#u.subscribe(e,r,n)}subscribeEndTransaction(e){this.#d.push(e)}subscribeDeletion(e,r){let n=this.#p.getOrCreate(e,()=>({uuid:e,listeners:new Set}));return n.listeners.add(r),{terminate:()=>{n.listeners.delete(r),n.listeners.size===0&&this.#p.removeByKeyIfExist(e)}}}unstageBox(e){this.#_();let r=this.#t.removeByKey(e.address.uuid);re(r===e,`${e} could not be found to unstage`),this.#l.unwatchVerticesOf(e);let n=new al(e.address.uuid,e.name,e.toArrayBuffer());this.#m||this.#n.push(n),this.#p.removeByKeyIfExist(e.address.uuid)?.listeners.forEach(i=>i()),this.#a.proxy.onUpdate(n),this.#o.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.#f;return r||this.beginTransaction(),e.forEach(n=>n.targetAddress=b.None),r||this.#w(),console.warn(`[BoxGraph] cleared ${e.length} pointer(s) whose target is missing`),e.length}edges(){return this.#l}checksum(){let e=new lg;return this.boxes().forEach(r=>r.write(e)),e.result()}onPrimitiveValueUpdate(e,r,n){if(this.#_(),e.isAttached()&&!this.#v){let i=new il(e.address,e.serialization(),r,n);this.#m||this.#n.push(i),this.#u.dispatch(i),this.#a.proxy.onUpdate(i),this.#o.proxy.onUpdate(i)}}onPointerAddressUpdated(e,r,n){this.#_(),r.nonEmpty()&&this.#l.disconnect(e),n.nonEmpty()&&this.#l.connect(e,n.unwrap());let i=new nl(e.address,r,n);this.#v?this.#r.push({pointerField:e,update:i}):(this.#m||this.#n.push(i),this.#y(e,i),this.#o.proxy.onUpdate(i))}#y(e,r){let{oldAddress:n,newAddress:i}=r;e.resolvedTo(i.flatMap(o=>this.findVertex(o))),this.#c.opt(e.address).match({none:()=>this.#c.add({pointer:e,initial:n,final:i,index:this.#c.size()}),some:o=>o.final=i}),this.#u.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.#c.opt(e.address).match({none:()=>this.#c.add({pointer:e,initial:n,final:i,index:this.#c.size()}),some:o=>o.final=i}),this.#i.push({pointerField:e,update:r})}#x(){for(let{update:e}of this.#i)this.#u.dispatch(e),this.#a.proxy.onUpdate(e);this.#i.length=0}#g(){for(this.#c.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.#c.clear(),this.#f=!1;this.#d.length>0;)this.#d.splice(0).forEach(e=>e()),this.#d.length>0&&console.debug(`${this.#d.length} new observers while notifying`);this.#s.proxy.onEndTransaction(this.#m),this.#m=!1}#F(){this.#m=!0;for(let{update:r}of this.#r)this.#n.push(r);this.#r.length=0;let e=EM(this.#n.splice(0));for(let r=e.length-1;r>=0;r--){let n=e[r];if((n instanceof nl||n instanceof il)&&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.#c.clear(),this.#n.length=0}#E(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.#P(e);return this.boxes().filter(n=>!r.has(n))}#P(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:Dc.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(h=>{s.add(h);let y=h.targetAddress.mapOr(_=>!_.isBox(),!1);if(h.mandatory&&y){if(f.resource==="shared"&&h.targetAddress.flatMap($=>this.findVertex($)).mapOr($=>$.pointerRules.mandatory,!1))return;c(h.box)}});return}f.outgoingEdges().filter(([h])=>!s.has(h)).forEach(([h,y])=>{s.add(h),this.findVertex(y).match({none:()=>console.warn(`[BoxGraph] skipping dangling ${h.toString()} -> ${y.toString()}`),some:_=>{_.pointerRules.mandatory&&(i||_.pointerHub.incoming().filter($=>$.targetAddress.mapOr(S=>S.equals(y),!1)).every($=>s.has($)))&&c(_.box)}})}),f.incomingEdges().forEach(h=>{s.add(h),h.mandatory&&c(h.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();re(o,`pointer ${a.address} is broken`),re(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[B.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:j("Unknown address"))))}toArrayBuffer(){let e=ir.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){re(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let n=new it(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 it(c.buffer),f=u.readInt(),v=u.readString(),h=B.fromDataInput(u);a.push({creationIndex:f,name:v,uuid:h,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.#w()}toJSON(){let e={};for(let r of this.#t.values())e[r.address.toString()]={name:r.name,fields:Ke(r.toJSON())};return e}fromJSON(e,r=!0){if(typeof e!="object"||e===null||Array.isArray(e))return j("Expected object");this.beginTransaction();let n=Object.entries(e);for(let[i,{name:a,fields:o}]of n)this.createBox(a,B.parse(i),s=>{let c=Lt(()=>s.fromJSON(o));c.status==="failure"&&console.warn(c.error)});r?this.endTransaction():this.#w()}#w(){this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:r})=>this.#y(e,r)),this.#r.length=0),this.#l.clearAffected(),this.#g()}#_(){re(this.#f,()=>"Modification only prohibited in transaction mode.")}};var pi;(function(t){t.insertOrder=(e,r=Number.MAX_SAFE_INTEGER)=>{let n=t.collectIndexedBoxes(e),i=Fe(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=Fe(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=Fe(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,h=0;for(let y=0;y<i.length;y++){let _=i[y],$=a.has(y)?c+v++:y<n?f++:u+h++;_.index.setValue($)}},t.isIndexedBox=e=>"index"in e&&e.index instanceof M,t.collectIndexedBoxes=(e,r)=>e.pointerHub.incoming().map(({box:n})=>t.isIndexedBox(n)&&(r===void 0||n instanceof r)?n:j(`${n} has no index field`)).sort((n,i)=>n.index.getValue()-i.index.getValue())})(pi||(pi={}));var $e=class extends L{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return N(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return Ke(this.#e[e])}optField(e){return b.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(ze.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){Lo.readFields(e,this.#e)}write(e){Lo.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(rg(e))Object.entries(e).forEach(([r,n])=>{let i=this.#e[parseInt(r)];K(n)&&i.fromJSON(n)});else return j("Type mismatch")}};var Zo;(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"})(Zo||(Zo={}));var Tp;(function(t){t[t.WRITE=0]="WRITE",t[t.READ=1]="READ"})(Tp||(Tp={}));var Uc;(function(t){t[t.ID=15793935]="ID",t[t.START=15790320]="START",t[t.END=986895]="END"})(Uc||(Uc={}));var Mg=class t{static create(e,r){return new t(e.channel(r))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#n=ir.create(0);#a=b.None;#o=b.None;#s=b.None;#u=-1;#l=-1;#c=!1;#d=!1;#p=0;constructor(e){this.#i=va.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.#f();if(e.nonEmpty()){this.#d||(this.#i.sendShareLock(this.#t),this.#d=!0),this.#i.sendUpdateStructure(e.unwrap());let r=this.#e.length,n=this.#v(),i=r+n;if(this.#a.isEmpty()||this.#a.unwrap().byteLength<i||r!==this.#p){let o=og(i),s=new SharedArrayBuffer(o);this.#o=b.wrap(new Uint8Array(s,0,r)),this.#n=ir.use(s,r),this.#a=b.wrap(s),this.#p=r,this.#i.sendUpdateData(s)}}this.#a.isEmpty()||Atomics.load(this.#r,0)===Tp.WRITE&&(this.#m(this.#n),this.#n.position=0,Atomics.store(this.#r,0,Tp.READ))}broadcastFloat(e,r){return this.#h(new class{type=Zo.Float;address=e;capacity=8;put(n,i){n.writeFloat(r())}})}broadcastInteger(e,r){return this.#h(new class{type=Zo.Integer;address=e;capacity=8;put(n,i){n.writeInt(r())}})}broadcastFloats(e,r,n){return this.#h(new class{type=Zo.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=Zo.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=Zo.ByteArray;address=e;capacity=4+r.byteLength;put(i,a){n(a),i.writeInt(r.byteLength),i.writeBytes(r)}})}#f(){if(this.#c){try{this.#s=b.wrap(this.#g())}catch(e){throw e}this.#c=!1}if(this.#s.nonEmpty()){let e=this.#s;return this.#s=b.None,e}return b.None}#v(){return this.#l===-1&&(this.#l=this.#y()+12),this.#l}terminate(){de.clear(this.#e),this.#s=b.None,this.#c=!1,this.#l=0}#m(e){re(!this.#c&&this.#s.isEmpty(),"Cannot flush while update is available");let r=this.#v();re(e.remaining>=r,"Insufficient data"),e.writeInt(this.#u),e.writeInt(Uc.START);let n=this.#o;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(Uc.END)}#y(){return this.#e.reduce((e,r)=>e+r.capacity,0)}#h(e){return this.#e.push(e),this.#x(),{terminate:()=>{de.removeOpt(this.#e,e),this.#x()}}}#x(){this.#l=-1,this.#c=!0}#g(){let e=ir.create();e.writeInt(Uc.ID),e.writeInt(++this.#u),e.writeInt(this.#e.length);for(let{address:r,type:n}of this.#e)r.write(e),e.writeByte(n);return e.toArrayBuffer()}};var Dp=class{#e=new Y;#t;constructor(e,r){this.#t=this.#e.own(new hg(r)),this.#e.own(va.executor(e,{updateSettings:n=>this.#t.update(n)}))}get settings(){return this.#t.data}catchupAndSubscribe(e,...r){return this.#t.catchupAndSubscribe(e,...r)}terminate(){this.#e.terminate(),this.#t.terminate()}};var SM;(function(t){t.NoSync="nosync",t.Pitch="pitch",t.Timestretch="timestretch",t.AudioFit="audiofit"})(SM||(SM={}));var PM;(function(t){t[t.Pre=0]="Pre",t[t.Post=1]="Post"})(PM||(PM={}));var Mt;(function(t){t.Instrument="instrument",t.Bus="bus",t.Aux="aux",t.Output="output"})(Mt||(Mt={}));var Go={white:new er(0,0,100),blue:new er(189,100,65),green:new er(150,77,69),yellow:new er(60,100,84),cream:new er(65,20,83),orange:new er(31,100,73),red:new er(354,100,65),purple:new er(314,100,78),bright:new er(197,5,95),gray:new er(197,31,88),dark:new er(197,15,70),shadow:new er(197,10,55),black:new er(197,10,25),background:new er(197,8,9),panelBackground:new er(197,14,12),panelBackgroundBright:new er(197,13,19),panelBackgroundDark:new er(197,14,11)};var Oe;(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"})(Oe||(Oe={}));(function(t){t.toName=e=>t[e],t.fromName=e=>t[e]??t.Rectangle})(Oe||(Oe={}));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 Ng;(function(t){t[t.Once=0]="Once",t[t.Repeat=1]="Repeat",t[t.Pingpong=2]="Pingpong"})(Ng||(Ng={}));var ya;(function(t){t[t.Monophonic=0]="Monophonic",t[t.Polyphonic=1]="Polyphonic"})(ya||(ya={}));var MM=(t,e)=>{if(t===e)return 0;let r=t-e;return r===0?j(`Indices cannot be equal (${t}, ${e})`):r};var po=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},$r=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)},$g,Un,Ho,kg,fo,Rt=class t{static create(e,r,n){return new t(e,r,n)}constructor(e,r,n){$g.set(this,void 0),Un.set(this,void 0),Ho.set(this,void 0),kg.set(this,void 0),fo.set(this,null),po(this,$g,e,"f"),po(this,Un,B.newSet(i=>i.adapter.uuid),"f"),po(this,Ho,new nr,"f"),po(this,kg,e.pointerHub.catchupAndSubscribe({onAdded:i=>{po(this,fo,null,"f");let a=r(i.box),o=a.indexField.subscribe(()=>{po(this,fo,null,"f"),$r(this,Ho,"f").proxy.onReorder(a)}),s=$r(this,Un,"f").add({adapter:a,subscription:o});re(s,`Could not add ${a}`),$r(this,Ho,"f").proxy.onAdd(a)},onRemoved:i=>{po(this,fo,null,"f");let a=i.box.address.uuid,{adapter:o,subscription:s}=$r(this,Un,"f").removeByKey(a);s.terminate(),$r(this,Ho,"f").proxy.onRemove(o)}},n),"f")}field(){return $r(this,$g,"f")}subscribe(e){return $r(this,Ho,"f").subscribe(e)}catchupAndSubscribe(e){return $r(this,Un,"f").forEach(({adapter:r})=>e.onAdd(r)),this.subscribe(e)}getAdapterByIndex(e){let r=vt.exactMapped(this.adapters(),e,MM,n=>n.indexField.getValue());return r===-1?b.None:b.wrap(this.adapters()[r])}getAdapterById(e){return $r(this,Un,"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 $r(this,fo,"f")===null&&po(this,fo,$r(this,Un,"f").values().map(({adapter:e})=>e).filter(e=>e.box.isAttached()).sort((e,r)=>e.indexField.getValue()-r.indexField.getValue()),"f"),$r(this,fo,"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=Fe(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 $r(this,Un,"f").size()}isEmpty(){return this.size()===0}terminate(){po(this,fo,null,"f"),$r(this,Un,"f").forEach(({subscription:e})=>e.terminate()),$r(this,Un,"f").clear(),$r(this,Ho,"f").terminate(),$r(this,kg,"f").terminate()}};$g=new WeakMap,Un=new WeakMap,Ho=new WeakMap,kg=new WeakMap,fo=new WeakMap;var mo;(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 jn.create(r,n,i);case"ProjectMetaBox":return Bg.create(r,n,i);case"RootBox":return qo.create(r,n,i);case"SelectionBox":return wa.create(r,n,i);case"UserInterfaceBox":return ho.create(r,n,i);case"UploadFileBox":return Ig.create(r,n,i);case"ShadertoyBox":return Tg.create(r,n,i);case"MIDIControllerBox":return Dg.create(r,n,i);case"TimelineBox":return ol.create(r,n,i);case"TrackBox":return fi.create(r,n,i);case"NoteEventBox":return Jo.create(r,n,i);case"NoteEventRepeatBox":return Rg.create(r,n,i);case"NoteEventCollectionBox":return go.create(r,n,i);case"NoteRegionBox":return sl.create(r,n,i);case"NoteClipBox":return jc.create(r,n,i);case"ValueEventBox":return Kn.create(r,n,i);case"ValueEventCollectionBox":return Wn.create(r,n,i);case"ValueEventCurveBox":return Yo.create(r,n,i);case"ValueRegionBox":return ll.create(r,n,i);case"ValueClipBox":return Kc.create(r,n,i);case"SignatureEventBox":return Wc.create(r,n,i);case"AudioRegionBox":return Xo.create(r,n,i);case"AudioClipBox":return Lc.create(r,n,i);case"AudioPitchStretchBox":return Zc.create(r,n,i);case"AudioTimeStretchBox":return Gc.create(r,n,i);case"AudioSignalsmithBox":return Hc.create(r,n,i);case"TransientMarkerBox":return Cg.create(r,n,i);case"WarpMarkerBox":return ba.create(r,n,i);case"MarkerBox":return qc.create(r,n,i);case"AudioFileBox":return rn.create(r,n,i);case"SoundfontFileBox":return _a.create(r,n,i);case"NeuralAmpModelBox":return zg.create(r,n,i);case"AudioUnitBox":return Xe.create(r,n,i);case"CaptureAudioBox":return Aa.create(r,n,i);case"CaptureMidiBox":return Fa.create(r,n,i);case"AudioBusBox":return Ln.create(r,n,i);case"AuxSendBox":return Jc.create(r,n,i);case"GrooveShuffleBox":return Yc.create(r,n,i);case"UnknownAudioEffectDeviceBox":return Og.create(r,n,i);case"UnknownMidiEffectDeviceBox":return Vg.create(r,n,i);case"DeviceInterfaceKnobBox":return Ug.create(r,n,i);case"ModularDeviceBox":return jg.create(r,n,i);case"StereoToolDeviceBox":return Kg.create(r,n,i);case"MaximizerDeviceBox":return Xc.create(r,n,i);case"CompressorDeviceBox":return Wg.create(r,n,i);case"GateDeviceBox":return Lg.create(r,n,i);case"DelayDeviceBox":return Zg.create(r,n,i);case"AutotuneDeviceBox":return Gg.create(r,n,i);case"CrusherDeviceBox":return Hg.create(r,n,i);case"DattorroReverbDeviceBox":return qg.create(r,n,i);case"VelocityDeviceBox":return Jg.create(r,n,i);case"FoldDeviceBox":return Yg.create(r,n,i);case"TidalDeviceBox":return Xg.create(r,n,i);case"RevampDeviceBox":return Qg.create(r,n,i);case"ReverbDeviceBox":return ev.create(r,n,i);case"VaporisateurDeviceBox":return Qc.create(r,n,i);case"MIDIOutputDeviceBox":return eu.create(r,n,i);case"MIDIOutputBox":return Qo.create(r,n,i);case"MIDIOutputParameterBox":return cl.create(r,n,i);case"SoundfontDeviceBox":return tu.create(r,n,i);case"NeonDeviceBox":return ru.create(r,n,i);case"NanoDeviceBox":return iu.create(r,n,i);case"PlayfieldDeviceBox":return nu.create(r,n,i);case"PlayfieldSampleBox":return Ea.create(r,n,i);case"TapeDeviceBox":return au.create(r,n,i);case"ArpeggioDeviceBox":return tv.create(r,n,i);case"PitchDeviceBox":return rv.create(r,n,i);case"ZeitgeistDeviceBox":return iv.create(r,n,i);case"NeuralAmpDeviceBox":return nv.create(r,n,i);case"VocoderDeviceBox":return av.create(r,n,i);case"WaveshaperDeviceBox":return ov.create(r,n,i);case"WerkstattDeviceBox":return sv.create(r,n,i);case"WerkstattParameterBox":return Sa.create(r,n,i);case"WerkstattSampleBox":return ul.create(r,n,i);case"SpielwerkDeviceBox":return lv.create(r,n,i);case"ApparatDeviceBox":return ou.create(r,n,i);case"CubedDeviceBox":return su.create(r,n,i);case"NoopInstrumentBox":return lu.create(r,n,i);case"CompositeDeviceBox":return cv.create(r,n,i);case"CompositeCellBox":return uv.create(r,n,i);case"AudioEffectCompositeBox":return dv.create(r,n,i);case"AudioEffectCompositeCellBox":return cu.create(r,n,i);case"StereoCompositeBox":return pv.create(r,n,i);case"FrequencySplitBox":return fv.create(r,n,i);case"ModularBox":return mv.create(r,n,i);case"ModuleConnectionBox":return hv.create(r,n,i);case"ModularAudioInputBox":return gv.create(r,n,i);case"ModularAudioOutputBox":return vv.create(r,n,i);case"ModuleDelayBox":return xv.create(r,n,i);case"ModuleMultiplierBox":return yv.create(r,n,i);case"ModuleGainBox":return wv.create(r,n,i);default:return j(`Unknown box class '${e}'`)}},t.deserialize=(e,r)=>{let n=new it(r),i=n.readString(),a=B.fromDataInput(n),o=t.create(i,e,a);return o.read(n),o}})(mo||(mo={}));var jn=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 N(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:k.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},"{}")}}};var Bg=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 N(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})}}};var bv=class t extends $e{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:M.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:p},{length:4},"",0),2:A.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:p},{min:1,max:64,scaling:"linear"},"",8),3:A.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:p},{min:.5,max:2,scaling:"linear"},"",1),4:I.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:p},!1),5:M.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-48,max:48},"st",0)}}};var qo=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:p},l.Timeline,!0),2:L.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:k.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0),5:A.create({parent:this,fieldKey:5,fieldName:"baseFrequency",deprecated:!1,pointerRules:p},{min:400,max:480,scaling:"linear"},"Hz",440),10:L.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!1,exclusive:!1}}),20:L.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[l.AudioUnits],mandatory:!1,exclusive:!1}}),21:L.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[l.AudioBusses],mandatory:!1,exclusive:!1}}),30:L.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!0,exclusive:!1}}),35:L.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!1,exclusive:!1}}),40:bv.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:p}),100:k.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:p},l.Shadertoy,!1),101:k.create({parent:this,fieldKey:101,fieldName:"projectMeta",deprecated:!1,pointerRules:p},l.ProjectMeta,!1),111:k.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:p},l.Editing,!1)}}};var wa=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 N(e.visitSelectionBox,this)}get tags(){return t.Tags}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:p},l.Selection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:p},l.Selection,!0)}}};var ho=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.User,!0),10:L.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[l.Selection],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[l.FileUploadState],mandatory:!1,exclusive:!1}}),21:k.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:p},l.Editing,!1),22:k.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:p},l.Editing,!1),23:k.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:p},l.Editing,!1),30:L.hook({parent:this,fieldKey:30,fieldName:"midiControllers",deprecated:!1,pointerRules:{accepts:[l.MIDIControllers],mandatory:!1,exclusive:!1}})}}};var Ig=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 N(e.visitUploadFileBox,this)}get tags(){return t.Tags}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:p},l.FileUploadState,!0),2:k.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.FileUploadState,!0)}}};var Tg=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 N(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:I.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:p},!0)}}};var Dg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"controllers",deprecated:!1,pointerRules:p},l.MIDIControllers,!0),2:k.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:M.create({parent:this,fieldKey:4,fieldName:"deviceChannel",deprecated:!1,pointerRules:p},{min:0,max:127},""),5:M.create({parent:this,fieldKey:5,fieldName:"controlId",deprecated:!1,pointerRules:p},{min:0,max:127},"")}}};var _v=class t extends $e{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:M.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4),2:M.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:p},{min:1,max:32},"",4)}}};var Av=class t extends $e{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),2:M.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:p},"any","ppqn",0),3:M.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:p},"any","ppqn",15360)}}};var Fv=class t extends $e{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:L.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),10:M.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var Ev=class t extends $e{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:k.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!1),10:M.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",2),15:M.create({parent:this,fieldKey:15,fieldName:"minBpm",deprecated:!1,pointerRules:p},{min:30,max:999},"bpm",60),16:M.create({parent:this,fieldKey:16,fieldName:"maxBpm",deprecated:!1,pointerRules:p},{min:31,max:1e3},"bpm",240),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var Sv=class t extends $e{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:L.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.SignatureAutomation],mandatory:!1,exclusive:!1}}),10:M.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index","",1),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0)}}};var ol=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 N(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:L.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[l.Timeline],mandatory:!0,exclusive:!1}}),10:_v.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:p}),11:Av.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:p}),20:L.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!0,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1,exclusive:!1}}),21:Fv.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:p}),22:Ev.create({parent:this,fieldKey:22,fieldName:"tempoTrack",deprecated:!1,pointerRules:p}),23:Sv.create({parent:this,fieldKey:23,fieldName:"signatureTrack",deprecated:!1,pointerRules:p}),30:M.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:p},"positive","ppqn",491520),31:A.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:p},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var fi=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:p},l.TrackCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:p},l.Automation,!0),3:L.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[l.RegionCollection],mandatory:!1,exclusive:!1}}),4:L.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[l.ClipCollection],mandatory:!1,exclusive:!1}}),10:M.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),11:M.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:p},{values:[0,1,2,3]},""),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),30:I.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:p},!1)}}};var Jo=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEvents,!0),10:M.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn",240),20:M.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:p},{min:0,max:127},"",60),21:A.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:p},"unipolar","%",.7874015748031497),22:M.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),23:A.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:p},"bipolar","%",0),24:A.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:p},{min:-50,max:50,scaling:"linear"},"ct",0),25:M.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:p},{min:0,max:100},"",100)}}};var Rg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.NoteEventFeature,!0),2:M.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:p},{min:1,max:128},"",1),3:A.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:p},"bipolar","%",0),4:A.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:p},"unipolar","%",1)}}};var go=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 N(e.visitNoteEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.NoteEvents],mandatory:!1,exclusive:!1}}),2:L.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.NoteEventCollection],mandatory:!0,exclusive:!1}})}}};var sl=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),10:M.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:M.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:M.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:M.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:p},"any","ppqn"),15:I.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:M.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var es=class t extends $e{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:I.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:p},!0),2:I.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:p}),3:I.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:p}),4:M.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:p},"non-negative",""),5:M.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:p},"non-negative",""),6:M.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:p},"non-negative","")}}};var jc=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.NoteEventCollection,!0),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:es.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:M.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:I.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:M.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Kn=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEvents,!0),10:M.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:M.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[l.ValueInterpolation],mandatory:!1,exclusive:!1}},{values:[0,1]},"",1),13:A.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:p},"any",""),14:A.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:p},"any","",NaN)}}};var Wn=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 N(e.visitValueEventCollectionBox,this)}get tags(){return t.Tags}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.ValueEvents],mandatory:!1,exclusive:!1}}),2:L.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.ValueEventCollection],mandatory:!0,exclusive:!1}})}}};var Yo=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 N(e.visitValueEventCurveBox,this)}get tags(){return t.Tags}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:p},l.ValueInterpolation,!0),2:A.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:p},"unipolar","%",.5)}}};var ll=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),10:M.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),12:M.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","ppqn"),13:M.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"positive","ppqn"),14:I.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:M.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Kc=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:es.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),10:M.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","ppqn"),11:I.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:M.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var Wc=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:p},l.SignatureAutomation,!0),9:M.create({parent:this,fieldKey:9,fieldName:"index",deprecated:!1,pointerRules:p},"index","",0),10:M.create({parent:this,fieldKey:10,fieldName:"relativePosition",deprecated:!1,pointerRules:p},"positive","bars",1),21:M.create({parent:this,fieldKey:21,fieldName:"nominator",deprecated:!1,pointerRules:p},"positive","",4),22:M.create({parent:this,fieldKey:22,fieldName:"denominator",deprecated:!1,pointerRules:p},"positive","",4)}}};var Pv=class t extends $e{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:A.create({parent:this,fieldKey:1,fieldName:"in",deprecated:!1,pointerRules:p},"positive","ppqn",0),2:A.create({parent:this,fieldKey:2,fieldName:"out",deprecated:!1,pointerRules:p},"positive","ppqn",0),3:A.create({parent:this,fieldKey:3,fieldName:"inSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.75),4:A.create({parent:this,fieldKey:4,fieldName:"outSlope",deprecated:!1,pointerRules:p},"unipolar","ratio",.25)}}};var Xo=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:p},l.RegionCollection,!0),2:k.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:k.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:k.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:A.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:k.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:M.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),11:A.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:p},"positive","mixed"),12:A.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:p},"any","mixed"),13:A.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:p},"any","mixed"),14:I.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:M.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),17:A.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:p},"decibel","db"),18:Pv.create({parent:this,fieldKey:18,fieldName:"fading",deprecated:!1,pointerRules:p})}}};var Lc=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:p},l.ClipCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:es.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:p}),5:k.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:p},l.ValueEventCollection,!0),6:k.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:p},l.Deprecated,!1),7:A.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:p},"any","seconds"),8:k.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:p},l.AudioPlayMode,!1),10:A.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:p},"any","ppqn"),11:I.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:M.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0"),14:A.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")}}};var Zc=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 N(e.visitAudioPitchStretchBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}})}}};var Gc=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 N(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:L.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:M.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:p},"positive","enum",2),3:A.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:p},"positive","ratio",1)}}};var Hc=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 N(e.visitAudioSignalsmithBox,this)}get tags(){return t.Tags}get warpMarkers(){return this.getField(1)}get transpose(){return this.getField(2)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0,exclusive:!1}}),2:A.create({parent:this,fieldKey:2,fieldName:"transpose",deprecated:!1,pointerRules:p},{min:-24,max:24,scaling:"linear"},"st",0)}}};var Cg=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 N(e.visitTransientMarkerBox,this)}get tags(){return t.Tags}get owner(){return this.getField(1)}get position(){return this.getField(2)}initializeFields(){return{1:k.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.TransientMarkers,!0),2:A.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};var ba=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:p},l.WarpMarkers,!0),2:M.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:A.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:p},"non-negative","seconds")}}};var qc=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:p},l.MarkerTrack,!0),2:M.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:p},"any","ppqn"),3:M.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:M.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:p},{min:0,max:360},"\xB0")}}};var rn=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 N(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:A.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:p},"non-negative","s"),2:A.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:L.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[l.TransientMarkers],mandatory:!1,exclusive:!1}})}}};var _a=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 N(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})}}};var zg=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 N(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})}}};var Mv=class t extends $e{static create(e){return new t(e)}constructor(e){super(e)}get automationCollapsed(){return this.getField(1)}initializeFields(){return{1:I.create({parent:this,fieldKey:1,fieldName:"automationCollapsed",deprecated:!1,pointerRules:p})}}};var Xe=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 N(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:k.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioUnits,!0),3:L.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:M.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),12:A.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:A.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),14:I.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:I.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:L.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[l.TrackCollection],mandatory:!1,exclusive:!1}}),21:L.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),22:L.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost,l.AudioOutput],mandatory:!1,exclusive:!0}}),23:L.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),24:L.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[l.AuxSend],mandatory:!1,exclusive:!1}}),25:k.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!1),26:k.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:p},l.Capture,!1),30:Mv.create({parent:this,fieldKey:30,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};var Aa=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 N(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:M.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:p},"any","",2),11:A.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:p},"decibel","dB",0),12:A.create({parent:this,fieldKey:12,fieldName:"inputLatency",deprecated:!1,pointerRules:p},"any","s",-2)}}};var Fa=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 N(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:M.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:p},"any","",-1)}}};var Ln=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.AudioBusses,!0),2:k.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:L.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!1,exclusive:!1}}),4:I.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:I.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:p})}}};var Jc=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:p},l.AuxSend,!0),2:k.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:p},l.AudioOutput,!0),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:M.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:p},{values:[0,1]},"",1),5:A.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB"),6:A.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var Yc=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 N(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:A.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6),11:M.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)}}};var Og=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.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})}}};var Vg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.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})}}};var Ug=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:p},l.DeviceUserInterface,!0),2:k.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:p},l.ParameterController,!0),3:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),10:A.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})}}};var Nv=class t extends $e{static create(e){return new t(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:L.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[l.DeviceUserInterface],mandatory:!1,exclusive:!1}})}}};var jg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:p},l.ModularSetup,!0),11:Nv.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:p})}}};var Kg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:A.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),12:A.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),13:I.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),14:I.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),15:I.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),20:M.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:p},{values:[0,1]},"",0)}}};var Xc=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:p},!0),11:A.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)}}};var Wg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:I.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),11:I.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!0),12:I.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),13:I.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),14:A.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:A.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:A.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:A.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:A.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:A.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:A.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:A.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),30:k.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var Lg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:A.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:A.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:A.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:A.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:A.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:I.create({parent:this,fieldKey:16,fieldName:"inverse",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),30:k.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var Zg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.create({parent:this,fieldKey:10,fieldName:"delayMusical",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",13),11:A.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),12:A.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:A.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:A.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:A.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:A.create({parent:this,fieldKey:16,fieldName:"preSyncTimeLeft",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",8),17:A.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:A.create({parent:this,fieldKey:19,fieldName:"preSyncTimeRight",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",0),20:A.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:A.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:A.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:A.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:M.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var Gg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:M.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:M.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:A.create({parent:this,fieldKey:12,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:A.create({parent:this,fieldKey:13,fieldName:"retune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),14:A.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:A.create({parent:this,fieldKey:15,fieldName:"smooth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.6)}}};var Hg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),11:M.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:A.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:A.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)}}};var qg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:A.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.9999),12:A.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),13:A.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.625),14:A.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.75),15:A.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),16:A.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),17:A.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.005),18:A.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),19:A.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.7),20:A.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:A.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var Jg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:A.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:M.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","",2048),13:A.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),14:A.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),15:A.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var Yg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:M.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:p},{length:3},"",0),12:A.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)}}};var Xg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",-.25),11:A.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),20:A.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:A.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","",1),22:A.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:A.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)}}};var Rp=class t extends $e{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:A.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:M.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},{length:4},""),12:A.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 Cp=class t extends $e{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:A.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:A.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 uu=class t extends $e{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),10:A.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:A.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:A.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 Qg=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Rp.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:p}),11:Cp.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:p}),12:uu.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:p}),13:uu.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:p}),14:uu.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:p}),15:Cp.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:p}),16:Rp.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:p}),17:A.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")}}};var ev=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),11:A.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:A.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),13:A.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%",0),14:A.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:A.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var $v=class t extends $e{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:M.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:A.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:M.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:A.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 kv=class t extends $e{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:M.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:A.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:I.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},!1),10:A.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),11:A.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),12:A.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%")}}};var Bv=class t extends $e{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:A.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:A.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:A.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:A.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 Qc=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:M.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","oct"),12:A.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any","ct"),13:M.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),14:A.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:A.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:A.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:A.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:A.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),19:A.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:A.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),21:A.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),22:M.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:M.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:A.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:A.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),26:M.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:A.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","%"),30:kv.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:p}),40:Vn.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:p},e=>$v.create(e),2),50:Bv.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:p}),99:M.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var Iv=class t extends $e{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 eu=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:Iv.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:p}),11:M.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:p},{min:0,max:15},"ch"),12:M.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:p},"any","ms",10),13:L.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),14:k.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:p},l.MIDIDevice,!1)}}};var Qo=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:p},l.MIDIDevice,!0),2:L.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:M.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:p},{min:0,max:500},"ms",10),6:I.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:p},!0)}}};var cl=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 N(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:k.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:M.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:p},{min:0,max:127},"#",64),4:A.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!0,exclusive:!1}},"unipolar","%")}}};var tu=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:p},l.SoundfontFile,!1),11:M.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:p},{min:0,max:65535},"")}}};var Tv=class t extends $e{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:M.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:M.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:A.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:A.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 Dv=class t extends $e{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:A.create({parent:this,fieldKey:1,fieldName:"rate1",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),2:A.create({parent:this,fieldKey:2,fieldName:"rate2",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),3:A.create({parent:this,fieldKey:3,fieldName:"rate3",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),4:A.create({parent:this,fieldKey:4,fieldName:"rate4",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),5:A.create({parent:this,fieldKey:5,fieldName:"rate5",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),6:A.create({parent:this,fieldKey:6,fieldName:"rate6",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),7:A.create({parent:this,fieldKey:7,fieldName:"rate7",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),8:A.create({parent:this,fieldKey:8,fieldName:"rate8",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),11:A.create({parent:this,fieldKey:11,fieldName:"level1",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),12:A.create({parent:this,fieldKey:12,fieldName:"level2",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),13:A.create({parent:this,fieldKey:13,fieldName:"level3",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),14:A.create({parent:this,fieldKey:14,fieldName:"level4",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),15:A.create({parent:this,fieldKey:15,fieldName:"level5",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),16:A.create({parent:this,fieldKey:16,fieldName:"level6",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),17:A.create({parent:this,fieldKey:17,fieldName:"level7",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),18:A.create({parent:this,fieldKey:18,fieldName:"level8",deprecated:!1,pointerRules:p},{min:0,max:99,scaling:"linear"},"",0),20:M.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:p},{min:0,max:8},"",0),21:M.create({parent:this,fieldKey:21,fieldName:"end",deprecated:!1,pointerRules:p},{min:1,max:8},"",1)}}};var Rv=class t extends $e{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:M.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:A.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:A.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:A.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 ru=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:M.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:M.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:M.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:A.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:A.create({parent:this,fieldKey:15,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),16:A.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:M.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:Rv.create({parent:this,fieldKey:20,fieldName:"vibrato",deprecated:!1,pointerRules:p}),30:Vn.create({parent:this,fieldKey:30,fieldName:"lines",deprecated:!1,pointerRules:p},e=>Tv.create(e),2),40:Vn.create({parent:this,fieldKey:40,fieldName:"envelopes",deprecated:!1,pointerRules:p},e=>Dv.create(e),6)}}};var iu=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:k.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1),20:A.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)}}};var nu=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var Ea=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 N(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:k.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:p},l.Sample,!0),11:k.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!0),12:L.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),13:L.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),15:M.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:I.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),23:I.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:I.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),41:I.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),42:I.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),43:I.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),44:M.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:A.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:A.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),47:A.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),48:A.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:A.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:A.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:A.create({parent:this,fieldKey:51,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var au=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),11:A.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),12:A.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%"),13:A.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%")}}};var tv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:M.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:M.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:M.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:A.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:M.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:A.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","",0)}}};var rv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:M.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:A.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:M.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)}}};var iv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:k.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:p},l.Groove,!0)}}};var nv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.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:A.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:A.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:I.create({parent:this,fieldKey:13,fieldName:"mono",deprecated:!1,pointerRules:p},!0),14:A.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:k.create({parent:this,fieldKey:20,fieldName:"model",deprecated:!1,pointerRules:p},l.NeuralAmpModel,!1)}}};var av=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:A.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:A.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:A.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:A.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:A.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:A.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:A.create({parent:this,fieldKey:17,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),18:M.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:A.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:A.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:k.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:p},l.SideChain,!1)}}};var ov=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.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:A.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:A.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:A.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1)}}};var sv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.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:L.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var Sa=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 N(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:k.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:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:A.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"any",""),5:A.create({parent:this,fieldKey:5,fieldName:"defaultValue",deprecated:!1,pointerRules:p},"any","")}}};var ul=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 N(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:k.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:M.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:p},"index",""),4:k.create({parent:this,fieldKey:4,fieldName:"file",deprecated:!1,pointerRules:p},l.AudioFile,!1)}}};var lv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.MIDIEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.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:L.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var ou=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.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:L.hook({parent:this,fieldKey:11,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1,exclusive:!1}})}}};var Cv=class t extends $e{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:M.create({parent:this,fieldKey:1,fieldName:"length",deprecated:!1,pointerRules:p},{min:1,max:64},"",16),2:Vn.create({parent:this,fieldKey:2,fieldName:"steps",deprecated:!1,pointerRules:p},e=>M.create(e,"any","",60),64)}}};var su=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:A.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:A.create({parent:this,fieldKey:11,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",0),12:A.create({parent:this,fieldKey:12,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),13:A.create({parent:this,fieldKey:13,fieldName:"envMod",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),14:A.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",.5),15:A.create({parent:this,fieldKey:15,fieldName:"accent",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"unipolar","%",1),16:A.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:M.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:M.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:Vn.create({parent:this,fieldKey:30,fieldName:"patterns",deprecated:!1,pointerRules:p},e=>Cv.create(e),16),99:M.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:p},"any","")}}};var lu=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1)}}};var cv=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 N(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:k.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"cells",deprecated:!1,pointerRules:{accepts:[l.CompositeCell],mandatory:!1,exclusive:!1}})}}};var uv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"composite",deprecated:!1,pointerRules:p},l.CompositeCell,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"instrument",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost],mandatory:!0,exclusive:!1}}),3:L.hook({parent:this,fieldKey:3,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MIDIEffectHost],mandatory:!1,exclusive:!1}}),4:L.hook({parent:this,fieldKey:4,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),5:M.create({parent:this,fieldKey:5,fieldName:"index",deprecated:!1,pointerRules:p},"index","")}}};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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:A.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:A.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var cu=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"composite",deprecated:!1,pointerRules:p},l.AudioEffectCompositeCell,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1,exclusive:!1}}),3:M.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:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),40:A.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:I.create({parent:this,fieldKey:41,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),42:I.create({parent:this,fieldKey:42,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}}),43:A.create({parent:this,fieldKey:43,fieldName:"pan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"bipolar","")}}};var pv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:A.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:A.create({parent:this,fieldKey:13,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MIDIControl],mandatory:!1,exclusive:!1}},"decibel","dB",0)}}};var fv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:p},l.AudioEffectHost,!0),2:M.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:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:p},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:p},!1),10:L.hook({parent:this,fieldKey:10,fieldName:"entries",deprecated:!1,pointerRules:{accepts:[l.AudioEffectCompositeCell],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.SideChain],mandatory:!1,exclusive:!1}}),12:A.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:A.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:A.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:A.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:A.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)}}};var mv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ModularSetup,!0),2:L.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!0,exclusive:!1}}),3:L.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[l.ModuleCollection],mandatory:!1,exclusive:!1}}),12:L.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})}}};var hv=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 N(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:k.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:p},l.ConnectionCollection,!0),2:k.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:p},l.VoltageConnection,!0),3:k.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:p},l.VoltageConnection,!0)}}};var nn=class t extends $e{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:k.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:M.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:p},"any","x"),4:M.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:p},"any","y"),5:I.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:p},!1),6:I.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:p},!0)}}};var gv=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 N(e.visitModularAudioInputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:nn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var vv=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 N(e.visitModularAudioOutputBox,this)}get tags(){return t.Tags}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:nn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}})}}};var xv=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 N(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:nn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:A.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)}}};var yv=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 N(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:nn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),11:L.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:A.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:p},"unipolar","%")}}};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 N(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:nn.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:p}),10:L.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),12:L.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1,exclusive:!1}}),20:A.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1,exclusive:!1}},"decibel","dB")}}};var mi;(function(t){t.map=e=>e===Pt.Int32||e===Pt.Boolean?Ur.None:Ur.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)?(C0(n,Yo),n.slope.setValue(r.slope)):Yo.create(e.box.graph,B.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)?(C0(r,Yo),{type:"curve",slope:r.slope.getValue()}):e.getValue()===0?Ur.None:e.getValue()===1?Ur.Linear:j("Unknown Interpolation value")}})(mi||(mi={}));var ts=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},et=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)},zp,du,Ct,Op,rs,Vp,vo=class t{constructor(e,r){this.type="value-event",zp.set(this,new Y),du.set(this,void 0),Ct.set(this,void 0),Op.set(this,void 0),rs.set(this,void 0),Vp.set(this,!1),ts(this,du,e,"f"),ts(this,Ct,r,"f"),ts(this,Op,et(this,zp,"f").own(new ng(()=>mi.read(et(this,Ct,"f").interpolation))),"f");let n=()=>{et(this,Op,"f").invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};et(this,zp,"f").ownAll(et(this,Ct,"f").subscribe(ze.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let a=this.collection.unwrap(),o=i.address.fieldKeys,s=de.equals(et(this,Ct,"f").index.address.fieldKeys,o),c=de.equals(et(this,Ct,"f").position.address.fieldKeys,o);s||c?a.requestSorting():a.onEventPropertyChanged()}}),et(this,Ct,"f").interpolation.subscribe(n),et(this,Ct,"f").interpolation.pointerHub.subscribe({onAdded:({box:i})=>{et(this,rs,"f").terminate(),ts(this,rs,i.subscribe(ze.Children,n),"f"),n()},onRemoved:()=>{et(this,rs,"f").terminate(),ts(this,rs,pe.Empty,"f"),n()}})),ts(this,rs,et(this,Ct,"f").interpolation.pointerHub.filter(l.ValueInterpolation).at(0)?.box.subscribe(ze.Children,n)??pe.Empty,"f")}onSelected(){ts(this,Vp,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){ts(this,Vp,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){et(this,rs,"f").terminate(),et(this,zp,"f").terminate()}get box(){return et(this,Ct,"f")}get uuid(){return et(this,Ct,"f").address.uuid}get address(){return et(this,Ct,"f").address}get position(){return et(this,Ct,"f").position.getValue()}get index(){return et(this,Ct,"f").index.getValue()}set interpolation(e){mi.write(et(this,Ct,"f").interpolation,e)}get interpolation(){return et(this,Op,"f").get()}get value(){return et(this,Ct,"f").value.getValue()}get isSelected(){return et(this,Vp,"f")}get collection(){return et(this,Ct,"f").events.targetVertex.map(e=>et(this,du,"f").boxAdapters.adapterFor(e.box,kr))}copyTo(e){let r=e?.position??this.position,n=e?.index??this.index,i=Kn.create(et(this,du,"f").boxGraph,B.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 mi.write(i.interpolation,e?.interpolation??this.interpolation),et(this,du,"f").boxAdapters.adapterFor(i,t)}copyFrom(e){return et(this,Ct,"f").position.setValue(e?.position??this.position),et(this,Ct,"f").index.setValue(e?.index??this.index),et(this,Ct,"f").events.refer(e?.events??this.collection.unwrap("collection").box.events),et(this,Ct,"f").value.setValue(e?.value??this.value),mi.write(et(this,Ct,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};zp=new WeakMap,du=new WeakMap,Ct=new WeakMap,Op=new WeakMap,rs=new WeakMap,Vp=new WeakMap;vo.Comparator=(t,e)=>{if(t===e)return j(`${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:j(`${t} and ${e} are identical in terms of comparison`)};var Up=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)},jp,Kp,is,an,dl,pu,xo,zv,kr=class t{constructor(e,r){jp.add(this),Kp.set(this,new Y),is.set(this,void 0),an.set(this,void 0),dl.set(this,void 0),pu.set(this,void 0),xo.set(this,void 0),Up(this,is,e,"f"),Up(this,an,r,"f"),Up(this,dl,new fe,"f"),Up(this,pu,B.newSet(i=>i.uuid),"f"),Up(this,xo,Vr.create(vo.Comparator),"f");let n=i=>{let a=Ke(i.accept({visitValueEventBox:o=>Qe(this,is,"f").boxAdapters.adapterFor(o,vo)}),`Could not find adapter for ${i}`);Qe(this,pu,"f").add(a)&&(Qe(this,xo,"f").add(a),Qe(this,jp,"m",zv).call(this))};Qe(this,an,"f").events.pointerHub.incoming().forEach(({box:i})=>n(i)),Qe(this,Kp,"f").own(Qe(this,an,"f").events.pointerHub.subscribe({onAdded:({box:i})=>n(i),onRemoved:({box:{address:{uuid:i}}})=>{Qe(this,xo,"f").remove(Qe(this,pu,"f").removeByKey(i)),Qe(this,jp,"m",zv).call(this)}})),Qe(this,Kp,"f").own(Qe(this,an,"f").owners.pointerHub.subscribe({onAdded:()=>Qe(this,dl,"f").notify(this),onRemoved:()=>Qe(this,dl,"f").notify(this)}))}valueAt(e,r){return Fg.valueAt(Qe(this,xo,"f"),e,r)}copy(){let e=Qe(this,is,"f").boxGraph,r=Wn.create(e,B.generate());return Qe(this,xo,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Qe(this,is,"f").boxAdapters.adapterFor(r,t)}cut(e,r=F.unipolar()){let n=this.events.lowerEqual(e),i=this.events.greaterEqual(e);if(i===null)return n===null?b.None:b.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n===null)return b.wrap(this.createEvent({position:e,value:i.value,index:i.index,interpolation:i.interpolation}));if(n.position===e)return b.wrap(n);if(i.position===e)return b.wrap(i);if(n.interpolation.type==="none")return b.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=fM(s,c,(e-a)/(o-a));return b.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=tr.byHalf(u,s,tr.valueAt({slope:n.interpolation.slope,steps:u,y0:s,y1:c},u*.5),c),h=tr.valueAt(v,f),y=tr.slopeByHalf(s,tr.valueAt(v,f*.5),h);return mi.write(n.box.interpolation,Ur.Curve(y)),b.wrap(this.createEvent({position:e,value:r.y(h),index:0,interpolation:Ur.Curve(tr.slopeByHalf(h,tr.valueAt(v,(f+u)*.5),c))}))}return j("Unknown interpolation type")}subscribeChange(e){return Qe(this,dl,"f").subscribe(e)}createEvent({position:e,index:r,value:n,interpolation:i}){let a=Math.trunc(e),o=Qe(this,pu,"f").values().find(c=>c.position===a&&c.index===r);if(K(o)&&o.box.isAttached())return o.box.value.setValue(n),mi.write(o.box.interpolation,i),o;let s=Kn.create(Qe(this,is,"f").boxGraph,B.generate(),c=>{c.position.setValue(e),c.index.setValue(r),c.value.setValue(n),c.events.refer(Qe(this,an,"f").events)});return mi.write(s.interpolation,i),Qe(this,is,"f").boxAdapters.adapterFor(s,vo)}requestSorting(){Qe(this,xo,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Qe(this,jp,"m",zv).call(this)}terminate(){Qe(this,Kp,"f").terminate()}get box(){return Qe(this,an,"f")}get uuid(){return Qe(this,an,"f").address.uuid}get address(){return Qe(this,an,"f").address}get numOwners(){return Qe(this,an,"f").owners.pointerHub.filter(l.ValueEventCollection).length}get events(){return Qe(this,xo,"f")}toString(){return`{ValueEventCollectionBox ${B.toString(Qe(this,an,"f").address.uuid)}}`}};Kp=new WeakMap,is=new WeakMap,an=new WeakMap,dl=new WeakMap,pu=new WeakMap,xo=new WeakMap,jp=new WeakSet,zv=function(){Qe(this,dl,"f").notify(this)};var pl=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)},fl,ns,ml,ar,hl,Zp,Wp,Lp,fu,as=class{constructor(e,r){fl.add(this),this.type="value-clip",ns.set(this,new Y),ml.set(this,void 0),ar.set(this,void 0),hl.set(this,void 0),Zp.set(this,void 0),Wp.set(this,void 0),Lp.set(this,pe.Empty),pl(this,ml,e,"f"),pl(this,ar,r,"f"),pl(this,Wp,!0,"f"),pl(this,hl,je(this,ns,"f").own(new tn(!1)),"f"),pl(this,Zp,je(this,ns,"f").own(new fe),"f"),je(this,ns,"f").own(je(this,ar,"f").pointerHub.subscribe({onAdded:()=>je(this,fl,"m",fu).call(this),onRemoved:()=>je(this,fl,"m",fu).call(this)})),je(this,ns,"f").own(je(this,ar,"f").subscribe(ze.Children,n=>je(this,fl,"m",fu).call(this))),je(this,ns,"f").own(je(this,ar,"f").events.catchupAndSubscribe(({targetVertex:n})=>{je(this,Lp,"f").terminate(),pl(this,Lp,n.match({none:()=>pe.Empty,some:({box:i})=>je(this,ml,"f").boxAdapters.adapterFor(i,kr).subscribeChange(()=>je(this,fl,"m",fu).call(this))}),"f"),je(this,fl,"m",fu).call(this)})),pl(this,Wp,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(e%this.duration,r)}catchupAndSubscribeSelected(e){return je(this,hl,"f").catchupAndSubscribe(e)}subscribeChange(e){return je(this,Zp,"f").subscribe(e)}accept(e){return N(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&je(this,ar,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:je(this,ar,"f").events.targetVertex.unwrap("events.target");Kc.create(je(this,ml,"f").boxGraph,B.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(je(this,ar,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){je(this,hl,"f").setValue(!0)}onDeselected(){je(this,hl,"f").setValue(!1)}get isSelected(){return je(this,hl,"f").getValue()}terminate(){je(this,Lp,"f").terminate(),je(this,ns,"f").terminate()}get box(){return je(this,ar,"f")}get uuid(){return je(this,ar,"f").address.uuid}get address(){return je(this,ar,"f").address}get indexField(){return je(this,ar,"f").index}get duration(){return je(this,ar,"f").duration.getValue()}get mute(){return je(this,ar,"f").mute.getValue()}get hue(){return je(this,ar,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return je(this,ar,"f").events.targetVertex.map(e=>je(this,ml,"f").boxAdapters.adapterFor(e.box,kr))}get label(){return je(this,ar,"f").label.getValue()}get trackBoxAdapter(){return je(this,Wp,"f")?b.None:je(this,ar,"f").clips.targetVertex.map(e=>je(this,ml,"f").boxAdapters.adapterFor(e.box,or))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${B.toString(je(this,ar,"f").address.uuid)} d: ${Te.toString(this.duration)}}`}};ns=new WeakMap,ml=new WeakMap,ar=new WeakMap,hl=new WeakMap,Zp=new WeakMap,Wp=new WeakMap,Lp=new WeakMap,fl=new WeakSet,fu=function(){je(this,Zp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Ov=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},on=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)},Gp,Vv,gl,qp,Hp,Uv,mu=class{constructor(e){Gp.add(this),this.type="transient-marker",Vv.set(this,new Y),gl.set(this,void 0),qp.set(this,void 0),Hp.set(this,!1),Ov(this,gl,e,"f"),Ov(this,qp,new fe,"f"),on(this,Vv,"f").own(e.subscribe(ze.Children,()=>on(this,Gp,"m",Uv).call(this)))}onSelected(){Ov(this,Hp,!0,"f"),on(this,Gp,"m",Uv).call(this)}onDeselected(){Ov(this,Hp,!1,"f"),on(this,Gp,"m",Uv).call(this)}get box(){return on(this,gl,"f")}get uuid(){return on(this,gl,"f").address.uuid}get address(){return on(this,gl,"f").address}get position(){return on(this,gl,"f").position.getValue()}get isSelected(){return on(this,Hp,"f")}subscribe(e){return on(this,qp,"f").subscribe(e)}terminate(){on(this,Vv,"f").terminate()}};Vv=new WeakMap,gl=new WeakMap,qp=new WeakMap,Hp=new WeakMap,Gp=new WeakSet,Uv=function(){on(this,qp,"f").notify()};var Jp=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)},jv,Yp,Pa,Xp,hu,Kv,Zn=class t{constructor(e,r){jv.set(this,new Y),Yp.set(this,void 0),Pa.set(this,void 0),Xp.set(this,void 0),hu.set(this,void 0),Kv.set(this,void 0),Jp(this,Yp,e,"f"),Jp(this,Pa,r,"f"),Jp(this,Xp,B.newSet(({uuid:n})=>n),"f"),Jp(this,hu,Vr.create(t.Comparator),"f"),Jp(this,Kv,Eg.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"),Br(this,jv,"f").ownAll(r.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Br(this,Yp,"f").boxAdapters.adapterFor(n.box,mu);Br(this,Xp,"f").add(i)&&Br(this,hu,"f").add(i)},onRemoved:({box:{address:{uuid:n}}})=>{Br(this,hu,"f").remove(Br(this,Xp,"f").removeByKey(n))}}))}get box(){return Br(this,Pa,"f")}get uuid(){return Br(this,Pa,"f").address.uuid}get address(){return Br(this,Pa,"f").address}get startInSeconds(){return Br(this,Pa,"f").startInSeconds.getValue()}get endInSeconds(){return Br(this,Pa,"f").endInSeconds.getValue()}get transients(){return Br(this,hu,"f")}get fileName(){return Br(this,Pa,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return Br(this,Kv,"f").call(this)}getOrCreateLoader(){return Br(this,Yp,"f").sampleManager.getOrCreate(Br(this,Pa,"f").address.uuid)}terminate(){Br(this,jv,"f").terminate()}};jv=new WeakMap,Yp=new WeakMap,Pa=new WeakMap,Xp=new WeakMap,hu=new WeakMap,Kv=new WeakMap;Zn.Comparator=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),j("Events at the same position: "+t.position+", "+e.position)):r};var Qp=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)},ef,Wv,Lv,yo,rf,tf,Zv,Ma=class{constructor(e,r){ef.add(this),this.type="warp-marker",Wv.set(this,new Y),Lv.set(this,void 0),yo.set(this,void 0),rf.set(this,void 0),tf.set(this,!1),Qp(this,Lv,e,"f"),Qp(this,yo,r,"f"),Qp(this,rf,new fe,"f"),ri(this,Wv,"f").own(r.subscribe(ze.Children,()=>ri(this,ef,"m",Zv).call(this)))}onSelected(){Qp(this,tf,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),ri(this,ef,"m",Zv).call(this)}onDeselected(){Qp(this,tf,!1,"f"),ri(this,ef,"m",Zv).call(this)}get box(){return ri(this,yo,"f")}get uuid(){return ri(this,yo,"f").address.uuid}get address(){return ri(this,yo,"f").address}get position(){return ri(this,yo,"f").position.getValue()}get seconds(){return ri(this,yo,"f").seconds.getValue()}get isSelected(){return ri(this,tf,"f")}get optWarping(){return ri(this,yo,"f").owner.targetVertex.map(e=>ri(this,Lv,"f").boxAdapters.adapterFor(e.box,Na.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return ri(this,rf,"f").subscribe(e)}terminate(){ri(this,Wv,"f").terminate()}};Wv=new WeakMap,Lv=new WeakMap,yo=new WeakMap,rf=new WeakMap,tf=new WeakMap,ef=new WeakSet,Zv=function(){ri(this,rf,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var gu=(t,e)=>{let r=t.position-e.position;return r===0?(console.warn(t,e),j("Events at the same position: "+t.position+", "+e.position)):r};var nf=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)},Gv,Hv,vl,xl,af,vu,$a=class{constructor(e,r){Gv.set(this,new Y),Hv.set(this,void 0),vl.set(this,void 0),xl.set(this,void 0),af.set(this,void 0),vu.set(this,void 0),nf(this,Hv,e,"f"),nf(this,vl,r,"f"),nf(this,xl,new fe,"f"),nf(this,af,B.newSet(({uuid:n})=>n),"f"),nf(this,vu,Vr.create(gu),"f"),jr(this,Gv,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=jr(this,Hv,"f").boxAdapters.adapterFor(n.box,Ma);jr(this,af,"f").add(i)&&(jr(this,vu,"f").add(i),jr(this,xl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{jr(this,vu,"f").remove(jr(this,af,"f").removeByKey(n)),jr(this,xl,"f").notify()}}))}get box(){return jr(this,vl,"f")}get uuid(){return jr(this,vl,"f").address.uuid}get address(){return jr(this,vl,"f").address}get warpMarkers(){return jr(this,vu,"f")}clone(){let e=Zc.create(jr(this,vl,"f").graph,B.generate());return this.warpMarkers.asArray().forEach(r=>ba.create(e.graph,B.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return jr(this,xl,"f").subscribe(e)}onChanged(){jr(this,xl,"f").notify()}terminate(){jr(this,Gv,"f").terminate()}};Gv=new WeakMap,Hv=new WeakMap,vl=new WeakMap,xl=new WeakMap,af=new WeakMap,vu=new WeakMap;var of=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)},qv,Jv,Gn,yl,sf,xu,ka=class{constructor(e,r){qv.set(this,new Y),Jv.set(this,void 0),Gn.set(this,void 0),yl.set(this,void 0),sf.set(this,void 0),xu.set(this,void 0),of(this,Jv,e,"f"),of(this,Gn,r,"f"),of(this,yl,new fe,"f"),of(this,sf,B.newSet(({uuid:n})=>n),"f"),of(this,xu,Vr.create(gu),"f"),sr(this,qv,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=sr(this,Jv,"f").boxAdapters.adapterFor(n.box,Ma);sr(this,sf,"f").add(i)&&(sr(this,xu,"f").add(i),sr(this,yl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{sr(this,xu,"f").remove(sr(this,sf,"f").removeByKey(n)),sr(this,yl,"f").notify()}}))}get box(){return sr(this,Gn,"f")}get uuid(){return sr(this,Gn,"f").address.uuid}get address(){return sr(this,Gn,"f").address}get warpMarkers(){return sr(this,xu,"f")}get playbackRate(){return sr(this,Gn,"f").playbackRate.getValue()}get cents(){return Math.log2(sr(this,Gn,"f").playbackRate.getValue())*1200}set cents(e){sr(this,Gn,"f").playbackRate.setValue(Fe(2**(e/1200),.5,2))}get transientPlayMode(){return ao(sr(this,Gn,"f").transientPlayMode.getValue(),Ng)}clone(){let e=Gc.create(sr(this,Gn,"f").graph,B.generate(),r=>{r.transientPlayMode.setValue(this.transientPlayMode),r.playbackRate.setValue(this.playbackRate),r.warpMarkers});return this.warpMarkers.asArray().forEach(r=>ba.create(e.graph,B.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return sr(this,yl,"f").subscribe(e)}onChanged(){sr(this,yl,"f").notify()}terminate(){sr(this,qv,"f").terminate()}};qv=new WeakMap,Jv=new WeakMap,Gn=new WeakMap,yl=new WeakMap,sf=new WeakMap,xu=new WeakMap;var lf=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)},Yv,Xv,sn,wl,cf,yu,Ba=class{constructor(e,r){Yv.set(this,new Y),Xv.set(this,void 0),sn.set(this,void 0),wl.set(this,void 0),cf.set(this,void 0),yu.set(this,void 0),lf(this,Xv,e,"f"),lf(this,sn,r,"f"),lf(this,wl,new fe,"f"),lf(this,cf,B.newSet(({uuid:n})=>n),"f"),lf(this,yu,Vr.create(gu),"f"),Zt(this,Yv,"f").ownAll(r.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Zt(this,Xv,"f").boxAdapters.adapterFor(n.box,Ma);Zt(this,cf,"f").add(i)&&(Zt(this,yu,"f").add(i),Zt(this,wl,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Zt(this,yu,"f").remove(Zt(this,cf,"f").removeByKey(n)),Zt(this,wl,"f").notify()}}))}get box(){return Zt(this,sn,"f")}get uuid(){return Zt(this,sn,"f").address.uuid}get address(){return Zt(this,sn,"f").address}get warpMarkers(){return Zt(this,yu,"f")}get transpose(){return Zt(this,sn,"f").transpose.getValue()}set transpose(e){Zt(this,sn,"f").transpose.setValue(e)}get cents(){return Zt(this,sn,"f").transpose.getValue()*100}set cents(e){Zt(this,sn,"f").transpose.setValue(e/100)}clone(){let e=Hc.create(Zt(this,sn,"f").graph,B.generate());return e.transpose.setValue(Zt(this,sn,"f").transpose.getValue()),this.warpMarkers.asArray().forEach(r=>ba.create(e.graph,B.generate(),n=>{n.position.setValue(r.position),n.seconds.setValue(r.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Zt(this,wl,"f").subscribe(e)}onChanged(){Zt(this,wl,"f").notify()}terminate(){Zt(this,Yv,"f").terminate()}};Yv=new WeakMap,Xv=new WeakMap,sn=new WeakMap,wl=new WeakMap,cf=new WeakMap,yu=new WeakMap;var Na;(function(t){t.isAudioPlayMode=e=>e instanceof $a||e instanceof ka||e instanceof Ba})(Na||(Na={}));var Bi=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)},bl,wu,_l,zt,Al,Fl,uf,pf,df,os,bu,_u,Au,Fu=class{constructor(e,r){bl.add(this),this.type="audio-clip",wu.set(this,new Y),_l.set(this,void 0),zt.set(this,void 0),Al.set(this,void 0),Fl.set(this,void 0),uf.set(this,void 0),pf.set(this,void 0),df.set(this,void 0),os.set(this,b.None),bu.set(this,b.None),_u.set(this,pe.Empty),Bi(this,_l,e,"f"),Bi(this,zt,r,"f"),Bi(this,df,!0,"f"),Bi(this,Al,new Nr,"f"),Bi(this,Fl,we(this,wu,"f").own(new tn(!1)),"f"),Bi(this,uf,Xs.aware(e.tempoMap,r.timeBase,r.duration),"f"),Bi(this,pf,we(this,wu,"f").own(new fe),"f"),we(this,wu,"f").ownAll(we(this,zt,"f").pointerHub.subscribe({onAdded:()=>we(this,bl,"m",Au).call(this),onRemoved:()=>we(this,bl,"m",Au).call(this)}),we(this,zt,"f").playMode.catchupAndSubscribe(({targetVertex:n})=>{we(this,_u,"f").terminate(),n.match({none:()=>we(this,Al,"f").clear(),some:({box:i})=>{let a=we(this,_l,"f").boxAdapters.adapterFor(i,Na.isAudioPlayMode);Bi(this,_u,a.subscribe(()=>we(this,bl,"m",Au).call(this)),"f"),we(this,Al,"f").wrap(a)}})}),we(this,zt,"f").file.catchupAndSubscribe(n=>{Bi(this,os,n.targetVertex.map(i=>we(this,_l,"f").boxAdapters.adapterFor(i.box,Zn)),"f"),we(this,bu,"f").ifSome(i=>i.terminate()),Bi(this,bu,we(this,os,"f").map(i=>i.getOrCreateLoader().subscribe(()=>we(this,bl,"m",Au).call(this))),"f")}),we(this,zt,"f").subscribe(ze.Children,n=>we(this,bl,"m",Au).call(this))),Bi(this,df,!1,"f")}catchupAndSubscribeSelected(e){return we(this,Fl,"f").catchupAndSubscribe(e)}subscribeChange(e){return we(this,pf,"f").subscribe(e)}accept(e){return N(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){let r=this.observableOptPlayMode.map(n=>n.clone());Lc.create(we(this,_l,"f").boxGraph,B.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(we(this,zt,"f").clips.targetVertex.unwrap("clips.target")),n.file.refer(we(this,zt,"f").file.targetVertex.unwrap("file.target")),n.events.refer(we(this,zt,"f").events.targetVertex.unwrap("events.target")),r.ifSome(i=>n.playMode.refer(i))})}onSelected(){we(this,Fl,"f").setValue(!0)}onDeselected(){we(this,Fl,"f").setValue(!1)}get isSelected(){return we(this,Fl,"f").getValue()}get box(){return we(this,zt,"f")}get uuid(){return we(this,zt,"f").address.uuid}get address(){return we(this,zt,"f").address}get indexField(){return we(this,zt,"f").index}get duration(){return we(this,uf,"f").toPPQN(0)}set duration(e){we(this,uf,"f").fromPPQN(e,0)}get mute(){return we(this,zt,"f").mute.getValue()}get hue(){return we(this,zt,"f").hue.getValue()}get gain(){return we(this,zt,"f").gain}get file(){return we(this,os,"f").unwrap("Cannot access file.")}get optFile(){return we(this,os,"f")}get observableOptPlayMode(){return we(this,Al,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return b.None}get timeBase(){return ao(we(this,zt,"f").timeBase.getValue(),ti)}get waveformOffset(){return we(this,zt,"f").waveformOffset}get isPlayModeNoStretch(){return we(this,zt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>gt(e,$a)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>gt(e,ka)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>gt(e,Ba)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>Na.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(we(this,os,"f").isEmpty())return"No Audio File";let e=we(this,os,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):we(this,zt,"f").label.getValue()}get trackBoxAdapter(){return we(this,df,"f")?b.None:we(this,zt,"f").clips.targetVertex.map(e=>we(this,_l,"f").boxAdapters.adapterFor(e.box,or))}get isMirrowed(){return!1}get canMirror(){return!1}get canResize(){return we(this,Al,"f").nonEmpty()}terminate(){we(this,bu,"f").ifSome(e=>e.terminate()),Bi(this,bu,b.None,"f"),we(this,_u,"f").terminate(),Bi(this,_u,pe.Empty,"f"),we(this,wu,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${B.toString(we(this,zt,"f").address.uuid)} d: ${Te.toString(this.duration)}}`}};wu=new WeakMap,_l=new WeakMap,zt=new WeakMap,Al=new WeakMap,Fl=new WeakMap,uf=new WeakMap,pf=new WeakMap,df=new WeakMap,os=new WeakMap,bu=new WeakMap,_u=new WeakMap,bl=new WeakSet,Au=function(){we(this,pf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};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},Gt=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)},Eu,hr,Qv,mf,El=class t{constructor(e,r){this.type="note-event",Eu.set(this,void 0),hr.set(this,void 0),Qv.set(this,void 0),mf.set(this,!1),ff(this,Eu,e,"f"),ff(this,hr,r,"f"),ff(this,Qv,Gt(this,hr,"f").subscribe(ze.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.collection.unwrap(),a=n.address.fieldKeys,o=de.equals(Gt(this,hr,"f").pitch.address.fieldKeys,a),s=de.equals(Gt(this,hr,"f").position.address.fieldKeys,a);o||s?i.requestSorting():i.onEventPropertyChanged()}}),"f")}onSelected(){ff(this,mf,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){ff(this,mf,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Gt(this,Qv,"f").terminate()}get box(){return Gt(this,hr,"f")}get uuid(){return Gt(this,hr,"f").address.uuid}get address(){return Gt(this,hr,"f").address}get position(){return Gt(this,hr,"f").position.getValue()}get duration(){return Gt(this,hr,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return Gt(this,hr,"f").velocity.getValue()}get pitch(){return Gt(this,hr,"f").pitch.getValue()}get cent(){return Gt(this,hr,"f").cent.getValue()}get chance(){return Gt(this,hr,"f").chance.getValue()}get playCount(){return Gt(this,hr,"f").playCount.getValue()}get playCurve(){return Gt(this,hr,"f").playCurve.getValue()}get isSelected(){return Gt(this,mf,"f")}get collection(){return Gt(this,hr,"f").events.targetVertex.map(e=>Gt(this,Eu,"f").boxAdapters.adapterFor(e.box,ln))}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 Gt(this,Eu,"f").boxAdapters.adapterFor(Jo.create(Gt(this,Eu,"f").boxGraph,B.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 Oc.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,r=this.collection.unwrap("collection").box.events,n=de.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 Gt(this,hr,"f").delete(),n}};Eu=new WeakMap,hr=new WeakMap,Qv=new WeakMap,mf=new WeakMap;var Ia=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},Pe=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)},wo,hf,ss,Hn,Sl,gf,hi,tx,rx,ix,ls,ex,vf,ln=class t{constructor(e,r){wo.add(this),hf.set(this,new Y),ss.set(this,void 0),Hn.set(this,void 0),Sl.set(this,void 0),gf.set(this,void 0),hi.set(this,void 0),tx.set(this,60),rx.set(this,60),ix.set(this,0),ls.set(this,!1),Ia(this,ss,e,"f"),Ia(this,Hn,r,"f"),Ia(this,Sl,new fe,"f"),Ia(this,gf,B.newSet(n=>n.uuid),"f"),Ia(this,hi,Vr.create(Oc.Comparator),"f"),Pe(this,hf,"f").own(Pe(this,Hn,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=Pe(this,ss,"f").boxAdapters.adapterFor(n,El);Pe(this,gf,"f").add(i)&&(Pe(this,hi,"f").add(i),Pe(this,wo,"m",ex).call(this))},onRemoved:({box:{address:{uuid:n}}})=>{Pe(this,hi,"f").remove(Pe(this,gf,"f").removeByKey(n)),Pe(this,wo,"m",ex).call(this)}})),Pe(this,hf,"f").own(Pe(this,Hn,"f").owners.pointerHub.subscribe({onAdded:()=>Pe(this,Sl,"f").notify(this),onRemoved:()=>Pe(this,Sl,"f").notify(this)}))}copy(){let e=Pe(this,ss,"f").boxGraph,r=go.create(e,B.generate());return Pe(this,hi,"f").asArray().forEach(n=>n.copyTo({events:r.events})),Pe(this,ss,"f").boxAdapters.adapterFor(r,t)}createEvent({position:e,duration:r,velocity:n,pitch:i,chance:a,playCount:o,cent:s}){return Pe(this,ss,"f").boxAdapters.adapterFor(Jo.create(Pe(this,ss,"f").boxGraph,B.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(Pe(this,Hn,"f").events)}),El)}subscribeChange(e){return Pe(this,Sl,"f").subscribe(e)}selectable(){return Pe(this,hi,"f").asArray()}selectableAt(e){for(let r of Pe(this,hi,"f").asArray())if(r.position<=e.u&&e.u<r.complete&&r.pitch===e.v)return rr.one(r);return rr.empty()}selectablesBetween(e,r){let n=[],i=Pe(this,hi,"f").asArray(),a=Pe(this,hi,"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 Pe(this,hi,"f").asArray())a.pitch===n&&a.complete>e&&a.position<r&&i.push(a);return i}requestSorting(){Pe(this,hi,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Pe(this,wo,"m",ex).call(this)}terminate(){Pe(this,hf,"f").terminate()}get box(){return Pe(this,Hn,"f")}get uuid(){return Pe(this,Hn,"f").address.uuid}get address(){return Pe(this,Hn,"f").address}get numOwners(){return Pe(this,Hn,"f").owners.pointerHub.filter(l.NoteEventCollection).length}get events(){return Pe(this,ls,"f")||Pe(this,wo,"m",vf).call(this),Pe(this,hi,"f")}get minPitch(){return Pe(this,ls,"f")||Pe(this,wo,"m",vf).call(this),Pe(this,tx,"f")}get maxPitch(){return Pe(this,ls,"f")||Pe(this,wo,"m",vf).call(this),Pe(this,rx,"f")}get maxDuration(){return Pe(this,ls,"f")||Pe(this,wo,"m",vf).call(this),Pe(this,ix,"f")}toString(){return`{NoteEventCollectionBox ${B.toString(Pe(this,Hn,"f").address.uuid)}}`}};hf=new WeakMap,ss=new WeakMap,Hn=new WeakMap,Sl=new WeakMap,gf=new WeakMap,hi=new WeakMap,tx=new WeakMap,rx=new WeakMap,ix=new WeakMap,ls=new WeakMap,wo=new WeakSet,ex=function(){Ia(this,ls,!1,"f"),Pe(this,Sl,"f").notify(this)},vf=function(){let e=127,r=0,n=0;Pe(this,hi,"f").asArray().forEach(({pitch:i,duration:a})=>{e=Math.min(e,i),r=Math.max(r,i),n=Math.max(n,a)}),Ia(this,tx,e,"f"),Ia(this,rx,r,"f"),Ia(this,ix,n,"f"),Ia(this,ls,!0,"f")};var Pl=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)},Ml,Su,Nl,lr,$l,wf,xf,yf,Pu,Mu=class{constructor(e,r){Ml.add(this),this.type="note-clip",Su.set(this,new Y),Nl.set(this,void 0),lr.set(this,void 0),$l.set(this,void 0),wf.set(this,void 0),xf.set(this,void 0),yf.set(this,pe.Empty),Pl(this,Nl,e,"f"),Pl(this,lr,r,"f"),Pl(this,xf,!0,"f"),Pl(this,$l,We(this,Su,"f").own(new tn(!1)),"f"),Pl(this,wf,We(this,Su,"f").own(new fe),"f"),We(this,Su,"f").ownAll(We(this,lr,"f").pointerHub.subscribe({onAdded:()=>We(this,Ml,"m",Pu).call(this),onRemoved:()=>We(this,Ml,"m",Pu).call(this)}),We(this,lr,"f").subscribe(ze.Children,n=>We(this,Ml,"m",Pu).call(this)),We(this,lr,"f").events.catchupAndSubscribe(({targetVertex:n})=>{We(this,yf,"f").terminate(),Pl(this,yf,n.match({none:()=>pe.Empty,some:({box:i})=>We(this,Nl,"f").boxAdapters.adapterFor(i,ln).subscribeChange(()=>We(this,Ml,"m",Pu).call(this))}),"f"),We(this,Ml,"m",Pu).call(this)})),Pl(this,xf,!1,"f")}catchupAndSubscribeSelected(e){return We(this,$l,"f").catchupAndSubscribe(e)}subscribeChange(e){return We(this,wf,"f").subscribe(e)}accept(e){return N(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&We(this,lr,"f").events.refer(this.optCollection.unwrap("optCollection").copy().box.owners)}clone(e){let r=e?this.optCollection.unwrap("optCollection").copy().box.owners:We(this,lr,"f").events.targetVertex.unwrap("events.target");jc.create(We(this,Nl,"f").boxGraph,B.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(We(this,lr,"f").clips.targetVertex.unwrap("clips.target")),n.events.refer(r)})}onSelected(){We(this,$l,"f").setValue(!0)}onDeselected(){We(this,$l,"f").setValue(!1)}get isSelected(){return We(this,$l,"f").getValue()}terminate(){We(this,yf,"f").terminate(),We(this,Su,"f").terminate()}get box(){return We(this,lr,"f")}get uuid(){return We(this,lr,"f").address.uuid}get address(){return We(this,lr,"f").address}get indexField(){return We(this,lr,"f").index}get duration(){return We(this,lr,"f").duration.getValue()}get mute(){return We(this,lr,"f").mute.getValue()}get hue(){return We(this,lr,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return We(this,lr,"f").events.targetVertex.map(e=>We(this,Nl,"f").boxAdapters.adapterFor(e.box,ln))}get label(){return We(this,lr,"f").label.getValue()}get trackBoxAdapter(){return We(this,xf,"f")?b.None:We(this,lr,"f").clips.targetVertex.map(e=>We(this,Nl,"f").boxAdapters.adapterFor(e.box,or))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${B.toString(We(this,lr,"f").address.uuid)} d: ${Te.toString(this.duration)}}`}};Su=new WeakMap,Nl=new WeakMap,lr=new WeakMap,$l=new WeakMap,wf=new WeakMap,xf=new WeakMap,yf=new WeakMap,Ml=new WeakSet,Pu=function(){We(this,wf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var NM={for:(t,e)=>Ke(e.accept({visitNoteClipBox:r=>t.adapterFor(r,Mu),visitValueClipBox:r=>t.adapterFor(r,as),visitAudioClipBox:r=>t.adapterFor(r,Fu)}),"")};var nx=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},cs=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)},ax,Nu,bf,_f,ox=class{constructor(e,r){ax.set(this,void 0),Nu.set(this,void 0),bf.set(this,void 0),_f.set(this,void 0),nx(this,ax,e,"f"),nx(this,Nu,new Y,"f"),nx(this,bf,cs(this,Nu,"f").own(new fe),"f"),nx(this,_f,cs(this,Nu,"f").own(Rt.create(e.box.clips,n=>NM.for(r,n),l.ClipCollection)),"f"),cs(this,_f,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return cs(this,ax,"f")}get collection(){return cs(this,_f,"f")}dispatchChange(){cs(this,bf,"f").notify()}subscribeChanges(e){return cs(this,bf,"f").subscribe(e)}terminate(){cs(this,Nu,"f").terminate()}};ax=new WeakMap,Nu=new WeakMap,bf=new WeakMap,_f=new WeakMap;var yD=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},cn=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)},ii,sx=class{constructor(e){ii.set(this,void 0),yD(this,ii,e,"f")}get inField(){return cn(this,ii,"f").in}get outField(){return cn(this,ii,"f").out}get inSlopeField(){return cn(this,ii,"f").inSlope}get outSlopeField(){return cn(this,ii,"f").outSlope}get in(){return cn(this,ii,"f").in.getValue()}get out(){return cn(this,ii,"f").out.getValue()}get inSlope(){return cn(this,ii,"f").inSlope.getValue()}get outSlope(){return cn(this,ii,"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(){cn(this,ii,"f").in.setValue(0),cn(this,ii,"f").out.setValue(0),cn(this,ii,"f").inSlope.setValue(.75),cn(this,ii,"f").outSlope.setValue(.25)}};ii=new WeakMap;var xt=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},Q=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)},Ii,Af,un,tt,$u,ku,Bu,Ff,qn,Ef,us,Iu,Tu,Du,Ru,Cu,zu,Ou,dn,Vu=class t{constructor(e,r){Ii.add(this),this.type="audio-region",Af.set(this,void 0),un.set(this,void 0),tt.set(this,void 0),$u.set(this,void 0),ku.set(this,void 0),Bu.set(this,void 0),Ff.set(this,void 0),qn.set(this,void 0),Ef.set(this,void 0),us.set(this,b.None),Iu.set(this,pe.Empty),Tu.set(this,pe.Empty),Du.set(this,pe.Empty),Ru.set(this,pe.Empty),Cu.set(this,void 0),zu.set(this,Number.NaN),Ou.set(this,Number.NaN),xt(this,un,e,"f"),xt(this,tt,r,"f"),xt(this,Af,new Y,"f");let{timeBase:n,duration:i,loopDuration:a}=r;xt(this,$u,Xs.aware(e.tempoMap,n,i),"f"),xt(this,ku,Xs.aware(e.tempoMap,n,a),"f"),xt(this,Bu,new Nr,"f"),xt(this,Ff,new fe,"f"),xt(this,qn,new sx(r.fading),"f"),xt(this,Cu,!1,"f"),xt(this,Ef,!0,"f"),Q(this,Af,"f").ownAll(Q(this,tt,"f").pointerHub.subscribe({onAdded:()=>Q(this,Ii,"m",dn).call(this),onRemoved:()=>Q(this,Ii,"m",dn).call(this)}),Q(this,tt,"f").file.catchupAndSubscribe(o=>{xt(this,us,o.targetVertex.map(s=>Q(this,un,"f").boxAdapters.adapterFor(s.box,Zn)),"f"),Q(this,Iu,"f").terminate(),xt(this,Iu,Q(this,us,"f").mapOr(s=>s.getOrCreateLoader().subscribe(()=>Q(this,Ii,"m",dn).call(this)),pe.Empty),"f")}),Q(this,tt,"f").playMode.catchupAndSubscribe(({targetVertex:o})=>{Q(this,Tu,"f").terminate(),o.match({none:()=>Q(this,Bu,"f").clear(),some:({box:s})=>{let c=Q(this,un,"f").boxAdapters.adapterFor(s,Na.isAudioPlayMode);xt(this,Tu,c.subscribe(()=>Q(this,Ii,"m",dn).call(this)),"f"),Q(this,Bu,"f").wrap(c)}})}),Q(this,tt,"f").timeBase.catchupAndSubscribe(o=>{Q(this,Du,"f").terminate(),ao(o.getValue(),ti)===ti.Seconds&&xt(this,Du,e.tempoMap.subscribe(()=>Q(this,Ii,"m",dn).call(this)),"f")}),Q(this,tt,"f").subscribe(ze.Children,o=>{if(!this.trackBoxAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let s=this.trackBoxAdapter.unwrap();Q(this,tt,"f").position.address.equals(o.address)?(s.regions.onIndexingChanged(),Q(this,Ii,"m",dn).call(this)):Q(this,Ii,"m",dn).call(this)}}),Q(this,tt,"f").events.catchupAndSubscribe(({targetVertex:o})=>{Q(this,Ru,"f").terminate(),xt(this,Ru,o.match({none:()=>pe.Empty,some:({box:s})=>Q(this,un,"f").boxAdapters.adapterFor(s,kr).subscribeChange(()=>Q(this,Ii,"m",dn).call(this))}),"f"),Q(this,Ii,"m",dn).call(this)})),xt(this,Ef,!1,"f")}subscribeChange(e){return Q(this,Ff,"f").subscribe(e)}accept(e){return N(e.visitAudioRegionBoxAdapter,this)}onSelected(){xt(this,Cu,!0,"f"),Q(this,Ii,"m",dn).call(this)}onDeselected(){xt(this,Cu,!1,"f"),Q(this,Ii,"m",dn).call(this)}get isSelected(){return Q(this,Cu,"f")}get box(){return Q(this,tt,"f")}get uuid(){return Q(this,tt,"f").address.uuid}get address(){return Q(this,tt,"f").address}get position(){return Q(this,tt,"f").position.getValue()}get duration(){return Number.isNaN(Q(this,zu,"f"))&&xt(this,zu,Q(this,$u,"f").toPPQN(this.position),"f"),Q(this,zu,"f")}get complete(){return this.position+this.duration}get loopOffset(){return Q(this,tt,"f").loopOffset.getValue()}get loopDuration(){return Number.isNaN(Q(this,Ou,"f"))&&xt(this,Ou,Q(this,ku,"f").toPPQN(this.position),"f"),Q(this,Ou,"f")}isNoteRegion(){return!1}isAudioRegion(){return!0}isValueRegion(){return!1}resolveDuration(e){return Q(this,$u,"f").toPPQN(e)}resolveComplete(e){return e+this.resolveDuration(e)}resolveLoopDuration(e){return Q(this,ku,"f").toPPQN(e)}get offset(){return this.position-this.loopOffset}get mute(){return Q(this,tt,"f").mute.getValue()}get hue(){return Q(this,tt,"f").hue.getValue()}get gain(){return Q(this,tt,"f").gain}get fading(){return Q(this,qn,"f")}get file(){return Q(this,us,"f").unwrap("Cannot access file.")}get optFile(){return Q(this,us,"f")}get observableOptPlayMode(){return Q(this,Bu,"f")}get timeBase(){return ao(Q(this,tt,"f").timeBase.getValue(),ti)}get waveformOffset(){return Q(this,tt,"f").waveformOffset}get isPlayModeNoStretch(){return Q(this,tt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>gt(e,$a)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>gt(e,ka)?e:null)}get asPlayModeSignalsmith(){return this.observableOptPlayMode.map(e=>gt(e,Ba)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>Na.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(Q(this,us,"f").isEmpty())return"No Audio File";let e=Q(this,us,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):Q(this,tt,"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 Q(this,tt,"f").regions.targetVertex.map(e=>Q(this,un,"f").boxAdapters.adapterFor(e.box,or))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return Q(this,tt,"f").events.targetVertex.map(e=>Q(this,un,"f").boxAdapters.adapterFor(e.box,kr))}set position(e){Q(this,tt,"f").position.setValue(e)}set duration(e){Q(this,$u,"f").fromPPQN(e,this.position);let r=Q(this,qn,"f").in+Q(this,qn,"f").out;if(r>e){let n=e/r;Q(this,qn,"f").inField.setValue(Q(this,qn,"f").in*n),Q(this,qn,"f").outField.setValue(Q(this,qn,"f").out*n)}}set loopOffset(e){Q(this,tt,"f").loopOffset.setValue(Js(e,this.loopDuration))}set loopDuration(e){Q(this,ku,"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===ti.Seconds){let i=e>=0?Q(this,un,"f").tempoMap.intervalToSeconds(r,n):-Q(this,un,"f").tempoMap.intervalToSeconds(n,r);Q(this,tt,"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=Q(this,un,"f").boxAdapters.adapterFor(Xo.create(Q(this,un,"f").boxGraph,B.generate(),o=>{o.timeBase.setValue(Q(this,tt,"f").timeBase.getValue()),o.position.setValue(e?.position??Q(this,tt,"f").position.getValue()),o.regions.refer(e?.target??Q(this,tt,"f").regions.targetVertex.unwrap("regions.target")),o.file.refer(Q(this,tt,"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)),Q(this,qn,"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&&de.satisfy(e,(r,n)=>r.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap("trackBoxAdapter")))&&e.every(r=>r.isSelected&&r instanceof t)}flatten(e){return b.None}terminate(){Q(this,Iu,"f").terminate(),xt(this,Iu,pe.Empty,"f"),Q(this,Du,"f").terminate(),xt(this,Du,pe.Empty,"f"),Q(this,Tu,"f").terminate(),xt(this,Tu,pe.Empty,"f"),Q(this,Ru,"f").terminate(),xt(this,Ru,pe.Empty,"f"),Q(this,Af,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${B.toString(Q(this,tt,"f").address.uuid)}}`}};Af=new WeakMap,un=new WeakMap,tt=new WeakMap,$u=new WeakMap,ku=new WeakMap,Bu=new WeakMap,Ff=new WeakMap,qn=new WeakMap,Ef=new WeakMap,us=new WeakMap,Iu=new WeakMap,Tu=new WeakMap,Du=new WeakMap,Ru=new WeakMap,Cu=new WeakMap,zu=new WeakMap,Ou=new WeakMap,Ii=new WeakSet,dn=function(){xt(this,zu,Number.NaN,"f"),xt(this,Ou,Number.NaN,"f"),!Q(this,Ef,"f")&&(Q(this,Ff,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var bo=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},ke=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)},Ta,lx,Da,yt,Mf,Sf,Uu,Pf,_o,ju=class t{constructor(e,r){Ta.add(this),this.type="note-region",lx.set(this,new Y),Da.set(this,void 0),yt.set(this,void 0),Mf.set(this,void 0),Sf.set(this,void 0),Uu.set(this,void 0),Pf.set(this,pe.Empty),bo(this,Da,e,"f"),bo(this,yt,r,"f"),bo(this,Mf,new fe,"f"),bo(this,Uu,!1,"f"),bo(this,Sf,!0,"f"),ke(this,lx,"f").ownAll(ke(this,yt,"f").pointerHub.subscribe({onAdded:()=>ke(this,Ta,"m",_o).call(this),onRemoved:()=>ke(this,Ta,"m",_o).call(this)}),ke(this,yt,"f").subscribe(ze.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();ke(this,yt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),ke(this,Ta,"m",_o).call(this)):ke(this,Ta,"m",_o).call(this)}}),ke(this,yt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{ke(this,Pf,"f").terminate(),bo(this,Pf,n.match({none:()=>pe.Empty,some:({box:i})=>ke(this,Da,"f").boxAdapters.adapterFor(i,ln).subscribeChange(()=>ke(this,Ta,"m",_o).call(this))}),"f"),ke(this,Ta,"m",_o).call(this)})),bo(this,Sf,!1,"f")}set position(e){ke(this,yt,"f").position.setValue(e)}set duration(e){ke(this,yt,"f").duration.setValue(e)}set loopOffset(e){ke(this,yt,"f").loopOffset.setValue(e)}set loopDuration(e){ke(this,yt,"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 ke(this,Mf,"f").subscribe(e)}accept(e){return N(e.visitNoteRegionBoxAdapter,this)}onSelected(){bo(this,Uu,!0,"f"),ke(this,Ta,"m",_o).call(this)}onDeselected(){bo(this,Uu,!1,"f"),ke(this,Ta,"m",_o).call(this)}get isSelected(){return ke(this,Uu,"f")}*iterateActiveNotesAt(e){let r=this.optCollection;if(r.isEmpty())return;let n=r.unwrap(),i=co.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(){ke(this,Pf,"f").terminate(),ke(this,lx,"f").terminate()}get box(){return ke(this,yt,"f")}get uuid(){return ke(this,yt,"f").address.uuid}get address(){return ke(this,yt,"f").address}get position(){return ke(this,yt,"f").position.getValue()}get duration(){return ke(this,yt,"f").duration.getValue()}get loopOffset(){return ke(this,yt,"f").loopOffset.getValue()}get loopDuration(){return ke(this,yt,"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 ke(this,yt,"f").mute.getValue()}get hue(){return ke(this,yt,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return ke(this,yt,"f").events.targetVertex.map(e=>ke(this,Da,"f").boxAdapters.adapterFor(e.box,ln))}get label(){return ke(this,yt,"f").label.getValue()}get trackBoxAdapter(){return ke(this,Sf,"f")?b.None:ke(this,yt,"f").regions.targetVertex.map(e=>ke(this,Da,"f").boxAdapters.adapterFor(e.box,or))}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 ke(this,Da,"f").boxAdapters.adapterFor(sl.create(ke(this,Da,"f").boxGraph,B.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??ke(this,yt,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let r=ke(this,Da,"f").boxGraph,n=go.create(r,B.generate());e.events.asArray().forEach(i=>i.copyTo({events:n.events})),ke(this,yt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&de.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 b.None;let r=ke(this,Da,"f").boxGraph,n=e.toSorted(Ko.Comparator),i=de.getFirst(n,"Internal error (no first)"),a=de.getLast(n,"Internal error (no last)"),o=i.position,s=a.position+a.duration,c=i.trackBoxAdapter.unwrap("trackBoxAdapter"),u=go.create(r,B.generate()),f=Array.from(c.regions.collection.iterateRange(o,s));return f.filter(v=>v.isSelected).forEach(v=>{let h=v;for(let{resultStart:y,resultEnd:_,rawStart:$}of co.locateLoops(h,h.position,h.complete)){let S=Math.floor(y-$),z=Math.floor(_-$);for(let O of h.optCollection.unwrap("optCollection").events.iterateRange(S,z))O.copyTo({position:O.position+$-i.position,events:u.events})}}),f.forEach(({box:v})=>v.delete()),b.wrap(sl.create(r,B.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 ${B.toString(ke(this,yt,"f").address.uuid)} p: ${Te.toString(this.position)}, c: ${Te.toString(this.complete)}}`}};lx=new WeakMap,Da=new WeakMap,yt=new WeakMap,Mf=new WeakMap,Sf=new WeakMap,Uu=new WeakMap,Pf=new WeakMap,Ta=new WeakSet,_o=function(){ke(this,Mf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var Ao=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},Ee=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)},Jn,Ku,Ra,wt,kf,Wu,Nf,$f,Ca,Fo=class t{constructor(e,r){Jn.add(this),this.type="value-region",Ku.set(this,new Y),Ra.set(this,void 0),wt.set(this,void 0),kf.set(this,void 0),Wu.set(this,void 0),Nf.set(this,void 0),$f.set(this,pe.Empty),Ao(this,Ra,e,"f"),Ao(this,wt,r,"f"),Ao(this,Nf,!0,"f"),Ao(this,kf,new fe,"f"),Ao(this,Wu,!1,"f"),Ee(this,Ku,"f").own(Ee(this,wt,"f").pointerHub.subscribe({onAdded:()=>Ee(this,Jn,"m",Ca).call(this),onRemoved:()=>Ee(this,Jn,"m",Ca).call(this)})),Ee(this,Ku,"f").own(Ee(this,wt,"f").subscribe(ze.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();Ee(this,wt,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),Ee(this,Jn,"m",Ca).call(this)):Ee(this,Jn,"m",Ca).call(this)}})),Ee(this,Ku,"f").own(Ee(this,wt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ee(this,$f,"f").terminate(),Ao(this,$f,n.match({none:()=>pe.Empty,some:({box:i})=>Ee(this,Ra,"f").boxAdapters.adapterFor(i,kr).subscribeChange(()=>Ee(this,Jn,"m",Ca).call(this))}),"f"),Ee(this,Jn,"m",Ca).call(this)})),Ao(this,Nf,!1,"f")}valueAt(e,r){let n=this.optCollection;return n.isEmpty()?r:n.unwrap().valueAt(co.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(co.globalToLocal(this,this.complete),e)}subscribeChange(e){return Ee(this,kf,"f").subscribe(e)}accept(e){return N(e.visitValueRegionBoxAdapter,this)}onSelected(){Ao(this,Wu,!0,"f"),Ee(this,Jn,"m",Ca).call(this)}onDeselected(){Ao(this,Wu,!1,"f"),Ee(this,Jn,"m",Ca).call(this)}get isSelected(){return Ee(this,Wu,"f")}onValuesPropertyChanged(){Ee(this,Jn,"m",Ca).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){Ee(this,$f,"f").terminate(),Ee(this,Ku,"f").terminate()}get box(){return Ee(this,wt,"f")}get uuid(){return Ee(this,wt,"f").address.uuid}get address(){return Ee(this,wt,"f").address}get position(){return Ee(this,wt,"f").position.getValue()}get duration(){return Ee(this,wt,"f").duration.getValue()}get loopOffset(){return Ee(this,wt,"f").loopOffset.getValue()}get loopDuration(){return Ee(this,wt,"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 Ee(this,wt,"f").mute.getValue()}get hue(){return Ee(this,wt,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Ee(this,wt,"f").events.targetVertex.map(e=>Ee(this,Ra,"f").boxAdapters.adapterFor(e.box,kr))}get label(){return Ee(this,wt,"f").label.getValue()}get trackBoxAdapter(){return Ee(this,Nf,"f")?b.None:Ee(this,wt,"f").regions.targetVertex.map(e=>Ee(this,Ra,"f").boxAdapters.adapterFor(e.box,or))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}set position(e){Ee(this,wt,"f").position.setValue(e)}set duration(e){Ee(this,wt,"f").duration.setValue(e)}set loopOffset(e){Ee(this,wt,"f").loopOffset.setValue(e)}set loopDuration(e){Ee(this,wt,"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 Ee(this,Ra,"f").boxAdapters.adapterFor(ll.create(Ee(this,Ra,"f").boxGraph,B.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??Ee(this,wt,"f").regions.targetVertex.unwrap("regions.target"))}),t)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let r=Ee(this,Ra,"f").boxGraph,n=Wn.create(r,B.generate());e.asArray().forEach(i=>i.copyTo({events:n.events})),Ee(this,wt,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&de.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 b.None;let r=Ee(this,Ra,"f").boxGraph,n=e.toSorted(Ko.Comparator),i=de.getFirst(n,"Internal error (no first)"),a=de.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(_=>_.isSelected).forEach(_=>{let $=_,S=$.optCollection.unwrap("optCollection"),z=S.events;for(let{rawStart:O,regionStart:J,regionEnd:te}of co.locateLoops($,$.position,$.complete)){let me=J-O,he=te-O,be=z.greaterEqual(me);if(!K(be)||be.position!==me){let Se=z.lowerEqual(me);K(Se)&&f.push({position:J-o,value:S.valueAt(me,0),interpolation:Se.interpolation})}let ue=!1;for(let Se of z.iterateRange(me,Mr.MAX_VALUE)){let Ut=Se.position+O;if(Ut<te)f.push({position:Ut-o,value:Se.value,interpolation:Se.interpolation});else if(Ut===te){f.push({position:Ut-o,value:Se.value,interpolation:Ur.None}),ue=!0;break}else{f.push({position:te-o,value:S.valueAt(he,0),interpolation:Ur.None}),ue=!0;break}}ue||f.push({position:te-o,value:S.valueAt(he,0),interpolation:Ur.None})}});let v=[];for(let _ of f){let $=v.length>0?v[v.length-1]:void 0;K($)&&$.position===_.position&&$.value===_.value?v[v.length-1]=_:v.push(_)}let h=Wn.create(r,B.generate()),y=0;for(;y<v.length;){let _=y+1;for(;_<v.length&&v[_].position===v[y].position;)_++;let $=v[y],S=v[_-1],z=Kn.create(r,B.generate(),O=>{O.position.setValue($.position),O.index.setValue(0),O.value.setValue($.value),O.events.refer(h.events)});if(mi.write(z.interpolation,_-y>1?Ur.None:$.interpolation),_-y>1){let O=Kn.create(r,B.generate(),J=>{J.position.setValue(S.position),J.index.setValue(1),J.value.setValue(S.value),J.events.refer(h.events)});mi.write(O.interpolation,S.interpolation)}y=_}return u.forEach(({box:_})=>_.delete()),b.wrap(ll.create(r,B.generate(),_=>{_.position.setValue(o),_.duration.setValue(s-o),_.loopDuration.setValue(s-o),_.loopOffset.setValue(0),_.hue.setValue(this.hue),_.mute.setValue(this.mute),_.label.setValue(this.label),_.events.refer(h.owners),_.regions.refer(c.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${B.toString(Ee(this,wt,"f").address.uuid)} p: ${Te.toString(this.position)}, c: ${Te.toString(this.complete)}}`}};Ku=new WeakMap,Ra=new WeakMap,wt=new WeakMap,kf=new WeakMap,Wu=new WeakMap,Nf=new WeakMap,$f=new WeakMap,Jn=new WeakSet,Ca=function(){Ee(this,kf,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var $M=(t,e)=>t.position-e.position,kM={for:(t,e)=>Ke(e.accept({visitNoteRegionBox:r=>t.adapterFor(r,ju),visitAudioRegionBox:r=>t.adapterFor(r,Vu),visitValueRegionBox:r=>t.adapterFor(r,Fo)}),"")};var Lu=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},cr=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)},Zu,kl,Bf,Gu,ds,Hu,cx=class{constructor(e,r){Zu.set(this,void 0),kl.set(this,void 0),Bf.set(this,void 0),Gu.set(this,void 0),ds.set(this,void 0),Hu.set(this,void 0),Lu(this,Zu,e,"f"),Lu(this,kl,new Y,"f"),Lu(this,Bf,cr(this,kl,"f").own(new fe),"f"),Lu(this,Gu,cr(this,kl,"f").own(new nr),"f"),Lu(this,ds,Ko.create($M),"f"),Lu(this,Hu,B.newSet(n=>n.uuid),"f"),cr(this,kl,"f").ownAll(cr(this,Zu,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=kM.for(r,n),a=cr(this,Hu,"f").add(i);re(a,`Cannot add ${n}`),cr(this,ds,"f").add(i);for(let o of cr(this,ds,"f").iterateRange(i.position,i.complete))if(o!==i&&o.position<i.complete&&o.complete>i.position){console.warn("[TrackRegions] Overlapping region added",{track:cr(this,Zu,"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}cr(this,Gu,"f").forEach(o=>o.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:n}}})=>{let i=cr(this,Hu,"f").removeByKey(n);cr(this,ds,"f").remove(i),cr(this,Gu,"f").forEach(a=>a.onRemoved(i)),this.dispatchChange()}},l.RegionCollection))}get trackBoxAdapter(){return cr(this,Zu,"f")}get collection(){return cr(this,ds,"f")}get adapters(){return cr(this,Hu,"f")}onIndexingChanged(){cr(this,ds,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),cr(this,Gu,"f").subscribe(e)}subscribeChanges(e){return cr(this,Bf,"f").subscribe(e)}dispatchChange(){cr(this,Bf,"f").notify()}terminate(){cr(this,kl,"f").terminate()}};Zu=new WeakMap,kl=new WeakMap,Bf=new WeakMap,Gu=new WeakMap,ds=new WeakMap,Hu=new WeakMap;var ge;(function(t){t[t.Undefined=0]="Undefined",t[t.Notes=1]="Notes",t[t.Audio=2]="Audio",t[t.Value=3]="Value"})(ge||(ge={}));(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 Oe.Waveform;case t.Notes:return Oe.Piano;case t.Value:return Oe.Automation;case t.Undefined:return Oe.AudioBus;default:return Oe.Unknown}}})(ge||(ge={}));var ux;(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&&gt(e.host,k)?e.host:j(`Could not find 'host' field in '${e?.name}'`),t.lookupLabelField=e=>K(e)&&"label"in e&&gt(e.label,T)?e.label:j(`Could not find 'label' field in '${e?.name}'`),t.lookupEnabledField=e=>K(e)&&"enabled"in e&&gt(e.enabled,I)?e.enabled:j(`Could not find 'enabled' field in '${e?.name}'`),t.lookupMinimizedField=e=>K(e)&&"minimized"in e&&gt(e.minimized,I)?e.minimized:j(`Could not find 'minimized' field in '${e?.name}'`),t.lookupIndexField=e=>K(e)&&"index"in e&&gt(e.index,M)?e.index:j(`Could not find 'index' field in '${e?.name}'`)})(ux||(ux={}));var BM;(function(t){t.toTrackType=e=>{switch(e){case"midi":return ge.Notes;case"audio":return ge.Audio;default:return j()}}})(BM||(BM={}));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 ee;(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;re(de.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})=>ux.lookupIndexField(a)).filter(a=>e.some(o=>B.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())}})(ee||(ee={}));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},Er=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)},qu,px,Yn,Bl,fx,mx=class{constructor(e,r){qu.set(this,void 0),px.set(this,new fe),Yn.set(this,void 0),Bl.set(this,void 0),fx.set(this,void 0),dx(this,qu,e,"f"),dx(this,Yn,Rt.create(e.box.tracks,n=>r.adapterFor(n,or),l.TrackCollection),"f"),dx(this,Bl,B.newSet(({uuid:n})=>n),"f"),dx(this,fx,Er(this,Yn,"f").catchupAndSubscribe({onAdd:n=>Er(this,Bl,"f").add({uuid:n.uuid,subscription:n.regions.subscribeChanges(()=>Er(this,px,"f").notify())}),onRemove:({uuid:n})=>Er(this,Bl,"f").removeByKey(n).subscription.terminate(),onReorder:n=>{}}),"f")}create(e,r,n){let i=Er(this,qu,"f").box.graph,a=Er(this,qu,"f").box.tracks;fi.create(i,B.generate(),o=>{o.index.setValue(n??Er(this,Yn,"f").getMinFreeIndex()),o.type.setValue(e),o.tracks.refer(a),o.target.refer(r)})}controls(e){return b.wrap(Er(this,Yn,"f").adapters().find(r=>r.target.targetVertex.contains(e),!1))}delete(e){let r=Er(this,Yn,"f").adapters(),n=r.indexOf(e);if(n===-1)return j(`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 Er(this,qu,"f").box}get collection(){return Er(this,Yn,"f")}values(){return Er(this,Yn,"f").adapters()}catchupAndSubscribe(e){return Er(this,Yn,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return Er(this,px,"f").subscribe(e)}terminate(){Er(this,Yn,"f").terminate(),Er(this,fx,"f").terminate(),Er(this,Bl,"f").forEach(({subscription:e})=>e.terminate()),Er(this,Bl,"f").clear()}};qu=new WeakMap,px=new WeakMap,Yn=new WeakMap,Bl=new WeakMap,fx=new WeakMap;var ie;(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"})(ie||(ie={}));var IM=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},Xn=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)},hx,Ti,Di=class{constructor(e,r){this.type="bus",this.accepts="audio",this.manualUrl=ie.AudioBus,hx.set(this,void 0),Ti.set(this,void 0),IM(this,hx,e,"f"),IM(this,Ti,r,"f")}catchupAndSubscribe(e){return e(this),Xn(this,Ti,"f").subscribe(ze.Children,()=>e(this))}get uuid(){return Xn(this,Ti,"f").address.uuid}get address(){return Xn(this,Ti,"f").address}get box(){return Xn(this,Ti,"f")}get enabledField(){return Xn(this,Ti,"f").enabled}get minimizedField(){return Xn(this,Ti,"f").minimized}get iconField(){return Xn(this,Ti,"f").icon}get labelField(){return Xn(this,Ti,"f").label}get colorField(){return Xn(this,Ti,"f").color}get iconSymbol(){return Oe.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return Xn(this,hx,"f").boxAdapters.adapterFor(Xn(this,Ti,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}toString(){return`{${this.constructor.name}}`}};hx=new WeakMap,Ti=new WeakMap;var If=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},Bt=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,Ju,Yu,Ri,Tf,gx=class{constructor(e,r){Eo.set(this,void 0),Ju.set(this,void 0),Yu.set(this,void 0),Ri.set(this,void 0),Tf.set(this,pe.Empty),If(this,Eo,new Y,"f"),If(this,Ju,Bt(this,Eo,"f").own(new fe),"f"),If(this,Yu,Bt(this,Eo,"f").own(new tn(Oe.Unknown)),"f"),If(this,Ri,Bt(this,Eo,"f").own(new Nr),"f"),Bt(this,Eo,"f").own(Bt(this,Ri,"f").subscribe(n=>{Bt(this,Tf,"f").terminate(),If(this,Tf,n.match({none:()=>(Bt(this,Ju,"f").notify(b.None),pe.Empty),some:({labelField:i,iconField:a})=>pe.many(a.catchupAndSubscribe(o=>Bt(this,Yu,"f").setValue(Oe.fromName(o.getValue()))),i.catchupAndSubscribe(o=>Bt(this,Ju,"f").notify(b.wrap(o.getValue()))))}),"f")})),Bt(this,Eo,"f").own(e.catchupAndSubscribe({onAdded:({box:n,pointerType:i})=>{if(Bt(this,Ri,"f").nonEmpty()){let o=Bt(this,Ri,"f").unwrap();j(`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 Ln?r.adapterFor(n,Di):r.adapterFor(n,ee.isInstrument);Bt(this,Ri,"f").unwrapOrNull()!==a&&Bt(this,Ri,"f").wrap(a)},onRemoved:({box:n})=>{re(Bt(this,Ri,"f").unwrap("Cannot remove").box.address.equals(n.address),"Unexpected value to remove"),Bt(this,Ri,"f").clear()}},l.InstrumentHost,l.AudioOutput))}adapter(){return Bt(this,Ri,"f")}subscribe(e){return Bt(this,Ri,"f").subscribe(e)}catchupAndSubscribe(e){return e(Bt(this,Ri,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),Bt(this,Ju,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return Bt(this,Yu,"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(Oe.toName(e)))}get icon(){return this.adapter().match({none:()=>Oe.Unknown,some:e=>Oe.fromName(e.iconField.getValue())})}get iconValue(){return Bt(this,Yu,"f")}terminate(){Bt(this,Eo,"f").terminate(),Bt(this,Tf,"f").terminate()}};Eo=new WeakMap,Ju=new WeakMap,Yu=new WeakMap,Ri=new WeakMap,Tf=new WeakMap;var TM=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},Il=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,So,oe=class{constructor(e){vx.set(this,void 0),So.set(this,void 0),TM(this,vx,e,"f"),TM(this,So,Ce.newSet(r=>r.address),"f")}terminate(){Il(this,So,"f").forEach(e=>e.terminate()),Il(this,So,"f").clear()}parameters(){return Il(this,So,"f").values()}parameterAt(e){return Il(this,So,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,r,n,i,a,o){let s=new Tl(Il(this,vx,"f"),e,r,n,i,a,o),c=Il(this,So,"f").add(s);return re(c,`Could not add adapter for ${e}`),s}removeParameter(e){return Il(this,So,"f").removeByKey(e)}};vx=new WeakMap,So=new WeakMap;var Dl=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)},Rl,pn,ps,Xu,xx,yx,Df,Qu=class{constructor(e,r){Rl.set(this,void 0),pn.set(this,void 0),ps.set(this,void 0),Xu.set(this,void 0),xx.set(this,void 0),yx.set(this,void 0),Df.set(this,pe.Empty),Dl(this,Rl,e,"f"),Dl(this,pn,r,"f"),Dl(this,ps,new Y,"f"),Dl(this,Xu,Nt(this,ps,"f").own(new fe),"f"),Nt(this,ps,"f").own(r.targetBus.catchupAndSubscribe(()=>{Nt(this,Df,"f").terminate(),Dl(this,Df,this.optTargetBus.match({none:()=>(Nt(this,Xu,"f").notify(b.None),pe.Empty),some:n=>n.catchupAndSubscribe(i=>Nt(this,Xu,"f").notify(b.wrap(i)))}),"f")})),Dl(this,xx,Nt(this,ps,"f").own(new Tl(Nt(this,Rl,"f"),Nt(this,pn,"f").sendPan,F.bipolar(),E.percent({unit:"%",fractionDigits:0}),"panning")),"f"),Dl(this,yx,Nt(this,ps,"f").own(new Tl(Nt(this,Rl,"f"),Nt(this,pn,"f").sendGain,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),Nt(this,Xu,"f").subscribe(e)}get uuid(){return Nt(this,pn,"f").address.uuid}get address(){return Nt(this,pn,"f").address}get box(){return Nt(this,pn,"f")}get indexField(){return Nt(this,pn,"f").index}get sendPan(){return Nt(this,xx,"f")}get sendGain(){return Nt(this,yx,"f")}get targetBus(){return Nt(this,Rl,"f").boxAdapters.adapterFor(Nt(this,pn,"f").targetBus.targetVertex.unwrap("no audioUnit").box,Di)}get optTargetBus(){return Nt(this,pn,"f").targetBus.targetVertex.flatMap(e=>b.wrap(e.box.accept({visitAudioBusBox:r=>Nt(this,Rl,"f").boxAdapters.adapterFor(r,Di)})))}delete(){Nt(this,pn,"f").delete()}terminate(){Nt(this,ps,"f").terminate(),Nt(this,Df,"f").terminate()}};Rl=new WeakMap,pn=new WeakMap,ps=new WeakMap,Xu=new WeakMap,xx=new WeakMap,yx=new WeakMap,Df=new WeakMap;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},za=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,bx,ed,td,Cf,_x=class{constructor(e,r){wx.set(this,void 0),bx.set(this,void 0),ed.set(this,void 0),td.set(this,void 0),Cf.set(this,pe.Empty),Rf(this,wx,e,"f"),Rf(this,bx,r,"f"),Rf(this,ed,new Y,"f"),Rf(this,td,za(this,ed,"f").own(new fe),"f"),za(this,ed,"f").own(e.catchupAndSubscribe(()=>{za(this,Cf,"f").terminate(),Rf(this,Cf,this.adapter.match({none:()=>(za(this,td,"f").notify(b.None),pe.Empty),some:n=>n.catchupAndSubscribe(i=>za(this,td,"f").notify(b.wrap(i)))}),"f")}))}subscribe(e){return za(this,td,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return za(this,wx,"f").targetVertex.flatMap(e=>b.wrap(e.box.accept({visitAudioBusBox:r=>za(this,bx,"f").adapterFor(r,Di)})))}terminate(){za(this,ed,"f").terminate(),za(this,Cf,"f").terminate()}};wx=new WeakMap,bx=new WeakMap,ed=new WeakMap,td=new WeakMap,Cf=new WeakMap;var Po=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)},Ax,DM,Oa,Ci,Ot,zl,rd,Cl,Fx,zf,Ex,Sx,RM,CM,fn=class{constructor(e,r){Ax.add(this),this.class="device-host",Oa.set(this,new Y),Ci.set(this,void 0),Ot.set(this,void 0),zl.set(this,void 0),rd.set(this,void 0),Cl.set(this,void 0),Fx.set(this,void 0),zf.set(this,void 0),Ex.set(this,void 0),Sx.set(this,void 0),Po(this,Ci,e,"f"),Po(this,Ot,r,"f"),Po(this,zl,xe(this,Oa,"f").own(new oe(xe(this,Ci,"f"))),"f"),Po(this,rd,xe(this,Oa,"f").own(new mx(this,xe(this,Ci,"f").boxAdapters)),"f"),Po(this,Cl,xe(this,Oa,"f").own(new gx(xe(this,Ot,"f").input.pointerHub,xe(this,Ci,"f").boxAdapters)),"f"),Po(this,Fx,xe(this,Oa,"f").own(Rt.create(xe(this,Ot,"f").midiEffects,n=>xe(this,Ci,"f").boxAdapters.adapterFor(n,ee.isMidiEffect),l.MIDIEffectHost)),"f"),Po(this,zf,xe(this,Oa,"f").own(Rt.create(xe(this,Ot,"f").audioEffects,n=>xe(this,Ci,"f").boxAdapters.adapterFor(n,ee.isAudioEffect),l.AudioEffectHost)),"f"),Po(this,Ex,xe(this,Oa,"f").own(Rt.create(xe(this,Ot,"f").auxSends,n=>xe(this,Ci,"f").boxAdapters.adapterFor(n,Qu),l.AuxSend)),"f"),Po(this,Sx,xe(this,Oa,"f").own(new _x(xe(this,Ot,"f").output,xe(this,Ci,"f").boxAdapters)),"f"),this.namedParameter=xe(this,Ax,"m",RM).call(this,r),xe(this,Ax,"m",CM).call(this)}get box(){return xe(this,Ot,"f")}get uuid(){return xe(this,Ot,"f").address.uuid}get address(){return xe(this,Ot,"f").address}get indexField(){return xe(this,Ot,"f").index}get type(){return xe(this,Ot,"f").type.getValue()}get captureBox(){return xe(this,Ot,"f").capture.targetVertex}get tracks(){return xe(this,rd,"f")}get input(){return xe(this,Cl,"f")}get midiEffects(){return b.wrap(xe(this,Fx,"f"))}get audioEffects(){return b.wrap(xe(this,zf,"f"))}get inputAdapter(){return xe(this,Cl,"f").adapter()}get auxSends(){return xe(this,Ex,"f")}get output(){return xe(this,Sx,"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 xe(this,Ot,"f").output.targetVertex.mapOr(e=>e.box.address.equals(xe(this,Ci,"f").rootBoxAdapter.address),!1)}get automationCollapsed(){return xe(this,Ot,"f").userInterface.automationCollapsed}get midiEffectsField(){return b.wrap(xe(this,Ot,"f").midiEffects)}get inputField(){return xe(this,Ot,"f").input}get audioEffectsField(){return b.wrap(xe(this,Ot,"f").audioEffects)}get tracksField(){return xe(this,Ot,"f").tracks}get minimizedField(){return xe(this,Cl,"f").adapter().unwrap("input.adapter").minimizedField}get isAudioUnit(){return!0}get hostsInstrument(){return!0}get label(){return xe(this,Cl,"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 xe(this,zf,"f").adapters())yield*r.labeledAudioOutputs();yield{address:this.address,label:"Channelstrip",children:()=>b.None}}indicesLimit(){let e=xe(this,Ci,"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){xe(this,Ci,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,r){xe(this,rd,"f").collection.move(e,r)}deleteTrack(e){xe(this,rd,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){xe(this,Oa,"f").terminate()}};DM=fn,Oa=new WeakMap,Ci=new WeakMap,Ot=new WeakMap,zl=new WeakMap,rd=new WeakMap,Cl=new WeakMap,Fx=new WeakMap,zf=new WeakMap,Ex=new WeakMap,Sx=new WeakMap,Ax=new WeakSet,RM=function(e){return{volume:xe(this,zl,"f").createParameter(e.volume,DM.VolumeMapper,E.decible,"Volume"),panning:xe(this,zl,"f").createParameter(e.panning,F.bipolar(),E.panning,"Panning",.5),mute:xe(this,zl,"f").createParameter(e.mute,F.bool,E.bool,"Mute"),solo:xe(this,zl,"f").createParameter(e.solo,F.bool,E.bool,"Solo")}},CM=function(){let e=this.address.toString(),r=xe(this,Ot,"f").capture.targetAddress.unwrapOrUndefined(),n=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${xe(this,Ot,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${r}`;re(this.type!==Mt.Instrument||xe(this,Ot,"f").capture.targetAddress.nonEmpty(),n)};fn.VolumeMapper=F.decibel(-96,-9,6);var id=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},Le=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,Wr,Kr,Ol,Px,Mx,Of,zM,OM,Nx,or=class{constructor(e,r){Vl.add(this),Wr.set(this,void 0),Kr.set(this,void 0),Ol.set(this,void 0),Px.set(this,void 0),Mx.set(this,void 0),Of.set(this,void 0),id(this,Wr,e,"f"),id(this,Kr,r,"f"),id(this,Ol,new Y,"f"),id(this,Of,Le(this,Ol,"f").own(new tn(-1)),"f"),id(this,Px,Le(this,Ol,"f").own(new ox(this,e.boxAdapters)),"f"),id(this,Mx,Le(this,Ol,"f").own(new cx(this,e.boxAdapters)),"f")}catchupAndSubscribePath(e){let r=[b.None,b.None],n=()=>{r.every(i=>i.nonEmpty())?e(b.wrap(r.map(i=>i.unwrap()))):e(b.None)};return pe.many(Le(this,Vl,"m",zM).call(this,i=>{r[0].equals(i)||(r[0]=i,n())}),Le(this,Vl,"m",OM).call(this,i=>{r[1].equals(i)||(r[1]=i,n())}))}get context(){return Le(this,Wr,"f")}set targetName(e){Le(this,Kr,"f").target.targetVertex.ifSome(r=>{let n=r.box;if(n instanceof Xe){Le(this,Wr,"f").boxAdapters.adapterFor(n,fn).input.adapter().ifSome(a=>a.labelField.setValue(e));return}Le(this,Wr,"f").boxAdapters.optAdapter(n).ifSome(i=>{"labelField"in i&&i.labelField instanceof T&&i.labelField.setValue(e)}),Le(this,Vl,"m",Nx).call(this,n).flatMap(i=>Le(this,Wr,"f").boxAdapters.optAdapter(i)).ifSome(i=>{"labelField"in i&&i.labelField instanceof T&&i.labelField.setValue(e)})})}get targetName(){return Le(this,Kr,"f").target.targetVertex.flatMap(e=>{let r=e.box;if(r instanceof Xe)return Le(this,Wr,"f").boxAdapters.adapterFor(r,fn).input.label;let n=Le(this,Wr,"f").boxAdapters.optAdapter(r);if(n.nonEmpty()){let a=n.unwrap();if("labelField"in a&&a.labelField instanceof T)return b.wrap(a.labelField.getValue())}let i=Le(this,Vl,"m",Nx).call(this,r).flatMap(a=>Le(this,Wr,"f").boxAdapters.optAdapter(a));if(i.nonEmpty()){let a=i.unwrap();if("labelField"in a&&a.labelField instanceof T)return b.wrap(a.labelField.getValue())}return b.wrap(r.name)})}terminate(){Le(this,Ol,"f").terminate()}get audioUnit(){return Re(Le(this,Kr,"f").tracks.targetVertex.unwrap("track has no audioUnit").box,Xe)}get target(){return Le(this,Kr,"f").target}get clips(){return Le(this,Px,"f")}get regions(){return Le(this,Mx,"f")}get enabled(){return Le(this,Kr,"f").enabled}get indexField(){return Le(this,Kr,"f").index}get type(){return Le(this,Kr,"f").type.getValue()}get box(){return Le(this,Kr,"f")}get uuid(){return Le(this,Kr,"f").address.uuid}get address(){return Le(this,Kr,"f").address}get listIndex(){return Le(this,Of,"f").getValue()}set listIndex(e){Le(this,Of,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===ge.Audio;case"note-clip":return this.type===ge.Notes;case"value-clip":return this.type===ge.Value;case"audio-region":return this.type===ge.Audio;case"note-region":return this.type===ge.Notes;case"value-region":return this.type===ge.Value}}valueAt(e,r){if(!this.enabled.getValue())return r;let n=r,i=Le(this,Wr,"f").clipSequencing.iterate(this.uuid,e,e+wM);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 gt(c,Fo)?c.incomingValue(r):r}else if(gt(s,Fo))return e<s.complete?s.valueAt(e,r):s.outgoingValue(r);return r},some:s=>o===e&&gt(s,as)&&!s.mute?s.valueAt(e,r):r});return n}get targetControlName(){return this.type!==ge.Value?b.None:Le(this,Kr,"f").target.targetVertex.flatMap(e=>e.isField()?Le(this,Wr,"f").parameterFieldAdapters.opt(e.address).map(r=>r.name):e.isBox()?b.wrap(e.name):j("Illegal State. Vertex is not a field nor box."))}};Wr=new WeakMap,Kr=new WeakMap,Ol=new WeakMap,Px=new WeakMap,Mx=new WeakMap,Of=new WeakMap,Vl=new WeakSet,zM=function(e){let r=Le(this,Kr,"f").target.targetVertex;if(r.nonEmpty()){let n=r.unwrap().box;if(n instanceof Xe)return Le(this,Wr,"f").boxAdapters.adapterFor(n,fn).input.catchupAndSubscribeLabelChange(s=>e(s));let i=Le(this,Wr,"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(b.wrap(s.getValue())))}let a=Le(this,Vl,"m",Nx).call(this,n).flatMap(o=>Le(this,Wr,"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(b.wrap(s.getValue())))}return e(b.wrap(n.name)),pe.Empty}return e(b.None),pe.Empty},OM=function(e){let r=this.type;switch(r){case ge.Audio:case ge.Notes:return e(b.wrap(ge[r])),pe.Empty;case ge.Value:{let n=Le(this,Kr,"f").target.targetVertex.flatMap(i=>i.isField()?Le(this,Wr,"f").parameterFieldAdapters.opt(i.address):b.None);return n.isEmpty()?(e(this.targetControlName),pe.Empty):n.unwrap().catchupAndSubscribeName(i=>e(b.wrap(i)))}case ge.Undefined:return e(b.wrap("")),pe.Empty;default:return e(b.None),pe.Empty}},Nx=function(e){for(let[r]of e.outgoingEdges())if(r.pointerType===l.Parameter)return r.targetVertex.map(n=>n.box);return b.None};var Ht=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},ve=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)},zi,Oi,Vf,$x,kx,Ul,Mo,fs,ms,hs,gs,jl,vs,Uf,VM=[l.Automation,l.Modulation,l.MIDIControl,l.ParameterController],Tl=class{constructor(e,r,n,i,a,o,s){zi.set(this,void 0),Oi.set(this,void 0),Vf.set(this,void 0),$x.set(this,void 0),kx.set(this,void 0),Ul.set(this,new Y),Mo.set(this,void 0),fs.set(this,void 0),ms.set(this,void 0),hs.set(this,void 0),gs.set(this,b.None),jl.set(this,b.None),vs.set(this,null),Uf.set(this,!1),Ht(this,zi,e,"f"),Ht(this,Oi,r,"f"),Ht(this,ms,n,"f"),Ht(this,hs,i,"f"),Ht(this,Vf,typeof a=="string"?dg.seal(a):a,"f"),Ht(this,$x,o??0,"f"),Ht(this,kx,b.wrap(s),"f"),ve(this,Ul,"f").own(ve(this,zi,"f").parameterFieldAdapters.register(this)),Ht(this,Mo,ve(this,Ul,"f").own(new fe),"f"),Ht(this,fs,new nr,"f"),ve(this,Ul,"f").own(ve(this,Oi,"f").subscribe(()=>ve(this,Mo,"f").notify(this))),ve(this,Ul,"f").own(ve(this,Oi,"f").pointerHub.catchupAndSubscribe({onAdded:c=>{ve(this,fs,"f").proxy.onControlSourceAdd(i_(c.pointerType)),c.box.accept({visitTrackBox:u=>{re(ve(this,gs,"f").isEmpty(),"Already assigned");let f=ve(this,zi,"f").boxAdapters.adapterFor(u,or);Ht(this,gs,b.wrap(f),"f"),ve(this,zi,"f").isMainThread&&Ht(this,jl,b.wrap(ve(this,zi,"f").liveStreamReceiver.subscribeFloat(ve(this,Oi,"f").address,v=>{if(isNaN(v)){if(en(ve(this,vs,"f")))return;Ht(this,vs,null,"f"),ve(this,Mo,"f").notify(this);return}ve(this,vs,"f")!==v&&(Ht(this,vs,v,"f"),ve(this,Mo,"f").notify(this))})),"f")}})},onRemoved:c=>{ve(this,fs,"f").proxy.onControlSourceRemove(i_(c.pointerType)),c.box.accept({visitTrackBox:u=>{re(ve(this,gs,"f").unwrapOrNull()?.address?.equals(u.address)===!0,`Unknown ${u}`),Ht(this,gs,b.None,"f"),ve(this,zi,"f").isMainThread&&(ve(this,jl,"f").ifSome(f=>f.terminate()),Ht(this,jl,b.None,"f"),Ht(this,vs,null,"f"),ve(this,Mo,"f").notify(this))}})}},...VM)),r.getValue(),n.clamp(r.getValue())}registerMidiControl(){return ve(this,fs,"f").proxy.onControlSourceAdd("midi"),Ht(this,Uf,!0,"f"),{terminate:()=>{Ht(this,Uf,!1,"f"),ve(this,fs,"f").proxy.onControlSourceRemove("midi")}}}get field(){return ve(this,Oi,"f")}get valueMapping(){return ve(this,ms,"f")}get stringMapping(){return ve(this,hs,"f")}get name(){return ve(this,Vf,"f").getValue()}get anchor(){return ve(this,$x,"f")}get type(){return ve(this,Oi,"f").type}get address(){return ve(this,Oi,"f").address}get track(){return ve(this,gs,"f")}catchupAndSubscribeName(e){return ve(this,Vf,"f").catchupAndSubscribe(r=>e(r.getValue()))}registerTracks(e){return ve(this,zi,"f").parameterFieldAdapters.registerTracks(this.address,e)}touchStart(){ve(this,zi,"f").parameterFieldAdapters.touchStart(this.address),ve(this,zi,"f").parameterFieldAdapters.notifyWrite(this,this.getUnitValue())}touchEnd(){ve(this,zi,"f").parameterFieldAdapters.touchEnd(this.address)}updateMappings(e,r){Ht(this,ms,e,"f"),Ht(this,hs,r,"f"),ve(this,Mo,"f").notify(this)}valueAt(e){let r=ve(this,gs,"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 ve(this,Mo,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return ve(this,Uf,"f")&&e.onControlSourceAdd("midi"),ve(this,Oi,"f").pointerHub.filter(...VM).forEach(r=>e.onControlSourceAdd(i_(r.pointerType))),ve(this,fs,"f").subscribe(e)}getValue(){return ve(this,Oi,"f").getValue()}setValue(e){if(e===this.getValue())return;let r=this.getUnitValue();ve(this,Oi,"f").setValue(e),ve(this,zi,"f").parameterFieldAdapters.notifyWrite(this,r)}setUnitValue(e){this.setValue(ve(this,ms,"f").y(e))}getUnitValue(){return ve(this,ms,"f").x(this.getValue())}getControlledValue(){return ve(this,ms,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return ve(this,vs,"f")??this.getUnitValue()}getControlledPrintValue(){return ve(this,hs,"f").x(this.getControlledValue())}getPrintValue(){return ve(this,hs,"f").x(this.getValue())}setPrintValue(e){let r=ve(this,hs,"f").y(e);r.type==="unitValue"?this.setUnitValue(Fe(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(ve(this,kx,"f").unwrapOrElse(ve(this,Oi,"f").initValue))}terminate(){ve(this,jl,"f").ifSome(e=>e.terminate()),Ht(this,jl,b.None,"f"),ve(this,Ul,"f").terminate()}};zi=new WeakMap,Oi=new WeakMap,Vf=new WeakMap,$x=new WeakMap,kx=new WeakMap,Ul=new WeakMap,Mo=new WeakMap,fs=new WeakMap,ms=new WeakMap,hs=new WeakMap,gs=new WeakMap,jl=new WeakMap,vs=new WeakMap,Uf=new WeakMap;var i_=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 j(`${t.toString()} is an unknown pointer type`)}};var Bx={min:400,max:480,default:440};var n_=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},Qn=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)},No,Kl,Ix,Tx=class{constructor(e,r,n){No.set(this,void 0),Kl.set(this,void 0),Ix.set(this,void 0),n_(this,No,B.newSet(i=>i.uuid),"f"),n_(this,Kl,new nr,"f"),n_(this,Ix,e.catchupAndSubscribe({onAdded:i=>{let a=r(i.box),o=Qn(this,No,"f").add(a);re(o,`Could not add ${a}`),Qn(this,Kl,"f").proxy.onAdd(a)},onRemoved:i=>{let a=i.box.address.uuid;Qn(this,Kl,"f").proxy.onRemove(Qn(this,No,"f").removeByKey(a))}},n),"f")}subscribe(e){return Qn(this,Kl,"f").subscribe(e)}catchupAndSubscribe(e){return Qn(this,No,"f").forEach(r=>e.onAdd(r)),this.subscribe(e)}adapters(){return Qn(this,No,"f").values()}size(){return Qn(this,No,"f").size()}isEmpty(){return this.size()===0}terminate(){Qn(this,No,"f").clear(),Qn(this,Kl,"f").terminate(),Qn(this,Ix,"f").terminate()}};No=new WeakMap,Kl=new WeakMap,Ix=new WeakMap;var a_=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},bt=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)},o_,gi,jf,mn,Ir,UM,ea=class{constructor(e,r){o_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Delay,jf.set(this,void 0),mn.set(this,void 0),Ir.set(this,void 0),a_(this,jf,e,"f"),a_(this,mn,r,"f"),a_(this,Ir,new oe(bt(this,jf,"f")),"f"),this.namedParameter=bt(this,o_,"m",UM).call(this,r)}get box(){return bt(this,mn,"f")}get uuid(){return bt(this,mn,"f").address.uuid}get address(){return bt(this,mn,"f").address}get indexField(){return bt(this,mn,"f").index}get labelField(){return bt(this,mn,"f").label}get enabledField(){return bt(this,mn,"f").enabled}get minimizedField(){return bt(this,mn,"f").minimized}get host(){return bt(this,mn,"f").host}deviceHost(){return bt(this,jf,"f").boxAdapters.adapterFor(bt(this,mn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){bt(this,Ir,"f").terminate()}};gi=ea,jf=new WeakMap,mn=new WeakMap,Ir=new WeakMap,o_=new WeakSet,UM=function(e){return{preSyncTimeLeft:bt(this,Ir,"f").createParameter(e.preSyncTimeLeft,F.linearInteger(0,gi.Fractions.length-1),gi.FractionsStringMapping,"Pre Sync L"),preMillisTimeLeft:bt(this,Ir,"f").createParameter(e.preMillisTimeLeft,F.powerByCenter(100,0,gi.MAX_MILLIS_TIME),E.numeric({unit:"ms",fractionDigits:1}),"Pre MS L"),preSyncTimeRight:bt(this,Ir,"f").createParameter(e.preSyncTimeRight,F.linearInteger(0,gi.Fractions.length-1),gi.FractionsStringMapping,"Pre Sync R"),preMillisTimeRight:bt(this,Ir,"f").createParameter(e.preMillisTimeRight,F.powerByCenter(100,0,gi.MAX_MILLIS_TIME),E.numeric({unit:"ms",fractionDigits:1}),"Pre MS R"),delay:bt(this,Ir,"f").createParameter(e.delayMusical,F.linearInteger(0,gi.Fractions.length-1),gi.FractionsStringMapping,"Delay"),millisTime:bt(this,Ir,"f").createParameter(e.delayMillis,F.powerByCenter(100,0,gi.MAX_MILLIS_TIME),E.numeric({unit:"ms",fractionDigits:1}),"MS"),feedback:bt(this,Ir,"f").createParameter(e.feedback,F.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"Feedback"),cross:bt(this,Ir,"f").createParameter(e.cross,F.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"Cross"),lfoSpeed:bt(this,Ir,"f").createParameter(e.lfoSpeed,F.exponential(gi.LFO_SPEED_MIN,gi.LFO_SPEED_MAX),E.numeric({unit:"Hz",fractionDigits:2}),"LFO Speed"),lfoDepth:bt(this,Ir,"f").createParameter(e.lfoDepth,F.power(4,0,gi.LFO_DEPTH_MAX),E.numeric({unit:"ms",fractionDigits:1}),"LFO Depth"),filter:bt(this,Ir,"f").createParameter(e.filter,F.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"Filter",.5),dry:bt(this,Ir,"f").createParameter(e.dry,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Dry"),wet:bt(this,Ir,"f").createParameter(e.wet,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Wet")}};ea.Fractions=Wo.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();ea.FractionsStringMapping=E.indices("",gi.Fractions.map(([t,e])=>t===0?"Off":`${t}/${e}`));ea.MAX_MILLIS_TIME=1e3;ea.LFO_SPEED_MIN=.1;ea.LFO_SPEED_MAX=5;ea.LFO_DEPTH_MAX=50;var s_=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)},l_,Kf,hn,Va,jM,Dx=class{constructor(e,r){l_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Reverb,Kf.set(this,void 0),hn.set(this,void 0),Va.set(this,void 0),s_(this,Kf,e,"f"),s_(this,hn,r,"f"),s_(this,Va,new oe(gr(this,Kf,"f")),"f"),this.namedParameter=gr(this,l_,"m",jM).call(this,r)}get box(){return gr(this,hn,"f")}get uuid(){return gr(this,hn,"f").address.uuid}get address(){return gr(this,hn,"f").address}get indexField(){return gr(this,hn,"f").index}get labelField(){return gr(this,hn,"f").label}get enabledField(){return gr(this,hn,"f").enabled}get minimizedField(){return gr(this,hn,"f").minimized}get host(){return gr(this,hn,"f").host}deviceHost(){return gr(this,Kf,"f").boxAdapters.adapterFor(gr(this,hn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){gr(this,Va,"f").terminate()}};Kf=new WeakMap,hn=new WeakMap,Va=new WeakMap,l_=new WeakSet,jM=function(e){return{decay:gr(this,Va,"f").createParameter(e.decay,F.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:gr(this,Va,"f").createParameter(e.preDelay,F.exponential(.001,.5),E.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:gr(this,Va,"f").createParameter(e.damp,F.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"Damping"),filter:gr(this,Va,"f").createParameter(e.filter,F.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"Filter"),dry:gr(this,Va,"f").createParameter(e.dry,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Dry"),wet:gr(this,Va,"f").createParameter(e.wet,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Wet")}};var c_=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)},d_,Wf,Vi,ta,LM,Rx=class{constructor(e,r){d_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Revamp,Wf.set(this,void 0),Vi.set(this,void 0),ta.set(this,void 0),c_(this,Wf,e,"f"),c_(this,Vi,r,"f"),c_(this,ta,new oe(qt(this,Wf,"f")),"f"),this.namedParameter=qt(this,d_,"m",LM).call(this,r)}get box(){return qt(this,Vi,"f")}get uuid(){return qt(this,Vi,"f").address.uuid}get address(){return qt(this,Vi,"f").address}get indexField(){return qt(this,Vi,"f").index}get labelField(){return qt(this,Vi,"f").label}get enabledField(){return qt(this,Vi,"f").enabled}get minimizedField(){return qt(this,Vi,"f").minimized}get host(){return qt(this,Vi,"f").host}get spectrum(){return qt(this,Vi,"f").address.append(4095)}deviceHost(){return qt(this,Wf,"f").boxAdapters.adapterFor(qt(this,Vi,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){qt(this,ta,"f").terminate()}};Wf=new WeakMap,Vi=new WeakMap,ta=new WeakMap,d_=new WeakSet,LM=function(e){return{highPass:KM(qt(this,ta,"f"),e.highPass,"High-Pass"),lowShelf:WM(qt(this,ta,"f"),e.lowShelf,"Low-Shelf"),lowBell:u_(qt(this,ta,"f"),e.lowBell,"Low-Bell"),midBell:u_(qt(this,ta,"f"),e.midBell,"Mid-Bell"),highBell:u_(qt(this,ta,"f"),e.highBell,"High-Bell"),highShelf:WM(qt(this,ta,"f"),e.highShelf,"High-Shelf"),lowPass:KM(qt(this,ta,"f"),e.lowPass,"Low-Pass")}};var p_=F.exponential(20,2e4),ZM=F.linear(-24,24),GM=F.exponential(.01,10),KM=(t,e,r)=>({enabled:t.createParameter(e.enabled,F.bool,E.bool,"Enabled"),frequency:t.createParameter(e.frequency,p_,E.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),order:t.createParameter(e.order,F.linearInteger(0,3),E.indices("db",["12","24","36","48"]),`${r} Order`),q:t.createParameter(e.q,GM,E.numeric({fractionDigits:3}),`${r} Q`)}),WM=(t,e,r)=>({enabled:t.createParameter(e.enabled,F.bool,E.bool,"Enabled"),frequency:t.createParameter(e.frequency,p_,E.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,ZM,E.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5)}),u_=(t,e,r)=>({enabled:t.createParameter(e.enabled,F.bool,E.bool,"Enabled"),frequency:t.createParameter(e.frequency,p_,E.numeric({unit:"Hz",fractionDigits:0}),`${r} Freq`),gain:t.createParameter(e.gain,ZM,E.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${r} Gain`,.5),q:t.createParameter(e.q,GM,E.numeric({fractionDigits:3}),`${r} Q`)});var HM=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},vi=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)},Cx,zx,xi,xs=class{constructor(e,r){this.type="marker-event",Cx.set(this,new Y),zx.set(this,void 0),xi.set(this,void 0),HM(this,zx,e,"f"),HM(this,xi,r,"f"),vi(this,Cx,"f").own(vi(this,xi,"f").subscribe(ze.Children,n=>{if(!this.trackAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackAdapter.unwrap();vi(this,xi,"f").position.address.equals(n.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return vi(this,xi,"f")}get uuid(){return vi(this,xi,"f").address.uuid}get address(){return vi(this,xi,"f").address}get position(){return vi(this,xi,"f").position.getValue()}get plays(){return vi(this,xi,"f").plays.getValue()}get hue(){return vi(this,xi,"f").hue.getValue()}get label(){return vi(this,xi,"f").label.getValue()}get trackAdapter(){return vi(this,xi,"f").track.targetVertex.map(e=>vi(this,zx,"f").boxAdapters.adapterFor(e.box,Ua).markerTrack)}terminate(){vi(this,Cx,"f").terminate()}toString(){return`{MarkerBoxAdapter ${B.toString(vi(this,xi,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};Cx=new WeakMap,zx=new WeakMap,xi=new WeakMap;xs.Comparator=(t,e)=>t.position-e.position;var Lf=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},gn=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)},Zf,nd,Gf,Wl,Ox,Vx=class{constructor(e,r){Zf.set(this,void 0),nd.set(this,void 0),Gf.set(this,void 0),Wl.set(this,void 0),Ox.set(this,void 0),Lf(this,Zf,e,"f"),Lf(this,nd,r,"f"),this.changeNotifier=new fe,Lf(this,Gf,B.newSet(n=>n.uuid),"f"),Lf(this,Wl,Vr.create(xs.Comparator),"f"),Lf(this,Ox,gn(this,nd,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{if(n instanceof qc){let i=gn(this,Zf,"f").boxAdapters.adapterFor(n,xs),a=gn(this,Gf,"f").add(i);re(a,"Could not add adapter"),gn(this,Wl,"f").add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:n}}})=>{gn(this,Wl,"f").remove(gn(this,Gf,"f").removeByKey(n)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return gn(this,Zf,"f")}get enabled(){return gn(this,nd,"f").enabled.getValue()}get events(){return gn(this,Wl,"f")}get object(){return gn(this,nd,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){gn(this,Wl,"f").onIndexingChanged(),this.dispatchChange()}terminate(){gn(this,Ox,"f").terminate()}};Zf=new WeakMap,nd=new WeakMap,Gf=new WeakMap,Wl=new WeakMap,Ox=new WeakMap;var qM=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},Ui=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,jx,ji,Ll=class{constructor(e,r){this.type="signature-event",Ux.set(this,new Y),jx.set(this,void 0),ji.set(this,void 0),qM(this,jx,e,"f"),qM(this,ji,r,"f"),Ui(this,Ux,"f").own(Ui(this,ji,"f").subscribe(ze.Children,n=>this.trackAdapter.ifSome(i=>i.dispatchChange())))}get box(){return Ui(this,ji,"f")}get uuid(){return Ui(this,ji,"f").address.uuid}get address(){return Ui(this,ji,"f").address}get index(){return Ui(this,ji,"f").index.getValue()}get indexField(){return Ui(this,ji,"f").index}get relativePosition(){return Ui(this,ji,"f").relativePosition.getValue()}get nominator(){return Ui(this,ji,"f").nominator.getValue()}get denominator(){return Ui(this,ji,"f").denominator.getValue()}get trackAdapter(){return Ui(this,ji,"f").events.targetVertex.map(e=>Ui(this,jx,"f").boxAdapters.adapterFor(e.box,Ua).signatureTrack)}terminate(){Ui(this,Ux,"f").terminate()}toString(){return`{SignatureEventBoxAdapter ${this.nominator}/${this.denominator}}`}};Ux=new WeakMap,jx=new WeakMap,ji=new WeakMap;Ll.Comparator=(t,e)=>t.index-e.index;var Kx=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)},ys,Hf,qf,Zl,$o,ws,JM,ad,Wx=class{constructor(e,r,n){ys.add(this),Hf.set(this,new Y),qf.set(this,void 0),Zl.set(this,void 0),$o.set(this,void 0),ws.set(this,void 0),Kx(this,qf,e,"f"),Kx(this,Zl,r,"f"),Kx(this,$o,n,"f"),this.changeNotifier=new fe,Kx(this,ws,_t(this,Hf,"f").own(Rt.create(_t(this,$o,"f").events,i=>e.boxAdapters.adapterFor(i,Ll),l.SignatureAutomation)),"f"),_t(this,Hf,"f").ownAll(_t(this,Zl,"f").subscribe(()=>this.dispatchChange()),_t(this,$o,"f").enabled.subscribe(()=>this.dispatchChange()),_t(this,ws,"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 _t(this,qf,"f")}get enabled(){return _t(this,$o,"f").enabled.getValue()}get object(){return _t(this,$o,"f")}get size(){return _t(this,ws,"f").size()}get storageSignature(){let{nominator:e,denominator:r}=_t(this,Zl,"f");return[e.getValue(),r.getValue()]}nonEmpty(){return _t(this,ws,"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},!!_t(this,$o,"f").enabled.getValue())for(let a of _t(this,ws,"f").adapters())e+=Te.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);_t(this,Zl,"f").nominator.setValue(e),_t(this,Zl,"f").denominator.setValue(r);let a=0,o=0,s=Te.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 h=(i[c]-a)/s,y=Math.floor(h),_=h-y;o+=_;let $=y;o>=1&&($++,o--),$=Math.max(1,$),f.unwrap().box.relativePosition.setValue($),a+=$*s,s=Te.fromSignature(u.nominator,u.denominator)}}deleteAdapter(e){let r=e.index,n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(y=>y.index===r);if(i===-1)return;let a=n.slice(i+1),o=a.map(y=>y.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,h=Te.fromSignature(c,u);for(let y=0;y<a.length;y++){let _=a[y],$=this.adapterAt(_.index);if($.isEmpty())continue;let z=(o[y]-v)/h,O=Math.max(1,Math.round(z));$.unwrap().box.relativePosition.setValue(O),v+=O*h,h=Te.fromSignature(_.nominator,_.denominator)}}createEvent(e,r,n){let i=Array.from(this.iterateAll()),a=i[0],o=0;for(let $=1;$<i.length&&!(i[$].accumulatedPpqn>e);$++)a=i[$],o=$;let s=Te.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),h=a.accumulatedPpqn+u*s,y=Te.fromSignature(r,n),_=v.map($=>({event:$,adapter:this.adapterAt($.index)})).filter(({adapter:$})=>$.nonEmpty()).map(({event:$,adapter:S})=>({event:$,adapter:S.unwrap()}));for(let $=0;$<_.length;$++){let{event:S,adapter:z}=_[$];if(z.box.index.setValue(S.index+1),$===0){let O=(S.accumulatedPpqn-h)/y;z.box.relativePosition.setValue(Math.max(1,Math.round(O)))}}Wc.create(_t(this,qf,"f").boxGraph,B.generate(),$=>{$.index.setValue(f),$.relativePosition.setValue(u),$.nominator.setValue(r),$.denominator.setValue(n),$.events.refer(_t(this,$o,"f").events)})}adapterAt(e){return _t(this,ws,"f").getAdapterByIndex(e)}moveEvent(e,r){let n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(h=>h.index===e.index);if(i===-1)return;let a=n[i];if(r===a.accumulatedPpqn)return;let o=n.map(h=>h.accumulatedBars),s=_t(this,ys,"m",JM).call(this,r,a.index);if(s===a.accumulatedBars)return;let c=[...o];c[i]=s;let u=c.map((h,y)=>({bar:h,i:y})).sort((h,y)=>h.bar-y.bar).map(h=>h.i),f=n.map(h=>this.adapterAt(h.index).unwrap("adapterAt"));for(let h=0;h<u.length;h++)f[u[h]].box.index.setValue(h);let v=0;for(let h=0;h<u.length;h++){let y=u[h],_=f[y],$=c[y],S=Math.max(1,$-v);_.box.relativePosition.setValue(S),v=$}}floorToBar(e){let{event:r,barPpqn:n}=_t(this,ys,"m",ad).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}ceilToBar(e){let{event:r,barPpqn:n}=_t(this,ys,"m",ad).call(this,e),i=Math.ceil((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}roundToBar(e){let{event:r,barPpqn:n}=_t(this,ys,"m",ad).call(this,e),i=Math.round((e-r.accumulatedPpqn)/n);return r.accumulatedPpqn+i*n}toParts(e){let{event:r}=_t(this,ys,"m",ad).call(this,e),n=Te.toParts(e-r.accumulatedPpqn,r.nominator,r.denominator);return{...n,bars:n.bars+r.accumulatedBars}}barLengthAt(e){let[r,n]=this.signatureAt(e);return Te.fromSignature(r,n)}getBarInterval(e){let{event:r,barPpqn:n}=_t(this,ys,"m",ad).call(this,e),i=Math.floor((e-r.accumulatedPpqn)/n),a=r.accumulatedPpqn+i*n;return{position:a,complete:a+n}}terminate(){_t(this,Hf,"f").terminate()}};Hf=new WeakMap,qf=new WeakMap,Zl=new WeakMap,$o=new WeakMap,ws=new WeakMap,ys=new WeakSet,JM=function(e,r){let n=null;for(let o of this.iterateAll())if(o.index!==r){if(o.accumulatedPpqn>e)break;n=o}if(en(n)){let[o,s]=this.storageSignature,c=Te.fromSignature(o,s);return Math.max(1,Math.round(e/c))}let i=Te.fromSignature(n.nominator,n.denominator),a=Math.round((e-n.accumulatedPpqn)/i);return Math.max(1,n.accumulatedBars+a)},ad=function(e){let r=null;for(let n of this.iterateAll()){if(n.accumulatedPpqn>e)break;r=n}if(en(r)){let[n,i]=this.storageSignature;return{event:{index:-1,accumulatedPpqn:0,accumulatedBars:0,nominator:n,denominator:i},barPpqn:Te.fromSignature(n,i)}}return{event:r,barPpqn:Te.fromSignature(r.nominator,r.denominator)}};var Jf=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},jt=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)},Yf,ja,Lx,Zx,ko,Xf,Gx,Ua=class{constructor(e,r){Yf.set(this,new Y),ja.set(this,void 0),Lx.set(this,void 0),Zx.set(this,void 0),ko.set(this,void 0),Xf.set(this,void 0),Gx.set(this,()=>{let{tempoTrack:{enabled:s}}=jt(this,ja,"f");return s.getValue()?jt(this,ko,"f").isEmpty()?b.None:jt(this,ko,"f").unwrap().events.isEmpty()?b.None:jt(this,ko,"f"):b.None}),Jf(this,ja,r,"f"),Jf(this,Lx,new Vx(e,r.markerTrack),"f"),Jf(this,Zx,new Wx(e,r.signature,r.signatureTrack),"f"),Jf(this,ko,new Nr,"f"),Jf(this,Xf,new fe,"f");let n=jt(this,Yf,"f").own(new Y),i=()=>jt(this,Xf,"f").notify(jt(this,Gx,"f").call(this)),{tempoTrack:{events:a,enabled:o}}=r;jt(this,Yf,"f").own(a.catchupAndSubscribe(({targetVertex:s})=>{n.terminate(),s.match({none:()=>jt(this,ko,"f").clear(),some:({box:c})=>{let u=e.boxAdapters.adapterFor(c,kr);jt(this,ko,"f").wrap(u),n.ownAll(u.subscribeChange(i),o.subscribe(i))}})}))}catchupAndSubscribeTempoAutomation(e){return e(jt(this,Gx,"f").call(this)),jt(this,Xf,"f").subscribe(e)}get box(){return jt(this,ja,"f")}get uuid(){return jt(this,ja,"f").address.uuid}get address(){return jt(this,ja,"f").address}get markerTrack(){return jt(this,Lx,"f")}get signatureTrack(){return jt(this,Zx,"f")}get tempoTrackEvents(){return jt(this,ko,"f")}get signature(){let{nominator:e,denominator:r}=jt(this,ja,"f").signature;return[e.getValue(),r.getValue()]}get signatureDuration(){let{nominator:e,denominator:r}=jt(this,ja,"f").signature;return Te.fromSignature(e.getValue(),r.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),jt(this,ja,"f").signature.subscribe(()=>e(this.signature))}terminate(){jt(this,Yf,"f").terminate()}};Yf=new WeakMap,ja=new WeakMap,Lx=new WeakMap,Zx=new WeakMap,ko=new WeakMap,Xf=new WeakMap,Gx=new WeakMap;var wD=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},Qf=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)},bs,_s=class{constructor(e,r){bs.set(this,void 0),wD(this,bs,r,"f")}get box(){return Qf(this,bs,"f")}get uuid(){return Qf(this,bs,"f").address.uuid}get address(){return Qf(this,bs,"f").address}get source(){return Qf(this,bs,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return Qf(this,bs,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};bs=new WeakMap;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},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)},Hx,Hl,ql,qx,Jx,em,xn=class{constructor(e,r){Hx.set(this,void 0),Hl.set(this,void 0),ql.set(this,void 0),qx.set(this,void 0),Jx.set(this,void 0),em.set(this,!1),Gl(this,Hx,e,"f"),Gl(this,Hl,r,"f"),Gl(this,ql,new Y,"f"),Gl(this,qx,r.attributes,"f"),Gl(this,Jx,vn(this,ql,"f").own(new oe(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return vn(this,ql,"f").own(e)}ownAll(...e){vn(this,ql,"f").ownAll(...e)}onSelected(){Gl(this,em,!0,"f")}onDeselected(){Gl(this,em,!1,"f")}isSelected(){return vn(this,em,"f")}get box(){return vn(this,Hl,"f")}get attributes(){return vn(this,qx,"f")}get uuid(){return vn(this,Hl,"f").address.uuid}get address(){return vn(this,Hl,"f").address}get parameters(){return vn(this,Jx,"f")}get modular(){return vn(this,Hx,"f").boxAdapters.adapterFor(vn(this,Hl,"f").attributes.collection.targetVertex.unwrap("attributes.target").box,As)}terminate(){vn(this,ql,"f").terminate()}};Hx=new WeakMap,Hl=new WeakMap,ql=new WeakMap,qx=new WeakMap,Jx=new WeakMap,em=new WeakMap;var Yx=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},Bo=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)},Xx,Fs,tm,Qx,Lr;(function(t){t.Input="input",t.Output="output"})(Lr||(Lr={}));var Zr=class t{static create(e,r,n,i){return new t(e,r,n,i??r.fieldName)}constructor(e,r,n,i){Xx.set(this,void 0),Fs.set(this,void 0),tm.set(this,void 0),Qx.set(this,void 0),Yx(this,Xx,e,"f"),Yx(this,Fs,r,"f"),Yx(this,tm,n,"f"),Yx(this,Qx,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 Bo(this,Fs,"f").pointerHub.isEmpty()?de.empty():Bo(this,Fs,"f").pointerHub.filter(l.VoltageConnection).map(({box:e})=>Bo(this,Xx,"f").adapterFor(e,_s))}get field(){return Bo(this,Fs,"f")}get address(){return Bo(this,Fs,"f").address}get direction(){return Bo(this,tm,"f")}get name(){return Bo(this,Qx,"f")}toString(){return`{ModuleConnectorAdapter address: ${Bo(this,Fs,"f").address.toString()}, direction: ${Bo(this,tm,"f")}}`}};Xx=new WeakMap,Fs=new WeakMap,tm=new WeakMap,Qx=new WeakMap;var f_=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)},ey,im,nm,od=class extends xn{constructor(e,r){super(e,r),ey.set(this,void 0),im.set(this,void 0),nm.set(this,void 0),f_(this,ey,this.parameters.createParameter(r.time,F.exponential(1,1e4),E.numeric({unit:"ms"}),"Time"),"f"),f_(this,im,Zr.create(e.boxAdapters,r.voltageInput,Lr.Input,"Input"),"f"),f_(this,nm,Zr.create(e.boxAdapters,r.voltageOutput,Lr.Output,"Output"),"f")}get parameterTime(){return rm(this,ey,"f")}get voltageInput(){return rm(this,im,"f")}get voltageOutput(){return rm(this,nm,"f")}get inputs(){return[rm(this,im,"f")]}get outputs(){return[rm(this,nm,"f")]}};ey=new WeakMap,im=new WeakMap,nm=new WeakMap;var bD=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},YM=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)},am,sd=class extends xn{constructor(e,r){super(e,r),am.set(this,void 0),bD(this,am,Zr.create(e.boxAdapters,r.input,Lr.Input,"Input"),"f")}get voltageInput(){return YM(this,am,"f")}get inputs(){return[YM(this,am,"f")]}get outputs(){return de.empty()}};am=new WeakMap;var m_=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},om=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)},ty,sm,lm,ld=class extends xn{constructor(e,r){super(e,r),ty.set(this,void 0),sm.set(this,void 0),lm.set(this,void 0),m_(this,ty,this.parameters.createParameter(r.gain,F.DefaultDecibel,E.numeric({unit:"db"}),"Gain"),"f"),m_(this,sm,Zr.create(e.boxAdapters,r.voltageInput,Lr.Input,"Input"),"f"),m_(this,lm,Zr.create(e.boxAdapters,r.voltageOutput,Lr.Output,"Output"),"f")}get parameterGain(){return om(this,ty,"f")}get voltageInput(){return om(this,sm,"f")}get voltageOutput(){return om(this,lm,"f")}get inputs(){return[om(this,sm,"f")]}get outputs(){return[om(this,lm,"f")]}};ty=new WeakMap,sm=new WeakMap,lm=new WeakMap;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},g_=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)},ry,iy,ny,cd=class extends xn{constructor(e,r){super(e,r),ry.set(this,void 0),iy.set(this,void 0),ny.set(this,void 0),h_(this,ry,Zr.create(e.boxAdapters,r.voltageInputX,Lr.Input,"X"),"f"),h_(this,iy,Zr.create(e.boxAdapters,r.voltageInputY,Lr.Input,"Y"),"f"),h_(this,ny,Zr.create(e.boxAdapters,r.voltageOutput,Lr.Output,"Result"),"f")}get inputs(){return[g_(this,ry,"f"),g_(this,iy,"f")]}get outputs(){return[g_(this,ny,"f")]}};ry=new WeakMap,iy=new WeakMap,ny=new WeakMap;var _D=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},XM=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)},cm,ud=class extends xn{constructor(e,r){super(e,r),cm.set(this,void 0),_D(this,cm,Zr.create(e.boxAdapters,r.output,Lr.Output,"Output"),"f")}get voltageOutput(){return XM(this,cm,"f")}get inputs(){return de.empty()}get outputs(){return[XM(this,cm,"f")]}};cm=new WeakMap;var dd;(function(t){t.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,t.adapterFor=(e,r)=>Ke(r.accept({visitModuleGainBox:n=>e.adapterFor(n,ld),visitModuleDelayBox:n=>e.adapterFor(n,od),visitModuleMultiplierBox:n=>e.adapterFor(n,cd),visitModularAudioInputBox:n=>e.adapterFor(n,ud),visitModularAudioOutputBox:n=>e.adapterFor(n,sd)}),`Could not find ModuleAdapter for ${r.name}`)})(dd||(dd={}));var QM=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},Jl=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,oy,Yl,v_,pd=class{constructor(e,r){ay.add(this),oy.set(this,void 0),Yl.set(this,void 0),QM(this,oy,e,"f"),QM(this,Yl,r,"f")}get box(){return Jl(this,Yl,"f")}get uuid(){return Jl(this,Yl,"f").address.uuid}get address(){return Jl(this,Yl,"f").address}get moduleAdapter(){return dd.adapterFor(Jl(this,oy,"f").boxAdapters,Jl(this,ay,"a",v_).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(Jl(this,ay,"a",v_).address)}terminate(){}};oy=new WeakMap,Yl=new WeakMap,ay=new WeakSet,v_=function(){return Jl(this,Yl,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var eN=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},yi=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)},fd,wi,md=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Modular,fd.set(this,void 0),wi.set(this,void 0),eN(this,fd,e,"f"),eN(this,wi,r,"f")}get box(){return yi(this,wi,"f")}get uuid(){return yi(this,wi,"f").address.uuid}get address(){return yi(this,wi,"f").address}get indexField(){return yi(this,wi,"f").index}get labelField(){return yi(this,wi,"f").label}get enabledField(){return yi(this,wi,"f").enabled}get minimizedField(){return yi(this,wi,"f").minimized}get host(){return yi(this,wi,"f").host}parameterAt(e){return j("Not yet implemented")}deviceHost(){return yi(this,fd,"f").boxAdapters.adapterFor(yi(this,wi,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return yi(this,fd,"f").boxAdapters.adapterFor(yi(this,wi,"f").modularSetup.targetVertex.unwrap("No Modular found").box,As)}elements(){return yi(this,wi,"f").userInterface.elements.pointerHub.filter(l.DeviceUserInterface).map(e=>yi(this,fd,"f").boxAdapters.adapterFor(e.box,pd))}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}};fd=new WeakMap,wi=new WeakMap;var um=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},ot=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)},hd,Es,gd,Ki,Xl,Ql,As=class{constructor(e,r){hd.set(this,new Y),Es.set(this,void 0),gd.set(this,void 0),Ki.set(this,void 0),Xl.set(this,void 0),Ql.set(this,void 0),um(this,gd,e,"f"),um(this,Ki,r,"f"),um(this,Es,ot(this,hd,"f").own(new nr),"f"),um(this,Xl,B.newSet(s=>s.uuid),"f"),um(this,Ql,B.newSet(s=>s.uuid),"f");let n=s=>{let c=dd.adapterFor(ot(this,gd,"f").boxAdapters,s.box);ot(this,Xl,"f").add(c)&&ot(this,Es,"f").proxy.onModuleAdded(c)},i=s=>ot(this,Es,"f").proxy.onModuleRemoved(ot(this,Xl,"f").removeByKey(s.address.uuid)),a=s=>{let c=ot(this,gd,"f").boxAdapters.adapterFor(s.box,_s);ot(this,Ql,"f").add(c)&&ot(this,Es,"f").proxy.onConnectionAdded(c)},o=s=>ot(this,Es,"f").proxy.onConnectionRemoved(ot(this,Ql,"f").removeByKey(s.address.uuid));ot(this,Ki,"f").modules.pointerHub.filter(l.ModuleCollection).forEach(n),ot(this,Ki,"f").connections.pointerHub.filter(l.ConnectionCollection).forEach(a),ot(this,hd,"f").own(ot(this,Ki,"f").modules.pointerHub.subscribe({onAdded:n,onRemoved:i},l.ModuleCollection)),ot(this,hd,"f").own(ot(this,Ki,"f").connections.pointerHub.subscribe({onAdded:a,onRemoved:o},l.ConnectionCollection))}catchupAndSubscribe(e){return R0(e.onModuleAdded,r=>ot(this,Xl,"f").forEach(n=>r(n))),R0(e.onConnectionAdded,r=>ot(this,Ql,"f").forEach(n=>r(n))),ot(this,Es,"f").subscribe(e)}get box(){return ot(this,Ki,"f")}get address(){return ot(this,Ki,"f").address}get uuid(){return ot(this,Ki,"f").address.uuid}get editingField(){return ot(this,Ki,"f").editing}get labelField(){return ot(this,Ki,"f").label}get modules(){return ot(this,Xl,"f").values()}get connections(){return ot(this,Ql,"f").values()}get device(){return ot(this,gd,"f").boxAdapters.adapterFor(Ke(ot(this,Ki,"f").device.pointerHub.incoming().at(0),"No device found").box,md)}terminate(){console.debug(`terminate ${this}`),ot(this,hd,"f").terminate()}};hd=new WeakMap,Es=new WeakMap,gd=new WeakMap,Ki=new WeakMap,Xl=new WeakMap,Ql=new WeakMap;var dm=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)},x_,xd,pm,sy,vd,mm,ly,fm,cy,tN,Ka=class{constructor(e,r){x_.add(this),this.type="groove-adapter",pm.set(this,new Y),sy.set(this,void 0),vd.set(this,void 0),mm.set(this,void 0),ly.set(this,new bg({duration:()=>ni(this,cy,"f"),fx:n=>V0(n,ni(this,fm,"f")),fy:n=>V0(n,1-ni(this,fm,"f"))})),fm.set(this,0),cy.set(this,Te.SemiQuaver*2),dm(this,sy,e,"f"),dm(this,vd,r,"f"),dm(this,mm,ni(this,pm,"f").own(new oe(ni(this,sy,"f"))),"f"),this.namedParameter=ni(this,x_,"m",tN).call(this,r),ni(this,pm,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(n=>dm(this,cy,n.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(n=>dm(this,fm,pM(n.getValue(),.01),"f")))}unwarp(e){return ni(this,ly,"f").unwarp(e)}warp(e){return ni(this,ly,"f").warp(e)}get box(){return ni(this,vd,"f")}get uuid(){return ni(this,vd,"f").address.uuid}get address(){return ni(this,vd,"f").address}terminate(){ni(this,pm,"f").terminate()}};xd=Ka,pm=new WeakMap,sy=new WeakMap,vd=new WeakMap,mm=new WeakMap,ly=new WeakMap,fm=new WeakMap,cy=new WeakMap,x_=new WeakSet,tN=function(e){return{duration:ni(this,mm,"f").createParameter(e.duration,F.values(xd.DurationPPQNs),E.values("",xd.DurationPPQNs,xd.DurationStrings),"Duration"),amount:ni(this,mm,"f").createParameter(e.amount,F.unipolar(),E.percent({fractionDigits:0}),"Amount")}};Ka.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];Ka.DurationPPQNs=xd.Durations.map(([t,e])=>Te.fromSignature(t,e));Ka.DurationStrings=xd.Durations.map(([t,e])=>`${t}/${e}`);var yd=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},Vt=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)},Wa,Ss,wd,uy,dy,hm,gm,y_,Ps=class{constructor(e,r,n,i,a){Wa.set(this,void 0),Ss.set(this,void 0),wd.set(this,void 0),uy.set(this,void 0),dy.set(this,void 0),hm.set(this,new Y),gm.set(this,void 0),y_.set(this,b.None),yd(this,Wa,e,"f"),yd(this,Ss,r,"f"),yd(this,wd,n,"f"),yd(this,uy,i,"f"),yd(this,dy,a??0,"f"),yd(this,gm,Vt(this,hm,"f").own(new fe),"f"),Vt(this,hm,"f").own(Vt(this,Wa,"f").subscribe(()=>Vt(this,gm,"f").notify(this))),e.getValue(),r.clamp(e.getValue())}get field(){return Vt(this,Wa,"f")}get valueMapping(){return Vt(this,Ss,"f")}get stringMapping(){return Vt(this,wd,"f")}get name(){return Vt(this,uy,"f")}get anchor(){return Vt(this,dy,"f")}get type(){return Vt(this,Wa,"f").type}get address(){return Vt(this,Wa,"f").address}get track(){return Vt(this,y_,"f")}subscribe(e){return Vt(this,gm,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return Vt(this,Wa,"f").getValue()}setValue(e){Vt(this,Wa,"f").setValue(Vt(this,Ss,"f").clamp(e))}setUnitValue(e){this.setValue(Vt(this,Ss,"f").y(e))}getUnitValue(){return Vt(this,Ss,"f").x(this.getValue())}getPrintValue(){return Vt(this,wd,"f").x(this.getValue())}setPrintValue(e){let r=Vt(this,wd,"f").y(e);r.type==="unitValue"?this.setUnitValue(Fe(r.value,0,1)):r.type==="explicit"?this.setValue(this.valueMapping.clamp(r.value)):console.debug(`Unknown text input: '${r.value}'`)}reset(){this.setValue(Vt(this,Ss,"f").clamp(Vt(this,Wa,"f").initValue))}terminate(){Vt(this,hm,"f").terminate()}};Wa=new WeakMap,Ss=new WeakMap,wd=new WeakMap,uy=new WeakMap,dy=new WeakMap,hm=new WeakMap,gm=new WeakMap,y_=new WeakMap;var bd=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},yn=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)},La,py,fy,my,hy,gy,vy=class{constructor(e){La.set(this,void 0),py.set(this,void 0),fy.set(this,void 0),my.set(this,void 0),hy.set(this,void 0),gy.set(this,void 0),bd(this,La,e,"f"),bd(this,py,new Ps(yn(this,La,"f").keyboard,F.values([88,76,61,49]),E.numeric({fractionDigits:1}),"Keyboard Type"),"f"),bd(this,fy,new Ps(yn(this,La,"f").timeRangeInQuarters,F.exponential(1,64),E.numeric({fractionDigits:1}),"Time-Range"),"f"),bd(this,my,new Ps(yn(this,La,"f").noteScale,F.exponential(.5,2),E.numeric({fractionDigits:1}),"Note Scale"),"f"),bd(this,hy,new Ps(yn(this,La,"f").noteLabels,F.bool,E.bool,"Note Labels"),"f"),bd(this,gy,new Ps(yn(this,La,"f").transpose,F.linearInteger(-48,48),E.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return yn(this,La,"f").box.subscribe(ze.Children,()=>e(this))}get object(){return yn(this,La,"f")}get keyboard(){return yn(this,py,"f")}get timeRangeInQuarters(){return yn(this,fy,"f")}get noteScale(){return yn(this,my,"f")}get noteLabels(){return yn(this,hy,"f")}get transpose(){return yn(this,gy,"f")}};La=new WeakMap,py=new WeakMap,fy=new WeakMap,my=new WeakMap,hy=new WeakMap,gy=new WeakMap;var vm=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},ur=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)},ec,Wi,tc,xy,yy,wy=class{constructor(e,r){ec.set(this,void 0),Wi.set(this,void 0),tc.set(this,void 0),xy.set(this,void 0),yy.set(this,void 0),vm(this,ec,e,"f"),vm(this,Wi,r,"f"),vm(this,tc,Rt.create(ur(this,Wi,"f").audioUnits,n=>ur(this,ec,"f").boxAdapters.adapterFor(n,fn),l.AudioUnits),"f"),vm(this,xy,new Tx(ur(this,Wi,"f").audioBusses.pointerHub,n=>ur(this,ec,"f").boxAdapters.adapterFor(n,Di),l.AudioBusses),"f"),vm(this,yy,new vy(ur(this,Wi,"f").pianoMode),"f")}get uuid(){return ur(this,Wi,"f").address.uuid}get address(){return ur(this,Wi,"f").address}get box(){return ur(this,Wi,"f")}get audioBusses(){return ur(this,xy,"f")}get audioUnits(){return ur(this,tc,"f")}get clips(){return ur(this,tc,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return ur(this,ec,"f").boxAdapters.adapterFor(ur(this,Wi,"f").groove.targetVertex.unwrap("no groove").box,Ka)}get timeline(){return ur(this,ec,"f").boxAdapters.adapterFor(ur(this,Wi,"f").timeline.targetVertex.unwrap("no timeline").box,Ua)}get pianoMode(){return ur(this,yy,"f")}get created(){return new Date(ur(this,Wi,"f").created.getValue())}get midiOutputDevices(){return ur(this,Wi,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>Re(e,Qo))}*labeledAudioOutputs(){for(let e of ur(this,tc,"f").adapters())yield{label:e.label,address:e.address,children:()=>b.wrap(e.labeledAudioOutputs())}}terminate(){ur(this,tc,"f").terminate()}};ec=new WeakMap,Wi=new WeakMap,tc=new WeakMap,xy=new WeakMap,yy=new WeakMap;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},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)},b_,xm,ra,Ms,rN,by=class{constructor(e,r){b_.add(this),this.type="instrument",this.accepts="audio",this.manualUrl=ie.Tape,xm.set(this,void 0),ra.set(this,void 0),Ms.set(this,void 0),w_(this,xm,e,"f"),w_(this,ra,r,"f"),w_(this,Ms,new oe(Gr(this,xm,"f")),"f"),this.namedParameter=Gr(this,b_,"m",rN).call(this,r)}get box(){return Gr(this,ra,"f")}get uuid(){return Gr(this,ra,"f").address.uuid}get address(){return Gr(this,ra,"f").address}get labelField(){return Gr(this,ra,"f").label}get iconField(){return Gr(this,ra,"f").icon}get defaultTrackType(){return ge.Audio}get enabledField(){return Gr(this,ra,"f").enabled}get minimizedField(){return Gr(this,ra,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return Gr(this,xm,"f").boxAdapters.adapterFor(Gr(this,ra,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Gr(this,Ms,"f").terminate()}};xm=new WeakMap,ra=new WeakMap,Ms=new WeakMap,b_=new WeakSet,rN=function(e){return{flutter:Gr(this,Ms,"f").createParameter(e.flutter,F.unipolar(),E.percent(),"Flutter"),wow:Gr(this,Ms,"f").createParameter(e.wow,F.unipolar(),E.percent(),"Wow"),noise:Gr(this,Ms,"f").createParameter(e.noise,F.unipolar(),E.percent(),"Noise"),saturation:Gr(this,Ms,"f").createParameter(e.saturation,F.unipolar(),E.percent(),"Saturation")}};var rc=(()=>{let r=[1,2,3,4],n=["12","24","36","48"],i=[ga.sine,ga.triangle,ga.saw,ga.square],a=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:F.exponential(20,2e4),CUTOFF_STRING_MAPPING:E.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:r,FILTER_ORDER_STRINGS:n,FILTER_ORDER_VALUE_MAPPING:F.values(r),FILTER_ORDER_STRING_MAPPING:E.values("db",r,n),LFO_WAVEFORM_VALUES:i,LFO_WAVEFORM_STRINGS:a,LFO_WAVEFORM_VALUE_MAPPING:F.values(i),LFO_WAVEFORM_STRING_MAPPING:E.values("",i,a)}})();var __=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},Ze=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)},A_,ym,ia,nt,iN,_y=class{constructor(e,r){A_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ie.Vaporisateur,ym.set(this,void 0),ia.set(this,void 0),nt.set(this,void 0),__(this,ym,e,"f"),__(this,ia,r,"f"),__(this,nt,new oe(Ze(this,ym,"f")),"f"),this.namedParameter=Ze(this,A_,"m",iN).call(this,r)}get box(){return Ze(this,ia,"f")}get uuid(){return Ze(this,ia,"f").address.uuid}get address(){return Ze(this,ia,"f").address}get labelField(){return Ze(this,ia,"f").label}get iconField(){return Ze(this,ia,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return Ze(this,ia,"f").enabled}get minimizedField(){return Ze(this,ia,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ze(this,ym,"f").boxAdapters.adapterFor(Ze(this,ia,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Ze(this,nt,"f").terminate()}};ym=new WeakMap,ia=new WeakMap,nt=new WeakMap,A_=new WeakSet,iN=function(e){let r=[ya.Monophonic,ya.Polyphonic];return{oscillators:e.oscillators.fields().map(n=>({waveform:Ze(this,nt,"f").createParameter(n.waveform,F.linearInteger(0,3),E.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:Ze(this,nt,"f").createParameter(n.volume,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:Ze(this,nt,"f").createParameter(n.octave,F.linearInteger(-3,3),E.numeric({unit:"oct"}),"Octave",.5),tune:Ze(this,nt,"f").createParameter(n.tune,F.linear(-1200,1200),E.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:Ze(this,nt,"f").createParameter(e.noise.volume,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:Ze(this,nt,"f").createParameter(e.noise.attack,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:Ze(this,nt,"f").createParameter(e.noise.hold,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Hold"),release:Ze(this,nt,"f").createParameter(e.noise.release,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:Ze(this,nt,"f").createParameter(e.filterOrder,rc.FILTER_ORDER_VALUE_MAPPING,rc.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:Ze(this,nt,"f").createParameter(e.cutoff,rc.CUTOFF_VALUE_MAPPING,rc.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:Ze(this,nt,"f").createParameter(e.resonance,F.exponential(.01,10),E.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:Ze(this,nt,"f").createParameter(e.attack,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:Ze(this,nt,"f").createParameter(e.decay,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:Ze(this,nt,"f").createParameter(e.sustain,F.unipolar(),E.percent({fractionDigits:1}),"Sustain"),release:Ze(this,nt,"f").createParameter(e.release,F.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:Ze(this,nt,"f").createParameter(e.filterEnvelope,F.bipolar(),E.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:Ze(this,nt,"f").createParameter(e.filterKeyboard,F.bipolar(),E.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:Ze(this,nt,"f").createParameter(e.voicingMode,F.values(r),E.values("",r,["mono","poly"]),"Play Mode",.5),glideTime:Ze(this,nt,"f").createParameter(e.glideTime,F.unipolar(),E.percent({fractionDigits:1}),"Glide time",0),unisonCount:Ze(this,nt,"f").createParameter(e.unisonCount,F.values([1,3,5]),E.values("#",[1,3,5],[1,3,5].map(n=>String(n))),"Unisono",0),unisonDetune:Ze(this,nt,"f").createParameter(e.unisonDetune,F.exponential(1,1200),E.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:Ze(this,nt,"f").createParameter(e.unisonStereo,F.unipolar(),E.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:Ze(this,nt,"f").createParameter(e.lfo.waveform,rc.LFO_WAVEFORM_VALUE_MAPPING,rc.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:Ze(this,nt,"f").createParameter(e.lfo.rate,F.exponential(1e-4,30),E.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:Ze(this,nt,"f").createParameter(e.lfo.targetTune,F.bipolar(),E.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:Ze(this,nt,"f").createParameter(e.lfo.targetVolume,F.bipolar(),E.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:Ze(this,nt,"f").createParameter(e.lfo.targetCutoff,F.bipolar(),E.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};var F_=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)},E_,Ay,wm,wn,Za,nN,ic=class{constructor(e,r){E_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=ie.Arpeggio,wm.set(this,void 0),wn.set(this,void 0),Za.set(this,void 0),F_(this,wm,e,"f"),F_(this,wn,r,"f"),F_(this,Za,new oe(vr(this,wm,"f")),"f"),this.namedParameter=vr(this,E_,"m",nN).call(this,r)}get box(){return vr(this,wn,"f")}get uuid(){return vr(this,wn,"f").address.uuid}get address(){return vr(this,wn,"f").address}get indexField(){return vr(this,wn,"f").index}get labelField(){return vr(this,wn,"f").label}get enabledField(){return vr(this,wn,"f").enabled}get minimizedField(){return vr(this,wn,"f").minimized}get host(){return vr(this,wn,"f").host}deviceHost(){return vr(this,wm,"f").boxAdapters.adapterFor(vr(this,wn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){vr(this,Za,"f").terminate()}};Ay=ic,wm=new WeakMap,wn=new WeakMap,Za=new WeakMap,E_=new WeakSet,nN=function(e){return{modeIndex:vr(this,Za,"f").createParameter(e.modeIndex,F.linearInteger(0,2),E.indices("",["Up","Down","UpDown"]),"Mode"),numOctaves:vr(this,Za,"f").createParameter(e.numOctaves,F.linearInteger(1,5),E.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:vr(this,Za,"f").createParameter(e.rateIndex,F.linearInteger(0,Ay.RateFractions.length-1),Ay.RateStringMapping,"Rate"),gate:vr(this,Za,"f").createParameter(e.gate,F.linear(0,2),E.percent({fractionDigits:0}),"Gate"),repeat:vr(this,Za,"f").createParameter(e.repeat,F.linearInteger(1,16),E.numeric({fractionDigits:0}),"Repeat"),velocity:vr(this,Za,"f").createParameter(e.velocity,F.bipolar(),E.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};ic.RateFractions=Wo.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();ic.RateStringMapping=E.indices("",Ay.RateFractions.map(([t,e])=>`${t}/${e}`));var S_=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)},P_,bm,bn,nc,aN,Fy=class{constructor(e,r){P_.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=ie.Pitch,bm.set(this,void 0),bn.set(this,void 0),nc.set(this,void 0),S_(this,bm,e,"f"),S_(this,bn,r,"f"),S_(this,nc,new oe(Hr(this,bm,"f")),"f"),this.namedParameter=Hr(this,P_,"m",aN).call(this,r)}get box(){return Hr(this,bn,"f")}get uuid(){return Hr(this,bn,"f").address.uuid}get address(){return Hr(this,bn,"f").address}get indexField(){return Hr(this,bn,"f").index}get labelField(){return Hr(this,bn,"f").label}get enabledField(){return Hr(this,bn,"f").enabled}get minimizedField(){return Hr(this,bn,"f").minimized}get host(){return Hr(this,bn,"f").host}deviceHost(){return Hr(this,bm,"f").boxAdapters.adapterFor(Hr(this,bn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Hr(this,nc,"f").terminate()}};bm=new WeakMap,bn=new WeakMap,nc=new WeakMap,P_=new WeakSet,aN=function(e){return{octaves:Hr(this,nc,"f").createParameter(e.octaves,F.linearInteger(-7,7),E.numeric({unit:"oct",fractionDigits:0}),"Octaves"),semiTones:Hr(this,nc,"f").createParameter(e.semiTones,F.linearInteger(-36,36),E.numeric({unit:"st",fractionDigits:0}),"Semi-Tones"),cent:Hr(this,nc,"f").createParameter(e.cents,F.linear(-50,50),E.numeric({unit:"cents",fractionDigits:1}),"Cents")}};var AD=/^\/\/ @label .+$/m,oN=/^\/\/ @param .+$/gm,sN=/^\/\/ @sample .+$/gm;var lN=/^\/\/ @(group|param|sample) .+$/gm,cN=/^\/\/ @(?:param|sample) \S+/gm,FD=/^\/\/ @no-pass\b(.*)$/m,_d=1e-6,ED=["linear","exp","int","bool"],SD=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}}},uN=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<_d)throw new Error(`Malformed @param: '${t}' \u2014 min (${u}) must be less than max (${f})`);if(i<u-_d||i>f+_d)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(!ED.includes(s))throw new Error(`Malformed @param: '${t}' \u2014 unknown mapping '${s}' (expected: linear, exp, int, bool)`);if(s!=="bool"&&o-a<_d)throw new Error(`Malformed @param: '${t}' \u2014 min (${a}) must be less than max (${o})`);if(i<a-_d||i>o+_d)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}},dN=(t,e)=>t.mapping===e.mapping&&t.min===e.min&&t.max===e.max&&t.unit===e.unit,PD=(t,e)=>dN(t,e)&&Math.abs(t.defaultValue-e.defaultValue)<1e-6,xr;(function(t){t.isEqual=PD,t.parseLabel=e=>{let r=AD.exec(e);if(r===null)return b.None;let n=r[0].replace(/^\/\/ @label\s+/,"").trim();if(n.length===0)throw new Error("Malformed @label: expected: // @label <name>");return b.wrap(n)},t.parsePassThrough=e=>{let r=FD.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(oN.lastIndex=0;(n=oN.exec(e))!==null;)r.push(uN(n[0]));return r},t.parseSamples=e=>{let r=[],n;for(sN.lastIndex=0;(n=sN.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;cN.lastIndex=0;let i=0;for(;(n=cN.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=[];lN.lastIndex=0;let a;for(;(a=lN.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:uN(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 F.unipolar();case"linear":return F.linear(e.min,e.max);case"exp":return F.exponential(e.min,e.max);case"int":return F.linearInteger(e.min,e.max);case"bool":return F.linearInteger(0,1)}},t.resolveStringMapping=e=>{switch(e.mapping){case"unipolar":return E.percent();case"linear":return E.numeric({unit:e.unit,fractionDigits:2});case"exp":return E.numeric({unit:e.unit,fractionDigits:2});case"int":return E.numeric({unit:e.unit,fractionDigits:0});case"bool":return SD}},t.resolveParamMappings=e=>({valueMapping:t.resolveValueMapping(e),stringMapping:t.resolveStringMapping(e)}),t.subscribeScriptParams=(e,r,n)=>{let i=new Map,a=new fe;return{terminable:pe.many(n.pointerHub.catchupAndSubscribe({onAdded:(({box:s})=>{let c=Re(s,Sa),u=c.label.getValue(),v=t.parseParams(r.getValue()).find(_=>_.label===u),{valueMapping:h,stringMapping:y}=K(v)?t.resolveParamMappings(v):{valueMapping:F.unipolar(),stringMapping:E.percent({fractionDigits:1})};e.createParameter(c.value,h,y,Ep.capitalize(u),void 0,c.defaultValue.getValue()),K(v)&&i.set(u,v)}),onRemoved:(({box:s})=>{let c=Re(s,Sa);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(y=>Ep.capitalize(y.label)===c.name);if(!K(u))continue;let f=i.get(u.label);if(K(f)&&dN(f,u))continue;let{valueMapping:v,stringMapping:h}=t.resolveParamMappings(u);c.updateMappings(v,h),i.set(u.label,u)}a.notify()}),a),codeChanged:a}}})(xr||(xr={}));var Ey=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)},_m,Am,_n,Fm,Sy,Py=class{constructor(e,r){_m.set(this,new Y),this.type="midi-effect",this.accepts="midi",this.manualUrl=ie.Spielwerk,Am.set(this,void 0),_n.set(this,void 0),Fm.set(this,void 0),Sy.set(this,void 0),Ey(this,Am,e,"f"),Ey(this,_n,r,"f"),Ey(this,Fm,Tr(this,_m,"f").own(new oe(Tr(this,Am,"f"))),"f");let{terminable:n,codeChanged:i}=xr.subscribeScriptParams(Tr(this,Fm,"f"),r.code,r.parameters);Tr(this,_m,"f").own(n),Ey(this,Sy,i,"f")}get box(){return Tr(this,_n,"f")}get uuid(){return Tr(this,_n,"f").address.uuid}get address(){return Tr(this,_n,"f").address}get indexField(){return Tr(this,_n,"f").index}get labelField(){return Tr(this,_n,"f").label}get enabledField(){return Tr(this,_n,"f").enabled}get minimizedField(){return Tr(this,_n,"f").minimized}get host(){return Tr(this,_n,"f").host}get parameters(){return Tr(this,Fm,"f")}get codeChanged(){return Tr(this,Sy,"f")}deviceHost(){return Tr(this,Am,"f").boxAdapters.adapterFor(Tr(this,_n,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Tr(this,_m,"f").terminate()}};_m=new WeakMap,Am=new WeakMap,_n=new WeakMap,Fm=new WeakMap,Sy=new WeakMap;var My=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},qr=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)},Em,Sm,na,Pm,Ny,$y=class{constructor(e,r){Em.set(this,new Y),this.type="instrument",this.accepts="midi",this.manualUrl=ie.Apparat,Sm.set(this,void 0),na.set(this,void 0),Pm.set(this,void 0),Ny.set(this,void 0),My(this,Sm,e,"f"),My(this,na,r,"f"),My(this,Pm,qr(this,Em,"f").own(new oe(qr(this,Sm,"f"))),"f");let{terminable:n,codeChanged:i}=xr.subscribeScriptParams(qr(this,Pm,"f"),r.code,r.parameters);qr(this,Em,"f").own(n),My(this,Ny,i,"f")}get box(){return qr(this,na,"f")}get uuid(){return qr(this,na,"f").address.uuid}get address(){return qr(this,na,"f").address}get labelField(){return qr(this,na,"f").label}get iconField(){return qr(this,na,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return qr(this,na,"f").enabled}get minimizedField(){return qr(this,na,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return qr(this,Pm,"f")}get codeChanged(){return qr(this,Ny,"f")}deviceHost(){return qr(this,Sm,"f").boxAdapters.adapterFor(qr(this,na,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){qr(this,Em,"f").terminate()}};Em=new WeakMap,Sm=new WeakMap,na=new WeakMap,Pm=new WeakMap,Ny=new WeakMap;var Io;(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})})(Io||(Io={}));var Mm;(function(t){t.Contours=["free","walk","rise","fall"],t.Motifs=[0,2,3,4,8],t.Default={root:0,scale:zc.StockScales[1],octave:1,octaves:3,density:.6,accent:.3,slide:.2,motif:0,contour:"free",rootFirst:!0};let e=r=>{let n=de.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=y=>{let _=Fe(y,0,o-1);return Fe(s+i[_%i.length]+Math.floor(_/i.length)*12,0,127)},u=r.motif>0?Math.min(r.motif,n):n,f=y=>Math.round((Math.random()*2-1)*y),v=new Array(u);for(let y=0;y<u;y++){let _=u<2?0:y/(u-1)*(o-1);v[y]=r.rootFirst&&y===0?0:Fe(r.contour==="walk"?y===0?o>>1:v[y-1]+f(2):r.contour==="rise"?Math.round(_)+f(1):r.contour==="fall"?Math.round(o-1-_)+f(1):Math.floor(Math.random()*o),0,o-1)}let h=de.create(y=>Io.pack({note:c(v[y]),active:r.rootFirst&&y===0||Math.random()<r.density,slide:Math.random()<r.slide,accent:Math.random()<r.accent}),u);return de.create(y=>h[y%u],n)}})(Mm||(Mm={}));var M_=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)},$_,Nm,Li,To,pN,N_=Io.pack({note:Io.DefaultNote,active:!1,slide:!1,accent:!1}),ky=class{constructor(e,r){$_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl="manuals/devices/instruments/cubed",Nm.set(this,void 0),Li.set(this,void 0),To.set(this,void 0),M_(this,Nm,e,"f"),M_(this,Li,r,"f"),M_(this,To,new oe(yr(this,Nm,"f")),"f"),this.namedParameter=yr(this,$_,"m",pN).call(this,r)}get box(){return yr(this,Li,"f")}get uuid(){return yr(this,Li,"f").address.uuid}get address(){return yr(this,Li,"f").address}get labelField(){return yr(this,Li,"f").label}get iconField(){return yr(this,Li,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return yr(this,Li,"f").enabled}get minimizedField(){return yr(this,Li,"f").minimized}get acceptsMidiEvents(){return!0}currentPattern(){return yr(this,Li,"f").patterns.getField(yr(this,Li,"f").patternIndex.getValue())}readCurrentPattern(){let e=this.currentPattern(),r=e.length.getValue();return{length:r,steps:e.steps.fields().slice(0,r).map(n=>Io.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?Io.pack(r[s]):N_)),n.length.setValue(Fe(e,1,i.length))}clearCurrentPattern(){this.currentPattern().steps.fields().forEach(e=>e.setValue(N_))}randomizeCurrentPattern(e=Mm.Default){let r=this.currentPattern(),n=r.length.getValue(),i=Mm.steps(e,n);r.steps.fields().forEach((a,o)=>a.setValue(o<n?i[o]:N_))}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 yr(this,Nm,"f").boxAdapters.adapterFor(yr(this,Li,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){yr(this,To,"f").terminate()}};Nm=new WeakMap,Li=new WeakMap,To=new WeakMap,$_=new WeakSet,pN=function(e){let r=(n,i,a)=>yr(this,To,"f").createParameter(n,F.unipolar(),E.percent({fractionDigits:0}),i,a);return{tuning:yr(this,To,"f").createParameter(e.tuning,F.linear(-1200,1200),E.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:yr(this,To,"f").createParameter(e.volume,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Volume"),waveform:yr(this,To,"f").createParameter(e.waveform,F.linearInteger(0,1),E.indices("",["Sawtooth","Square"]),"Waveform",.5),patternIndex:yr(this,To,"f").createParameter(e.patternIndex,F.linearInteger(0,e.patterns.fields().length-1),E.oneBasedIndex(),"Pattern")}};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},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)},B_,$m,An,Dr,fN,Ns;(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)})(Ns||(Ns={}));var By=class{constructor(e,r){B_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ie.Neon,$m.set(this,void 0),An.set(this,void 0),Dr.set(this,void 0),k_(this,$m,e,"f"),k_(this,An,r,"f"),k_(this,Dr,new oe(At(this,$m,"f")),"f"),this.namedParameter=At(this,B_,"m",fN).call(this,r)}get box(){return At(this,An,"f")}get uuid(){return At(this,An,"f").address.uuid}get address(){return At(this,An,"f").address}get labelField(){return At(this,An,"f").label}get iconField(){return At(this,An,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return At(this,An,"f").enabled}get minimizedField(){return At(this,An,"f").minimized}get acceptsMidiEvents(){return!0}envelope(e,r){return At(this,An,"f").envelopes.fields()[Ns.envelopeIndex(e,r)]}deviceHost(){return At(this,$m,"f").boxAdapters.adapterFor(At(this,An,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){At(this,Dr,"f").terminate()}};$m=new WeakMap,An=new WeakMap,Dr=new WeakMap,B_=new WeakSet,fN=function(e){let r=[ya.Monophonic,ya.Polyphonic],n=(i,a)=>At(this,Dr,"f").createParameter(i,F.linear(0,99),E.numeric({unit:"",fractionDigits:0}),a);return{lineSelect:At(this,Dr,"f").createParameter(e.lineSelect,F.linearInteger(0,3),E.indices("",Ns.LineSelect),"Line"),modulation:At(this,Dr,"f").createParameter(e.modulation,F.linearInteger(0,2),E.indices("",Ns.Modulation),"Mod"),octave:At(this,Dr,"f").createParameter(e.octave,F.linearInteger(-3,3),E.numeric({unit:"oct"}),"Octave",.5),detune:At(this,Dr,"f").createParameter(e.detune,F.linear(-4800,4800),E.numeric({unit:"ct",fractionDigits:0}),"Detune",.5),tune:At(this,Dr,"f").createParameter(e.tune,F.linear(-1200,1200),E.numeric({unit:"ct",fractionDigits:0}),"Tune",.5),glideTime:At(this,Dr,"f").createParameter(e.glideTime,F.unipolar(),E.percent({fractionDigits:1}),"Glide time",0),voicingMode:At(this,Dr,"f").createParameter(e.voicingMode,F.values(r),E.values("",r,["mono","poly"]),"Play Mode",.5),vibrato:{wave:At(this,Dr,"f").createParameter(e.vibrato.wave,F.linearInteger(0,3),E.indices("",Ns.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:At(this,Dr,"f").createParameter(i.wave1,F.linearInteger(0,7),E.indices("",Ns.Waves),"Wave 1"),wave2:At(this,Dr,"f").createParameter(i.wave2,F.linearInteger(0,8),E.indices("",["Off",...Ns.Waves]),"Wave 2"),dcwKeyFollow:At(this,Dr,"f").createParameter(i.dcwKeyFollow,F.linear(0,9),E.numeric({unit:"",fractionDigits:1}),"DCW Key Follow"),dcaKeyFollow:At(this,Dr,"f").createParameter(i.dcaKeyFollow,F.linear(0,9),E.numeric({unit:"",fractionDigits:1}),"DCA Key Follow")}))}};var I_=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},bi=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)},T_,km,aa,Ad,mN,Iy=class{constructor(e,r){T_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ie.Nano,km.set(this,void 0),aa.set(this,void 0),Ad.set(this,void 0),I_(this,km,e,"f"),I_(this,aa,r,"f"),I_(this,Ad,new oe(bi(this,km,"f")),"f"),this.namedParameter=bi(this,T_,"m",mN).call(this,r)}get box(){return bi(this,aa,"f")}get uuid(){return bi(this,aa,"f").address.uuid}get address(){return bi(this,aa,"f").address}get labelField(){return bi(this,aa,"f").label}get iconField(){return bi(this,aa,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return bi(this,aa,"f").enabled}get minimizedField(){return bi(this,aa,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return bi(this,km,"f").boxAdapters.adapterFor(bi(this,aa,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){bi(this,Ad,"f").terminate()}};km=new WeakMap,aa=new WeakMap,Ad=new WeakMap,T_=new WeakSet,mN=function(e){return{volume:bi(this,Ad,"f").createParameter(e.volume,F.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Volume"),release:bi(this,Ad,"f").createParameter(e.release,F.exponential(.001,8),E.numeric({unit:"s",fractionDigits:3}),"Release")}};var Fd=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},se=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_,ac,$s,Me,Ty,Bm,ai,oc,hN,Ed=class{constructor(e,r){D_.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",this.manualUrl="manuals/devices/instruments/playfield",ac.set(this,new Y),$s.set(this,void 0),Me.set(this,void 0),Ty.set(this,void 0),Bm.set(this,void 0),ai.set(this,void 0),oc.set(this,b.None),Fd(this,$s,e,"f"),Fd(this,Me,r,"f"),Fd(this,Ty,se(this,ac,"f").own(Rt.create(se(this,Me,"f").midiEffects,n=>se(this,$s,"f").boxAdapters.adapterFor(n,ee.isMidiEffect),l.MIDIEffectHost)),"f"),Fd(this,Bm,se(this,ac,"f").own(Rt.create(se(this,Me,"f").audioEffects,n=>se(this,$s,"f").boxAdapters.adapterFor(n,ee.isAudioEffect),l.AudioEffectHost)),"f"),Fd(this,ai,se(this,ac,"f").own(new oe(se(this,$s,"f"))),"f"),this.namedParameter=se(this,D_,"m",hN).call(this,r),se(this,ac,"f").own(se(this,Me,"f").file.catchupAndSubscribe(n=>{Fd(this,oc,n.targetVertex.map(({box:i})=>se(this,$s,"f").boxAdapters.adapterFor(i,Zn)),"f"),se(this,oc,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return se(this,Me,"f")}get uuid(){return se(this,Me,"f").address.uuid}get address(){return se(this,Me,"f").address}get peakAddress(){return se(this,Me,"f").address.append(1001)}get indexField(){return se(this,Me,"f").index}get gate(){return se(this,Me,"f").gate.getValue()}get exclude(){return se(this,Me,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${se(this,oc,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get fileLabel(){return`${se(this,oc,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return se(this,Me,"f").icon}get defaultTrackType(){return ge.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return b.wrap(se(this,Me,"f").midiEffects)}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return b.wrap(se(this,Me,"f").audioEffects)}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}get hostsInstrument(){return!0}file(){return se(this,oc,"f")}fileUUID(){return se(this,Me,"f").file.targetAddress.unwrap("file.targetAddr").uuid}resetParameters(){se(this,Me,"f").mute.reset(),se(this,Me,"f").solo.reset(),se(this,Me,"f").exclude.reset(),se(this,Me,"f").polyphone.reset(),se(this,Me,"f").pitch.reset(),se(this,Me,"f").attack.reset(),se(this,Me,"f").release.reset(),se(this,Me,"f").sampleStart.reset(),se(this,Me,"f").sampleEnd.reset(),se(this,Me,"f").gate.reset(),se(this,Me,"f").volume.reset(),se(this,Me,"f").panning.reset()}copyToIndex(e){Ea.create(se(this,Me,"f").graph,B.generate(),r=>{r.file.refer(se(this,Me,"f").file.targetVertex.unwrap("file.target")),r.device.refer(se(this,Me,"f").device.targetVertex.unwrap("device.target")),r.index.setValue(e),r.mute.setValue(se(this,Me,"f").mute.getValue()),r.solo.setValue(se(this,Me,"f").solo.getValue()),r.sampleStart.setValue(se(this,Me,"f").sampleStart.getValue()),r.sampleEnd.setValue(se(this,Me,"f").sampleEnd.getValue()),r.attack.setValue(se(this,Me,"f").attack.getValue()),r.release.setValue(se(this,Me,"f").release.getValue()),r.pitch.setValue(se(this,Me,"f").pitch.getValue()),r.exclude.setValue(se(this,Me,"f").exclude.getValue()),r.gate.setValue(se(this,Me,"f").gate.getValue()),r.volume.setValue(se(this,Me,"f").volume.getValue()),r.panning.setValue(se(this,Me,"f").panning.getValue())})}get midiEffects(){return b.wrap(se(this,Ty,"f"))}get inputAdapter(){return b.wrap(this)}get audioEffects(){return b.wrap(se(this,Bm,"f"))}get labelField(){return Re(se(this,Me,"f").file.targetVertex.unwrap("file.target").box,rn).fileName}get enabledField(){return se(this,Me,"f").enabled}get minimizedField(){return se(this,Me,"f").minimized}device(){return se(this,$s,"f").boxAdapters.adapterFor(se(this,Me,"f").device.targetVertex.unwrap("device.target").box,Sd)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.fileLabel,children:()=>b.None};for(let e of se(this,Bm,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){se(this,ac,"f").terminate()}};ac=new WeakMap,$s=new WeakMap,Me=new WeakMap,Ty=new WeakMap,Bm=new WeakMap,ai=new WeakMap,oc=new WeakMap,D_=new WeakSet,hN=function(e){return{gate:se(this,ai,"f").createParameter(e.gate,F.linearInteger(0,2),E.indices("",["Off","On","Loop"]),"Gate"),mute:se(this,ai,"f").createParameter(e.mute,F.bool,E.bool,"Mute"),solo:se(this,ai,"f").createParameter(e.solo,F.bool,E.bool,"Solo"),polyphone:se(this,ai,"f").createParameter(e.polyphone,F.bool,E.bool,"Polyphone"),exclude:se(this,ai,"f").createParameter(e.exclude,F.bool,E.bool,"Exclude"),pitch:se(this,ai,"f").createParameter(e.pitch,F.linear(-1200,1200),E.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:se(this,ai,"f").createParameter(e.sampleStart,F.unipolar(),E.percent(),"Start",0),sampleEnd:se(this,ai,"f").createParameter(e.sampleEnd,F.unipolar(),E.percent(),"End",1),attack:se(this,ai,"f").createParameter(e.attack,F.exponential(.001,5),E.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:se(this,ai,"f").createParameter(e.release,F.exponential(.001,5),E.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release"),volume:se(this,ai,"f").createParameter(e.volume,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Volume"),panning:se(this,ai,"f").createParameter(e.panning,F.bipolar(),E.panning,"Pan",.5)}};var Dy=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)},sc,Fn,lc,Ry,Sd=class{constructor(e,r){this.type="instrument",this.accepts="midi",this.manualUrl=ie.Playfield,sc.set(this,void 0),Fn.set(this,void 0),lc.set(this,void 0),Ry.set(this,void 0),Dy(this,sc,e,"f"),Dy(this,Fn,r,"f"),Dy(this,lc,Rt.create(r.samples,n=>e.boxAdapters.adapterFor(n,Ed),l.Sample),"f"),Dy(this,Ry,new oe(Sr(this,sc,"f")),"f")}reset(){Sr(this,lc,"f").adapters().forEach(e=>e.box.delete())}chop({file:e,startKey:r,slices:n}){let i=r+n.length-1;Sr(this,lc,"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)=>{Ea.create(Sr(this,sc,"f").boxGraph,B.generate(),c=>{c.file.refer(e),c.device.refer(Sr(this,Fn,"f").samples),c.index.setValue(r+s),c.sampleStart.setValue(a),c.sampleEnd.setValue(o),c.exclude.setValue(!0)})})}get box(){return Sr(this,Fn,"f")}get uuid(){return Sr(this,Fn,"f").address.uuid}get address(){return Sr(this,Fn,"f").address}get labelField(){return Sr(this,Fn,"f").label}get iconField(){return Sr(this,Fn,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return Sr(this,Fn,"f").enabled}get minimizedField(){return Sr(this,Fn,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return Sr(this,lc,"f")}get context(){return Sr(this,sc,"f")}deviceHost(){return Sr(this,sc,"f").boxAdapters.adapterFor(Sr(this,Fn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None};for(let e of Sr(this,lc,"f").adapters())yield{address:e.address,label:e.fileLabel,children:()=>b.wrap(e.labeledAudioOutputs())}}terminate(){Sr(this,Ry,"f").terminate()}};sc=new WeakMap,Fn=new WeakMap,lc=new WeakMap,Ry=new WeakMap;var R_=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)},C_,Im,En,Ga,gN,Cy=class{constructor(e,r){C_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.StereoTool,Im.set(this,void 0),En.set(this,void 0),Ga.set(this,void 0),R_(this,Im,e,"f"),R_(this,En,r,"f"),R_(this,Ga,new oe(wr(this,Im,"f")),"f"),this.namedParameter=wr(this,C_,"m",gN).call(this,r)}get box(){return wr(this,En,"f")}get uuid(){return wr(this,En,"f").address.uuid}get address(){return wr(this,En,"f").address}get indexField(){return wr(this,En,"f").index}get labelField(){return wr(this,En,"f").label}get enabledField(){return wr(this,En,"f").enabled}get minimizedField(){return wr(this,En,"f").minimized}get host(){return wr(this,En,"f").host}deviceHost(){return wr(this,Im,"f").boxAdapters.adapterFor(wr(this,En,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){wr(this,Ga,"f").terminate()}};Im=new WeakMap,En=new WeakMap,Ga=new WeakMap,C_=new WeakSet,gN=function(e){return{volume:wr(this,Ga,"f").createParameter(e.volume,F.decibel(-72,0,12),E.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:wr(this,Ga,"f").createParameter(e.panning,F.bipolar(),E.panning,"Panning",.5),stereo:wr(this,Ga,"f").createParameter(e.stereo,F.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"Stereo",.5),invertL:wr(this,Ga,"f").createParameter(e.invertL,F.bool,E.bool,"Invert Left"),invertR:wr(this,Ga,"f").createParameter(e.invertR,F.bool,E.bool,"Invert Right"),swap:wr(this,Ga,"f").createParameter(e.swap,F.bool,E.bool,"Swap")}};var zy=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)},z_,Tm,Pd,dr,Dm,cc,vN,Md=class{constructor(e,r){z_.add(this),this.class="device-host",Tm.set(this,new Y),Pd.set(this,void 0),dr.set(this,void 0),Dm.set(this,void 0),cc.set(this,void 0),zy(this,Pd,e,"f"),zy(this,dr,r,"f"),zy(this,Dm,st(this,Tm,"f").own(Rt.create(st(this,dr,"f").audioEffects,n=>st(this,Pd,"f").boxAdapters.adapterFor(n,ee.isAudioEffect),l.AudioEffectHost)),"f"),zy(this,cc,st(this,Tm,"f").own(new oe(st(this,Pd,"f"))),"f"),this.namedParameter=st(this,z_,"m",vN).call(this,r)}get box(){return st(this,dr,"f")}get uuid(){return st(this,dr,"f").address.uuid}get address(){return st(this,dr,"f").address}get indexField(){return st(this,dr,"f").index}get labelField(){return st(this,dr,"f").label}get minimizedField(){return st(this,dr,"f").minimized}get label(){return st(this,dr,"f").label.getValue()}get audioEffects(){return b.wrap(st(this,Dm,"f"))}get midiEffects(){return b.None}get audioEffectsField(){return b.wrap(st(this,dr,"f").audioEffects)}get midiEffectsField(){return b.None}get inputAdapter(){return b.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 st(this,Pd,"f").boxAdapters.adapterFor(st(this,dr,"f").composite.targetVertex.unwrap("composite.target").box,Ha)}deviceHost(){return this.compositeDevice().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.label,children:()=>b.None};for(let e of st(this,Dm,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){st(this,Tm,"f").terminate()}copyToIndex(e){cu.create(st(this,dr,"f").graph,B.generate(),r=>{r.composite.refer(st(this,dr,"f").composite.targetVertex.unwrap("composite.target")),r.index.setValue(e),r.label.setValue(st(this,dr,"f").label.getValue()),r.gain.setValue(st(this,dr,"f").gain.getValue()),r.pan.setValue(st(this,dr,"f").pan.getValue()),r.mute.setValue(st(this,dr,"f").mute.getValue()),r.solo.setValue(st(this,dr,"f").solo.getValue())})}};Tm=new WeakMap,Pd=new WeakMap,dr=new WeakMap,Dm=new WeakMap,cc=new WeakMap,z_=new WeakSet,vN=function(e){return{gain:st(this,cc,"f").createParameter(e.gain,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Gain"),pan:st(this,cc,"f").createParameter(e.pan,F.bipolar(),E.panning,"Pan",.5),mute:st(this,cc,"f").createParameter(e.mute,F.bool,E.bool,"Mute"),solo:st(this,cc,"f").createParameter(e.solo,F.bool,E.bool,"Solo")}};var Oy=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},Jt=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)},O_,Rm,Nd,_i,Vy,Cm,xN,Ha=class{constructor(e,r){O_.add(this),this.type="audio-effect",this.accepts="audio",Rm.set(this,new Y),Nd.set(this,void 0),_i.set(this,void 0),Vy.set(this,void 0),Cm.set(this,void 0),Oy(this,Nd,e,"f"),Oy(this,_i,r,"f"),Oy(this,Vy,Jt(this,Rm,"f").own(Rt.create(Jt(this,_i,"f").entries,n=>Jt(this,Nd,"f").boxAdapters.adapterFor(n,Md),l.AudioEffectCompositeCell)),"f"),Oy(this,Cm,Jt(this,Rm,"f").own(new oe(Jt(this,Nd,"f"))),"f"),this.namedParameter=Jt(this,O_,"m",xN).call(this,r)}get box(){return Jt(this,_i,"f")}get uuid(){return Jt(this,_i,"f").address.uuid}get address(){return Jt(this,_i,"f").address}get indexField(){return Jt(this,_i,"f").index}get labelField(){return Jt(this,_i,"f").label}get enabledField(){return Jt(this,_i,"f").enabled}get minimizedField(){return Jt(this,_i,"f").minimized}get host(){return Jt(this,_i,"f").host}get entries(){return Jt(this,Vy,"f")}get inputField(){return Jt(this,_i,"f").input}deviceHost(){return Jt(this,Nd,"f").boxAdapters.adapterFor(Jt(this,_i,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Jt(this,Rm,"f").terminate()}};Rm=new WeakMap,Nd=new WeakMap,_i=new WeakMap,Vy=new WeakMap,Cm=new WeakMap,O_=new WeakSet,xN=function(e){return{dry:Jt(this,Cm,"f").createParameter(e.dry,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Dry"),wet:Jt(this,Cm,"f").createParameter(e.wet,F.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"Wet")}};var Uy=class extends Ha{constructor(e,r){super(e,r)}get entriesFixed(){return!1}get manualUrl(){return ie.AudioEffectComposite}};var jy=class extends Ha{constructor(e,r){super(e,r)}get entriesFixed(){return!0}get manualUrl(){return ie.StereoComposite}};var MD=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},V_=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,U_=F.exponential(20,2e4),j_=E.numeric({unit:"Hz",fractionDigits:0}),zm=class extends Ha{constructor(e,r){super(e,r),$d.set(this,void 0),MD(this,$d,new oe(e),"f"),this.crossover=[V_(this,$d,"f").createParameter(r.crossover1,U_,j_,"Crossover 1"),V_(this,$d,"f").createParameter(r.crossover2,U_,j_,"Crossover 2"),V_(this,$d,"f").createParameter(r.crossover3,U_,j_,"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 ie.FrequencySplit}};$d=new WeakMap;zm.MAX_BANDS=4;var Om;(function(t){t.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(Om||(Om={}));var yN=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},Ai=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)},kd,Fi,Ky=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl=ie.Zeitgeist,kd.set(this,void 0),Fi.set(this,void 0),yN(this,kd,e,"f"),yN(this,Fi,r,"f"),this.groove()}get box(){return Ai(this,Fi,"f")}get uuid(){return Ai(this,Fi,"f").address.uuid}get address(){return Ai(this,Fi,"f").address}get indexField(){return Ai(this,Fi,"f").index}get labelField(){return Ai(this,Fi,"f").label}get enabledField(){return Ai(this,Fi,"f").enabled}get minimizedField(){return Ai(this,Fi,"f").minimized}get host(){return Ai(this,Fi,"f").host}deviceHost(){return Ai(this,kd,"f").boxAdapters.adapterFor(Ai(this,Fi,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}groove(){return Ai(this,kd,"f").boxAdapters.adapterFor(Ai(this,Fi,"f").groove.targetVertex.unwrap("no groove").box,Om.checkType)}catchupAndSubscribeGroove(e){return Ai(this,Fi,"f").groove.catchupAndSubscribe(r=>e(Ai(this,kd,"f").boxAdapters.adapterFor(r.targetVertex.unwrap("No groove found").box,Om.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};kd=new WeakMap,Fi=new WeakMap;var wN=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},oa=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)},Wy,Zi,Ly=class{constructor(e,r){this.type="audio-effect",this.accepts="audio",this.manualUrl="",Wy.set(this,void 0),Zi.set(this,void 0),wN(this,Wy,e,"f"),wN(this,Zi,r,"f")}get box(){return oa(this,Zi,"f")}get uuid(){return oa(this,Zi,"f").address.uuid}get address(){return oa(this,Zi,"f").address}get indexField(){return oa(this,Zi,"f").index}get labelField(){return oa(this,Zi,"f").label}get enabledField(){return oa(this,Zi,"f").enabled}get minimizedField(){return oa(this,Zi,"f").minimized}get host(){return oa(this,Zi,"f").host}get commentField(){return oa(this,Zi,"f").comment}deviceHost(){return oa(this,Wy,"f").boxAdapters.adapterFor(oa(this,Zi,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){}};Wy=new WeakMap,Zi=new WeakMap;var bN=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)},Zy,Gi,Gy=class{constructor(e,r){this.type="midi-effect",this.accepts="midi",this.manualUrl="",Zy.set(this,void 0),Gi.set(this,void 0),bN(this,Zy,e,"f"),bN(this,Gi,r,"f")}get box(){return sa(this,Gi,"f")}get uuid(){return sa(this,Gi,"f").address.uuid}get address(){return sa(this,Gi,"f").address}get indexField(){return sa(this,Gi,"f").index}get labelField(){return sa(this,Gi,"f").label}get enabledField(){return sa(this,Gi,"f").enabled}get minimizedField(){return sa(this,Gi,"f").minimized}get host(){return sa(this,Gi,"f").host}get commentField(){return sa(this,Gi,"f").comment}deviceHost(){return sa(this,Zy,"f").boxAdapters.adapterFor(sa(this,Gi,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Zy=new WeakMap,Gi=new WeakMap;var ks=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)},K_,W_,Vm,Ei,Hy,Bd,la,Sn,Id,_N,L_,qy=class{constructor(e,r){K_.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ie.Soundfont,W_.set(this,new Y),Vm.set(this,void 0),Ei.set(this,void 0),Hy.set(this,void 0),Bd.set(this,void 0),la.set(this,void 0),Sn.set(this,void 0),Id.set(this,pe.Empty),L_.set(this,n=>n.match({none:()=>{Ge(this,Sn,"f").clear(),Ge(this,la,"f").clear()},some:i=>i.soundfont.match({none:()=>{Ge(this,Sn,"f").clear(),Ge(this,la,"f").clear(),Ge(this,Id,"f").terminate(),ks(this,Id,i.subscribe(a=>{if(a.type==="loaded"){let o=i.soundfont.unwrap("soundfont");Ge(this,Sn,"f").wrap(o.presets[this.presetIndex]??o.presets[0]),Ge(this,la,"f").wrap(o)}else a.type==="error"?(Ge(this,Sn,"f").clear(),Ge(this,la,"f").clear()):a.type==="idle"&&(Ge(this,Sn,"f").clear(),Ge(this,la,"f").clear())}),"f")},some:a=>{Ge(this,la,"f").wrap(a),Ge(this,Sn,"f").wrap(a.presets[this.presetIndex]??a.presets[0])}})})),ks(this,Vm,e,"f"),ks(this,Ei,r,"f"),ks(this,Hy,new oe(Ge(this,Vm,"f")),"f"),this.namedParameter=Ge(this,K_,"m",_N).call(this,r),ks(this,Bd,new Nr,"f"),ks(this,la,new Nr,"f"),ks(this,Sn,new Nr,"f"),Ge(this,W_,"f").ownAll(Ge(this,Bd,"f").subscribe(Ge(this,L_,"f")),Ge(this,Ei,"f").file.catchupAndSubscribe(({targetVertex:n})=>Ge(this,Bd,"f").wrapOption(n.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),Ge(this,Ei,"f").presetIndex.catchupAndSubscribe(n=>Ge(this,la,"f").match({none:()=>Ge(this,Sn,"f").clear(),some:i=>Ge(this,Sn,"f").wrap(i.presets[n.getValue()]??i.presets[0])})))}get loader(){return Ge(this,Bd,"f")}get soundfont(){return Ge(this,la,"f")}get preset(){return Ge(this,Sn,"f")}get presetIndex(){return Ge(this,Ei,"f").presetIndex.getValue()}get box(){return Ge(this,Ei,"f")}get uuid(){return Ge(this,Ei,"f").address.uuid}get address(){return Ge(this,Ei,"f").address}get labelField(){return Ge(this,Ei,"f").label}get iconField(){return Ge(this,Ei,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return Ge(this,Ei,"f").enabled}get minimizedField(){return Ge(this,Ei,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ge(this,Vm,"f").boxAdapters.adapterFor(Ge(this,Ei,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Ge(this,Id,"f").terminate(),ks(this,Id,pe.Empty,"f"),Ge(this,Hy,"f").terminate()}};W_=new WeakMap,Vm=new WeakMap,Ei=new WeakMap,Hy=new WeakMap,Bd=new WeakMap,la=new WeakMap,Sn=new WeakMap,Id=new WeakMap,L_=new WeakMap,K_=new WeakSet,_N=function(e){return{}};var AN=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},Um=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)},Jy,uc,Yy=class{constructor(e,r){Jy.set(this,void 0),uc.set(this,void 0),AN(this,Jy,e,"f"),AN(this,uc,r,"f")}get box(){return Um(this,uc,"f")}get uuid(){return Um(this,uc,"f").address.uuid}get address(){return Um(this,uc,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return Um(this,Jy,"f").soundfontManager.getOrCreate(Um(this,uc,"f").address.uuid)}terminate(){}};Jy=new WeakMap,uc=new WeakMap;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},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)},G_,jm,Pn,Km,FN,Xy=class{constructor(e,r){G_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Maximizer,jm.set(this,void 0),Pn.set(this,void 0),Km.set(this,void 0),Z_(this,jm,e,"f"),Z_(this,Pn,r,"f"),Z_(this,Km,new oe(Si(this,jm,"f")),"f"),this.namedParameter=Si(this,G_,"m",FN).call(this,r)}get box(){return Si(this,Pn,"f")}get uuid(){return Si(this,Pn,"f").address.uuid}get address(){return Si(this,Pn,"f").address}get indexField(){return Si(this,Pn,"f").index}get labelField(){return Si(this,Pn,"f").label}get enabledField(){return Si(this,Pn,"f").enabled}get minimizedField(){return Si(this,Pn,"f").minimized}get host(){return Si(this,Pn,"f").host}deviceHost(){return Si(this,jm,"f").boxAdapters.adapterFor(Si(this,Pn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Si(this,Km,"f").terminate()}};jm=new WeakMap,Pn=new WeakMap,Km=new WeakMap,G_=new WeakSet,FN=function(e){return{threshold:Si(this,Km,"f").createParameter(e.threshold,F.linear(-24,0),E.decible,"Threshold")}};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},Ft=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)},q_,Wm,Hi,Jr,EN,Qy=class{constructor(e,r){q_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Compressor,Wm.set(this,void 0),Hi.set(this,void 0),Jr.set(this,void 0),H_(this,Wm,e,"f"),H_(this,Hi,r,"f"),H_(this,Jr,new oe(Ft(this,Wm,"f")),"f"),this.namedParameter=Ft(this,q_,"m",EN).call(this,r)}get box(){return Ft(this,Hi,"f")}get uuid(){return Ft(this,Hi,"f").address.uuid}get address(){return Ft(this,Hi,"f").address}get indexField(){return Ft(this,Hi,"f").index}get labelField(){return Ft(this,Hi,"f").label}get enabledField(){return Ft(this,Hi,"f").enabled}get minimizedField(){return Ft(this,Hi,"f").minimized}get host(){return Ft(this,Hi,"f").host}get sideChain(){return Ft(this,Hi,"f").sideChain}deviceHost(){return Ft(this,Wm,"f").boxAdapters.adapterFor(Ft(this,Hi,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Ft(this,Jr,"f").terminate()}};Wm=new WeakMap,Hi=new WeakMap,Jr=new WeakMap,q_=new WeakSet,EN=function(e){return{lookahead:Ft(this,Jr,"f").createParameter(e.lookahead,F.bool,E.bool,"Lookahead"),automakeup:Ft(this,Jr,"f").createParameter(e.automakeup,F.bool,E.bool,"Auto Makeup"),autoattack:Ft(this,Jr,"f").createParameter(e.autoattack,F.bool,E.bool,"Auto Attack"),autorelease:Ft(this,Jr,"f").createParameter(e.autorelease,F.bool,E.bool,"Auto Release"),inputgain:Ft(this,Jr,"f").createParameter(e.inputgain,F.linear(-30,30),E.decible,"Input Gain"),threshold:Ft(this,Jr,"f").createParameter(e.threshold,F.linear(-60,0),E.decible,"Threshold"),ratio:Ft(this,Jr,"f").createParameter(e.ratio,F.exponential(1,24),E.numeric({fractionDigits:1}),"Ratio"),knee:Ft(this,Jr,"f").createParameter(e.knee,F.linear(0,24),E.decible,"Knee"),attack:Ft(this,Jr,"f").createParameter(e.attack,F.linear(0,100),E.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:Ft(this,Jr,"f").createParameter(e.release,F.linear(5,1500),E.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:Ft(this,Jr,"f").createParameter(e.makeup,F.linear(-40,40),E.decible,"Makeup Gain"),mix:Ft(this,Jr,"f").createParameter(e.mix,F.unipolar(),E.percent(),"Dry/Wet")}};var J_=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},Yt=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_,Lm,qi,ca,SN,ew=class{constructor(e,r){Y_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Gate,Lm.set(this,void 0),qi.set(this,void 0),ca.set(this,void 0),J_(this,Lm,e,"f"),J_(this,qi,r,"f"),J_(this,ca,new oe(Yt(this,Lm,"f")),"f"),this.namedParameter=Yt(this,Y_,"m",SN).call(this,r)}get box(){return Yt(this,qi,"f")}get uuid(){return Yt(this,qi,"f").address.uuid}get address(){return Yt(this,qi,"f").address}get indexField(){return Yt(this,qi,"f").index}get labelField(){return Yt(this,qi,"f").label}get enabledField(){return Yt(this,qi,"f").enabled}get minimizedField(){return Yt(this,qi,"f").minimized}get host(){return Yt(this,qi,"f").host}get sideChain(){return Yt(this,qi,"f").sideChain}deviceHost(){return Yt(this,Lm,"f").boxAdapters.adapterFor(Yt(this,qi,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Yt(this,ca,"f").terminate()}};Lm=new WeakMap,qi=new WeakMap,ca=new WeakMap,Y_=new WeakSet,SN=function(e){return{inverse:Yt(this,ca,"f").createParameter(e.inverse,F.bool,E.bool,"Inverse"),threshold:Yt(this,ca,"f").createParameter(e.threshold,F.linear(-80,0),E.decible,"Threshold"),return:Yt(this,ca,"f").createParameter(e.return,F.linear(0,24),E.decible,"Return"),attack:Yt(this,ca,"f").createParameter(e.attack,F.linear(0,1e3),E.numeric({unit:"ms",fractionDigits:1}),"Attack"),hold:Yt(this,ca,"f").createParameter(e.hold,F.linear(0,500),E.numeric({unit:"ms",fractionDigits:1}),"Hold"),release:Yt(this,ca,"f").createParameter(e.release,F.linear(1,2e3),E.numeric({unit:"ms",fractionDigits:1}),"Release"),floor:Yt(this,ca,"f").createParameter(e.floor,F.decibel(-72,-12,0),E.decible,"Floor")}};var X_=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)},Q_,Zm,Mn,qa,PN,tw=class{constructor(e,r){Q_.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Autotune,Zm.set(this,void 0),Mn.set(this,void 0),qa.set(this,void 0),X_(this,Zm,e,"f"),X_(this,Mn,r,"f"),X_(this,qa,new oe(br(this,Zm,"f")),"f"),this.namedParameter=br(this,Q_,"m",PN).call(this,r)}get box(){return br(this,Mn,"f")}get uuid(){return br(this,Mn,"f").address.uuid}get address(){return br(this,Mn,"f").address}get indexField(){return br(this,Mn,"f").index}get labelField(){return br(this,Mn,"f").label}get enabledField(){return br(this,Mn,"f").enabled}get minimizedField(){return br(this,Mn,"f").minimized}get host(){return br(this,Mn,"f").host}deviceHost(){return br(this,Zm,"f").boxAdapters.adapterFor(br(this,Mn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){br(this,qa,"f").terminate()}};Zm=new WeakMap,Mn=new WeakMap,qa=new WeakMap,Q_=new WeakSet,PN=function(e){return{key:br(this,qa,"f").createParameter(e.key,F.linearInteger(0,11),E.indices("",["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"]),"Key"),scale:br(this,qa,"f").createParameter(e.scale,F.linearInteger(0,7),E.indices("",["Chrom","Major","Minor","MajPent","MinPent","Blues","Dorian","Mixo"]),"Scale"),amount:br(this,qa,"f").createParameter(e.amount,F.unipolar(),E.percent(),"Amount"),retune:br(this,qa,"f").createParameter(e.retune,F.unipolar(),E.percent(),"Retune"),smooth:br(this,qa,"f").createParameter(e.smooth,F.unipolar(),E.percent(),"Smooth"),shift:br(this,qa,"f").createParameter(e.shift,F.linear(-12,12),E.numeric({unit:"st"}),"Shift")}};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},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)},t1,Gm,Nn,Bs,MN,rw=class{constructor(e,r){t1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Crusher,Gm.set(this,void 0),Nn.set(this,void 0),Bs.set(this,void 0),e1(this,Gm,e,"f"),e1(this,Nn,r,"f"),e1(this,Bs,new oe(Rr(this,Gm,"f")),"f"),this.namedParameter=Rr(this,t1,"m",MN).call(this,r)}get box(){return Rr(this,Nn,"f")}get uuid(){return Rr(this,Nn,"f").address.uuid}get address(){return Rr(this,Nn,"f").address}get indexField(){return Rr(this,Nn,"f").index}get labelField(){return Rr(this,Nn,"f").label}get enabledField(){return Rr(this,Nn,"f").enabled}get minimizedField(){return Rr(this,Nn,"f").minimized}get host(){return Rr(this,Nn,"f").host}deviceHost(){return Rr(this,Gm,"f").boxAdapters.adapterFor(Rr(this,Nn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Rr(this,Bs,"f").terminate()}};Gm=new WeakMap,Nn=new WeakMap,Bs=new WeakMap,t1=new WeakSet,MN=function(e){return{crush:Rr(this,Bs,"f").createParameter(e.crush,F.unipolar(),E.percent(),"Crush"),bits:Rr(this,Bs,"f").createParameter(e.bits,F.linearInteger(1,16),E.numeric(),"Bits"),boost:Rr(this,Bs,"f").createParameter(e.boost,F.linear(0,24),E.decible,"Boost"),mix:Rr(this,Bs,"f").createParameter(e.mix,F.exponential(.001,1),E.percent(),"Mix")}};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},oi=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,Hm,$n,Td,NN,iw=class{constructor(e,r){i1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Fold,Hm.set(this,void 0),$n.set(this,void 0),Td.set(this,void 0),r1(this,Hm,e,"f"),r1(this,$n,r,"f"),r1(this,Td,new oe(oi(this,Hm,"f")),"f"),this.namedParameter=oi(this,i1,"m",NN).call(this,r)}get box(){return oi(this,$n,"f")}get uuid(){return oi(this,$n,"f").address.uuid}get address(){return oi(this,$n,"f").address}get indexField(){return oi(this,$n,"f").index}get labelField(){return oi(this,$n,"f").label}get enabledField(){return oi(this,$n,"f").enabled}get minimizedField(){return oi(this,$n,"f").minimized}get host(){return oi(this,$n,"f").host}deviceHost(){return oi(this,Hm,"f").boxAdapters.adapterFor(oi(this,$n,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){oi(this,Td,"f").terminate()}};Hm=new WeakMap,$n=new WeakMap,Td=new WeakMap,i1=new WeakSet,NN=function(e){return{drive:oi(this,Td,"f").createParameter(e.drive,F.linear(0,30),E.decible,"Drive"),volume:oi(this,Td,"f").createParameter(e.volume,F.linear(-18,0),E.decible,"Volume")}};var nw=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)},qm,Jm,kn,Dd,Rd,ND=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 pe.many(t.label.subscribe(()=>e(this)),t.controller.subscribe(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}},aw=class{constructor(e,r){qm.set(this,new Y),this.type="instrument",this.accepts="midi",this.manualUrl=ie.MIDIOutput,Jm.set(this,void 0),kn.set(this,void 0),Dd.set(this,void 0),Rd.set(this,void 0),nw(this,Jm,e,"f"),nw(this,kn,r,"f"),nw(this,Dd,new Nr,"f"),nw(this,Rd,pr(this,qm,"f").own(new oe(pr(this,Jm,"f"))),"f"),pr(this,qm,"f").ownAll(r.parameters.pointerHub.catchupAndSubscribe({onAdded:(({box:n})=>{let i=Re(n,cl);pr(this,Rd,"f").createParameter(i.value,F.unipolar(),E.percent({fractionDigits:1}),ND(i),0)}),onRemoved:(({box:n})=>pr(this,Rd,"f").removeParameter(Re(n,cl).value.address))}),pr(this,kn,"f").device.catchupAndSubscribe(({targetVertex:n})=>n.match({none:()=>pr(this,Dd,"f").clear(),some:({box:i})=>pr(this,Dd,"f").wrap(Re(i,Qo))})))}get box(){return pr(this,kn,"f")}get uuid(){return pr(this,kn,"f").address.uuid}get address(){return pr(this,kn,"f").address}get labelField(){return pr(this,kn,"f").label}get iconField(){return pr(this,kn,"f").icon}get defaultTrackType(){return ge.Notes}get enabledField(){return pr(this,kn,"f").enabled}get minimizedField(){return pr(this,kn,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return pr(this,Rd,"f")}get midiDevice(){return pr(this,Dd,"f")}deviceHost(){return pr(this,Jm,"f").boxAdapters.adapterFor(pr(this,kn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){pr(this,qm,"f").terminate()}};qm=new WeakMap,Jm=new WeakMap,kn=new WeakMap,Dd=new WeakMap,Rd=new WeakMap;var ow=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)},n1,Ym,Bn,Ja,Xm,$N,sw=class{constructor(e,r){n1.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=ie.Velocity,Ym.set(this,void 0),Bn.set(this,void 0),Ja.set(this,void 0),Xm.set(this,void 0),ow(this,Ym,e,"f"),ow(this,Bn,r,"f"),ow(this,Ja,new oe(Xt(this,Ym,"f")),"f"),ow(this,Xm,fg.create(),"f"),this.namedParameter=Xt(this,n1,"m",$N).call(this,r)}computeVelocity(e,r){let{magnetPosition:n,magnetStrength:i,randomSeed:a,randomAmount:o,offset:s,mix:c}=this.namedParameter;Xt(this,Xm,"f").setSeed(a.valueAt(e)+e);let u=r+(n.valueAt(e)-r)*i.valueAt(e),f=(Xt(this,Xm,"f").uniform()*2-1)*o.valueAt(e),v=s.valueAt(e),h=c.valueAt(e);return r*(1-h)+ag(u+f+v)*h}get box(){return Xt(this,Bn,"f")}get uuid(){return Xt(this,Bn,"f").address.uuid}get address(){return Xt(this,Bn,"f").address}get indexField(){return Xt(this,Bn,"f").index}get labelField(){return Xt(this,Bn,"f").label}get enabledField(){return Xt(this,Bn,"f").enabled}get minimizedField(){return Xt(this,Bn,"f").minimized}get host(){return Xt(this,Bn,"f").host}deviceHost(){return Xt(this,Ym,"f").boxAdapters.adapterFor(Xt(this,Bn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Xt(this,Ja,"f").terminate()}};Ym=new WeakMap,Bn=new WeakMap,Ja=new WeakMap,Xm=new WeakMap,n1=new WeakSet,$N=function(e){return{magnetPosition:Xt(this,Ja,"f").createParameter(e.magnetPosition,F.unipolar(),E.percent(),"Position"),magnetStrength:Xt(this,Ja,"f").createParameter(e.magnetStrength,F.unipolar(),E.percent(),"Strength"),randomSeed:Xt(this,Ja,"f").createParameter(e.randomSeed,F.linearInteger(0,65535),E.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:Xt(this,Ja,"f").createParameter(e.randomAmount,F.unipolar(),E.percent(),"Amount"),offset:Xt(this,Ja,"f").createParameter(e.offset,F.bipolar(),E.percent(),"Offset"),mix:Xt(this,Ja,"f").createParameter(e.mix,F.unipolar(),E.percent(),"Mix")}};var a1=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},_r=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)},o1,s1,Qm,In,Ya,kN,dc=class{constructor(e,r){o1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Tidal,Qm.set(this,void 0),In.set(this,void 0),Ya.set(this,void 0),a1(this,Qm,e,"f"),a1(this,In,r,"f"),a1(this,Ya,new oe(_r(this,Qm,"f")),"f"),this.namedParameter=_r(this,o1,"m",kN).call(this,r)}get box(){return _r(this,In,"f")}get uuid(){return _r(this,In,"f").address.uuid}get address(){return _r(this,In,"f").address}get indexField(){return _r(this,In,"f").index}get labelField(){return _r(this,In,"f").label}get enabledField(){return _r(this,In,"f").enabled}get minimizedField(){return _r(this,In,"f").minimized}get host(){return _r(this,In,"f").host}deviceHost(){return _r(this,Qm,"f").boxAdapters.adapterFor(_r(this,In,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){_r(this,Ya,"f").terminate()}};s1=dc,Qm=new WeakMap,In=new WeakMap,Ya=new WeakMap,o1=new WeakSet,kN=function(e){let{RateFractions:r,RateStringMapping:n}=s1;return{slope:_r(this,Ya,"f").createParameter(e.slope,F.bipolar(),E.percent({fractionDigits:1}),"Slope",.5),symmetry:_r(this,Ya,"f").createParameter(e.symmetry,F.unipolar(),E.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:_r(this,Ya,"f").createParameter(e.rate,F.values(r.map((i,a)=>a)),n,"Rate",0),depth:_r(this,Ya,"f").createParameter(e.depth,F.unipolar(),E.percent({fractionDigits:1}),"Depth",0),offset:_r(this,Ya,"f").createParameter(e.offset,F.linear(-180,180),E.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:_r(this,Ya,"f").createParameter(e.channelOffset,F.linear(-180,180),E.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};dc.RateFractions=Wo.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();dc.RateStringMapping=E.indices("",s1.RateFractions.map(([t,e])=>`${t}/${e}`));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},Et=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,eh,si,Pi,BN,lw=class{constructor(e,r){c1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Vocoder,eh.set(this,void 0),si.set(this,void 0),Pi.set(this,void 0),l1(this,eh,e,"f"),l1(this,si,r,"f"),l1(this,Pi,new oe(Et(this,eh,"f")),"f"),this.namedParameter=Et(this,c1,"m",BN).call(this,r)}get box(){return Et(this,si,"f")}get uuid(){return Et(this,si,"f").address.uuid}get address(){return Et(this,si,"f").address}get indexField(){return Et(this,si,"f").index}get labelField(){return Et(this,si,"f").label}get enabledField(){return Et(this,si,"f").enabled}get minimizedField(){return Et(this,si,"f").minimized}get host(){return Et(this,si,"f").host}get sideChain(){return Et(this,si,"f").sideChain}get modulatorSpectrum(){return Et(this,si,"f").address.append(4094)}get carrierSpectrum(){return Et(this,si,"f").address.append(4095)}deviceHost(){return Et(this,eh,"f").boxAdapters.adapterFor(Et(this,si,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Et(this,Pi,"f").terminate()}};eh=new WeakMap,si=new WeakMap,Pi=new WeakMap,c1=new WeakSet,BN=function(e){let r=F.exponential(20,2e4),n=E.numeric({unit:"Hz",fractionDigits:0}),i=F.exponential(1,60),a=E.numeric({fractionDigits:1});return{carrierMinFreq:Et(this,Pi,"f").createParameter(e.carrierMinFreq,r,n,"Carrier Min"),carrierMaxFreq:Et(this,Pi,"f").createParameter(e.carrierMaxFreq,r,n,"Carrier Max"),modulatorMinFreq:Et(this,Pi,"f").createParameter(e.modulatorMinFreq,r,n,"Mod Min"),modulatorMaxFreq:Et(this,Pi,"f").createParameter(e.modulatorMaxFreq,r,n,"Mod Max"),qStart:Et(this,Pi,"f").createParameter(e.qStart,i,a,"Q Start"),qEnd:Et(this,Pi,"f").createParameter(e.qEnd,i,a,"Q End"),envAttack:Et(this,Pi,"f").createParameter(e.envAttack,F.exponential(.1,100),E.numeric({unit:"ms",fractionDigits:1}),"Attack"),envRelease:Et(this,Pi,"f").createParameter(e.envRelease,F.exponential(1,1e3),E.numeric({unit:"ms",fractionDigits:0}),"Release"),gain:Et(this,Pi,"f").createParameter(e.gain,F.linear(-20,20),E.decible,"Gain"),mix:Et(this,Pi,"f").createParameter(e.mix,F.unipolar(),E.percent(),"Mix")}};var u1=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)},d1,th,Tn,Yr,IN,cw=class{constructor(e,r){d1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.DattorroReverb,th.set(this,void 0),Tn.set(this,void 0),Yr.set(this,void 0),u1(this,th,e,"f"),u1(this,Tn,r,"f"),u1(this,Yr,new oe($t(this,th,"f")),"f"),this.namedParameter=$t(this,d1,"m",IN).call(this,r)}get box(){return $t(this,Tn,"f")}get uuid(){return $t(this,Tn,"f").address.uuid}get address(){return $t(this,Tn,"f").address}get indexField(){return $t(this,Tn,"f").index}get labelField(){return $t(this,Tn,"f").label}get enabledField(){return $t(this,Tn,"f").enabled}get minimizedField(){return $t(this,Tn,"f").minimized}get host(){return $t(this,Tn,"f").host}deviceHost(){return $t(this,th,"f").boxAdapters.adapterFor($t(this,Tn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){$t(this,Yr,"f").terminate()}};th=new WeakMap,Tn=new WeakMap,Yr=new WeakMap,d1=new WeakSet,IN=function(e){return{preDelay:$t(this,Yr,"f").createParameter(e.preDelay,F.linear(0,1e3),E.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:$t(this,Yr,"f").createParameter(e.bandwidth,F.unipolar(),E.percent(),"Bandwidth"),inputDiffusion1:$t(this,Yr,"f").createParameter(e.inputDiffusion1,F.unipolar(),E.percent(),"Tank 1"),inputDiffusion2:$t(this,Yr,"f").createParameter(e.inputDiffusion2,F.unipolar(),E.percent(),"Tank 2"),decay:$t(this,Yr,"f").createParameter(e.decay,F.unipolar(),E.percent(),"Decay"),decayDiffusion1:$t(this,Yr,"f").createParameter(e.decayDiffusion1,F.unipolar(),E.percent(),"Tank 1"),decayDiffusion2:$t(this,Yr,"f").createParameter(e.decayDiffusion2,F.unipolar(),E.percent(),"Tank 2"),damping:$t(this,Yr,"f").createParameter(e.damping,F.unipolar(),E.percent(),"Damping"),excursionRate:$t(this,Yr,"f").createParameter(e.excursionRate,F.unipolar(),E.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:$t(this,Yr,"f").createParameter(e.excursionDepth,F.unipolar(),E.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:$t(this,Yr,"f").createParameter(e.wet,F.DefaultDecibel,E.decible,"Wet"),dry:$t(this,Yr,"f").createParameter(e.dry,F.DefaultDecibel,E.decible,"Dry")}};var TN=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},Cd=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,Do,zd=class{constructor(e,r){p1.set(this,void 0),Do.set(this,void 0),TN(this,p1,e,"f"),TN(this,Do,r,"f")}get box(){return Cd(this,Do,"f")}get uuid(){return Cd(this,Do,"f").address.uuid}get address(){return Cd(this,Do,"f").address}get labelField(){return Cd(this,Do,"f").label}get modelField(){return Cd(this,Do,"f").model}getModelJson(){return Cd(this,Do,"f").model.getValue()}terminate(){}};p1=new WeakMap,Do=new WeakMap;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},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)},m1,Od,Cr,pc,DN,uw=class{constructor(e,r){m1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.NeuralAmp,Od.set(this,void 0),Cr.set(this,void 0),pc.set(this,void 0),f1(this,Od,e,"f"),f1(this,Cr,r,"f"),f1(this,pc,new oe(Kt(this,Od,"f")),"f"),this.namedParameter=Kt(this,m1,"m",DN).call(this,r)}get box(){return Kt(this,Cr,"f")}get uuid(){return Kt(this,Cr,"f").address.uuid}get address(){return Kt(this,Cr,"f").address}get indexField(){return Kt(this,Cr,"f").index}get labelField(){return Kt(this,Cr,"f").label}get enabledField(){return Kt(this,Cr,"f").enabled}get minimizedField(){return Kt(this,Cr,"f").minimized}get host(){return Kt(this,Cr,"f").host}get modelField(){return Kt(this,Cr,"f").model}get monoField(){return Kt(this,Cr,"f").mono}get spectrum(){return Kt(this,Cr,"f").address.append(4095)}getModelAdapter(){let e=Kt(this,Cr,"f").model.targetVertex;return e.isEmpty()?b.None:b.wrap(Kt(this,Od,"f").boxAdapters.adapterFor(e.unwrap().box,zd))}getModelJson(){let e=this.getModelAdapter();return e.nonEmpty()?e.unwrap().getModelJson():Kt(this,Cr,"f").modelJson.getValue()}deviceHost(){return Kt(this,Od,"f").boxAdapters.adapterFor(Kt(this,Cr,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Kt(this,pc,"f").terminate()}};Od=new WeakMap,Cr=new WeakMap,pc=new WeakMap,m1=new WeakSet,DN=function(e){return{inputGain:Kt(this,pc,"f").createParameter(e.inputGain,F.decibel(-72,0,12),E.numeric({unit:"dB",fractionDigits:1}),"Input"),outputGain:Kt(this,pc,"f").createParameter(e.outputGain,F.decibel(-72,0,12),E.numeric({unit:"dB",fractionDigits:1}),"Output"),mix:Kt(this,pc,"f").createParameter(e.mix,F.linear(0,1),E.percent(),"Mix")}};var h1=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},Xr=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)},g1,rh,Dn,fc,RN,dw=class{constructor(e,r){g1.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Waveshaper,rh.set(this,void 0),Dn.set(this,void 0),fc.set(this,void 0),h1(this,rh,e,"f"),h1(this,Dn,r,"f"),h1(this,fc,new oe(Xr(this,rh,"f")),"f"),this.namedParameter=Xr(this,g1,"m",RN).call(this,r)}get box(){return Xr(this,Dn,"f")}get uuid(){return Xr(this,Dn,"f").address.uuid}get address(){return Xr(this,Dn,"f").address}get indexField(){return Xr(this,Dn,"f").index}get labelField(){return Xr(this,Dn,"f").label}get enabledField(){return Xr(this,Dn,"f").enabled}get minimizedField(){return Xr(this,Dn,"f").minimized}get host(){return Xr(this,Dn,"f").host}deviceHost(){return Xr(this,rh,"f").boxAdapters.adapterFor(Xr(this,Dn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){Xr(this,fc,"f").terminate()}};rh=new WeakMap,Dn=new WeakMap,fc=new WeakMap,g1=new WeakSet,RN=function(e){return{inputGain:Xr(this,fc,"f").createParameter(e.inputGain,F.linear(0,40),E.decible,"Input"),outputGain:Xr(this,fc,"f").createParameter(e.outputGain,F.linear(-24,24),E.decible,"Output"),mix:Xr(this,fc,"f").createParameter(e.mix,F.unipolar(),E.percent(),"Mix")}};var pw=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)},ih,nh,Rn,ah,fw,mw=class{constructor(e,r){ih.set(this,new Y),this.type="audio-effect",this.accepts="audio",this.manualUrl=ie.Werkstatt,nh.set(this,void 0),Rn.set(this,void 0),ah.set(this,void 0),fw.set(this,void 0),pw(this,nh,e,"f"),pw(this,Rn,r,"f"),pw(this,ah,zr(this,ih,"f").own(new oe(zr(this,nh,"f"))),"f");let{terminable:n,codeChanged:i}=xr.subscribeScriptParams(zr(this,ah,"f"),r.code,r.parameters);zr(this,ih,"f").own(n),pw(this,fw,i,"f")}get box(){return zr(this,Rn,"f")}get uuid(){return zr(this,Rn,"f").address.uuid}get address(){return zr(this,Rn,"f").address}get indexField(){return zr(this,Rn,"f").index}get labelField(){return zr(this,Rn,"f").label}get enabledField(){return zr(this,Rn,"f").enabled}get minimizedField(){return zr(this,Rn,"f").minimized}get host(){return zr(this,Rn,"f").host}get parameters(){return zr(this,ah,"f")}get codeChanged(){return zr(this,fw,"f")}deviceHost(){return zr(this,nh,"f").boxAdapters.adapterFor(zr(this,Rn,"f").host.targetVertex.unwrap("no device-host").box,ee.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>b.None}}terminate(){zr(this,ih,"f").terminate()}};ih=new WeakMap,nh=new WeakMap,Rn=new WeakMap,ah=new WeakMap,fw=new WeakMap;var ce=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,le,kD,BD,ID,TD;le=new WeakMap,kD=new WeakMap,BD=new WeakMap,ID=new WeakMap,$D=new WeakSet,TD=function(e){return Ke(e.accept({visitArpeggioDeviceBox:r=>new ic(ce(this,le,"f"),r),visitAudioBusBox:r=>new Di(ce(this,le,"f"),r),visitAudioClipBox:r=>new Fu(ce(this,le,"f"),r),visitAudioFileBox:r=>new Zn(ce(this,le,"f"),r),visitAudioTimeStretchBox:r=>new ka(ce(this,le,"f"),r),visitAudioPitchStretchBox:r=>new $a(ce(this,le,"f"),r),visitAudioSignalsmithBox:r=>new Ba(ce(this,le,"f"),r),visitTransientMarkerBox:r=>new mu(r),visitWarpMarkerBox:r=>new Ma(ce(this,le,"f"),r),visitApparatDeviceBox:r=>new $y(ce(this,le,"f"),r),visitCubedDeviceBox:r=>new ky(ce(this,le,"f"),r),visitAudioRegionBox:r=>new Vu(ce(this,le,"f"),r),visitAudioUnitBox:r=>new fn(ce(this,le,"f"),r),visitAuxSendBox:r=>new Qu(ce(this,le,"f"),r),visitMaximizerDeviceBox:r=>new Xy(ce(this,le,"f"),r),visitCompressorDeviceBox:r=>new Qy(ce(this,le,"f"),r),visitGateDeviceBox:r=>new ew(ce(this,le,"f"),r),visitAutotuneDeviceBox:r=>new tw(ce(this,le,"f"),r),visitCrusherDeviceBox:r=>new rw(ce(this,le,"f"),r),visitDattorroReverbDeviceBox:r=>new cw(ce(this,le,"f"),r),visitDelayDeviceBox:r=>new ea(ce(this,le,"f"),r),visitDeviceInterfaceKnobBox:r=>new pd(ce(this,le,"f"),r),visitTidalDeviceBox:r=>new dc(ce(this,le,"f"),r),visitFoldDeviceBox:r=>new iw(ce(this,le,"f"),r),visitGrooveShuffleBox:r=>new Ka(ce(this,le,"f"),r),visitMarkerBox:r=>new xs(ce(this,le,"f"),r),visitSignatureEventBox:r=>new Ll(ce(this,le,"f"),r),visitMIDIOutputDeviceBox:r=>new aw(ce(this,le,"f"),r),visitModularAudioInputBox:r=>new ud(ce(this,le,"f"),r),visitModularAudioOutputBox:r=>new sd(ce(this,le,"f"),r),visitModularBox:r=>new As(ce(this,le,"f"),r),visitModularDeviceBox:r=>new md(ce(this,le,"f"),r),visitModuleConnectionBox:r=>new _s(ce(this,le,"f"),r),visitModuleDelayBox:r=>new od(ce(this,le,"f"),r),visitModuleGainBox:r=>new ld(ce(this,le,"f"),r),visitModuleMultiplierBox:r=>new cd(ce(this,le,"f"),r),visitNeonDeviceBox:r=>new By(ce(this,le,"f"),r),visitNanoDeviceBox:r=>new Iy(ce(this,le,"f"),r),visitNeuralAmpDeviceBox:r=>new uw(ce(this,le,"f"),r),visitNeuralAmpModelBox:r=>new zd(ce(this,le,"f"),r),visitNoteClipBox:r=>new Mu(ce(this,le,"f"),r),visitNoteEventBox:r=>new El(ce(this,le,"f"),r),visitNoteEventCollectionBox:r=>new ln(ce(this,le,"f"),r),visitNoteRegionBox:r=>new ju(ce(this,le,"f"),r),visitPitchDeviceBox:r=>new Fy(ce(this,le,"f"),r),visitPlayfieldDeviceBox:r=>new Sd(ce(this,le,"f"),r),visitPlayfieldSampleBox:r=>new Ed(ce(this,le,"f"),r),visitAudioEffectCompositeBox:r=>new Uy(ce(this,le,"f"),r),visitAudioEffectCompositeCellBox:r=>new Md(ce(this,le,"f"),r),visitStereoCompositeBox:r=>new jy(ce(this,le,"f"),r),visitFrequencySplitBox:r=>new zm(ce(this,le,"f"),r),visitRevampDeviceBox:r=>new Rx(ce(this,le,"f"),r),visitReverbDeviceBox:r=>new Dx(ce(this,le,"f"),r),visitRootBox:r=>new wy(ce(this,le,"f"),r),visitSoundfontDeviceBox:r=>new qy(ce(this,le,"f"),r),visitSoundfontFileBox:r=>new Yy(ce(this,le,"f"),r),visitSpielwerkDeviceBox:r=>new Py(ce(this,le,"f"),r),visitStereoToolDeviceBox:r=>new Cy(ce(this,le,"f"),r),visitTapeDeviceBox:r=>new by(ce(this,le,"f"),r),visitTimelineBox:r=>new Ua(ce(this,le,"f"),r),visitTrackBox:r=>new or(ce(this,le,"f"),r),visitUnknownAudioEffectDeviceBox:r=>new Ly(ce(this,le,"f"),r),visitUnknownMidiEffectDeviceBox:r=>new Gy(ce(this,le,"f"),r),visitValueClipBox:r=>new as(ce(this,le,"f"),r),visitValueEventBox:r=>new vo(ce(this,le,"f"),r),visitValueEventCollectionBox:r=>new kr(ce(this,le,"f"),r),visitValueRegionBox:r=>new Fo(ce(this,le,"f"),r),visitVaporisateurDeviceBox:r=>new _y(ce(this,le,"f"),r),visitVocoderDeviceBox:r=>new lw(ce(this,le,"f"),r),visitWaveshaperDeviceBox:r=>new dw(ce(this,le,"f"),r),visitWerkstattDeviceBox:r=>new mw(ce(this,le,"f"),r),visitVelocityDeviceBox:r=>new sw(ce(this,le,"f"),r),visitZeitgeistDeviceBox:r=>new Ky(ce(this,le,"f"),r)}),`Could not find factory for ${e}`)};var Xa;(function(t){t.PEAKS=Ce.compose(B.Lowest).append(0),t.SPECTRUM=Ce.compose(B.Lowest).append(1),t.WAVEFORM=Ce.compose(B.Lowest).append(2),t.STEREO=Ce.compose(B.Lowest).append(3),t.GONIO=Ce.compose(B.Lowest).append(4),t.LOUDNESS=Ce.compose(B.Lowest).append(5),t.HEAP=Ce.compose(B.Lowest).append(6)})(Xa||(Xa={}));var CN;(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)))}})(CN||(CN={}));var hw=512,zN=ki.createBuilder({position:ki.float,bpm:ki.float,playbackTimestamp:ki.float,countInBeatsRemaining:ki.float,isPlaying:ki.bool,isCountingIn:ki.bool,isRecording:ki.bool,perfIndex:ki.int32,perfBuffer:ki.floats(hw)});var ON;(function(t){t.store=(e,r,n)=>{if(n==="")return j("MetaData.store: origin must be unique to your app.");let i=e.pointerHub.filter(l.MetaData).map(({box:o})=>o).find(o=>o instanceof jn&&o.origin.getValue()===n),a=o=>{o.target.refer(e),o.origin.setValue(n),o.value.setValue(JSON.stringify(r))};T0(i)?a(i):jn.create(e.graph,B.generate(),a)},t.read=(e,r)=>{if(r==="")return j("MetaData.read: origin must be unique to your app.");let n=e.pointerHub.filter(l.MetaData).map(({box:i})=>i).find(i=>i instanceof jn&&i.origin.getValue()===r);if(T0(n)){let{status:i,value:a,error:o}=Lt(()=>JSON.parse(n.value.getValue()));if(i==="success")return a;console.warn(o)}return null},t.clear=(e,r)=>{if(r==="")return j("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(l.MetaData).map(({box:n})=>n).filter(n=>n instanceof jn&&n.origin.getValue()===r).forEach(n=>n.delete())},t.catchupAndSubscribe=(e,r,n)=>{if(r==="")return j("MetaData.catchupAndSubscribe: origin must be unique to your app.");let i=B.newSet(s=>s.uuid),a=s=>{let{status:c,value:u,error:f}=Lt(()=>JSON.parse(s.value.getValue()));c==="success"?n(b.wrap(u)):(console.warn(f),n(b.None))},o=e.pointerHub.catchupAndSubscribe({onAdded:({box:s})=>{if(!(s instanceof jn)||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 jn)||s.origin.getValue()!==r)return;i.removeByKey(s.address.uuid).subscription.terminate(),n(b.None)}},l.MetaData);return{terminate:()=>{o.terminate(),i.forEach(({subscription:s})=>s.terminate()),i.clear()}}}})(ON||(ON={}));var DD,RD,CD,zD;DD=new WeakMap,RD=new WeakMap,CD=new WeakMap,zD=new WeakMap;var Is;(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)=>{en(r)||(t.isNoteOn(r)?N(n.noteOn,t.readPitch(r),t.readVelocity(r)):t.isNoteOff(r)?N(n.noteOff,t.readPitch(r)):t.isPitchWheel(r)?N(n.pitchBend,t.asPitchBend(r)):t.isController(r)?N(n.controller,t.readParam1(r),t.readParam2(r)/127):t.isClock(r)?N(n.clock):t.isStart(r)?N(n.start):t.isContinue(r)?N(n.continue):t.isStop(r)?N(n.stop):t.isPosition(r)&&N(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"})(Is||(Is={}));var Ro;(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(Is.isNoteOn(n)){let i=Is.readPitch(n),a=Is.readVelocity(n);return{type:"note-on",uuid:r,pitch:i,velocity:a}}else if(Is.isNoteOff(n)){let i=Is.readPitch(n);return{type:"note-off",uuid:r,pitch:i}}return j("Unknown MIDI event")}})(Ro||(Ro={}));var VN;(function(t){t.start=(e,r,n,i=1)=>{let a=!0;return e(Ro.on(r,n,i)),{terminate:()=>{a&&(e(Ro.off(r,n)),a=!1)}}}})(VN||(VN={}));var UN=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)},OD,VD,jN,KN,UD,jD;VD=new WeakMap,jN=new WeakMap,KN=new WeakMap,UD=new WeakMap,OD=new WeakSet,jD=function(e,r){return e.subscribeIntegers(r,n=>{UN(this,jN,"f").replace(n.buffer)&&UN(this,KN,"f").notify(this)})};var KD,WD,LD,ZD,GD,HD;KD=new WeakMap,WD=new WeakMap,LD=new WeakMap,ZD=new WeakMap,GD=new WeakMap,HD=new WeakMap;var ua={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})??j("Could not cast to AnyRegionBox"),isLoopableRegionBox:t=>t.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var gw={min:30,max:1e3,default:120};var vw;(function(t){t.isTimeSignatureValid=(e,r)=>!Number.isInteger(e)||e<1||e>31?Pr.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(r)||r<1||r>32||(r&r-1)!==0?Pr.err("Denominator must be a power of two between 1 and 32"):Pr.ok([e,r]),t.clampBpm=e=>Number.isFinite(e)?Fe(e,gw.min,gw.max):gw.default,t.clampBaseFrequency=e=>Number.isFinite(e)?Fe(e,Bx.min,Bx.max):Bx.default,t.hasOverlappingRegions=e=>e.boxes().some(r=>r.accept({visitTrackBox:n=>{for(let[i,a]of de.iterateAdjacent(n.regions.pointerHub.incoming().map(({box:o})=>ua.asRegionBox(o)).sort(({position:o},{position:s})=>o.getValue()-s.getValue()))){if(i instanceof Xo&&i.timeBase.getValue()===ti.Seconds)return!1;if(i.position.getValue()+i.duration.getValue()>a.position.getValue())return!0}return!1}})??!1)})(vw||(vw={}));var WN;(function(t){t.parseTimeSignature=e=>{let[r,n]=e.split("/"),i=parseInt(r,10),a=parseInt(n,10);return vw.isTimeSignatureValid(i,a)}})(WN||(WN={}));var LN;(function(t){t.reader=(e,r)=>{let n=`
4
4
  onmessage = (event) => {
5
5
  const {sab, numChunks, numberOfChannels, bufferSize} = event.data
6
6
  const pointers = new Int32Array(sab, 0, 2)
@@ -110,10 +110,10 @@ var dD=Object.defineProperty;var no=(t,e)=>{for(var r in e)dD(t,r,{get:e[r],enum
110
110
 
111
111
  `)}y.write("payload.value = newResult;"),y.write("return payload;");let O=y.compile();return(J,te)=>O(h,J,te)},a,o=wc,s=!yc.jitless,u=s&&k1.value,f=e.catchall,v;t._zod.parse=(h,y)=>{v??(v=n.value);let _=h.value;return o(_)?s&&u&&y?.async===!1&&y.jitless!==!0?(a||(a=i(e.shape)),h=a(h,y),f?W$([],_,h,y,v,t):h):r(h,y):(h.issues.push({expected:"object",code:"invalid_type",input:_,inst:t}),h)}});function M$(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=>!Os(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=>ci(o,n,Wt())))}),e)}var _h=R("$ZodUnion",(t,e)=>{Be.init(t,e),He(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),He(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),He(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),He(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=>dh(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=>M$(s,n,t,i)):M$(o,n,t,i)}});function N$(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=>ci(o,n,Wt())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:!1}),e)}var bF=R("$ZodXor",(t,e)=>{_h.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=>N$(s,n,t,i)):N$(o,n,t,i)}}),_F=R("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,_h.init(t,e);let r=t._zod.parse;He(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=Ud(()=>{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(!wc(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)}}),AF=R("$ZodIntersection",(t,e)=>{Be.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])=>$$(r,c,u)):$$(r,a,o)}});function RA(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=RA(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=RA(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 $$(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}),Os(t))return t;let o=RA(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 Ww=R("$ZodTuple",(t,e)=>{Be.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=k$(r,"optin"),c=k$(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(h=>{u[f]=h})):u[f]=v}if(e.rest){let f=r.length-1,v=a.slice(r.length);for(let h of v){f++;let y=e.rest._zod.run({value:h,issues:[]},i);y instanceof Promise?o.push(y.then(_=>B$(_,n,f))):B$(y,n,f)}}return o.length?Promise.all(o).then(()=>I$(u,n,r,a,c)):I$(u,n,r,a,c)}});function k$(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]._zod[e]!=="optional")return r+1;return 0}function B$(t,e,r){t.issues.length&&e.issues.push(...Mi(r,t.issues)),e.value[r]=t.value}function I$(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(...Mi(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 FF=R("$ZodRecord",(t,e)=>{Be.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(y=>ci(y,n,Wt())),input:u,path:[u],inst:t});continue}let v=f.value,h=e.valueType._zod.run({value:i[u],issues:[]},n);h instanceof Promise?a.push(h.then(y=>{y.issues.length&&r.issues.push(...Mi(u,y.issues)),r.value[v]=y.value})):(h.issues.length&&r.issues.push(...Mi(u,h.issues)),r.value[v]=h.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"&&Dw.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=>ci(v,n,Wt())),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(...Mi(s,v.issues)),r.value[c.value]=v.value})):(f.issues.length&&r.issues.push(...Mi(s,f.issues)),r.value[c.value]=f.value)}}return a.length?Promise.all(a).then(()=>r):r}}),EF=R("$ZodMap",(t,e)=>{Be.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])=>{T$(f,v,r,o,i,t,n)})):T$(c,u,r,o,i,t,n)}return a.length?Promise.all(a).then(()=>r):r}});function T$(t,e,r,n,i,a,o){t.issues.length&&(ph.has(typeof n)?r.issues.push(...Mi(n,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:a,issues:t.issues.map(s=>ci(s,o,Wt()))})),e.issues.length&&(ph.has(typeof n)?r.issues.push(...Mi(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:a,key:n,issues:e.issues.map(s=>ci(s,o,Wt()))})),r.value.set(t.value,e.value)}var SF=R("$ZodSet",(t,e)=>{Be.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=>D$(c,r))):D$(s,r)}return a.length?Promise.all(a).then(()=>r):r}});function D$(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var PF=R("$ZodEnum",(t,e)=>{Be.init(t,e);let r=uh(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>ph.has(typeof i)).map(i=>typeof i=="string"?Cn(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}}),MF=R("$ZodLiteral",(t,e)=>{if(Be.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"?Cn(n):n?Cn(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}}),NF=R("$ZodFile",(t,e)=>{Be.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}}),$F=R("$ZodTransform",(t,e)=>{Be.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ds(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 da;return r.value=i,r.fallback=!0,r}});function R$(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var Lw=R("$ZodOptional",(t,e)=>{Be.init(t,e),t._zod.optin="optional",t._zod.optout="optional",He(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),He(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${dh(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=>R$(o,i)):R$(a,i)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),kF=R("$ZodExactOptional",(t,e)=>{Lw.init(t,e),He(t._zod,"values",()=>e.innerType._zod.values),He(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),BF=R("$ZodNullable",(t,e)=>{Be.init(t,e),He(t._zod,"optin",()=>e.innerType._zod.optin),He(t._zod,"optout",()=>e.innerType._zod.optout),He(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${dh(r.source)}|null)$`):void 0}),He(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)}),IF=R("$ZodDefault",(t,e)=>{Be.init(t,e),t._zod.optin="optional",He(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=>C$(a,e)):C$(i,e)}});function C$(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var TF=R("$ZodPrefault",(t,e)=>{Be.init(t,e),t._zod.optin="optional",He(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))}),DF=R("$ZodNonOptional",(t,e)=>{Be.init(t,e),He(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=>z$(a,t)):z$(i,t)}});function z$(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 RF=R("$ZodSuccess",(t,e)=>{Be.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ds("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)}}),CF=R("$ZodCatch",(t,e)=>{Be.init(t,e),t._zod.optin="optional",He(t._zod,"optout",()=>e.innerType._zod.optout),He(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=>ci(o,n,Wt()))},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=>ci(a,n,Wt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),zF=R("$ZodNaN",(t,e)=>{Be.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)}),Zw=R("$ZodPipe",(t,e)=>{Be.init(t,e),He(t._zod,"values",()=>e.in._zod.values),He(t._zod,"optin",()=>e.in._zod.optin),He(t._zod,"optout",()=>e.out._zod.optout),He(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=>zw(o,e.in,n)):zw(a,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(a=>zw(a,e.out,n)):zw(i,e.out,n)}});function zw(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 Ah=R("$ZodCodec",(t,e)=>{Be.init(t,e),He(t._zod,"values",()=>e.in._zod.values),He(t._zod,"optin",()=>e.in._zod.optin),He(t._zod,"optout",()=>e.out._zod.optout),He(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=>Ow(o,e,n)):Ow(a,e,n)}else{let a=e.out._zod.run(r,n);return a instanceof Promise?a.then(o=>Ow(o,e,n)):Ow(a,e,n)}}});function Ow(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=>Vw(t,a,e.out,r)):Vw(t,i,e.out,r)}else{let i=e.reverseTransform(t.value,t);return i instanceof Promise?i.then(a=>Vw(t,a,e.in,r)):Vw(t,i,e.in,r)}}function Vw(t,e,r,n){return t.issues.length?(t.aborted=!0,t):r._zod.run({value:e,issues:t.issues},n)}var OF=R("$ZodPreprocess",(t,e)=>{Zw.init(t,e)}),VF=R("$ZodReadonly",(t,e)=>{Be.init(t,e),He(t._zod,"propValues",()=>e.innerType._zod.propValues),He(t._zod,"values",()=>e.innerType._zod.values),He(t._zod,"optin",()=>e.innerType?._zod?.optin),He(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(O$):O$(i)}});function O$(t){return t.value=Object.freeze(t.value),t}var UF=R("$ZodTemplateLiteral",(t,e)=>{Be.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||I1.has(typeof n))r.push(Cn(`${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)}),jF=R("$ZodFunction",(t,e)=>(Be.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?Fw(t._def.input,n):n,a=Reflect.apply(r,this,i);return t._def.output?Fw(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 Ew(t._def.input,n):n,a=await Reflect.apply(r,this,i);return t._def.output?await Ew(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 Ww({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)),KF=R("$ZodPromise",(t,e)=>{Be.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(i=>e.innerType._zod.run({value:i,issues:[]},n))}),WF=R("$ZodLazy",(t,e)=>{Be.init(t,e),He(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),He(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),He(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),He(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),He(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),LF=R("$ZodCustom",(t,e)=>{ht.init(t,e),Be.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=>V$(a,r,n,t));V$(i,r,n,t)}});function V$(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(jd(i))}}var Eh={};no(Eh,{ar:()=>Z$,az:()=>G$,be:()=>q$,bg:()=>J$,ca:()=>Y$,cs:()=>X$,da:()=>Q$,de:()=>ek,el:()=>tk,en:()=>Gw,eo:()=>rk,es:()=>ik,fa:()=>nk,fi:()=>ak,fr:()=>ok,frCA:()=>sk,he:()=>lk,hr:()=>ck,hu:()=>uk,hy:()=>pk,id:()=>fk,is:()=>mk,it:()=>hk,ja:()=>gk,ka:()=>vk,kh:()=>xk,km:()=>Hw,ko:()=>yk,lt:()=>bk,mk:()=>_k,ms:()=>Ak,nl:()=>Fk,no:()=>Ek,ota:()=>Sk,pl:()=>Mk,ps:()=>Pk,pt:()=>Nk,ro:()=>$k,ru:()=>Bk,sl:()=>Ik,sv:()=>Tk,ta:()=>Dk,th:()=>Rk,tr:()=>Ck,ua:()=>zk,uk:()=>qw,ur:()=>Ok,uz:()=>Vk,vi:()=>Uk,yo:()=>Wk,zhCN:()=>jk,zhTW:()=>Kk});var TR=()=>{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=G(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 ${Z(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: ${U(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":""}: ${U(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 Z$(){return{localeError:TR()}}var DR=()=>{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=G(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 ${Z(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${U(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":""}: ${U(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 G$(){return{localeError:DR()}}function H$(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 RR=()=>{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=G(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 ${Z(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 ${U(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);if(o){let s=Number(i.maximum),c=H$(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=H$(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"}: ${U(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 q$(){return{localeError:RR()}}var CR=()=>{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=G(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 ${Z(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 ${U(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":""}: ${U(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 J$(){return{localeError:CR()}}var zR=()=>{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=G(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 ${Z(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${U(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":""}: ${U(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 Y$(){return{localeError:zR()}}var OR=()=>{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=G(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 ${Z(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${U(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: ${U(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 X$(){return{localeError:OR()}}var VR=()=>{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=G(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 ${Z(i.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${U(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"}: ${U(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 Q$(){return{localeError:VR()}}var UR=()=>{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=G(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 ${Z(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${U(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"}: ${U(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 ek(){return{localeError:UR()}}var jR=()=>{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=G(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 ${Z(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 ${U(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"}: ${U(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 tk(){return{localeError:jR()}}var KR=()=>{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=G(i.input),s=n[o]??o;return`Invalid input: expected ${a}, received ${s}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${Z(i.values[0])}`:`Invalid option: expected one of ${U(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":""}: ${U(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 Gw(){return{localeError:KR()}}var WR=()=>{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=G(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 ${Z(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${U(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":""}: ${U(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 rk(){return{localeError:WR()}}var LR=()=>{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=G(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 ${Z(i.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${U(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":""}: ${U(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 ik(){return{localeError:LR()}}var ZR=()=>{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=G(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 ${Z(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 ${U(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: ${U(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 nk(){return{localeError:ZR()}}var GR=()=>{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=G(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 ${Z(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${U(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"}: ${U(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 ak(){return{localeError:GR()}}var HR=()=>{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=G(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 : ${Z(i.values[0])} attendu`:`Option invalide : une valeur parmi ${U(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":""} : ${U(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 ok(){return{localeError:HR()}}var qR=()=>{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=G(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 ${Z(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${U(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":""} : ${U(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 sk(){return{localeError:qR()}}var JR=()=>{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),h=G(u.input),y=c[h]??t[h]?.label??h;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 ${y}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${v}, \u05D4\u05EA\u05E7\u05D1\u05DC ${y}`}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 ${Z(u.values[0])}`;let f=u.values.map(y=>Z(y));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 _=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 ${_}`}if(u.origin==="array"||u.origin==="set"){let _=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",$=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} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${$}`.trim()}let h=u.inclusive?"<=":"<",y=a(u.origin??"value");return f?.unit?`${f.longLabel} \u05DE\u05D3\u05D9: ${v} ${y} ${h}${u.maximum.toString()} ${f.unit}`:`${f?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${v} ${y} ${h}${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 _=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 ${_}`}if(u.origin==="array"||u.origin==="set"){let _=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let S=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${v} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${S}`}let $=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} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${$}`.trim()}let h=u.inclusive?">=":">",y=a(u.origin??"value");return f?.unit?`${f.shortLabel} \u05DE\u05D3\u05D9: ${v} ${y} ${h}${u.minimum.toString()} ${f.unit}`:`${f?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${v} ${y} ${h}${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],h=v?.label??f.format,_=(v?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${h} \u05DC\u05D0 ${_}`}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"}: ${U(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 lk(){return{localeError:JR()}}var YR=()=>{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=G(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 ${Z(i.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${U(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"}: ${U(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 ck(){return{localeError:YR()}}var XR=()=>{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=G(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 ${Z(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${U(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":""}: ${U(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 uk(){return{localeError:XR()}}function dk(t,e,r){return Math.abs(t)===1?e:r}function Hd(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 QR=()=>{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=G(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 ${Z(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 ${U(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);if(o){let s=Number(i.maximum),c=dk(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 ${Hd(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 ${Hd(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=dk(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 ${Hd(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 ${Hd(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":""}. ${U(i.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Hd(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 ${Hd(i.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function pk(){return{localeError:QR()}}var eC=()=>{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=G(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 ${Z(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${U(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":""}: ${U(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 fk(){return{localeError:eC()}}var tC=()=>{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=G(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 ${Z(i.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${U(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"}: ${U(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 mk(){return{localeError:tC()}}var rC=()=>{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=G(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 ${Z(i.values[0])}`:`Opzione non valida: atteso uno tra ${U(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"}: ${U(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 hk(){return{localeError:rC()}}var iC=()=>{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=G(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: ${Z(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${U(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":""}: ${U(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 gk(){return{localeError:iC()}}var nC=()=>{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=G(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 ${Z(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 ${U(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"}: ${U(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 vk(){return{localeError:nC()}}var aC=()=>{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=G(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 ${Z(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 ${U(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 ${U(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 Hw(){return{localeError:aC()}}function xk(){return Hw()}var oC=()=>{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=G(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 ${Z(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${U(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: ${U(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 yk(){return{localeError:oC()}}var Fh=t=>t.charAt(0).toUpperCase()+t.slice(1);function wk(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 sC=()=>{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=G(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 ${Z(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${U(i.values,"|")} pasirinkim\u0173`;case"too_big":{let a=n[i.origin]??i.origin,o=e(i.origin,wk(Number(i.maximum)),i.inclusive??!1,"smaller");if(o?.verb)return`${Fh(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`${Fh(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,wk(Number(i.minimum)),i.inclusive??!1,"bigger");if(o?.verb)return`${Fh(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`${Fh(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"}: ${U(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`${Fh(a??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function bk(){return{localeError:sC()}}var lC=()=>{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=G(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 ${Z(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 ${U(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"}: ${U(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 _k(){return{localeError:lC()}}var cC=()=>{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=G(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 ${Z(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${U(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: ${U(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 Ak(){return{localeError:cC()}}var uC=()=>{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=G(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 ${Z(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${U(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":""}: ${U(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 Fk(){return{localeError:uC()}}var dC=()=>{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=G(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 ${Z(i.values[0])}`:`Ugyldig valg: forventet en av ${U(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"}: ${U(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 Ek(){return{localeError:dC()}}var pC=()=>{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=G(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 ${Z(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${U(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":""}: ${U(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 Sk(){return{localeError:pC()}}var fC=()=>{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=G(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 ${Z(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${U(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"}: ${U(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 Pk(){return{localeError:fC()}}var mC=()=>{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=G(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 ${Z(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${U(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":""}: ${U(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 Mk(){return{localeError:mC()}}var hC=()=>{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=G(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 ${Z(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${U(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":""}: ${U(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 Nk(){return{localeError:hC()}}var gC=()=>{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=G(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 ${Z(i.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${U(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: ${U(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 $k(){return{localeError:gC()}}function kk(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 vC=()=>{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=G(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 ${Z(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 ${U(i.values,"|")}`;case"too_big":{let a=i.inclusive?"<=":"<",o=e(i.origin);if(o){let s=Number(i.maximum),c=kk(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=kk(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":""}: ${U(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 Bk(){return{localeError:vC()}}var xC=()=>{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=G(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 ${Z(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${U(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"}: ${U(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 Ik(){return{localeError:xC()}}var yC=()=>{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=G(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 ${Z(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${U(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"}: ${U(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 Tk(){return{localeError:yC()}}var wC=()=>{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=G(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 ${Z(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 ${U(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":""}: ${U(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 Dk(){return{localeError:wC()}}var bC=()=>{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=G(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 ${Z(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 ${U(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: ${U(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 Rk(){return{localeError:bC()}}var _C=()=>{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=G(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 ${Z(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${U(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":""}: ${U(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 Ck(){return{localeError:_C()}}var AC=()=>{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=G(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 ${Z(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 ${U(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":""}: ${U(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 qw(){return{localeError:AC()}}function zk(){return qw()}var FC=()=>{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=G(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: ${Z(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${U(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":""}: ${U(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 Ok(){return{localeError:FC()}}var EC=()=>{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=G(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 ${Z(i.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${U(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":""}: ${U(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 Vk(){return{localeError:EC()}}var SC=()=>{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=G(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 ${Z(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 ${U(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: ${U(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 Uk(){return{localeError:SC()}}var PC=()=>{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=G(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 ${Z(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${U(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): ${U(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 jk(){return{localeError:PC()}}var MC=()=>{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=G(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 ${Z(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${U(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${U(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 Kk(){return{localeError:MC()}}var NC=()=>{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=G(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 ${Z(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${U(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: ${U(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 Wk(){return{localeError:NC()}}var Lk,ZF=Symbol("ZodOutput"),GF=Symbol("ZodInput"),Jw=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 Yw(){return new Jw}(Lk=globalThis).__zod_globalRegistry??(Lk.__zod_globalRegistry=Yw());var Or=globalThis.__zod_globalRegistry;function HF(t,e){return new t({type:"string",...X(e)})}function qF(t,e){return new t({type:"string",coerce:!0,...X(e)})}function Xw(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...X(e)})}function Sh(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...X(e)})}function Qw(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...X(e)})}function eb(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...X(e)})}function tb(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...X(e)})}function rb(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...X(e)})}function Ph(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...X(e)})}function ib(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...X(e)})}function nb(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...X(e)})}function ab(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...X(e)})}function ob(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...X(e)})}function sb(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...X(e)})}function lb(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...X(e)})}function cb(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...X(e)})}function ub(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...X(e)})}function db(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...X(e)})}function JF(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...X(e)})}function pb(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...X(e)})}function fb(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...X(e)})}function mb(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...X(e)})}function hb(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...X(e)})}function gb(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...X(e)})}function vb(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...X(e)})}var YF={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function XF(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...X(e)})}function QF(t,e){return new t({type:"string",format:"date",check:"string_format",...X(e)})}function eE(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...X(e)})}function tE(t,e){return new t({type:"string",format:"duration",check:"string_format",...X(e)})}function rE(t,e){return new t({type:"number",checks:[],...X(e)})}function iE(t,e){return new t({type:"number",coerce:!0,checks:[],...X(e)})}function nE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...X(e)})}function aE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...X(e)})}function oE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...X(e)})}function sE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...X(e)})}function lE(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...X(e)})}function cE(t,e){return new t({type:"boolean",...X(e)})}function uE(t,e){return new t({type:"boolean",coerce:!0,...X(e)})}function dE(t,e){return new t({type:"bigint",...X(e)})}function pE(t,e){return new t({type:"bigint",coerce:!0,...X(e)})}function fE(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...X(e)})}function mE(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...X(e)})}function hE(t,e){return new t({type:"symbol",...X(e)})}function gE(t,e){return new t({type:"undefined",...X(e)})}function vE(t,e){return new t({type:"null",...X(e)})}function xE(t){return new t({type:"any"})}function yE(t){return new t({type:"unknown"})}function wE(t,e){return new t({type:"never",...X(e)})}function bE(t,e){return new t({type:"void",...X(e)})}function _E(t,e){return new t({type:"date",...X(e)})}function AE(t,e){return new t({type:"date",coerce:!0,...X(e)})}function FE(t,e){return new t({type:"nan",...X(e)})}function Qa(t,e){return new Rw({check:"less_than",...X(e),value:t,inclusive:!1})}function Yi(t,e){return new Rw({check:"less_than",...X(e),value:t,inclusive:!0})}function eo(t,e){return new Cw({check:"greater_than",...X(e),value:t,inclusive:!1})}function ui(t,e){return new Cw({check:"greater_than",...X(e),value:t,inclusive:!0})}function xb(t){return eo(0,t)}function yb(t){return Qa(0,t)}function wb(t){return Yi(0,t)}function bb(t){return ui(0,t)}function Vs(t,e){return new vA({check:"multiple_of",...X(e),value:t})}function Us(t,e){return new wA({check:"max_size",...X(e),maximum:t})}function to(t,e){return new bA({check:"min_size",...X(e),minimum:t})}function Ac(t,e){return new _A({check:"size_equals",...X(e),size:t})}function Fc(t,e){return new AA({check:"max_length",...X(e),maximum:t})}function zo(t,e){return new FA({check:"min_length",...X(e),minimum:t})}function Ec(t,e){return new EA({check:"length_equals",...X(e),length:t})}function qd(t,e){return new SA({check:"string_format",format:"regex",...X(e),pattern:t})}function Jd(t){return new PA({check:"string_format",format:"lowercase",...X(t)})}function Yd(t){return new MA({check:"string_format",format:"uppercase",...X(t)})}function Xd(t,e){return new NA({check:"string_format",format:"includes",...X(e),includes:t})}function Qd(t,e){return new $A({check:"string_format",format:"starts_with",...X(e),prefix:t})}function ep(t,e){return new kA({check:"string_format",format:"ends_with",...X(e),suffix:t})}function _b(t,e,r){return new BA({check:"property",property:t,schema:e,...X(r)})}function tp(t,e){return new IA({check:"mime_type",mime:t,...X(e)})}function pa(t){return new TA({check:"overwrite",tx:t})}function rp(t){return pa(e=>e.normalize(t))}function ip(){return pa(t=>t.trim())}function np(){return pa(t=>t.toLowerCase())}function ap(){return pa(t=>t.toUpperCase())}function op(){return pa(t=>$1(t))}function EE(t,e,r){return new t({type:"array",element:e,...X(r)})}function kC(t,e,r){return new t({type:"union",options:e,...X(r)})}function BC(t,e,r){return new t({type:"union",options:e,inclusive:!1,...X(r)})}function IC(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...X(n)})}function TC(t,e,r){return new t({type:"intersection",left:e,right:r})}function DC(t,e,r,n){let i=r instanceof Be,a=i?n:r,o=i?r:null;return new t({type:"tuple",items:e,rest:o,...X(a)})}function RC(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...X(n)})}function CC(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...X(n)})}function zC(t,e,r){return new t({type:"set",valueType:e,...X(r)})}function OC(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new t({type:"enum",entries:n,...X(r)})}function VC(t,e,r){return new t({type:"enum",entries:e,...X(r)})}function UC(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...X(r)})}function SE(t,e){return new t({type:"file",...X(e)})}function jC(t,e){return new t({type:"transform",transform:e})}function KC(t,e){return new t({type:"optional",innerType:e})}function WC(t,e){return new t({type:"nullable",innerType:e})}function LC(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():B1(r)}})}function ZC(t,e,r){return new t({type:"nonoptional",innerType:e,...X(r)})}function GC(t,e){return new t({type:"success",innerType:e})}function HC(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function qC(t,e,r){return new t({type:"pipe",in:e,out:r})}function JC(t,e){return new t({type:"readonly",innerType:e})}function YC(t,e,r){return new t({type:"template_literal",parts:e,...X(r)})}function XC(t,e){return new t({type:"lazy",getter:e})}function QC(t,e){return new t({type:"promise",innerType:e})}function PE(t,e,r){let n=X(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function ME(t,e,r){return new t({type:"custom",check:"custom",fn:e,...X(r)})}function NE(t,e){let r=Zk(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(jd(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(jd(a))}},t(n.value,n)),e);return r}function Zk(t,e){let r=new ht({check:"custom",...X(e)});return r._zod.check=t,r}function $E(t){let e=new ht({check:"describe"});return e._zod.onattach=[r=>{let n=Or.get(r)??{};Or.add(r,{...n,description:t})}],e._zod.check=()=>{},e}function kE(t){let e=new ht({check:"meta"});return e._zod.onattach=[r=>{let n=Or.get(r)??{};Or.add(r,{...n,...t})}],e._zod.check=()=>{},e}function BE(t,e){let r=X(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(y=>typeof y=="string"?y.toLowerCase():y),i=i.map(y=>typeof y=="string"?y.toLowerCase():y));let a=new Set(n),o=new Set(i),s=t.Codec??Ah,c=t.Boolean??bh,u=t.String??_c,f=new u({type:"string",error:r.error}),v=new c({type:"boolean",error:r.error}),h=new s({type:"pipe",in:f,out:v,transform:((y,_)=>{let $=y;return r.case!=="sensitive"&&($=$.toLowerCase()),a.has($)?!0:o.has($)?!1:(_.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...o],input:_.value,inst:h,continue:!1}),{})}),reverseTransform:((y,_)=>y===!0?n[0]||"true":i[0]||"false"),error:r.error});return h}function sp(t,e,r,n={}){let i=X(n),a={...X(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??Or,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 ct(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 h=o.schema,y=e.processors[i.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);y(t,e,h,f)}let v=t._zod.parent;v&&(o.ref||(o.ref=v),ct(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"&&di(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 Ks(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,h=t.external.uri??(_=>_);if(v)return{ref:h(v)};let y=o[1].defId??o[1].schema.id??`schema${t.counter++}`;return o[1].defId=y,{defId:y,ref:`${h("__shared")}#/${s}/${y}`}}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>
112
112
 
113
- 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 Ws(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 y=t.seen.get(v),_=y.schema;if(_.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(_)):Object.assign(u,_),Object.assign(u,f),s._zod.parent===v)for(let S in u)S==="$ref"||S==="allOf"||S in f||delete u[S];if(_.$ref&&y.def)for(let S in u)S==="$ref"||S==="allOf"||S in y.def&&JSON.stringify(u[S])===JSON.stringify(y.def[S])&&delete u[S]}let h=s._zod.parent;if(h&&h!==v){n(h);let y=t.seen.get(h);if(y?.schema.$ref&&(u.$ref=y.schema.$ref,y.def))for(let _ in u)_==="$ref"||_==="allOf"||_ in y.def&&JSON.stringify(u[_])===JSON.stringify(y.def[_])&&delete u[_]}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:lp(e,"input",t.processors),output:lp(e,"output",t.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function di(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 di(n.element,r);if(n.type==="set")return di(n.valueType,r);if(n.type==="lazy")return di(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 di(n.innerType,r);if(n.type==="intersection")return di(n.left,r)||di(n.right,r);if(n.type==="record"||n.type==="map")return di(n.keyType,r)||di(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:di(n.in,r)||di(n.out,r);if(n.type==="object"){for(let i in n.shape)if(di(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(di(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(di(i,r))return!0;return!!(n.rest&&di(n.rest,r))}return!1}var IE=(t,e={})=>r=>{let n=js({...r,processors:e});return ct(t,n),Ks(n,t),Ws(n,t)},lp=(t,e,r={})=>n=>{let{libraryOptions:i,target:a}=n??{},o=js({...i??{},target:a,io:e,processors:r});return ct(t,o),Ks(o,t),Ws(o,t)};var ez={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},TE=(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=ez[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}))])}},DE=(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),h=typeof u=="number"&&u<=(o??Number.POSITIVE_INFINITY),y=e.target==="draft-04"||e.target==="openapi-3.0";v?y?(i.minimum=f,i.exclusiveMinimum=!0):i.exclusiveMinimum=f:typeof a=="number"&&(i.minimum=a),h?y?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u:typeof o=="number"&&(i.maximum=o),typeof c=="number"&&(i.multipleOf=c)},RE=(t,e,r,n)=>{r.type="boolean"},CE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},zE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},OE=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},VE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},UE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},jE=(t,e,r,n)=>{r.not={}},KE=(t,e,r,n)=>{},WE=(t,e,r,n)=>{},LE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},ZE=(t,e,r,n)=>{let i=t._zod.def,a=uh(i.entries);a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),r.enum=a},GE=(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},HE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},qE=(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},JE=(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)},YE=(t,e,r,n)=>{r.type="boolean"},XE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},QE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},eS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},tS=(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")},iS=(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=ct(a.element,e,{...n,path:[...n.path,"items"]})},nS=(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]=ct(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=ct(a.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},Fb=(t,e,r,n)=>{let i=t._zod.def,a=i.inclusive===!1,o=i.options.map((s,c)=>ct(s,e,{...n,path:[...n.path,a?"oneOf":"anyOf",c]}));a?r.oneOf=o:r.anyOf=o},aS=(t,e,r,n)=>{let i=t._zod.def,a=ct(i.left,e,{...n,path:[...n.path,"allOf",0]}),o=ct(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},oS=(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((h,y)=>ct(h,e,{...n,path:[...n.path,o,y]})),u=a.rest?ct(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)},sS=(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=ct(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=ct(a.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=ct(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)}},lS=(t,e,r,n)=>{let i=t._zod.def,a=ct(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"}]},cS=(t,e,r,n)=>{let i=t._zod.def;ct(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},uS=(t,e,r,n)=>{let i=t._zod.def;ct(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},dS=(t,e,r,n)=>{let i=t._zod.def;ct(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)))},pS=(t,e,r,n)=>{let i=t._zod.def;ct(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},fS=(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;ct(o,e,n);let s=e.seen.get(t);s.ref=o},mS=(t,e,r,n)=>{let i=t._zod.def;ct(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.readOnly=!0},hS=(t,e,r,n)=>{let i=t._zod.def;ct(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},Eb=(t,e,r,n)=>{let i=t._zod.def;ct(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},gS=(t,e,r,n)=>{let i=t._zod.innerType;ct(i,e,n);let a=e.seen.get(t);a.ref=i},Ab={string:TE,number:DE,boolean:RE,bigint:CE,symbol:zE,null:OE,undefined:VE,void:UE,never:jE,any:KE,unknown:WE,date:LE,enum:ZE,literal:GE,nan:HE,template_literal:qE,file:JE,success:YE,custom:XE,function:QE,transform:eS,map:tS,set:rS,array:iS,object:nS,union:Fb,intersection:aS,tuple:oS,record:sS,nullable:lS,nonoptional:cS,default:uS,prefault:dS,catch:pS,pipe:fS,readonly:mS,promise:hS,optional:Eb,lazy:gS};function Sb(t,e){if("_idmap"in t){let n=t,i=js({...e,processors:Ab}),a={};for(let c of n._idmap.entries()){let[u,f]=c;ct(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;Ks(i,f),o[u]=Ws(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:Ab});return ct(t,r),Ks(r,t),Ws(r,t)}var Pb=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:Ab,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 ct(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)),Ks(this.ctx,e);let n=Ws(this.ctx,e),{"~standard":i,...a}=n;return a}};var Gk={};var Mh={};no(Mh,{ZodAny:()=>VS,ZodArray:()=>WS,ZodBase64:()=>Hb,ZodBase64URL:()=>qb,ZodBigInt:()=>gp,ZodBigIntFormat:()=>Xb,ZodBoolean:()=>hp,ZodCIDRv4:()=>Zb,ZodCIDRv6:()=>Gb,ZodCUID:()=>Ob,ZodCUID2:()=>Vb,ZodCatch:()=>pP,ZodCodec:()=>Vh,ZodCustom:()=>Uh,ZodCustomStringFormat:()=>fp,ZodDate:()=>Dh,ZodDefault:()=>oP,ZodDiscriminatedUnion:()=>ZS,ZodE164:()=>Jb,ZodEmail:()=>Rb,ZodEmoji:()=>Cb,ZodEnum:()=>dp,ZodExactOptional:()=>iP,ZodFile:()=>tP,ZodFunction:()=>_P,ZodGUID:()=>$h,ZodIPv4:()=>Wb,ZodIPv6:()=>Lb,ZodIntersection:()=>GS,ZodJWT:()=>Yb,ZodKSUID:()=>Kb,ZodLazy:()=>yP,ZodLiteral:()=>eP,ZodMAC:()=>IS,ZodMap:()=>XS,ZodNaN:()=>mP,ZodNanoID:()=>zb,ZodNever:()=>jS,ZodNonOptional:()=>n0,ZodNull:()=>zS,ZodNullable:()=>aP,ZodNumber:()=>mp,ZodNumberFormat:()=>Pc,ZodObject:()=>Ch,ZodOptional:()=>i0,ZodPipe:()=>Oh,ZodPrefault:()=>lP,ZodPreprocess:()=>hP,ZodPromise:()=>bP,ZodReadonly:()=>gP,ZodRecord:()=>up,ZodSet:()=>QS,ZodString:()=>pp,ZodStringFormat:()=>pt,ZodSuccess:()=>dP,ZodSymbol:()=>RS,ZodTemplateLiteral:()=>xP,ZodTransform:()=>rP,ZodTuple:()=>qS,ZodType:()=>Ve,ZodULID:()=>Ub,ZodURL:()=>Th,ZodUUID:()=>ro,ZodUndefined:()=>CS,ZodUnion:()=>zh,ZodUnknown:()=>US,ZodVoid:()=>KS,ZodXID:()=>jb,ZodXor:()=>LS,_ZodString:()=>Db,_default:()=>sP,_function:()=>rI,any:()=>IB,array:()=>Rh,base64:()=>gB,base64url:()=>vB,bigint:()=>MB,boolean:()=>DS,catch:()=>fP,check:()=>iI,cidrv4:()=>mB,cidrv6:()=>hB,codec:()=>XB,cuid:()=>oB,cuid2:()=>sB,custom:()=>nI,date:()=>DB,describe:()=>aI,discriminatedUnion:()=>UB,e164:()=>xB,email:()=>Jk,emoji:()=>nB,enum:()=>t0,exactOptional:()=>nP,file:()=>HB,float32:()=>FB,float64:()=>EB,function:()=>rI,guid:()=>Yk,hash:()=>AB,hex:()=>_B,hostname:()=>bB,httpUrl:()=>iB,instanceof:()=>sI,int:()=>Ib,int32:()=>SB,int64:()=>NB,intersection:()=>HS,invertCodec:()=>QB,ipv4:()=>dB,ipv6:()=>fB,json:()=>cI,jwt:()=>yB,keyof:()=>RB,ksuid:()=>uB,lazy:()=>wP,literal:()=>GB,looseObject:()=>OB,looseRecord:()=>KB,mac:()=>pB,map:()=>WB,meta:()=>oI,nan:()=>YB,nanoid:()=>aB,nativeEnum:()=>ZB,never:()=>Qb,nonoptional:()=>uP,null:()=>OS,nullable:()=>Bh,nullish:()=>qB,number:()=>TS,object:()=>CB,optional:()=>kh,partialRecord:()=>jB,pipe:()=>Tb,prefault:()=>cP,preprocess:()=>uI,promise:()=>tI,readonly:()=>vP,record:()=>YS,refine:()=>AP,set:()=>LB,strictObject:()=>zB,string:()=>Nh,stringFormat:()=>wB,stringbool:()=>lI,success:()=>JB,superRefine:()=>FP,symbol:()=>kB,templateLiteral:()=>eI,transform:()=>r0,tuple:()=>JS,uint32:()=>PB,uint64:()=>$B,ulid:()=>lB,undefined:()=>BB,union:()=>e0,unknown:()=>Sc,url:()=>rB,uuid:()=>Xk,uuidv4:()=>Qk,uuidv6:()=>eB,uuidv7:()=>tB,void:()=>TB,xid:()=>cB,xor:()=>VB});var Mb={};no(Mb,{endsWith:()=>ep,gt:()=>eo,gte:()=>ui,includes:()=>Xd,length:()=>Ec,lowercase:()=>Jd,lt:()=>Qa,lte:()=>Yi,maxLength:()=>Fc,maxSize:()=>Us,mime:()=>tp,minLength:()=>zo,minSize:()=>to,multipleOf:()=>Vs,negative:()=>yb,nonnegative:()=>bb,nonpositive:()=>wb,normalize:()=>rp,overwrite:()=>pa,positive:()=>xb,property:()=>_b,regex:()=>qd,size:()=>Ac,slugify:()=>op,startsWith:()=>Qd,toLowerCase:()=>np,toUpperCase:()=>ap,trim:()=>ip,uppercase:()=>Yd});var cp={};no(cp,{ZodISODate:()=>$b,ZodISODateTime:()=>Nb,ZodISODuration:()=>Bb,ZodISOTime:()=>kb,date:()=>xS,datetime:()=>vS,duration:()=>wS,time:()=>yS});var Nb=R("ZodISODateTime",(t,e)=>{HA.init(t,e),pt.init(t,e)});function vS(t){return XF(Nb,t)}var $b=R("ZodISODate",(t,e)=>{qA.init(t,e),pt.init(t,e)});function xS(t){return QF($b,t)}var kb=R("ZodISOTime",(t,e)=>{JA.init(t,e),pt.init(t,e)});function yS(t){return eE(kb,t)}var Bb=R("ZodISODuration",(t,e)=>{YA.init(t,e),pt.init(t,e)});function wS(t){return tE(Bb,t)}var Hk=(t,e)=>{hh.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>vh(t,r)},flatten:{value:r=>gh(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Vd,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Vd,2)}},isEmpty:{get(){return t.issues.length===0}}})},rz=R("ZodError",Hk),$i=R("ZodError",Hk,{Parent:Error});var bS=Kd($i),_S=Wd($i),AS=Ld($i),FS=Zd($i),ES=Sw($i),SS=Pw($i),PS=Mw($i),MS=Nw($i),NS=$w($i),$S=kw($i),kS=Bw($i),BS=Iw($i);var qk=new WeakMap;function Ih(t,e,r){let n=Object.getPrototypeOf(t),i=qk.get(n);if(i||(i=new Set,qk.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 Ve=R("ZodType",(t,e)=>(Be.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:lp(t,"input"),output:lp(t,"output")}}),t.toJSONSchema=IE(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>bS(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>AS(t,r,n),t.parseAsync=async(r,n)=>_S(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>FS(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>ES(t,r,n),t.decode=(r,n)=>SS(t,r,n),t.encodeAsync=async(r,n)=>PS(t,r,n),t.decodeAsync=async(r,n)=>MS(t,r,n),t.safeEncode=(r,n)=>NS(t,r,n),t.safeDecode=(r,n)=>$S(t,r,n),t.safeEncodeAsync=async(r,n)=>kS(t,r,n),t.safeDecodeAsync=async(r,n)=>BS(t,r,n),Ih(t,"ZodType",{check(...r){let n=this.def;return this.clone(H.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 li(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(AP(r,n))},superRefine(r,n){return this.check(FP(r,n))},overwrite(r){return this.check(pa(r))},optional(){return kh(this)},exactOptional(){return nP(this)},nullable(){return Bh(this)},nullish(){return kh(Bh(this))},nonoptional(r){return uP(this,r)},array(){return Rh(this)},or(r){return e0([this,r])},and(r){return HS(this,r)},transform(r){return Tb(this,r0(r))},default(r){return sP(this,r)},prefault(r){return cP(this,r)},catch(r){return fP(this,r)},pipe(r){return Tb(this,r)},readonly(){return vP(this)},describe(r){let n=this.clone();return Or.add(n,{description:r}),n},meta(...r){if(r.length===0)return Or.get(this);let n=this.clone();return Or.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 Or.get(t)?.description},configurable:!0}),t)),Db=R("_ZodString",(t,e)=>{_c.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(n,i,a)=>TE(t,n,i,a);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Ih(t,"_ZodString",{regex(...n){return this.check(qd(...n))},includes(...n){return this.check(Xd(...n))},startsWith(...n){return this.check(Qd(...n))},endsWith(...n){return this.check(ep(...n))},min(...n){return this.check(zo(...n))},max(...n){return this.check(Fc(...n))},length(...n){return this.check(Ec(...n))},nonempty(...n){return this.check(zo(1,...n))},lowercase(n){return this.check(Jd(n))},uppercase(n){return this.check(Yd(n))},trim(){return this.check(ip())},normalize(...n){return this.check(rp(...n))},toLowerCase(){return this.check(np())},toUpperCase(){return this.check(ap())},slugify(){return this.check(op())}})}),pp=R("ZodString",(t,e)=>{_c.init(t,e),Db.init(t,e),t.email=r=>t.check(Xw(Rb,r)),t.url=r=>t.check(Ph(Th,r)),t.jwt=r=>t.check(vb(Yb,r)),t.emoji=r=>t.check(ib(Cb,r)),t.guid=r=>t.check(Sh($h,r)),t.uuid=r=>t.check(Qw(ro,r)),t.uuidv4=r=>t.check(eb(ro,r)),t.uuidv6=r=>t.check(tb(ro,r)),t.uuidv7=r=>t.check(rb(ro,r)),t.nanoid=r=>t.check(nb(zb,r)),t.guid=r=>t.check(Sh($h,r)),t.cuid=r=>t.check(ab(Ob,r)),t.cuid2=r=>t.check(ob(Vb,r)),t.ulid=r=>t.check(sb(Ub,r)),t.base64=r=>t.check(mb(Hb,r)),t.base64url=r=>t.check(hb(qb,r)),t.xid=r=>t.check(lb(jb,r)),t.ksuid=r=>t.check(cb(Kb,r)),t.ipv4=r=>t.check(ub(Wb,r)),t.ipv6=r=>t.check(db(Lb,r)),t.cidrv4=r=>t.check(pb(Zb,r)),t.cidrv6=r=>t.check(fb(Gb,r)),t.e164=r=>t.check(gb(Jb,r)),t.datetime=r=>t.check(vS(r)),t.date=r=>t.check(xS(r)),t.time=r=>t.check(yS(r)),t.duration=r=>t.check(wS(r))});function Nh(t){return HF(pp,t)}var pt=R("ZodStringFormat",(t,e)=>{dt.init(t,e),Db.init(t,e)}),Rb=R("ZodEmail",(t,e)=>{OA.init(t,e),pt.init(t,e)});function Jk(t){return Xw(Rb,t)}var $h=R("ZodGUID",(t,e)=>{CA.init(t,e),pt.init(t,e)});function Yk(t){return Sh($h,t)}var ro=R("ZodUUID",(t,e)=>{zA.init(t,e),pt.init(t,e)});function Xk(t){return Qw(ro,t)}function Qk(t){return eb(ro,t)}function eB(t){return tb(ro,t)}function tB(t){return rb(ro,t)}var Th=R("ZodURL",(t,e)=>{VA.init(t,e),pt.init(t,e)});function rB(t){return Ph(Th,t)}function iB(t){return Ph(Th,{protocol:Ji.httpProtocol,hostname:Ji.domain,...H.normalizeParams(t)})}var Cb=R("ZodEmoji",(t,e)=>{UA.init(t,e),pt.init(t,e)});function nB(t){return ib(Cb,t)}var zb=R("ZodNanoID",(t,e)=>{jA.init(t,e),pt.init(t,e)});function aB(t){return nb(zb,t)}var Ob=R("ZodCUID",(t,e)=>{KA.init(t,e),pt.init(t,e)});function oB(t){return ab(Ob,t)}var Vb=R("ZodCUID2",(t,e)=>{WA.init(t,e),pt.init(t,e)});function sB(t){return ob(Vb,t)}var Ub=R("ZodULID",(t,e)=>{LA.init(t,e),pt.init(t,e)});function lB(t){return sb(Ub,t)}var jb=R("ZodXID",(t,e)=>{ZA.init(t,e),pt.init(t,e)});function cB(t){return lb(jb,t)}var Kb=R("ZodKSUID",(t,e)=>{GA.init(t,e),pt.init(t,e)});function uB(t){return cb(Kb,t)}var Wb=R("ZodIPv4",(t,e)=>{XA.init(t,e),pt.init(t,e)});function dB(t){return ub(Wb,t)}var IS=R("ZodMAC",(t,e)=>{eF.init(t,e),pt.init(t,e)});function pB(t){return JF(IS,t)}var Lb=R("ZodIPv6",(t,e)=>{QA.init(t,e),pt.init(t,e)});function fB(t){return db(Lb,t)}var Zb=R("ZodCIDRv4",(t,e)=>{tF.init(t,e),pt.init(t,e)});function mB(t){return pb(Zb,t)}var Gb=R("ZodCIDRv6",(t,e)=>{rF.init(t,e),pt.init(t,e)});function hB(t){return fb(Gb,t)}var Hb=R("ZodBase64",(t,e)=>{nF.init(t,e),pt.init(t,e)});function gB(t){return mb(Hb,t)}var qb=R("ZodBase64URL",(t,e)=>{aF.init(t,e),pt.init(t,e)});function vB(t){return hb(qb,t)}var Jb=R("ZodE164",(t,e)=>{oF.init(t,e),pt.init(t,e)});function xB(t){return gb(Jb,t)}var Yb=R("ZodJWT",(t,e)=>{sF.init(t,e),pt.init(t,e)});function yB(t){return vb(Yb,t)}var fp=R("ZodCustomStringFormat",(t,e)=>{lF.init(t,e),pt.init(t,e)});function wB(t,e,r={}){return sp(fp,t,e,r)}function bB(t){return sp(fp,"hostname",Ji.hostname,t)}function _B(t){return sp(fp,"hex",Ji.hex,t)}function AB(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=Ji[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return sp(fp,n,i,e)}var mp=R("ZodNumber",(t,e)=>{jw.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(n,i,a)=>DE(t,n,i,a),Ih(t,"ZodNumber",{gt(n,i){return this.check(eo(n,i))},gte(n,i){return this.check(ui(n,i))},min(n,i){return this.check(ui(n,i))},lt(n,i){return this.check(Qa(n,i))},lte(n,i){return this.check(Yi(n,i))},max(n,i){return this.check(Yi(n,i))},int(n){return this.check(Ib(n))},safe(n){return this.check(Ib(n))},positive(n){return this.check(eo(0,n))},nonnegative(n){return this.check(ui(0,n))},negative(n){return this.check(Qa(0,n))},nonpositive(n){return this.check(Yi(0,n))},multipleOf(n,i){return this.check(Vs(n,i))},step(n,i){return this.check(Vs(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 TS(t){return rE(mp,t)}var Pc=R("ZodNumberFormat",(t,e)=>{cF.init(t,e),mp.init(t,e)});function Ib(t){return nE(Pc,t)}function FB(t){return aE(Pc,t)}function EB(t){return oE(Pc,t)}function SB(t){return sE(Pc,t)}function PB(t){return lE(Pc,t)}var hp=R("ZodBoolean",(t,e)=>{bh.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>RE(t,r,n,i)});function DS(t){return cE(hp,t)}var gp=R("ZodBigInt",(t,e)=>{Kw.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(n,i,a)=>CE(t,n,i,a),t.gte=(n,i)=>t.check(ui(n,i)),t.min=(n,i)=>t.check(ui(n,i)),t.gt=(n,i)=>t.check(eo(n,i)),t.gte=(n,i)=>t.check(ui(n,i)),t.min=(n,i)=>t.check(ui(n,i)),t.lt=(n,i)=>t.check(Qa(n,i)),t.lte=(n,i)=>t.check(Yi(n,i)),t.max=(n,i)=>t.check(Yi(n,i)),t.positive=n=>t.check(eo(BigInt(0),n)),t.negative=n=>t.check(Qa(BigInt(0),n)),t.nonpositive=n=>t.check(Yi(BigInt(0),n)),t.nonnegative=n=>t.check(ui(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(Vs(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function MB(t){return dE(gp,t)}var Xb=R("ZodBigIntFormat",(t,e)=>{uF.init(t,e),gp.init(t,e)});function NB(t){return fE(Xb,t)}function $B(t){return mE(Xb,t)}var RS=R("ZodSymbol",(t,e)=>{dF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>zE(t,r,n,i)});function kB(t){return hE(RS,t)}var CS=R("ZodUndefined",(t,e)=>{pF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>VE(t,r,n,i)});function BB(t){return gE(CS,t)}var zS=R("ZodNull",(t,e)=>{fF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>OE(t,r,n,i)});function OS(t){return vE(zS,t)}var VS=R("ZodAny",(t,e)=>{mF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>KE(t,r,n,i)});function IB(){return xE(VS)}var US=R("ZodUnknown",(t,e)=>{hF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>WE(t,r,n,i)});function Sc(){return yE(US)}var jS=R("ZodNever",(t,e)=>{gF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>jE(t,r,n,i)});function Qb(t){return wE(jS,t)}var KS=R("ZodVoid",(t,e)=>{vF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>UE(t,r,n,i)});function TB(t){return bE(KS,t)}var Dh=R("ZodDate",(t,e)=>{xF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(n,i,a)=>LE(t,n,i,a),t.min=(n,i)=>t.check(ui(n,i)),t.max=(n,i)=>t.check(Yi(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 DB(t){return _E(Dh,t)}var WS=R("ZodArray",(t,e)=>{yF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>iS(t,r,n,i),t.element=e.element,Ih(t,"ZodArray",{min(r,n){return this.check(zo(r,n))},nonempty(r){return this.check(zo(1,r))},max(r,n){return this.check(Fc(r,n))},length(r,n){return this.check(Ec(r,n))},unwrap(){return this.element}})});function Rh(t,e){return EE(WS,t,e)}function RB(t){let e=t._zod.def.shape;return t0(Object.keys(e))}var Ch=R("ZodObject",(t,e)=>{wF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nS(t,r,n,i),H.defineLazy(t,"shape",()=>e.shape),Ih(t,"ZodObject",{keyof(){return t0(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Sc()})},loose(){return this.clone({...this._zod.def,catchall:Sc()})},strict(){return this.clone({...this._zod.def,catchall:Qb()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return H.extend(this,r)},safeExtend(r){return H.safeExtend(this,r)},merge(r){return H.merge(this,r)},pick(r){return H.pick(this,r)},omit(r){return H.omit(this,r)},partial(...r){return H.partial(i0,this,r[0])},required(...r){return H.required(n0,this,r[0])}})});function CB(t,e){let r={type:"object",shape:t??{},...H.normalizeParams(e)};return new Ch(r)}function zB(t,e){return new Ch({type:"object",shape:t,catchall:Qb(),...H.normalizeParams(e)})}function OB(t,e){return new Ch({type:"object",shape:t,catchall:Sc(),...H.normalizeParams(e)})}var zh=R("ZodUnion",(t,e)=>{_h.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Fb(t,r,n,i),t.options=e.options});function e0(t,e){return new zh({type:"union",options:t,...H.normalizeParams(e)})}var LS=R("ZodXor",(t,e)=>{zh.init(t,e),bF.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Fb(t,r,n,i),t.options=e.options});function VB(t,e){return new LS({type:"union",options:t,inclusive:!1,...H.normalizeParams(e)})}var ZS=R("ZodDiscriminatedUnion",(t,e)=>{zh.init(t,e),_F.init(t,e)});function UB(t,e,r){return new ZS({type:"union",options:e,discriminator:t,...H.normalizeParams(r)})}var GS=R("ZodIntersection",(t,e)=>{AF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>aS(t,r,n,i)});function HS(t,e){return new GS({type:"intersection",left:t,right:e})}var qS=R("ZodTuple",(t,e)=>{Ww.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>oS(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});function JS(t,e,r){let n=e instanceof Be,i=n?r:e,a=n?e:null;return new qS({type:"tuple",items:t,rest:a,...H.normalizeParams(i)})}var up=R("ZodRecord",(t,e)=>{FF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>sS(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function YS(t,e,r){return!e||!e._zod?new up({type:"record",keyType:Nh(),valueType:t,...H.normalizeParams(e)}):new up({type:"record",keyType:t,valueType:e,...H.normalizeParams(r)})}function jB(t,e,r){let n=li(t);return n._zod.values=void 0,new up({type:"record",keyType:n,valueType:e,...H.normalizeParams(r)})}function KB(t,e,r){return new up({type:"record",keyType:t,valueType:e,mode:"loose",...H.normalizeParams(r)})}var XS=R("ZodMap",(t,e)=>{EF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>tS(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(to(...r)),t.nonempty=r=>t.check(to(1,r)),t.max=(...r)=>t.check(Us(...r)),t.size=(...r)=>t.check(Ac(...r))});function WB(t,e,r){return new XS({type:"map",keyType:t,valueType:e,...H.normalizeParams(r)})}var QS=R("ZodSet",(t,e)=>{SF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>rS(t,r,n,i),t.min=(...r)=>t.check(to(...r)),t.nonempty=r=>t.check(to(1,r)),t.max=(...r)=>t.check(Us(...r)),t.size=(...r)=>t.check(Ac(...r))});function LB(t,e){return new QS({type:"set",valueType:t,...H.normalizeParams(e)})}var dp=R("ZodEnum",(t,e)=>{PF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(n,i,a)=>ZE(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 dp({...e,checks:[],...H.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 dp({...e,checks:[],...H.normalizeParams(i),entries:a})}});function t0(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new dp({type:"enum",entries:r,...H.normalizeParams(e)})}function ZB(t,e){return new dp({type:"enum",entries:t,...H.normalizeParams(e)})}var eP=R("ZodLiteral",(t,e)=>{MF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>GE(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 GB(t,e){return new eP({type:"literal",values:Array.isArray(t)?t:[t],...H.normalizeParams(e)})}var tP=R("ZodFile",(t,e)=>{NF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>JE(t,r,n,i),t.min=(r,n)=>t.check(to(r,n)),t.max=(r,n)=>t.check(Us(r,n)),t.mime=(r,n)=>t.check(tp(Array.isArray(r)?r:[r],n))});function HB(t){return SE(tP,t)}var rP=R("ZodTransform",(t,e)=>{$F.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>eS(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ds(t.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(H.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(H.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 r0(t){return new rP({type:"transform",transform:t})}var i0=R("ZodOptional",(t,e)=>{Lw.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Eb(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function kh(t){return new i0({type:"optional",innerType:t})}var iP=R("ZodExactOptional",(t,e)=>{kF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Eb(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function nP(t){return new iP({type:"optional",innerType:t})}var aP=R("ZodNullable",(t,e)=>{BF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>lS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Bh(t){return new aP({type:"nullable",innerType:t})}function qB(t){return kh(Bh(t))}var oP=R("ZodDefault",(t,e)=>{IF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function sP(t,e){return new oP({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():H.shallowClone(e)}})}var lP=R("ZodPrefault",(t,e)=>{TF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>dS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function cP(t,e){return new lP({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():H.shallowClone(e)}})}var n0=R("ZodNonOptional",(t,e)=>{DF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>cS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function uP(t,e){return new n0({type:"nonoptional",innerType:t,...H.normalizeParams(e)})}var dP=R("ZodSuccess",(t,e)=>{RF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>YE(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function JB(t){return new dP({type:"success",innerType:t})}var pP=R("ZodCatch",(t,e)=>{CF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function fP(t,e){return new pP({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var mP=R("ZodNaN",(t,e)=>{zF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>HE(t,r,n,i)});function YB(t){return FE(mP,t)}var Oh=R("ZodPipe",(t,e)=>{Zw.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fS(t,r,n,i),t.in=e.in,t.out=e.out});function Tb(t,e){return new Oh({type:"pipe",in:t,out:e})}var Vh=R("ZodCodec",(t,e)=>{Oh.init(t,e),Ah.init(t,e)});function XB(t,e,r){return new Vh({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function QB(t){let e=t._zod.def;return new Vh({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var hP=R("ZodPreprocess",(t,e)=>{Oh.init(t,e),OF.init(t,e)}),gP=R("ZodReadonly",(t,e)=>{VF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function vP(t){return new gP({type:"readonly",innerType:t})}var xP=R("ZodTemplateLiteral",(t,e)=>{UF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>qE(t,r,n,i)});function eI(t,e){return new xP({type:"template_literal",parts:t,...H.normalizeParams(e)})}var yP=R("ZodLazy",(t,e)=>{WF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gS(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});function wP(t){return new yP({type:"lazy",getter:t})}var bP=R("ZodPromise",(t,e)=>{KF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function tI(t){return new bP({type:"promise",innerType:t})}var _P=R("ZodFunction",(t,e)=>{jF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>QE(t,r,n,i)});function rI(t){return new _P({type:"function",input:Array.isArray(t?.input)?JS(t?.input):t?.input??Rh(Sc()),output:t?.output??Sc()})}var Uh=R("ZodCustom",(t,e)=>{LF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>XE(t,r,n,i)});function iI(t){let e=new ht({check:"custom"});return e._zod.check=t,e}function nI(t,e){return PE(Uh,t??(()=>!0),e)}function AP(t,e={}){return ME(Uh,t,e)}function FP(t,e){return NE(t,e)}var aI=$E,oI=kE;function sI(t,e={}){let r=new Uh({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...H.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 lI=(...t)=>BE({Codec:Vh,Boolean:hp,String:pp},...t);function cI(t){let e=wP(()=>e0([Nh(t),TS(),DS(),OS(),Rh(e),YS(Nh(),e)]));return e}function uI(t,e){return new hP({type:"pipe",in:r0(t),out:e})}var nz={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 az(t){Wt({customError:t})}function oz(){return Wt().customError}var EP;EP||(EP={});var ne={...Mh,...Mb,iso:cp},sz=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 lz(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 cz(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 dI(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return ne.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 ne.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=cz(i,e),o=Qr(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 ne.null();if(i.length===0)return ne.never();if(i.length===1)return ne.literal(i[0]);if(i.every(o=>typeof o=="string"))return ne.enum(i);let a=i.map(o=>ne.literal(o));return a.length<2?a[0]:ne.union([a[0],a[1],...a.slice(2)])}if(t.const!==void 0)return ne.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(a=>{let o={...t,type:a};return dI(o,e)});return i.length===0?ne.never():i.length===1?i[0]:ne.union(i)}if(!r)return ne.any();let n;switch(r){case"string":{let i=ne.string();if(t.format){let a=t.format;a==="email"?i=i.check(ne.email()):a==="uri"||a==="uri-reference"?i=i.check(ne.url()):a==="uuid"||a==="guid"?i=i.check(ne.uuid()):a==="date-time"?i=i.check(ne.iso.datetime()):a==="date"?i=i.check(ne.iso.date()):a==="time"?i=i.check(ne.iso.time()):a==="duration"?i=i.check(ne.iso.duration()):a==="ipv4"?i=i.check(ne.ipv4()):a==="ipv6"?i=i.check(ne.ipv6()):a==="mac"?i=i.check(ne.mac()):a==="cidr"?i=i.check(ne.cidrv4()):a==="cidr-v6"?i=i.check(ne.cidrv6()):a==="base64"?i=i.check(ne.base64()):a==="base64url"?i=i.check(ne.base64url()):a==="e164"?i=i.check(ne.e164()):a==="jwt"?i=i.check(ne.jwt()):a==="emoji"?i=i.check(ne.emoji()):a==="nanoid"?i=i.check(ne.nanoid()):a==="cuid"?i=i.check(ne.cuid()):a==="cuid2"?i=i.check(ne.cuid2()):a==="ulid"?i=i.check(ne.ulid()):a==="xid"?i=i.check(ne.xid()):a==="ksuid"&&(i=i.check(ne.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"?ne.number().int():ne.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=ne.boolean();break}case"null":{n=ne.null();break}case"object":{let i={},a=t.properties||{},o=new Set(t.required||[]);for(let[c,u]of Object.entries(a)){let f=Qr(u,e);i[c]=o.has(c)?f:f.optional()}if(t.propertyNames){let c=Qr(t.propertyNames,e),u=t.additionalProperties&&typeof t.additionalProperties=="object"?Qr(t.additionalProperties,e):ne.any();if(Object.keys(i).length===0){n=ne.record(c,u);break}let f=ne.object(i).passthrough(),v=ne.looseRecord(c,u);n=ne.intersection(f,v);break}if(t.patternProperties){let c=t.patternProperties,u=Object.keys(c),f=[];for(let h of u){let y=Qr(c[h],e),_=ne.string().regex(new RegExp(h));f.push(ne.looseRecord(_,y))}let v=[];if(Object.keys(i).length>0&&v.push(ne.object(i).passthrough()),v.push(...f),v.length===0)n=ne.object({}).passthrough();else if(v.length===1)n=v[0];else{let h=ne.intersection(v[0],v[1]);for(let y=2;y<v.length;y++)h=ne.intersection(h,v[y]);n=h}break}let s=ne.object(i);t.additionalProperties===!1?n=s.strict():typeof t.additionalProperties=="object"?n=s.catchall(Qr(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=>Qr(c,e)),s=a&&typeof a=="object"&&!Array.isArray(a)?Qr(a,e):void 0;s?n=ne.tuple(o).rest(s):n=ne.tuple(o),typeof t.minItems=="number"&&(n=n.check(ne.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(ne.maxLength(t.maxItems)))}else if(Array.isArray(a)){let o=a.map(c=>Qr(c,e)),s=t.additionalItems&&typeof t.additionalItems=="object"?Qr(t.additionalItems,e):void 0;s?n=ne.tuple(o).rest(s):n=ne.tuple(o),typeof t.minItems=="number"&&(n=n.check(ne.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(ne.maxLength(t.maxItems)))}else if(a!==void 0){let o=Qr(a,e),s=ne.array(o);typeof t.minItems=="number"&&(s=s.min(t.minItems)),typeof t.maxItems=="number"&&(s=s.max(t.maxItems)),n=s}else n=ne.array(ne.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}function Qr(t,e){if(typeof t=="boolean")return t?ne.any():ne.never();let r=dI(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=>Qr(u,e)),c=ne.union(s);r=n?ne.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let s=t.oneOf.map(u=>Qr(u,e)),c=ne.xor(s);r=n?ne.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:ne.any();else{let s=n?r:Qr(t.allOf[0],e),c=n?0:1;for(let u=c;u<t.allOf.length;u++)s=ne.intersection(s,Qr(t.allOf[u],e));r=s}t.nullable===!0&&e.version==="openapi-3.0"&&(r=ne.nullable(r)),t.readOnly===!0&&(r=ne.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))sz.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 pI(t,e){if(typeof t=="boolean")return t?ne.any():ne.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=lz(r,e?.defaultTarget),i=r.$defs||r.definitions||{},a={version:n,defs:i,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??Or};return Qr(r,a)}var SP={};no(SP,{bigint:()=>fz,boolean:()=>pz,date:()=>mz,number:()=>dz,string:()=>uz});function uz(t){return qF(pp,t)}function dz(t){return iE(mp,t)}function pz(t){return uE(hp,t)}function fz(t){return pE(gp,t)}function mz(t){return AE(Dh,t)}Wt(Gw());var mI=[1,2,4,8],hI=[1,2,3,4,5,6,7,8],gI=["disable-track","mute-region"],vI=["none","all","previous-only"],xI=Ie.object({metronome:Ie.object({enabled:Ie.boolean(),beatSubDivision:Ie.union(mI.map(t=>Ie.literal(t))),gain:Ie.number().min(Number.NEGATIVE_INFINITY).max(0),monophonic:Ie.boolean()}).default({enabled:!1,beatSubDivision:1,gain:-6,monophonic:!0}),playback:Ie.object({timestampEnabled:Ie.boolean(),pauseOnLoopDisabled:Ie.boolean(),truncateNotesAtRegionEnd:Ie.boolean()}).default({timestampEnabled:!0,pauseOnLoopDisabled:!1,truncateNotesAtRegionEnd:!1}),debug:Ie.object({dspLoadMeasurement:Ie.boolean()}).default({dspLoadMeasurement:!1}),recording:Ie.object({countInBars:Ie.union(hI.map(t=>Ie.literal(t))),allowTakes:Ie.boolean(),automationEnabled:Ie.boolean(),olderTakeAction:Ie.union(gI.map(t=>Ie.literal(t))),olderTakeScope:Ie.union(vI.map(t=>Ie.literal(t))),inputLatency:Ie.number().min(-1)}).default({countInBars:1,allowTakes:!0,automationEnabled:!0,olderTakeAction:"mute-region",olderTakeScope:"previous-only",inputLatency:0})}),fI;(function(t){t.BeatSubDivisionOptions=mI,t.RecordingCountInBars=hI,t.OlderTakeActionOptions=gI,t.OlderTakeScopeOptions=vI})(fI||(fI={}));var Ls={[Mt.Instrument]:0,[Mt.Aux]:1,[Mt.Bus]:2,[Mt.Output]:3};var a0;(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}`),Xe.create(e,B.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=pi.collectIndexedBoxes(e.audioUnits,Xe),i=Ls[r],a=0;for(;a<n.length&&!(Ls[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 ge.Audio:return b.wrap(Aa.create(e,B.generate()));case ge.Notes:return b.wrap(Fa.create(e,B.generate()));default:return b.None}}})(a0||(a0={}));var yI;(function(t){t.create=(e,r,n,i,a)=>{console.debug(`createAudioBus '${r}', type: ${i}, color: ${a}`);let{boxGraph:o,mandatoryBoxes:{rootBox:s}}=e;re(s.isAttached(),"rootBox not attached");let c=B.generate(),u=Ln.create(o,c,v=>{v.collection.refer(s.audioBusses),v.label.setValue(r),v.icon.setValue(Oe.toName(n)),v.color.setValue(a.toString())}),f=a0.create(e,i,b.None);return u.output.refer(f.input),u}})(yI||(yI={}));var wI;(function(t){t.forAudioType=e=>{switch(e){case Mt.Output:return Go.blue;case Mt.Aux:return Go.purple;case Mt.Bus:return Go.orange;case Mt.Instrument:return Go.green;default:return Go.dark}},t.forTrackType=e=>{switch(e){case ge.Audio:return 200;case ge.Notes:return 45;case ge.Value:return 156;default:return 0}}})(wI||(wI={}));var bI;(function(t){t.Tape={defaultName:"Tape",defaultIcon:Oe.Tape,briefDescription:"Audio Player",description:"Plays audio regions & clips",manualPage:ie.Tape,trackType:ge.Audio,create:(n,i,a,o,s)=>au.create(n,B.generate(),c=>{c.label.setValue(a),c.icon.setValue(Oe.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:Oe.NanoWave,briefDescription:"Simple Sampler",description:"Simple sampler",manualPage:ie.Nano,trackType:ge.Notes,create:(n,i,a,o,s)=>iu.create(n,B.generate(),c=>{c.label.setValue(a),c.icon.setValue(Oe.toName(o)),K(s)&&c.file.refer(s),c.host.refer(i)})},t.Playfield={defaultName:"Playfield",defaultIcon:Oe.Playfield,briefDescription:"Drum Machine",description:"Drum computer",manualPage:ie.Playfield,trackType:ge.Notes,create:(n,i,a,o,s)=>{let c=nu.create(n,B.generate(),u=>{u.label.setValue(a),u.icon.setValue(Oe.toName(o)),u.host.refer(i)});return K(s)&&s.filter(({note:u,uuid:f,name:v,durationInSeconds:h,exclude:y})=>{let _=e(n,f,v,h);Ea.create(n,B.generate(),$=>{$.device.refer(c.samples),$.file.refer(_),$.index.setValue(u),$.exclude.setValue(y)})}),c}},t.Neon={defaultName:"Neon",defaultIcon:Oe.Neon,briefDescription:"CZ-style Synth",description:"CZ-style phase distortion synthesizer",manualPage:ie.Neon,trackType:ge.Notes,create:(n,i,a,o,s)=>ru.create(n,B.generate(),c=>{c.label.setValue(a),c.icon.setValue(Oe.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:Oe.Cube,briefDescription:"303-style Synth",description:"Acid bassline synthesizer",manualPage:"manuals/devices/instruments/cubed",trackType:ge.Notes,create:(n,i,a,o,s)=>su.create(n,B.generate(),c=>{c.label.setValue(a),c.icon.setValue(Oe.toName(o)),c.host.refer(i)})},t.Vaporisateur={defaultName:"Vaporisateur",defaultIcon:Oe.Vaporisateur,briefDescription:"Subtractive Synth",description:"Classic subtractive synthesizer",manualPage:ie.Vaporisateur,trackType:ge.Notes,create:(n,i,a,o,s)=>Qc.create(n,B.generate(),c=>{c.label.setValue(a),c.icon.setValue(Oe.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(ya.Polyphonic),c.lfo.rate.setInitValue(1),c.oscillators.fields()[0].waveform.setInitValue(ga.saw),c.oscillators.fields()[0].volume.setInitValue(-6),c.oscillators.fields()[1].volume.setInitValue(Number.NEGATIVE_INFINITY),c.oscillators.fields()[1].waveform.setInitValue(ga.square),c.host.refer(i),c.version.setValue(2)})},t.MIDIOutput={defaultName:"MIDIOutput",defaultIcon:Oe.Midi,briefDescription:"Send MIDI",description:"MIDI Output",manualPage:ie.MIDIOutput,trackType:ge.Notes,create:(n,i,a,o,s)=>eu.create(n,B.generate(),c=>{c.label.setValue(a),c.icon.setValue(Oe.toName(o)),c.host.refer(i)})},t.Soundfont={defaultName:"Soundfont",defaultIcon:Oe.SoundFont,briefDescription:"Soundfont Player",description:"Soundfont Player",manualPage:ie.Soundfont,trackType:ge.Notes,create:(n,i,a,o,s)=>tu.create(n,B.generate(),c=>{c.label.setValue(a),c.icon.setValue(Oe.toName(o)),K(s)&&c.file.refer(s),c.host.refer(i)})},t.Apparat={defaultName:"Apparat",defaultIcon:Oe.Code,briefDescription:"Scriptable Instrument",description:"User-scripted instrument",manualPage:ie.Apparat,trackType:ge.Notes,create:(n,i,a,o)=>ou.create(n,B.generate(),s=>{s.label.setValue(a),s.icon.setValue(Oe.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(()=>rn.create(n,i,s=>{s.fileName.setValue(a),s.endInSeconds.setValue(o)})),r=(n,i,a)=>n.findBox(i).unwrapOrElse(()=>_a.create(n,i,o=>o.fileName.setValue(a)))})(bI||(bI={}));var Mc;(function(t){t.empty=n=>{let i=new uo(b.wrap(mo.create)),a=new Date().toISOString();console.debug(`New Project created on ${a}`),i.beginTransaction();let o=Yc.create(i,B.generate(),h=>{h.label.setValue("Groove Shuffle")}),s=qo.create(i,B.generate(),h=>{h.groove.refer(o),h.created.setValue(a)}),c=Ln.create(i,B.generate(),h=>{h.collection.refer(s.audioBusses),h.label.setValue("Output"),h.icon.setValue(Oe.toName(Oe.SpeakerHeadphone)),h.color.setValue(Go.blue.toString())}),u=Xe.create(i,B.generate(),h=>{h.type.setValue(Mt.Output),h.collection.refer(s.audioUnits),h.output.refer(s.outputDevice),h.index.setValue(0)});n.createOutputMaximizer&&Xc.create(i,B.generate(),h=>{h.label.setValue("Master Maximizer"),h.index.setValue(0),h.host.refer(u.audioEffects),h.lookahead.setValue(!1)});let f=ol.create(i,B.generate());Wn.create(i,B.generate(),h=>f.tempoTrack.events.refer(h.owners)),s.timeline.refer(f.root),c.output.refer(u.input);let v=[];if(n.createDefaultUser){let h=ho.create(i,B.generate());h.root.refer(s.users),v.push(h)}return i.endTransaction(),{boxGraph:i,mandatoryBoxes:{rootBox:s,primaryAudioBusBox:c,primaryAudioUnitBox:u,timelineBox:f,userInterfaceBoxes:v}}},t.encode=n=>{let i=ir.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 it(n);re(i.readInt()===1330660686,"Corrupt header. Probably not an openDAW project file."),re(i.readInt()===2,"Deprecated Format");let a=i.readInt(),o=new Int8Array(a);i.readBytes(o);let s=new uo(b.wrap(mo.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=Re(i.outputDevice.pointerHub.incoming().at(0)?.box,Xe),o=Re(a.input.pointerHub.incoming().at(0)?.box,Ln),s=Re(i.timeline.targetVertex.unwrap("TimelineBox not found").box,ol),c=i.users.pointerHub.incoming().map(({box:u})=>Re(u,ho));return{rootBox:i,primaryAudioBusBox:o,primaryAudioUnitBox:a,timelineBox:s,userInterfaceBoxes:c}}return j("Could not find mandatory boxes")}})(Mc||(Mc={}));var Tt;(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===Jc.ClassName,t.generateMap=(n,i,a,o)=>{let s=B.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:B.generate()})),...i.map(c=>({source:c.address.uuid,target:c.resource==="preserved"?c.address.uuid:B.generate()}))]),s},t.copyBoxes=(n,i,a,o)=>{let s=B.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};k.decodeWith({map:(u,f)=>f.flatMap(v=>n.opt(v.uuid).match({some:({target:h})=>b.wrap(v.moveTo(h)),none:()=>i.findBox(v.uuid).nonEmpty()?b.wrap(v):b.None}))},()=>{a.forEach(u=>{let f=new it(u.toArrayBuffer()),v=n.get(u.address.uuid,"uuid mapping").target;i.createBox(u.name,v,h=>h.read(f))}),o.forEach(u=>{if(s.hasKey(u.address.uuid)||c(u))return;let f=new it(u.toArrayBuffer()),v=n.get(u.address.uuid,"uuid mapping").target;i.createBox(u.name,v,h=>h.read(f))})})},t.reorderAudioUnits=(n,i,a,o)=>{let s=i.toSorted(r).map(h=>Re(a.graph.findBox(n.get(h.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),Xe)),c=new Set(s),f=pi.collectIndexedBoxes(a.audioUnits,Xe).filter(h=>!c.has(h)),v;if(K(o)){let h=Fe(o,0,f.length);v=[...f.slice(0,h),...s,...f.slice(h)]}else{let h=f.toSorted(($,S)=>(Ls[$.type.getValue()]??0)-(Ls[S.type.getValue()]??0)),y=s.reduce(($,S)=>Math.max($,Ls[S.type.getValue()]??0),0),_=h.findIndex($=>(Ls[$.type.getValue()]??0)>y);_===-1&&(_=h.length),v=[...h.slice(0,_),...s,...h.slice(_)]}v.forEach((h,y)=>h.index.setValue(y))},t.extractRegions=(n,{boxGraph:i,mandatoryBoxes:{primaryAudioBusBox:a,rootBox:o}},s=0)=>{re(de.satisfy(n,e),"Region smust be from the same BoxGraph");let c=new Set(n),u=new Set,f=new cg;n.forEach(z=>{let O=Re(z.regions.targetVertex.unwrap("regions.target").box,fi);u.add(O);let J=Re(O.tracks.targetVertex.unwrap("tracks.target").box,Xe);f.add(J,O)}),console.debug(`Found ${f.keyCount()} audioUnits`),console.debug(`Found ${u.size} tracks`);let v=[...f.keys()],h=z=>t.shouldExclude(z)||gt(z,fi)&&!u.has(z)||ua.isRegionBox(z)&&!c.has(z),y=Array.from(v[0].graph.dependenciesOf(v,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:h}).boxes),_=t.generateMap(v,y,o.audioUnits.address.uuid,a.address.uuid);t.copyBoxes(_,i,v,y),t.reorderAudioUnits(_,v,o),f.forEach((z,O)=>[...O].sort(r).forEach((J,te)=>{let me=i.findBox(_.get(J.address.uuid,"uuid mapping").target).unwrap("Target Track has not been copied");Re(me,fi).index.setValue(te)}));let $=n.reduce((z,O)=>Math.min(z,O.position.getValue()),Number.MAX_VALUE),S=s-$;n.forEach(z=>{let O=i.findBox(_.get(z.address.uuid,"uuid mapping").target).unwrap("Target Track has not been copied"),{position:J}=ua.asRegionBox(O);J.setValue(J.getValue()+S)})}})(Tt||(Tt={}));var _I;(function(t){t.transfer=(e,{boxGraph:r,mandatoryBoxes:{primaryAudioBusBox:n,rootBox:i}},a={})=>{let o=e.filter(v=>v.type.getValue()!==Mt.Output);if(o.length===0)return[];let s=v=>Tt.shouldExclude(v)||a?.excludeTimeline===!0&&Tt.excludeTimelinePredicate(v),c=Array.from(o[0].graph.dependenciesOf(o,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:s}).boxes),u=Tt.generateMap(o,c,i.audioUnits.address.uuid,n.address.uuid);Tt.copyBoxes(u,r,o,c),Tt.reorderAudioUnits(u,o,i,a.insertIndex);let f=o.map(v=>Re(i.graph.findBox(u.get(v.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),Xe));if(a.deleteSource===!0){let v=Re(o[0].collection.targetVertex.unwrap("collection.target").box,qo);o.forEach(h=>h.delete()),pi.collectIndexedBoxes(v.audioUnits,Xe).forEach((h,y)=>h.index.setValue(y))}return f}})(_I||(_I={}));var AI;(function(t){t.transfer=(e,r,n,i=!0)=>{let a=r.graph,o=B.newSet(h=>h.address.uuid);o.add(e);for(let h of e.graph.dependenciesOf(e,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:y=>y.ephemeral}).boxes)o.add(h);let s=B.newSet(h=>h);o.forEach(h=>{h.resource==="preserved"&&a.findBox(h.address.uuid).nonEmpty()&&s.add(h.address.uuid)});let c=h=>{if(h.resource==="preserved"&&s.hasKey(h.address.uuid))return!0;for(let[,y]of h.outgoingEdges())if(s.hasKey(y.uuid)&&!y.isBox())return!0;return!1},u=o.values().filter(h=>!c(h)),f=B.newSet(h=>h.source);u.forEach(h=>{f.add({source:h.address.uuid,target:h.resource==="preserved"?h.address.uuid:B.generate()})}),s.forEach(h=>f.add({source:h,target:h}));let v=null;return k.decodeWith({map:(h,y)=>{let _=y.flatMap($=>f.opt($.uuid).map(S=>$.moveTo(S.target)));return _.nonEmpty()?_:h.pointerType===l.RegionCollection?b.wrap(r.regions.address):h.pointerType===l.ClipCollection?b.wrap(r.clips.address):b.None}},()=>u.forEach(h=>{let y=new it(h.toArrayBuffer()),_=f.get(h.address.uuid,"uuid mapping").target;a.createBox(h.name,_,$=>{if($.read(y),ua.isRegionBox($)){let S=ua.asRegionBox($);S.position.setValue(n),v=S}})})),i&&e.delete(),Ke(v,"Failed to create region copy")}})(AI||(AI={}));var Qt;(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={}))})(Qt||(Qt={}));var FI;(function(t){t.decode=(e,r)=>{let n=new it(e.slice(0,8));if(n.readInt()!==Qt.MAGIC_HEADER_OPEN)return Cc.notify({message:"Invalid preset file.",icon:"Warning"}),[];let i=n.readInt();if(i!==Qt.FORMAT_VERSION)return console.warn(`Unsupported preset version ${i} (supports ${Qt.FORMAT_VERSION})`),Cc.notify({message:"Unsupported preset version.",icon:"Warning"}),[];let a=new uo(b.wrap(mo.create));try{a.fromArrayBuffer(e.slice(8),!1)}catch(_){return console.warn(_),Cc.notify({message:"Could not import preset.",icon:"Warning"}),[]}let o={};for(let _ of a.boxes())o[_.name]=(o[_.name]??0)+1;console.info("PresetDecoder.decode: source graph boxes",o);let s=a.boxes().filter(_=>gt(_,Xe)).filter(_=>_.type.getValue()!==Mt.Output),c=_=>Tt.shouldExclude(_),u=Array.from(a.dependenciesOf(s,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:c}).boxes),{mandatoryBoxes:{rootBox:f,primaryAudioBusBox:v}}=r,h=Tt.generateMap(s,u,f.audioUnits.address.uuid,v.address.uuid);Tt.copyBoxes(h,r.boxGraph,s,u),Tt.reorderAudioUnits(h,s,f);let y=s.map(_=>Re(f.graph.findBox(h.get(_.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),Xe)).filter(_=>_.type.getValue()!==Mt.Output);return y.forEach(_=>{let $=_.input.pointerHub.incoming().at(0)?.box;if(!K($))return;let S=_.tracks.pointerHub.incoming().length;console.info(`PresetDecoder.decode: AudioUnit ${B.toString(_.address.uuid)} has ${S} pre-copied track(s)`),!(S>0)&&_.capture.targetVertex.ifSome(({box:z})=>{z instanceof Fa?fi.create(r.boxGraph,B.generate(),O=>{O.index.setValue(0),O.type.setValue(ge.Notes),O.target.refer(_),O.tracks.refer(_.tracks)}):z instanceof Aa&&fi.create(r.boxGraph,B.generate(),O=>{O.index.setValue(0),O.type.setValue(ge.Audio),O.target.refer(_),O.tracks.refer(_.tracks)})})}),y},t.peekHasTimeline=e=>{if(e.byteLength<8)return!1;let r=new it(e.slice(0,8));if(r.readInt()!==Qt.MAGIC_HEADER_OPEN||r.readInt()!==Qt.FORMAT_VERSION)return!1;let n=new uo(b.wrap(mo.create));if(Lt(()=>n.fromArrayBuffer(e.slice(8),!1)).status==="failure")return!1;for(let a of n.boxes())if(gt(a,fi))return!0;return!1},t.replaceAudioUnit=(e,r,n)=>{console.debug("ReplaceAudioUnit with preset...");let i=Mc.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:O})=>Re(O,Xe)).find(O=>O.type.getValue()!==Mt.Output);if(D0(s))return Pr.err("Preset contains no valid audio unit. Please send the file to the developers.");let c=s.capture.targetVertex.mapOr(({box:O})=>O.name,""),u=r.capture.targetVertex.mapOr(({box:O})=>O.name,"");if(c!==u)return Pr.err("Cannot replace incompatible instruments");let f=n?.keepMIDIEffects!==!0,v=n?.keepAudioEffects!==!0,h=n?.keepTimeline!==!0;console.debug("replaceMIDIEffects",f),console.debug("replaceAudioEffects",v),console.debug("replaceTimeline",h),Ke(r.input.pointerHub.incoming().at(0)?.box,"Target has no input").delete(),f?r.midiEffects.pointerHub.incoming().forEach(({box:O})=>O.delete()):(a.beginTransaction(),s.midiEffects.pointerHub.incoming().forEach(({box:O})=>O.delete()),a.endTransaction()),v?r.audioEffects.pointerHub.incoming().forEach(({box:O})=>O.delete()):(a.beginTransaction(),s.audioEffects.pointerHub.incoming().forEach(({box:O})=>O.delete()),a.endTransaction()),s.tracks.pointerHub.incoming().length>0&&h&&r.tracks.pointerHub.incoming().forEach(({box:O})=>O.delete());let _=O=>!!(O.accept({visitCaptureMidiBox:J=>!0,visitCaptureAudioBox:J=>!0})===!0||!h&&Tt.excludeTimelinePredicate(O)),$=B.newSet(({source:O})=>O),S=Array.from(a.dependenciesOf(s,{excludeBox:_,alwaysFollowMandatory:!0,stopAtResources:!0}).boxes);$.addMany([{source:s.address.uuid,target:r.address.uuid},...S.map(({address:{uuid:O},name:J})=>({source:O,target:J===rn.ClassName||J===_a.ClassName?O:B.generate()}))]);let z=B.newSet(O=>O);return S.forEach(O=>{(O instanceof rn||O instanceof _a)&&o.findBox(O.address.uuid).nonEmpty()&&z.add(O.address.uuid)}),k.decodeWith({map:(O,J)=>J.flatMap(te=>$.opt(te.uuid).match({some:({target:me})=>b.wrap(te.moveTo(me)),none:()=>o.findBox(te.uuid).nonEmpty()?b.wrap(te):b.None}))},()=>{S.forEach(O=>{if((O instanceof rn||O instanceof _a)&&z.opt(O.address.uuid).nonEmpty())return;let J=new it(O.toArrayBuffer()),te=O.name,me=$.get(O.address.uuid,"uuid mapping").target;o.createBox(te,me,he=>he.read(J))})}),Pr.Ok},t.insertEffectChain=(e,r,n,i)=>{if(e.byteLength<8)return Pr.err("Invalid preset header");let a=new it(e.slice(0,8));if(a.readInt()!==Qt.MAGIC_HEADER_OPEN)return Pr.err("Invalid preset header");let o=a.readInt();if(o!==Qt.FORMAT_VERSION)return Pr.err(`Unsupported preset version ${o} (this build supports ${Qt.FORMAT_VERSION}).`);let s=new uo(b.wrap(mo.create)),c=Lt(()=>s.fromArrayBuffer(e.slice(8),!1));if(c.status==="failure")return Pr.err(`Failed to decode preset: ${String(c.error)}`);let u=s.boxes().filter(he=>gt(he,Xe)).map(he=>Re(he,Xe)).find(he=>he.type.getValue()!==Mt.Output);if(D0(u))return Pr.err("Preset contains no audio unit");let f=i===Qt.ChainKind.Audio?u.audioEffects:u.midiEffects,v=pi.collectIndexedBoxes(f);if(v.length===0)return Pr.err("Preset contains no effects of the requested kind");let h=r.address,y=i===Qt.ChainKind.Audio?l.AudioEffectHost:l.MIDIEffectHost,_=r.box.graph,$=v.length,S=pi.collectIndexedBoxes(r);for(let he=S.length-1;he>=0;he--){let be=S[he],ue=be.index.getValue();ue>=n&&be.index.setValue(ue+$)}let z=he=>Tt.shouldExclude(he)||Tt.excludeTimelinePredicate(he)||he instanceof Xe,O=new Set(v),J=Array.from(s.dependenciesOf(v,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:z}).boxes).filter(he=>!O.has(he)),te=B.newSet(he=>he);J.forEach(he=>{he.resource==="preserved"&&_.findBox(he.address.uuid).nonEmpty()&&te.add(he.address.uuid)});let me=B.newSet(({source:he})=>he);return me.addMany([...v.map(he=>({source:he.address.uuid,target:B.generate()})),...J.map(he=>({source:he.address.uuid,target:he.resource==="preserved"?he.address.uuid:B.generate()}))]),k.decodeWith({map:(he,be)=>{let ue=be.flatMap(Se=>me.opt(Se.uuid).map(({target:Ut})=>Se.moveTo(Ut)));return ue.nonEmpty()?ue:he.pointerType===y?b.wrap(h):be.flatMap(Se=>_.findBox(Se.uuid).nonEmpty()?b.wrap(Se):b.None)}},()=>{v.forEach((he,be)=>{let ue=new it(he.toArrayBuffer()),Se=me.get(he.address.uuid,"uuid mapping").target;_.createBox(he.name,Se,Ut=>{Ut.read(ue),pi.isIndexedBox(Ut)&&Ut.index.setValue(n+be)})}),J.forEach(he=>{if(te.hasKey(he.address.uuid))return;let be=new it(he.toArrayBuffer()),ue=me.get(he.address.uuid,"uuid mapping").target;_.createBox(he.name,ue,Se=>Se.read(be))})}),Pr.Ok}})(FI||(FI={}));var EI;(function(t){t.encode=(e,r={})=>{let n=ir.create();n.writeInt(Qt.MAGIC_HEADER_OPEN),n.writeInt(Qt.FORMAT_VERSION);let i=Mc.empty({createOutputMaximizer:!1,createDefaultUser:!1}),{boxGraph:a,mandatoryBoxes:{rootBox:o,primaryAudioBusBox:s}}=i,c=[e],u=r.excludeEffect??(()=>!1),f=r.includeTimeline===!0,v=$=>Tt.shouldExclude($)||!f&&Tt.excludeTimelinePredicate($)||u($);a.beginTransaction();let h=Array.from(e.graph.dependenciesOf(c,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:v}).boxes),y={};for(let $ of h)y[$.name]=(y[$.name]??0)+1;console.info(`PresetEncoder.encode: includeTimeline=${f}, deps=${h.length}`,y);let _=Tt.generateMap(c,h,o.audioUnits.address.uuid,s.address.uuid);return Tt.copyBoxes(_,a,c,h),Tt.reorderAudioUnits(_,c,o),a.endTransaction(),de.concatArrayBuffers(n.toArrayBuffer(),a.toArrayBuffer())},t.encodeEffects=(e,r)=>{let n=ir.create();n.writeInt(Qt.MAGIC_HEADER_OPEN),n.writeInt(Qt.FORMAT_VERSION);let i=Mc.empty({createOutputMaximizer:!1,createDefaultUser:!1}),{boxGraph:a,mandatoryBoxes:{rootBox:o,primaryAudioBusBox:s}}=i;a.beginTransaction();let c=r===Qt.ChainKind.Audio?Aa.create(a,B.generate()):Fa.create(a,B.generate()),u=Xe.create(a,B.generate(),f=>{f.collection.refer(o.audioUnits),f.output.refer(s.input),f.index.setValue(0),f.type.setValue(Mt.Instrument),f.capture.refer(c)});if(lu.create(a,B.generate(),f=>{f.host.refer(u.input)}),e.length>0){let f=e[0].graph,v=z=>Tt.shouldExclude(z)||Tt.excludeTimelinePredicate(z)||z instanceof Xe,h=new Set(e),y=Array.from(f.dependenciesOf(e,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:v}).boxes).filter(z=>!h.has(z)),_=B.newSet(({source:z})=>z);_.addMany([...e.map(z=>({source:z.address.uuid,target:B.generate()})),...y.map(z=>({source:z.address.uuid,target:z.resource==="preserved"?z.address.uuid:B.generate()}))]);let $=r===Qt.ChainKind.Audio?u.audioEffects:u.midiEffects,S=r===Qt.ChainKind.Audio?l.AudioEffectHost:l.MIDIEffectHost;k.decodeWith({map:(z,O)=>{let J=O.flatMap(te=>_.opt(te.uuid).map(({target:me})=>te.moveTo(me)));return J.nonEmpty()?J:z.pointerType===S?b.wrap($.address):O.flatMap(te=>a.findBox(te.uuid).nonEmpty()?b.wrap(te):b.None)}},()=>{e.forEach((z,O)=>{let J=new it(z.toArrayBuffer()),te=_.get(z.address.uuid,"uuid mapping").target;a.createBox(z.name,te,me=>{me.read(J),pi.isIndexedBox(me)&&me.index.setValue(O)})}),y.forEach(z=>{let O=new it(z.toArrayBuffer()),J=_.get(z.address.uuid,"uuid mapping").target;a.createBox(z.name,J,te=>te.read(O))})})}return a.endTransaction(),de.concatArrayBuffers(n.toArrayBuffer(),a.toArrayBuffer())}})(EI||(EI={}));var SI;(function(t){t.existingInstrumentNames=e=>e.audioUnits.pointerHub.incoming().map(({box:r})=>{let n=Re(r,Xe).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"})})(SI||(SI={}));var PI;(function(t){t.Unknown={detect:async(e,r)=>(r(1),b.None)}})(PI||(PI={}));var MI=Ie.object({name:Ie.string(),bpm:Ie.number(),duration:Ie.number(),sample_rate:Ie.number(),origin:Ie.enum(["openDAW","recording","import"]),custom:Ie.string().optional()});var Cde=MI.extend({uuid:B.zType(Ie)});var hz,gz,vz,xz,yz,wz;hz=new WeakMap,gz=new WeakMap,vz=new WeakMap,xz=new WeakMap,yz=new WeakMap,wz=new WeakMap;var bz,_z,Az,Fz,Ez,Sz;bz=new WeakMap,_z=new WeakMap,Az=new WeakMap,Fz=new WeakMap,Ez=new WeakMap,Sz=new WeakMap;var Pz=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)},Zs,Mz,Nz,jh,NI,o0,PP,Kh,$z,MP,$I,kI,NP,BI;Mz=new WeakMap,Nz=new WeakMap,jh=new WeakMap,NI=new WeakMap,o0=new WeakMap,PP=new WeakMap,Kh=new WeakMap,Zs=new WeakSet,$z=function(e){let r=fr(this,Kh,"f");Pz(this,Kh,e.isEmpty()?b.None:b.wrap(e.unwrap()),"f"),r.ifSome(n=>fr(this,Zs,"m",MP).call(this,n)),fr(this,Kh,"f").ifSome(n=>{r.contains(n)||fr(this,Zs,"m",MP).call(this,n)})},MP=function(e){let r=fr(this,NI,"f").hasKey(e.address.uuid)&&!fr(this,Kh,"f").contains(e),n=fr(this,o0,"f").hasKey(e.address.uuid);r!==n&&(r?fr(this,o0,"f").add({user:e,terminable:fr(this,Zs,"m",$I).call(this,e)}):fr(this,o0,"f").removeByKey(e.address.uuid).terminable.terminate())},$I=function(e){let r=B.newSet(i=>i.box.address.uuid),n=e.selection.pointerHub.catchupAndSubscribe({onAdded:i=>{let a=Re(i.box,wa);a.selectable.targetVertex.ifSome(o=>{let s=o;r.add({box:a,selectable:s})&&fr(this,Zs,"m",kI).call(this,s,e)})},onRemoved:i=>{let a=Re(i.box,wa),o=r.removeByKeyIfExist(a.address.uuid);K(o)&&fr(this,Zs,"m",NP).call(this,o.selectable,e)}},l.Selection);return{terminate:()=>{n.terminate(),r.forEach(i=>fr(this,Zs,"m",NP).call(this,i.selectable,e)),r.clear()}}},kI=function(e,r){(fr(this,jh,"f").getOrNull(e.address)??fr(this,Zs,"m",BI).call(this,e)).owners.add(r),fr(this,PP,"f").proxy.onSelected(e,r)},NP=function(e,r){let n=fr(this,jh,"f").getOrNull(e.address);K(n)&&(n.owners.removeByKey(r.address.uuid),n.owners.size()===0&&fr(this,jh,"f").removeByKey(e.address),fr(this,PP,"f").proxy.onDeselected(e,r))},BI=function(e){let r={selectable:e,owners:B.newSet(n=>n.address.uuid)};return fr(this,jh,"f").add(r),r};var vp=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)},kz,Bz,$P,kP,BP,Iz,Tz,Dz;Bz=new WeakMap,$P=new WeakMap,kP=new WeakMap,BP=new WeakMap,Iz=new WeakMap,Tz=new WeakMap,kz=new WeakSet,Dz=function(e){return e.pointerHub.catchupAndSubscribe({onAdded:r=>{let n=Re(r.box,wa);re(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};vp(this,BP,"f").proxy.onSelected(i),re(vp(this,$P,"f").add(a),"Could not add to entityMap"),re(vp(this,kP,"f").add(a),"Could not add to selectableMap")},onRemoved:r=>{let n=Re(r.box,wa),i=vp(this,$P,"f").removeByKey(n.address.uuid);re(i.box===n,"Broken selection");let a=i.selectable;vp(this,BP,"f").proxy.onDeselected(a),vp(this,kP,"f").removeByKey(a.address)}},l.Selection)};var II=Ie.object({name:Ie.string(),size:Ie.number().int(),url:Ie.string(),license:Ie.string(),origin:Ie.enum(["openDAW","import"])});var ape=II.extend({uuid:B.zType(Ie)});var TI;(function(t){t.cut=(e,r,n)=>{if(e.position>=r||r>=e.complete)return b.None;if(y1.isLoopableRegion(e)){let{position:i,complete:a,loopOffset:o,loopDuration:s}=e;return e.duration=r-i,b.wrap(e.copyTo({position:r,duration:a-r,loopOffset:Js(o+(r-i),s),consolidate:n}))}else return j("Not yet implemented")},t.clip=(e,r,n)=>{if(y1.isLoopableRegion(e)){let{position:i,complete:a,loopOffset:o,loopDuration:s}=e;return r-i<=0?j(`first part duration will be zero or negative(${r-i})`):a-n<=0?j(`second part duration will be zero or negative(${a-n})`):(e.duration=r-i,e.copyTo({position:n,duration:a-n,loopOffset:Js(o+(n-i),s)}))}else return j("Not yet implemented")}})(TI||(TI={}));var s0=class{#e;#t;#r=0;#i=0;#n=0;#a=0;constructor(e){this.#e=new Int32Array(e),this.#t=new Float64Array(e)}start(){let e=Atomics.load(this.#e,1),r=Atomics.load(this.#e,2),n=this.#t[2],i=this.#t[3];this.#o();let a=0;return this.#r>0&&this.#i===this.#r+1&&(a=this.#a-this.#n),this.#r=e,this.#i=r,this.#n=n,this.#a=i,a}end(){this.#o()}#o(){Atomics.add(this.#e,0,1),Atomics.notify(this.#e,0)}};var l0=class t{static PEAK_DECAY=Math.exp(-1/(sampleRate*.25));static RMS_WINDOW=Math.floor(sampleRate*.3);#e;#t;#r;#i;#n;#a=0;#o=0;#s=0;#u=0;constructor(e,r){this.#e=e,this.#t=r,this.#r=new Float32Array(4),this.#i=de.create(()=>new _g(t.RMS_WINDOW),2),this.#n=this.#e.broadcastFloats(this.#t,this.#r,n=>{this.#r[0]=this.#a,this.#r[1]=this.#o,this.#r[2]=this.#s,this.#r[3]=this.#u})}clear(){this.#i[0].clear(),this.#i[1].clear(),this.#a=0,this.#o=0}process(e,r,n=0,i=ha){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.#o=Math.max(c,this.#o*o),this.#s=this.#i[0].processBlock(e,n,i),this.#u=this.#i[1].processBlock(r,n,i)}processStereo([e,r],n=0,i=ha){this.process(e,r,n,i)}terminate(){this.#n.terminate()}};var c0=class{#e=0;#t=0;#r=0;process(e,r,n){let i=e.length,a=0,o=0,s=0,c=0,u=0;for(let y=0;y<i;y++){let _=e[y],$=r[y];a+=_*$,o+=_*_,s+=$*$;let S=(_+$)*.5,z=(_-$)*.5;c+=S*S,u+=z*z}let f=o>1e-12&&s>1e-12?a/Math.sqrt(o*s):0,v=c+u>1e-12?u/(c+u):0,h=o+s>1e-12?(s-o)/(o+s):0;this.#e+=(f-this.#e)*.1,this.#t+=(v-this.#t)*.1,this.#r+=(h-this.#r)*.1,n[0]=this.#e,n[1]=this.#t,n[2]=this.#r,n[3]=Math.sqrt(c/Math.max(1,i)),n[4]=Math.sqrt(u/Math.max(1,i))}},u0=class{#e;#t=0;constructor(e){this.#e=e}process(e,r,n){let i=e.length;for(let a=0;a<i;a++){let o=this.#t*2;n[o]=e[a],n[o+1]=r[a],this.#t=(this.#t+1)%this.#e}}},d0=class t{static#e=-70;static#t=-70;static#r=.1;static#i=800;#n=new Mp;#a=new Mp;#o=new Ys;#s=new Ys;#u=new Ys;#l=new Ys;#c;#d;#p=new Float32Array(t.#i);#g=new Float32Array(t.#i);#v;#m=0;#y=0;#h=0;#x=0;#f=0;constructor(e){this.#n.setHighShelfParams(1681.974450955533/e,3.999843853973347),this.#a.setHighpassParams(38.13547087602444/e,.5003270373238773),this.#v=Math.max(1,Math.round(e*.1)),this.#c=new Float32Array(4),this.#d=new Float32Array(30)}process(e,r){let n=e.length;for(let i=0;i<n;i++){let a=e[i],o=r[i],s=this.#u.processFrame(this.#a,this.#o.processFrame(this.#n,a)),c=this.#l.processFrame(this.#a,this.#s.processFrame(this.#n,o));this.#h+=s*s+c*c;let u=Math.max(Math.abs(a),Math.abs(o));u>this.#f&&(this.#f=u),++this.#x>=this.#v&&(this.#A(this.#h/this.#x),this.#h=0,this.#x=0)}}fill(e){e[0]=t.#w(t.#_(this.#c)),e[1]=t.#w(t.#_(this.#d)),e[2]=this.#F(),e[3]=this.#S(),e[4]=this.#f>1e-7?20*Math.log10(this.#f):-120}#A(e){this.#c[this.#m]=e,this.#m=(this.#m+1)%this.#c.length,this.#d[this.#y]=e,this.#y=(this.#y+1)%this.#d.length;let r=t.#w(e);r>=t.#e&&t.#N(this.#p,r);let n=t.#w(t.#_(this.#d));n>=t.#e&&t.#N(this.#g,n)}#F(){let e=t.#M(this.#p,t.#e);if(e<=0)return-120;let r=t.#w(e)-10,n=t.#M(this.#p,r);return n>0?t.#w(n):-120}#S(){let e=t.#M(this.#g,t.#e);if(e<=0)return 0;let r=t.#w(e)-20,n=t.#$(this.#g,r,.1),i=t.#$(this.#g,r,.95);return Math.max(0,i-n)}static#_(e){let r=0;for(let n=0;n<e.length;n++)r+=e[n];return r/e.length}static#w(e){return e>1e-12?-.691+10*Math.log10(e):-120}static#P(e){let r=Math.floor((e-t.#t)/t.#r);return Math.max(0,Math.min(t.#i-1,r))}static#E(e){return t.#t+(e+.5)*t.#r}static#N(e,r){e[t.#P(r)]+=1}static#M(e,r){let n=0,i=0,a=t.#P(r);for(let o=a;o<t.#i;o++){let s=e[o];s<=0||(n+=s*Math.pow(10,(t.#E(o)+.691)/10),i+=s)}return i>0?n/i:0}static#$(e,r,n){let i=t.#P(r),a=0;for(let c=i;c<t.#i;c++)a+=e[c];if(a<=0)return t.#t;let o=a*n,s=0;for(let c=i;c<t.#i;c++)if(s+=e[c],s>=o)return t.#E(c);return t.#E(t.#i-1)}};var p0=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(tg(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,h=n|0,y=a<<1;return this.#r[y]=v,this.#r[y+1]=h,Atomics.store(this.#t,0,o),this.#e.postMessage(null),!0}};var f0=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 IP=16,m0=class{#e=new Map;#t=[new Uint8Array(1),new Uint8Array(2),new Uint8Array(3)];#r=null;connect(e,r){this.#r=new p0(e,r)}drain(e,r){let n=e.midi_out_count();if(n===0)return;let i=e.input_reserve(n*IP),a=e.midi_out_take(i),o=this.#r;if(o===null)return;let s=new Uint8Array(r.buffer,i,a*IP).slice(),c=new DataView(s.buffer);for(let u=0;u<a;u++){let f=u*IP,v=c.getUint32(f,!0),h=Math.min(Math.max(c.getUint8(f+7),1),3),y=c.getFloat64(f+8,!0),_=this.#t[h-1];_[0]=c.getUint8(f+4),h>1&&(_[1]=c.getUint8(f+5)),h>2&&(_[2]=c.getUint8(f+6)),o.send(this.#i(e,r,v),_,y)}}#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?"":f0(new Uint8Array(r.buffer,a,o));return this.#e.set(n,s),s}};var DI=(t,e)=>{let r=t.panic_message_len();return r===0?"":f0(new Uint8Array(e.buffer,t.panic_message_ptr(),r))};var Rz=["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"],h0=(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]},Cz=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]=h0(r,n);if(i===1){let[s,c]=h0(r,o),[,u]=h0(r,c),[f]=h0(r,u);return{memorySize:s,tableSize:f}}n=o+a}return{memorySize:0,tableSize:0}},TP=(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},RI=(t,e,r,n,i,a,o)=>{let{memorySize:s,tableSize:c}=Cz(n),u=t.device_alloc(s),f=c>0?r.grow(c):r.length,v=t.device_alloc(262144),h={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 z of Rz){let O=t[z];if(typeof O!="function")throw new Error(`engine is missing the device host export '${z}'`);h[z]=O}Object.assign(h,o);let y=new WebAssembly.Instance(n,{env:h}).exports;y.__wasm_apply_data_relocs?.(),y.__wasm_call_ctors?.();let _=z=>{if(z===void 0)return 0;let O=r.grow(1);return r.set(O,z),O},$=r.grow(1);r.set($,y.process_events??y.process);let S=t.device_register($,y.state_size(a),y.kind(),_(y.init),_(y.parameter_changed),_(y.field_changed),_(y.sample_changed),_(y.soundfont_changed),_(y.reset),_(y.terminate),y.midi_effects_field?.()??0,y.audio_effects_field?.()??0,y.observe_param_collection_field?.()??0,y.observe_sample_collection_field?.()??0);t.device_set_box_type(S,TP(t,e,i))},CI=(t,e,r)=>{t.composite_register(TP(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)},zI=(t,e,r)=>{t.effect_composite_register(TP(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])};var zz=1,g0=class{retained=[];scheduled=[];sourceToOutput=new Map;reset(){this.retained.length=0,this.scheduled.length=0,this.sourceToOutput.clear()}},Oz=(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)},DP=(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},Vz=(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,VI=(t,e,r,n,i,a,o,s,c,u,f,v,h,y)=>{let _=new DataView(r,n,i*40),$=new DataView(r,a,o*40),S=y?DP(r,n,i,a,o):0,z=(be,ue,Se,Ut,Xi,Je,ft)=>{if(S>=o)throw new Error(`Note flood: exceeded ${o} output notes per range`);Oz($,S++,be,ue,Se,Ut,Xi,Je,ft)};if((f&2)!==0){for(let be of t.retained)z(1,s,be.id,be.pitch,0,0,0);t.reset()}for(let be=t.retained.length-1;be>=0;be--){let ue=t.retained[be],Se=ue.position+ue.duration;Se<c&&(t.retained.splice(be,1),z(1,Se,ue.id,ue.pitch,0,0,0))}let O=[];for(let be=0;be<i;be++){let ue=be*40,Se=_.getUint32(ue+12,!0),Ut=_.getUint32(ue+16,!0),Xi=_.getFloat64(ue+0,!0),Je=_.getUint32(ue+20,!0);if(Se===0)O.push({gate:!0,id:Ut,position:Xi,duration:_.getFloat64(ue+32,!0),pitch:Je,velocity:_.getFloat32(ue+24,!0),cent:_.getFloat32(ue+28,!0)});else if(Se===1){let ft=t.sourceToOutput.get(Ut);if(ft!==void 0){for(let A0 of ft){let Zh=t.retained.findIndex(Gs=>Gs.id===A0);if(Zh>=0){let Gs=t.retained.splice(Zh,1)[0];z(1,Xi,Gs.id,Gs.pitch,0,0,0)}}t.sourceToOutput.delete(Ut)}O.push({gate:!1,id:Ut,position:Xi,pitch:Je})}}for(let be=t.scheduled.length-1;be>=0;be--){let ue=t.scheduled[be];ue.position>=s&&ue.position<c&&(t.scheduled.splice(be,1),z(0,ue.position,OI(t,ue),ue.pitch,ue.velocity,ue.cent,ue.duration))}let J=-1,te={[Symbol.iterator](){let be=0;return{next(){if(be>=O.length)return J=-1,{done:!0,value:void 0};let ue=O[be++];return ue.gate&&(J=ue.id),{done:!1,value:ue}}}}},me={from:s,to:c,bpm:u,s0:v,s1:h,flags:f},he=0;for(let be of e.process(me,te)){if(++he>128)throw new Error("Note flood: exceeded 128 notes per block");let ue=Vz(be,s);if(ue!==null)throw new Error(ue);let Se={position:be.position,duration:be.duration,pitch:be.pitch,velocity:be.velocity,cent:be.cent??0};if(Se.position>=c){if(t.scheduled.length>=128)throw new Error("Scheduler full: exceeded 128 scheduled notes");t.scheduled.push(Se)}else{let Ut=OI(t,Se);if(J>=0){let Xi=t.sourceToOutput.get(J);Xi===void 0&&(Xi=new Set,t.sourceToOutput.set(J,Xi)),Xi.add(Ut)}z(0,Se.position,Ut,Se.pitch,Se.velocity,Se.cent,Se.duration)}}return S},OI=(t,e)=>{let r=1073741824+(zz++&1073741823);return t.retained.push({id:r,position:e.position,duration:e.duration,pitch:e.pitch,velocity:e.velocity,cent:e.cent}),r};var v0=128,Uz=375,RP=0,jI=1,KI=2,jz={[RP]:"apparatProcessors",[jI]:"werkstattProcessors",[KI]:"spielwerkProcessors"},Kz=0,UI=1e3,CP=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},Wz=t=>{switch(t.mapping){case"unipolar":return F.unipolar();case"linear":return F.linear(t.min,t.max);case"exp":return F.exponential(t.min,t.max);case"int":return F.linearInteger(t.min,t.max);case"bool":return F.linearInteger(0,1);default:return F.unipolar()}},Lz=(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>UI||o<-UI)return`Signal overflow in channel ${n} at sample ${a} (amplitude: ${o.toFixed(1)})`}}return null},x0=class{#e;#t;#r;#i;#n=new Map;#a=new Map;#o=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.#s(e,r,n),host_script_audio:(e,r,n,i,a,o,s,c,u,f,v,h)=>this.#l(e,r,n,i,a,o,s,c,u,f,v,h),host_script_note_on:(e,r,n,i,a)=>this.#c(e,r,n,i,a),host_script_note_off:(e,r)=>this.#d(e,r),host_script_reset:e=>this.#p(e),host_script_param:(e,r,n,i)=>this.#g(e,r,n,i),host_script_sample:(e,r,n,i)=>this.#m(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.#f(e)}}#s(e,r,n){let i=B.toString(new Uint8Array(this.#e.buffer,e,16).slice()),a=this.#a.get(i);K(a)&&this.#f(a);let o=this.#o++;return this.#n.set(o,new CP(i,r,jz[r]??"werkstattProcessors")),this.#a.set(i,o),o}#u(e){let r=globalThis.openDAW?.[e.registryName]?.[e.uuid];if(r===void 0&&e.currentUpdate===-1)return!e.warnedMissing&&++e.missingCalls>Uz&&(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:Wz(i)}])),e.sampleLabels=new Map(r.samples.map(i=>[i.index,i.label])),e.kind===RP){n.samples={};for(let i of e.sampleLabels.values())n.samples[i]=null;e.limiter??=new Ag(this.#r)}e.kind===KI&&(e.spielwerk=new g0),e.proc=n,e.currentUpdate=r.update,e.silenced=!1;for(let[i,a]of e.rawParams)this.#v(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,h){let y=this.#n.get(e);if(y===void 0)return 1;let _=this.#u(y);if(_===null)return 1;let $=this.#e.buffer,S=new Float32Array($,i,v0),z=new Float32Array($,a,v0),O={index:c,p0:u,p1:f,s0:o,s1:s,bpm:v,flags:h};try{if(y.kind===jI){let te={src:[new Float32Array($,r,v0),new Float32Array($,n,v0)],out:[S,z]};_.process(te,O)}else{for(let[te,me]of y.sampleHandles)this.#h(y,te,me);S.fill(0,o,s),z.fill(0,o,s),_.process([S,z],O)}}catch(te){return this.#x(y,`Runtime error: ${te}`),1}let J=Lz([S,z],o,s);return J!==null?(S.fill(0,o,s),z.fill(0,o,s),this.#x(y,J),1):(y.kind===RP&&y.limiter!==null&&y.limiter.replace({channels:()=>[S,z]},o,s),0)}#c(e,r,n,i,a){let o=this.#n.get(e);o!==void 0&&this.#u(o)?.noteOn?.(r,n,i,a)}#d(e,r){let n=this.#n.get(e);n!==void 0&&this.#u(n)?.noteOff?.(r)}#p(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.#v(a,r,n,i))}#v(e,r,n,i){let a=e.paramMappings.get(r);if(a===void 0)return;let o=n===Kz?a.mapping.y(i):i;e.proc?.paramChanged?.(a.label,o)}#m(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 h=this.#n.get(e);if(h===void 0)return 0;let y=()=>h.pass?DP(this.#e.buffer,r,n,i,a):0,_=this.#u(h);if(_===null||h.spielwerk===null)return y();try{return VI(h.spielwerk,_,this.#e.buffer,r,n,i,a,o,s,c,u,f,v,h.pass)}catch($){return this.#x(h,`Runtime error: ${$}`),y()}}#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 h=0;h<u;h++)v.push(new Float32Array(this.#e.buffer,s+h*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)}#f(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}};var y0=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)},kt,Nc,$c,Wh,Lh=class t{constructor(e,r=128){if(kt.set(this,void 0),Nc.set(this,void 0),$c.set(this,void 0),Wh.set(this,void 0),y0(this,kt,e,"f"),y0(this,Wh,r,"f"),y0(this,Nc,e._malloc(r*4),"f"),y0(this,$c,e._malloc(r*4),"f"),rt(this,Nc,"f")===0||rt(this,$c,"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(){rt(this,kt,"f")._free(rt(this,Nc,"f")),rt(this,kt,"f")._free(rt(this,$c,"f"))}createInstance(){return rt(this,kt,"f")._nam_createInstance()}destroyInstance(e){rt(this,kt,"f")._nam_destroyInstance(e)}getInstanceCount(){return rt(this,kt,"f")._nam_getInstanceCount()}loadModel(e,r){let n=rt(this,kt,"f").lengthBytesUTF8(r)+1,i=rt(this,kt,"f")._malloc(n);if(i===0)return!1;try{return rt(this,kt,"f").stringToUTF8(r,i,n),rt(this,kt,"f")._nam_loadModel(e,i)}finally{rt(this,kt,"f")._free(i)}}unloadModel(e){rt(this,kt,"f")._nam_unloadModel(e)}hasModel(e){return rt(this,kt,"f")._nam_hasModel(e)}process(e,r,n){let i=Math.min(r.length,n.length,rt(this,Wh,"f")),a=rt(this,Nc,"f")>>2,o=rt(this,$c,"f")>>2;rt(this,kt,"f").HEAPF32.set(r.subarray(0,i),a),rt(this,kt,"f")._nam_process(e,rt(this,Nc,"f"),rt(this,$c,"f"),i),n.set(rt(this,kt,"f").HEAPF32.subarray(o,o+i))}processInPlace(e,r){this.process(e,r,r)}setSampleRate(e){rt(this,kt,"f")._nam_setSampleRate(e)}getSampleRate(){return rt(this,kt,"f")._nam_getSampleRate()}setMaxBufferSize(e){rt(this,kt,"f")._nam_setMaxBufferSize(e)}getMaxBufferSize(){return rt(this,kt,"f")._nam_getMaxBufferSize()}getModelLoudness(e){return rt(this,kt,"f")._nam_getModelLoudness(e)}hasModelLoudness(e){return rt(this,kt,"f")._nam_hasModelLoudness(e)}reset(e){rt(this,kt,"f")._nam_reset(e)}get bufferSize(){return rt(this,Wh,"f")}};kt=new WeakMap,Nc=new WeakMap,$c=new WeakMap,Wh=new WeakMap;var zP;(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)})(zP||(zP={}));var Zz=(()=>{var t=import.meta.url;return(function(e={}){var r=e,n,i;r.ready=new Promise((d,m)=>{n=d,i=m});var a=Object.assign({},r),o=[],s="./this.program",c=(d,m)=>{throw m},u=typeof window=="object",f=typeof importScripts=="function",v=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",h="";function y(d){return r.locateFile?r.locateFile(d,h):h+d}var _,$,S;(u||f)&&(f?h=self.location.href:typeof document<"u"&&document.currentScript&&(h=document.currentScript.src),t&&(h=t),h.indexOf("blob:")!==0?h=h.substr(0,h.replace(/[?#].*/,"").lastIndexOf("/")+1):h="",_=d=>{var m=new XMLHttpRequest;return m.open("GET",d,!1),m.send(null),m.responseText},f&&(S=d=>{var m=new XMLHttpRequest;return m.open("GET",d,!1),m.responseType="arraybuffer",m.send(null),new Uint8Array(m.response)}),$=(d,m,g)=>{var w=new XMLHttpRequest;w.open("GET",d,!0),w.responseType="arraybuffer",w.onload=()=>{if(w.status==200||w.status==0&&w.response){m(w.response);return}g()},w.onerror=g,w.send(null)});var z=r.print||console.log.bind(console),O=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 J;r.wasmBinary&&(J=r.wasmBinary),typeof WebAssembly!="object"&&kc("no native wasm support detected");var te,me=!1,he;function be(d,m){d||kc(m)}var ue,Se,Ut,Xi,Je,ft,A0,Zh;function Gs(){var d=te.buffer;r.HEAP8=ue=new Int8Array(d),r.HEAP16=Ut=new Int16Array(d),r.HEAPU8=Se=new Uint8Array(d),r.HEAPU16=Xi=new Uint16Array(d),r.HEAP32=Je=new Int32Array(d),r.HEAPU32=ft=new Uint32Array(d),r.HEAPF32=A0=new Float32Array(d),r.HEAPF64=Zh=new Float64Array(d)}var KP=[],WP=[],LP=[],tT=!1;function rT(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)aT(r.preRun.shift());S0(KP)}function iT(){tT=!0,!r.noFSInit&&!x.init.initialized&&x.init(),x.ignorePermissions=!1,Vo.init(),S0(WP)}function nT(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)sT(r.postRun.shift());S0(LP)}function aT(d){KP.unshift(d)}function oT(d){WP.unshift(d)}function sT(d){LP.unshift(d)}var Hs=0,F0=null,yp=null;function Xz(d){return d}function E0(d){Hs++,r.monitorRunDependencies?.(Hs)}function Gh(d){if(Hs--,r.monitorRunDependencies?.(Hs),Hs==0&&(F0!==null&&(clearInterval(F0),F0=null),yp)){var m=yp;yp=null,m()}}function kc(d){r.onAbort?.(d),d="Aborted("+d+")",O(d),me=!0,he=1,d+=". Build with -sASSERTIONS for more info.";var m=new WebAssembly.RuntimeError(d);throw i(m),m}var lT="data:application/octet-stream;base64,",ZP=d=>d.startsWith(lT),qs;r.locateFile?(qs="nam.wasm",ZP(qs)||(qs=y(qs))):qs=new URL("nam.wasm",import.meta.url).href;function GP(d){if(d==qs&&J)return new Uint8Array(J);if(S)return S(d);throw"both async and sync fetching of the wasm failed"}function cT(d){return!J&&(u||f)&&typeof fetch=="function"?fetch(d,{credentials:"same-origin"}).then(m=>{if(!m.ok)throw"failed to load wasm binary file at '"+d+"'";return m.arrayBuffer()}).catch(()=>GP(d)):Promise.resolve().then(()=>GP(d))}function HP(d,m,g){return cT(d).then(w=>WebAssembly.instantiate(w,m)).then(w=>w).then(g,w=>{O(`failed to asynchronously prepare wasm: ${w}`),kc(w)})}function uT(d,m,g,w){return!d&&typeof WebAssembly.instantiateStreaming=="function"&&!ZP(m)&&typeof fetch=="function"?fetch(m,{credentials:"same-origin"}).then(P=>{var C=WebAssembly.instantiateStreaming(P,g);return C.then(w,function(V){return O(`wasm streaming compile failed: ${V}`),O("falling back to ArrayBuffer instantiation"),HP(m,g,w)})}):HP(m,g,w)}function dT(){var d={a:LT};function m(w,P){return mt=w.exports,te=mt.l,Gs(),oT(mt.m),Gh("wasm-instantiate"),mt}E0("wasm-instantiate");function g(w){m(w.instance)}if(r.instantiateWasm)try{return r.instantiateWasm(d,m)}catch(w){O(`Module.instantiateWasm callback failed with error: ${w}`),i(w)}return uT(J,qs,d,g).catch(i),{}}var Ye,Ar,S0=d=>{for(;d.length>0;)d.shift()(r)},Qz=r.noExitRuntime||!0;function pT(d){this.excPtr=d,this.ptr=d-24,this.set_type=function(m){ft[this.ptr+4>>2]=m},this.get_type=function(){return ft[this.ptr+4>>2]},this.set_destructor=function(m){ft[this.ptr+8>>2]=m},this.get_destructor=function(){return ft[this.ptr+8>>2]},this.set_caught=function(m){m=m?1:0,ue[this.ptr+12>>0]=m},this.get_caught=function(){return ue[this.ptr+12>>0]!=0},this.set_rethrown=function(m){m=m?1:0,ue[this.ptr+13>>0]=m},this.get_rethrown=function(){return ue[this.ptr+13>>0]!=0},this.init=function(m,g){this.set_adjusted_ptr(0),this.set_type(m),this.set_destructor(g)},this.set_adjusted_ptr=function(m){ft[this.ptr+16>>2]=m},this.get_adjusted_ptr=function(){return ft[this.ptr+16>>2]},this.get_exception_ptr=function(){var m=lM(this.get_type());if(m)return ft[this.excPtr>>2];var g=this.get_adjusted_ptr();return g!==0?g:this.excPtr}}var qP=0,fT=0,mT=(d,m,g)=>{var w=new pT(d);throw w.init(m,g),qP=d,fT++,qP},hT=()=>{kc("")},gT=(d,m,g)=>Se.copyWithin(d,m,m+g),vT=()=>536870912,xT=d=>{var m=te.buffer,g=(d-m.byteLength+65535)/65536;try{return te.grow(g),Gs(),1}catch{}},yT=d=>{var m=Se.length;d>>>=0;var g=vT();if(d>g)return!1;for(var w=(ae,De)=>ae+(De-ae%De)%De,P=1;P<=4;P*=2){var C=m*(1+.2/P);C=Math.min(C,d+100663296);var V=Math.min(g,w(Math.max(d,C),65536)),W=xT(V);if(W)return!0}return!1},P0={},wT=()=>s||"./this.program",wp=()=>{if(!wp.strings){var d=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",m={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:d,_:wT()};for(var g in P0)P0[g]===void 0?delete m[g]:m[g]=P0[g];var w=[];for(var g in m)w.push(`${g}=${m[g]}`);wp.strings=w}return wp.strings},bT=(d,m)=>{for(var g=0;g<d.length;++g)ue[m++>>0]=d.charCodeAt(g);ue[m>>0]=0},ut={isAbs:d=>d.charAt(0)==="/",splitPath:d=>{var m=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return m.exec(d).slice(1)},normalizeArray:(d,m)=>{for(var g=0,w=d.length-1;w>=0;w--){var P=d[w];P==="."?d.splice(w,1):P===".."?(d.splice(w,1),g++):g&&(d.splice(w,1),g--)}if(m)for(;g;g--)d.unshift("..");return d},normalize:d=>{var m=ut.isAbs(d),g=d.substr(-1)==="/";return d=ut.normalizeArray(d.split("/").filter(w=>!!w),!m).join("/"),!d&&!m&&(d="."),d&&g&&(d+="/"),(m?"/":"")+d},dirname:d=>{var m=ut.splitPath(d),g=m[0],w=m[1];return!g&&!w?".":(w&&(w=w.substr(0,w.length-1)),g+w)},basename:d=>{if(d==="/")return"/";d=ut.normalize(d),d=d.replace(/\/$/,"");var m=d.lastIndexOf("/");return m===-1?d:d.substr(m+1)},join:function(){var d=Array.prototype.slice.call(arguments);return ut.normalize(d.join("/"))},join2:(d,m)=>ut.normalize(d+"/"+m)},_T=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return d=>crypto.getRandomValues(d);kc("initRandomDevice")},JP=d=>(JP=_T())(d),io={resolve:function(){for(var d="",m=!1,g=arguments.length-1;g>=-1&&!m;g--){var w=g>=0?arguments[g]:x.cwd();if(typeof w!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!w)return"";d=w+"/"+d,m=ut.isAbs(w)}return d=ut.normalizeArray(d.split("/").filter(P=>!!P),!m).join("/"),(m?"/":"")+d||"."},relative:(d,m)=>{d=io.resolve(d).substr(1),m=io.resolve(m).substr(1);function g(De){for(var qe=0;qe<De.length&&De[qe]==="";qe++);for(var at=De.length-1;at>=0&&De[at]==="";at--);return qe>at?[]:De.slice(qe,at-qe+1)}for(var w=g(d.split("/")),P=g(m.split("/")),C=Math.min(w.length,P.length),V=C,W=0;W<C;W++)if(w[W]!==P[W]){V=W;break}for(var ae=[],W=V;W<w.length;W++)ae.push("..");return ae=ae.concat(P.slice(V)),ae.join("/")}},YP=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Bc=(d,m,g)=>{for(var w=m+g,P=m;d[P]&&!(P>=w);)++P;if(P-m>16&&d.buffer&&YP)return YP.decode(d.subarray(m,P));for(var C="";m<P;){var V=d[m++];if(!(V&128)){C+=String.fromCharCode(V);continue}var W=d[m++]&63;if((V&224)==192){C+=String.fromCharCode((V&31)<<6|W);continue}var ae=d[m++]&63;if((V&240)==224?V=(V&15)<<12|W<<6|ae:V=(V&7)<<18|W<<12|ae<<6|d[m++]&63,V<65536)C+=String.fromCharCode(V);else{var De=V-65536;C+=String.fromCharCode(55296|De>>10,56320|De&1023)}}return C},M0=[],Hh=d=>{for(var m=0,g=0;g<d.length;++g){var w=d.charCodeAt(g);w<=127?m++:w<=2047?m+=2:w>=55296&&w<=57343?(m+=4,++g):m+=3}return m},N0=(d,m,g,w)=>{if(!(w>0))return 0;for(var P=g,C=g+w-1,V=0;V<d.length;++V){var W=d.charCodeAt(V);if(W>=55296&&W<=57343){var ae=d.charCodeAt(++V);W=65536+((W&1023)<<10)|ae&1023}if(W<=127){if(g>=C)break;m[g++]=W}else if(W<=2047){if(g+1>=C)break;m[g++]=192|W>>6,m[g++]=128|W&63}else if(W<=65535){if(g+2>=C)break;m[g++]=224|W>>12,m[g++]=128|W>>6&63,m[g++]=128|W&63}else{if(g+3>=C)break;m[g++]=240|W>>18,m[g++]=128|W>>12&63,m[g++]=128|W>>6&63,m[g++]=128|W&63}}return m[g]=0,g-P};function qh(d,m,g){var w=g>0?g:Hh(d)+1,P=new Array(w),C=N0(d,P,0,P.length);return m&&(P.length=C),P}var AT=()=>{if(!M0.length){var d=null;if(typeof window<"u"&&typeof window.prompt=="function"?(d=window.prompt("Input: "),d!==null&&(d+=`
113
+ 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 Ws(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 y=t.seen.get(v),_=y.schema;if(_.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(_)):Object.assign(u,_),Object.assign(u,f),s._zod.parent===v)for(let S in u)S==="$ref"||S==="allOf"||S in f||delete u[S];if(_.$ref&&y.def)for(let S in u)S==="$ref"||S==="allOf"||S in y.def&&JSON.stringify(u[S])===JSON.stringify(y.def[S])&&delete u[S]}let h=s._zod.parent;if(h&&h!==v){n(h);let y=t.seen.get(h);if(y?.schema.$ref&&(u.$ref=y.schema.$ref,y.def))for(let _ in u)_==="$ref"||_==="allOf"||_ in y.def&&JSON.stringify(u[_])===JSON.stringify(y.def[_])&&delete u[_]}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:lp(e,"input",t.processors),output:lp(e,"output",t.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function di(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 di(n.element,r);if(n.type==="set")return di(n.valueType,r);if(n.type==="lazy")return di(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 di(n.innerType,r);if(n.type==="intersection")return di(n.left,r)||di(n.right,r);if(n.type==="record"||n.type==="map")return di(n.keyType,r)||di(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:di(n.in,r)||di(n.out,r);if(n.type==="object"){for(let i in n.shape)if(di(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(di(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(di(i,r))return!0;return!!(n.rest&&di(n.rest,r))}return!1}var IE=(t,e={})=>r=>{let n=js({...r,processors:e});return ct(t,n),Ks(n,t),Ws(n,t)},lp=(t,e,r={})=>n=>{let{libraryOptions:i,target:a}=n??{},o=js({...i??{},target:a,io:e,processors:r});return ct(t,o),Ks(o,t),Ws(o,t)};var ez={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},TE=(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=ez[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}))])}},DE=(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),h=typeof u=="number"&&u<=(o??Number.POSITIVE_INFINITY),y=e.target==="draft-04"||e.target==="openapi-3.0";v?y?(i.minimum=f,i.exclusiveMinimum=!0):i.exclusiveMinimum=f:typeof a=="number"&&(i.minimum=a),h?y?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u:typeof o=="number"&&(i.maximum=o),typeof c=="number"&&(i.multipleOf=c)},RE=(t,e,r,n)=>{r.type="boolean"},CE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},zE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},OE=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},VE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},UE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},jE=(t,e,r,n)=>{r.not={}},KE=(t,e,r,n)=>{},WE=(t,e,r,n)=>{},LE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},ZE=(t,e,r,n)=>{let i=t._zod.def,a=uh(i.entries);a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),r.enum=a},GE=(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},HE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},qE=(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},JE=(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)},YE=(t,e,r,n)=>{r.type="boolean"},XE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},QE=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},eS=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},tS=(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")},iS=(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=ct(a.element,e,{...n,path:[...n.path,"items"]})},nS=(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]=ct(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=ct(a.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},Fb=(t,e,r,n)=>{let i=t._zod.def,a=i.inclusive===!1,o=i.options.map((s,c)=>ct(s,e,{...n,path:[...n.path,a?"oneOf":"anyOf",c]}));a?r.oneOf=o:r.anyOf=o},aS=(t,e,r,n)=>{let i=t._zod.def,a=ct(i.left,e,{...n,path:[...n.path,"allOf",0]}),o=ct(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},oS=(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((h,y)=>ct(h,e,{...n,path:[...n.path,o,y]})),u=a.rest?ct(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)},sS=(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=ct(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=ct(a.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=ct(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)}},lS=(t,e,r,n)=>{let i=t._zod.def,a=ct(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"}]},cS=(t,e,r,n)=>{let i=t._zod.def;ct(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},uS=(t,e,r,n)=>{let i=t._zod.def;ct(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},dS=(t,e,r,n)=>{let i=t._zod.def;ct(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)))},pS=(t,e,r,n)=>{let i=t._zod.def;ct(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},fS=(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;ct(o,e,n);let s=e.seen.get(t);s.ref=o},mS=(t,e,r,n)=>{let i=t._zod.def;ct(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.readOnly=!0},hS=(t,e,r,n)=>{let i=t._zod.def;ct(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},Eb=(t,e,r,n)=>{let i=t._zod.def;ct(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},gS=(t,e,r,n)=>{let i=t._zod.innerType;ct(i,e,n);let a=e.seen.get(t);a.ref=i},Ab={string:TE,number:DE,boolean:RE,bigint:CE,symbol:zE,null:OE,undefined:VE,void:UE,never:jE,any:KE,unknown:WE,date:LE,enum:ZE,literal:GE,nan:HE,template_literal:qE,file:JE,success:YE,custom:XE,function:QE,transform:eS,map:tS,set:rS,array:iS,object:nS,union:Fb,intersection:aS,tuple:oS,record:sS,nullable:lS,nonoptional:cS,default:uS,prefault:dS,catch:pS,pipe:fS,readonly:mS,promise:hS,optional:Eb,lazy:gS};function Sb(t,e){if("_idmap"in t){let n=t,i=js({...e,processors:Ab}),a={};for(let c of n._idmap.entries()){let[u,f]=c;ct(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;Ks(i,f),o[u]=Ws(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:Ab});return ct(t,r),Ks(r,t),Ws(r,t)}var Pb=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:Ab,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 ct(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)),Ks(this.ctx,e);let n=Ws(this.ctx,e),{"~standard":i,...a}=n;return a}};var Gk={};var Mh={};no(Mh,{ZodAny:()=>VS,ZodArray:()=>WS,ZodBase64:()=>Hb,ZodBase64URL:()=>qb,ZodBigInt:()=>gp,ZodBigIntFormat:()=>Xb,ZodBoolean:()=>hp,ZodCIDRv4:()=>Zb,ZodCIDRv6:()=>Gb,ZodCUID:()=>Ob,ZodCUID2:()=>Vb,ZodCatch:()=>pP,ZodCodec:()=>Vh,ZodCustom:()=>Uh,ZodCustomStringFormat:()=>fp,ZodDate:()=>Dh,ZodDefault:()=>oP,ZodDiscriminatedUnion:()=>ZS,ZodE164:()=>Jb,ZodEmail:()=>Rb,ZodEmoji:()=>Cb,ZodEnum:()=>dp,ZodExactOptional:()=>iP,ZodFile:()=>tP,ZodFunction:()=>_P,ZodGUID:()=>$h,ZodIPv4:()=>Wb,ZodIPv6:()=>Lb,ZodIntersection:()=>GS,ZodJWT:()=>Yb,ZodKSUID:()=>Kb,ZodLazy:()=>yP,ZodLiteral:()=>eP,ZodMAC:()=>IS,ZodMap:()=>XS,ZodNaN:()=>mP,ZodNanoID:()=>zb,ZodNever:()=>jS,ZodNonOptional:()=>n0,ZodNull:()=>zS,ZodNullable:()=>aP,ZodNumber:()=>mp,ZodNumberFormat:()=>Pc,ZodObject:()=>Ch,ZodOptional:()=>i0,ZodPipe:()=>Oh,ZodPrefault:()=>lP,ZodPreprocess:()=>hP,ZodPromise:()=>bP,ZodReadonly:()=>gP,ZodRecord:()=>up,ZodSet:()=>QS,ZodString:()=>pp,ZodStringFormat:()=>pt,ZodSuccess:()=>dP,ZodSymbol:()=>RS,ZodTemplateLiteral:()=>xP,ZodTransform:()=>rP,ZodTuple:()=>qS,ZodType:()=>Ve,ZodULID:()=>Ub,ZodURL:()=>Th,ZodUUID:()=>ro,ZodUndefined:()=>CS,ZodUnion:()=>zh,ZodUnknown:()=>US,ZodVoid:()=>KS,ZodXID:()=>jb,ZodXor:()=>LS,_ZodString:()=>Db,_default:()=>sP,_function:()=>rI,any:()=>IB,array:()=>Rh,base64:()=>gB,base64url:()=>vB,bigint:()=>MB,boolean:()=>DS,catch:()=>fP,check:()=>iI,cidrv4:()=>mB,cidrv6:()=>hB,codec:()=>XB,cuid:()=>oB,cuid2:()=>sB,custom:()=>nI,date:()=>DB,describe:()=>aI,discriminatedUnion:()=>UB,e164:()=>xB,email:()=>Jk,emoji:()=>nB,enum:()=>t0,exactOptional:()=>nP,file:()=>HB,float32:()=>FB,float64:()=>EB,function:()=>rI,guid:()=>Yk,hash:()=>AB,hex:()=>_B,hostname:()=>bB,httpUrl:()=>iB,instanceof:()=>sI,int:()=>Ib,int32:()=>SB,int64:()=>NB,intersection:()=>HS,invertCodec:()=>QB,ipv4:()=>dB,ipv6:()=>fB,json:()=>cI,jwt:()=>yB,keyof:()=>RB,ksuid:()=>uB,lazy:()=>wP,literal:()=>GB,looseObject:()=>OB,looseRecord:()=>KB,mac:()=>pB,map:()=>WB,meta:()=>oI,nan:()=>YB,nanoid:()=>aB,nativeEnum:()=>ZB,never:()=>Qb,nonoptional:()=>uP,null:()=>OS,nullable:()=>Bh,nullish:()=>qB,number:()=>TS,object:()=>CB,optional:()=>kh,partialRecord:()=>jB,pipe:()=>Tb,prefault:()=>cP,preprocess:()=>uI,promise:()=>tI,readonly:()=>vP,record:()=>YS,refine:()=>AP,set:()=>LB,strictObject:()=>zB,string:()=>Nh,stringFormat:()=>wB,stringbool:()=>lI,success:()=>JB,superRefine:()=>FP,symbol:()=>kB,templateLiteral:()=>eI,transform:()=>r0,tuple:()=>JS,uint32:()=>PB,uint64:()=>$B,ulid:()=>lB,undefined:()=>BB,union:()=>e0,unknown:()=>Sc,url:()=>rB,uuid:()=>Xk,uuidv4:()=>Qk,uuidv6:()=>eB,uuidv7:()=>tB,void:()=>TB,xid:()=>cB,xor:()=>VB});var Mb={};no(Mb,{endsWith:()=>ep,gt:()=>eo,gte:()=>ui,includes:()=>Xd,length:()=>Ec,lowercase:()=>Jd,lt:()=>Qa,lte:()=>Yi,maxLength:()=>Fc,maxSize:()=>Us,mime:()=>tp,minLength:()=>zo,minSize:()=>to,multipleOf:()=>Vs,negative:()=>yb,nonnegative:()=>bb,nonpositive:()=>wb,normalize:()=>rp,overwrite:()=>pa,positive:()=>xb,property:()=>_b,regex:()=>qd,size:()=>Ac,slugify:()=>op,startsWith:()=>Qd,toLowerCase:()=>np,toUpperCase:()=>ap,trim:()=>ip,uppercase:()=>Yd});var cp={};no(cp,{ZodISODate:()=>$b,ZodISODateTime:()=>Nb,ZodISODuration:()=>Bb,ZodISOTime:()=>kb,date:()=>xS,datetime:()=>vS,duration:()=>wS,time:()=>yS});var Nb=R("ZodISODateTime",(t,e)=>{HA.init(t,e),pt.init(t,e)});function vS(t){return XF(Nb,t)}var $b=R("ZodISODate",(t,e)=>{qA.init(t,e),pt.init(t,e)});function xS(t){return QF($b,t)}var kb=R("ZodISOTime",(t,e)=>{JA.init(t,e),pt.init(t,e)});function yS(t){return eE(kb,t)}var Bb=R("ZodISODuration",(t,e)=>{YA.init(t,e),pt.init(t,e)});function wS(t){return tE(Bb,t)}var Hk=(t,e)=>{hh.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>vh(t,r)},flatten:{value:r=>gh(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Vd,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Vd,2)}},isEmpty:{get(){return t.issues.length===0}}})},rz=R("ZodError",Hk),$i=R("ZodError",Hk,{Parent:Error});var bS=Kd($i),_S=Wd($i),AS=Ld($i),FS=Zd($i),ES=Sw($i),SS=Pw($i),PS=Mw($i),MS=Nw($i),NS=$w($i),$S=kw($i),kS=Bw($i),BS=Iw($i);var qk=new WeakMap;function Ih(t,e,r){let n=Object.getPrototypeOf(t),i=qk.get(n);if(i||(i=new Set,qk.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 Ve=R("ZodType",(t,e)=>(Be.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:lp(t,"input"),output:lp(t,"output")}}),t.toJSONSchema=IE(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>bS(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>AS(t,r,n),t.parseAsync=async(r,n)=>_S(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>FS(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>ES(t,r,n),t.decode=(r,n)=>SS(t,r,n),t.encodeAsync=async(r,n)=>PS(t,r,n),t.decodeAsync=async(r,n)=>MS(t,r,n),t.safeEncode=(r,n)=>NS(t,r,n),t.safeDecode=(r,n)=>$S(t,r,n),t.safeEncodeAsync=async(r,n)=>kS(t,r,n),t.safeDecodeAsync=async(r,n)=>BS(t,r,n),Ih(t,"ZodType",{check(...r){let n=this.def;return this.clone(H.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 li(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(AP(r,n))},superRefine(r,n){return this.check(FP(r,n))},overwrite(r){return this.check(pa(r))},optional(){return kh(this)},exactOptional(){return nP(this)},nullable(){return Bh(this)},nullish(){return kh(Bh(this))},nonoptional(r){return uP(this,r)},array(){return Rh(this)},or(r){return e0([this,r])},and(r){return HS(this,r)},transform(r){return Tb(this,r0(r))},default(r){return sP(this,r)},prefault(r){return cP(this,r)},catch(r){return fP(this,r)},pipe(r){return Tb(this,r)},readonly(){return vP(this)},describe(r){let n=this.clone();return Or.add(n,{description:r}),n},meta(...r){if(r.length===0)return Or.get(this);let n=this.clone();return Or.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 Or.get(t)?.description},configurable:!0}),t)),Db=R("_ZodString",(t,e)=>{_c.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(n,i,a)=>TE(t,n,i,a);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Ih(t,"_ZodString",{regex(...n){return this.check(qd(...n))},includes(...n){return this.check(Xd(...n))},startsWith(...n){return this.check(Qd(...n))},endsWith(...n){return this.check(ep(...n))},min(...n){return this.check(zo(...n))},max(...n){return this.check(Fc(...n))},length(...n){return this.check(Ec(...n))},nonempty(...n){return this.check(zo(1,...n))},lowercase(n){return this.check(Jd(n))},uppercase(n){return this.check(Yd(n))},trim(){return this.check(ip())},normalize(...n){return this.check(rp(...n))},toLowerCase(){return this.check(np())},toUpperCase(){return this.check(ap())},slugify(){return this.check(op())}})}),pp=R("ZodString",(t,e)=>{_c.init(t,e),Db.init(t,e),t.email=r=>t.check(Xw(Rb,r)),t.url=r=>t.check(Ph(Th,r)),t.jwt=r=>t.check(vb(Yb,r)),t.emoji=r=>t.check(ib(Cb,r)),t.guid=r=>t.check(Sh($h,r)),t.uuid=r=>t.check(Qw(ro,r)),t.uuidv4=r=>t.check(eb(ro,r)),t.uuidv6=r=>t.check(tb(ro,r)),t.uuidv7=r=>t.check(rb(ro,r)),t.nanoid=r=>t.check(nb(zb,r)),t.guid=r=>t.check(Sh($h,r)),t.cuid=r=>t.check(ab(Ob,r)),t.cuid2=r=>t.check(ob(Vb,r)),t.ulid=r=>t.check(sb(Ub,r)),t.base64=r=>t.check(mb(Hb,r)),t.base64url=r=>t.check(hb(qb,r)),t.xid=r=>t.check(lb(jb,r)),t.ksuid=r=>t.check(cb(Kb,r)),t.ipv4=r=>t.check(ub(Wb,r)),t.ipv6=r=>t.check(db(Lb,r)),t.cidrv4=r=>t.check(pb(Zb,r)),t.cidrv6=r=>t.check(fb(Gb,r)),t.e164=r=>t.check(gb(Jb,r)),t.datetime=r=>t.check(vS(r)),t.date=r=>t.check(xS(r)),t.time=r=>t.check(yS(r)),t.duration=r=>t.check(wS(r))});function Nh(t){return HF(pp,t)}var pt=R("ZodStringFormat",(t,e)=>{dt.init(t,e),Db.init(t,e)}),Rb=R("ZodEmail",(t,e)=>{OA.init(t,e),pt.init(t,e)});function Jk(t){return Xw(Rb,t)}var $h=R("ZodGUID",(t,e)=>{CA.init(t,e),pt.init(t,e)});function Yk(t){return Sh($h,t)}var ro=R("ZodUUID",(t,e)=>{zA.init(t,e),pt.init(t,e)});function Xk(t){return Qw(ro,t)}function Qk(t){return eb(ro,t)}function eB(t){return tb(ro,t)}function tB(t){return rb(ro,t)}var Th=R("ZodURL",(t,e)=>{VA.init(t,e),pt.init(t,e)});function rB(t){return Ph(Th,t)}function iB(t){return Ph(Th,{protocol:Ji.httpProtocol,hostname:Ji.domain,...H.normalizeParams(t)})}var Cb=R("ZodEmoji",(t,e)=>{UA.init(t,e),pt.init(t,e)});function nB(t){return ib(Cb,t)}var zb=R("ZodNanoID",(t,e)=>{jA.init(t,e),pt.init(t,e)});function aB(t){return nb(zb,t)}var Ob=R("ZodCUID",(t,e)=>{KA.init(t,e),pt.init(t,e)});function oB(t){return ab(Ob,t)}var Vb=R("ZodCUID2",(t,e)=>{WA.init(t,e),pt.init(t,e)});function sB(t){return ob(Vb,t)}var Ub=R("ZodULID",(t,e)=>{LA.init(t,e),pt.init(t,e)});function lB(t){return sb(Ub,t)}var jb=R("ZodXID",(t,e)=>{ZA.init(t,e),pt.init(t,e)});function cB(t){return lb(jb,t)}var Kb=R("ZodKSUID",(t,e)=>{GA.init(t,e),pt.init(t,e)});function uB(t){return cb(Kb,t)}var Wb=R("ZodIPv4",(t,e)=>{XA.init(t,e),pt.init(t,e)});function dB(t){return ub(Wb,t)}var IS=R("ZodMAC",(t,e)=>{eF.init(t,e),pt.init(t,e)});function pB(t){return JF(IS,t)}var Lb=R("ZodIPv6",(t,e)=>{QA.init(t,e),pt.init(t,e)});function fB(t){return db(Lb,t)}var Zb=R("ZodCIDRv4",(t,e)=>{tF.init(t,e),pt.init(t,e)});function mB(t){return pb(Zb,t)}var Gb=R("ZodCIDRv6",(t,e)=>{rF.init(t,e),pt.init(t,e)});function hB(t){return fb(Gb,t)}var Hb=R("ZodBase64",(t,e)=>{nF.init(t,e),pt.init(t,e)});function gB(t){return mb(Hb,t)}var qb=R("ZodBase64URL",(t,e)=>{aF.init(t,e),pt.init(t,e)});function vB(t){return hb(qb,t)}var Jb=R("ZodE164",(t,e)=>{oF.init(t,e),pt.init(t,e)});function xB(t){return gb(Jb,t)}var Yb=R("ZodJWT",(t,e)=>{sF.init(t,e),pt.init(t,e)});function yB(t){return vb(Yb,t)}var fp=R("ZodCustomStringFormat",(t,e)=>{lF.init(t,e),pt.init(t,e)});function wB(t,e,r={}){return sp(fp,t,e,r)}function bB(t){return sp(fp,"hostname",Ji.hostname,t)}function _B(t){return sp(fp,"hex",Ji.hex,t)}function AB(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=Ji[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return sp(fp,n,i,e)}var mp=R("ZodNumber",(t,e)=>{jw.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(n,i,a)=>DE(t,n,i,a),Ih(t,"ZodNumber",{gt(n,i){return this.check(eo(n,i))},gte(n,i){return this.check(ui(n,i))},min(n,i){return this.check(ui(n,i))},lt(n,i){return this.check(Qa(n,i))},lte(n,i){return this.check(Yi(n,i))},max(n,i){return this.check(Yi(n,i))},int(n){return this.check(Ib(n))},safe(n){return this.check(Ib(n))},positive(n){return this.check(eo(0,n))},nonnegative(n){return this.check(ui(0,n))},negative(n){return this.check(Qa(0,n))},nonpositive(n){return this.check(Yi(0,n))},multipleOf(n,i){return this.check(Vs(n,i))},step(n,i){return this.check(Vs(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 TS(t){return rE(mp,t)}var Pc=R("ZodNumberFormat",(t,e)=>{cF.init(t,e),mp.init(t,e)});function Ib(t){return nE(Pc,t)}function FB(t){return aE(Pc,t)}function EB(t){return oE(Pc,t)}function SB(t){return sE(Pc,t)}function PB(t){return lE(Pc,t)}var hp=R("ZodBoolean",(t,e)=>{bh.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>RE(t,r,n,i)});function DS(t){return cE(hp,t)}var gp=R("ZodBigInt",(t,e)=>{Kw.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(n,i,a)=>CE(t,n,i,a),t.gte=(n,i)=>t.check(ui(n,i)),t.min=(n,i)=>t.check(ui(n,i)),t.gt=(n,i)=>t.check(eo(n,i)),t.gte=(n,i)=>t.check(ui(n,i)),t.min=(n,i)=>t.check(ui(n,i)),t.lt=(n,i)=>t.check(Qa(n,i)),t.lte=(n,i)=>t.check(Yi(n,i)),t.max=(n,i)=>t.check(Yi(n,i)),t.positive=n=>t.check(eo(BigInt(0),n)),t.negative=n=>t.check(Qa(BigInt(0),n)),t.nonpositive=n=>t.check(Yi(BigInt(0),n)),t.nonnegative=n=>t.check(ui(BigInt(0),n)),t.multipleOf=(n,i)=>t.check(Vs(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function MB(t){return dE(gp,t)}var Xb=R("ZodBigIntFormat",(t,e)=>{uF.init(t,e),gp.init(t,e)});function NB(t){return fE(Xb,t)}function $B(t){return mE(Xb,t)}var RS=R("ZodSymbol",(t,e)=>{dF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>zE(t,r,n,i)});function kB(t){return hE(RS,t)}var CS=R("ZodUndefined",(t,e)=>{pF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>VE(t,r,n,i)});function BB(t){return gE(CS,t)}var zS=R("ZodNull",(t,e)=>{fF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>OE(t,r,n,i)});function OS(t){return vE(zS,t)}var VS=R("ZodAny",(t,e)=>{mF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>KE(t,r,n,i)});function IB(){return xE(VS)}var US=R("ZodUnknown",(t,e)=>{hF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>WE(t,r,n,i)});function Sc(){return yE(US)}var jS=R("ZodNever",(t,e)=>{gF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>jE(t,r,n,i)});function Qb(t){return wE(jS,t)}var KS=R("ZodVoid",(t,e)=>{vF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>UE(t,r,n,i)});function TB(t){return bE(KS,t)}var Dh=R("ZodDate",(t,e)=>{xF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(n,i,a)=>LE(t,n,i,a),t.min=(n,i)=>t.check(ui(n,i)),t.max=(n,i)=>t.check(Yi(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 DB(t){return _E(Dh,t)}var WS=R("ZodArray",(t,e)=>{yF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>iS(t,r,n,i),t.element=e.element,Ih(t,"ZodArray",{min(r,n){return this.check(zo(r,n))},nonempty(r){return this.check(zo(1,r))},max(r,n){return this.check(Fc(r,n))},length(r,n){return this.check(Ec(r,n))},unwrap(){return this.element}})});function Rh(t,e){return EE(WS,t,e)}function RB(t){let e=t._zod.def.shape;return t0(Object.keys(e))}var Ch=R("ZodObject",(t,e)=>{wF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>nS(t,r,n,i),H.defineLazy(t,"shape",()=>e.shape),Ih(t,"ZodObject",{keyof(){return t0(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Sc()})},loose(){return this.clone({...this._zod.def,catchall:Sc()})},strict(){return this.clone({...this._zod.def,catchall:Qb()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return H.extend(this,r)},safeExtend(r){return H.safeExtend(this,r)},merge(r){return H.merge(this,r)},pick(r){return H.pick(this,r)},omit(r){return H.omit(this,r)},partial(...r){return H.partial(i0,this,r[0])},required(...r){return H.required(n0,this,r[0])}})});function CB(t,e){let r={type:"object",shape:t??{},...H.normalizeParams(e)};return new Ch(r)}function zB(t,e){return new Ch({type:"object",shape:t,catchall:Qb(),...H.normalizeParams(e)})}function OB(t,e){return new Ch({type:"object",shape:t,catchall:Sc(),...H.normalizeParams(e)})}var zh=R("ZodUnion",(t,e)=>{_h.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Fb(t,r,n,i),t.options=e.options});function e0(t,e){return new zh({type:"union",options:t,...H.normalizeParams(e)})}var LS=R("ZodXor",(t,e)=>{zh.init(t,e),bF.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Fb(t,r,n,i),t.options=e.options});function VB(t,e){return new LS({type:"union",options:t,inclusive:!1,...H.normalizeParams(e)})}var ZS=R("ZodDiscriminatedUnion",(t,e)=>{zh.init(t,e),_F.init(t,e)});function UB(t,e,r){return new ZS({type:"union",options:e,discriminator:t,...H.normalizeParams(r)})}var GS=R("ZodIntersection",(t,e)=>{AF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>aS(t,r,n,i)});function HS(t,e){return new GS({type:"intersection",left:t,right:e})}var qS=R("ZodTuple",(t,e)=>{Ww.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>oS(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});function JS(t,e,r){let n=e instanceof Be,i=n?r:e,a=n?e:null;return new qS({type:"tuple",items:t,rest:a,...H.normalizeParams(i)})}var up=R("ZodRecord",(t,e)=>{FF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>sS(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function YS(t,e,r){return!e||!e._zod?new up({type:"record",keyType:Nh(),valueType:t,...H.normalizeParams(e)}):new up({type:"record",keyType:t,valueType:e,...H.normalizeParams(r)})}function jB(t,e,r){let n=li(t);return n._zod.values=void 0,new up({type:"record",keyType:n,valueType:e,...H.normalizeParams(r)})}function KB(t,e,r){return new up({type:"record",keyType:t,valueType:e,mode:"loose",...H.normalizeParams(r)})}var XS=R("ZodMap",(t,e)=>{EF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>tS(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(to(...r)),t.nonempty=r=>t.check(to(1,r)),t.max=(...r)=>t.check(Us(...r)),t.size=(...r)=>t.check(Ac(...r))});function WB(t,e,r){return new XS({type:"map",keyType:t,valueType:e,...H.normalizeParams(r)})}var QS=R("ZodSet",(t,e)=>{SF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>rS(t,r,n,i),t.min=(...r)=>t.check(to(...r)),t.nonempty=r=>t.check(to(1,r)),t.max=(...r)=>t.check(Us(...r)),t.size=(...r)=>t.check(Ac(...r))});function LB(t,e){return new QS({type:"set",valueType:t,...H.normalizeParams(e)})}var dp=R("ZodEnum",(t,e)=>{PF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(n,i,a)=>ZE(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 dp({...e,checks:[],...H.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 dp({...e,checks:[],...H.normalizeParams(i),entries:a})}});function t0(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new dp({type:"enum",entries:r,...H.normalizeParams(e)})}function ZB(t,e){return new dp({type:"enum",entries:t,...H.normalizeParams(e)})}var eP=R("ZodLiteral",(t,e)=>{MF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>GE(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 GB(t,e){return new eP({type:"literal",values:Array.isArray(t)?t:[t],...H.normalizeParams(e)})}var tP=R("ZodFile",(t,e)=>{NF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>JE(t,r,n,i),t.min=(r,n)=>t.check(to(r,n)),t.max=(r,n)=>t.check(Us(r,n)),t.mime=(r,n)=>t.check(tp(Array.isArray(r)?r:[r],n))});function HB(t){return SE(tP,t)}var rP=R("ZodTransform",(t,e)=>{$F.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>eS(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ds(t.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(H.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(H.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 r0(t){return new rP({type:"transform",transform:t})}var i0=R("ZodOptional",(t,e)=>{Lw.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Eb(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function kh(t){return new i0({type:"optional",innerType:t})}var iP=R("ZodExactOptional",(t,e)=>{kF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Eb(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function nP(t){return new iP({type:"optional",innerType:t})}var aP=R("ZodNullable",(t,e)=>{BF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>lS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function Bh(t){return new aP({type:"nullable",innerType:t})}function qB(t){return kh(Bh(t))}var oP=R("ZodDefault",(t,e)=>{IF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function sP(t,e){return new oP({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():H.shallowClone(e)}})}var lP=R("ZodPrefault",(t,e)=>{TF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>dS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function cP(t,e){return new lP({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():H.shallowClone(e)}})}var n0=R("ZodNonOptional",(t,e)=>{DF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>cS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function uP(t,e){return new n0({type:"nonoptional",innerType:t,...H.normalizeParams(e)})}var dP=R("ZodSuccess",(t,e)=>{RF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>YE(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function JB(t){return new dP({type:"success",innerType:t})}var pP=R("ZodCatch",(t,e)=>{CF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function fP(t,e){return new pP({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var mP=R("ZodNaN",(t,e)=>{zF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>HE(t,r,n,i)});function YB(t){return FE(mP,t)}var Oh=R("ZodPipe",(t,e)=>{Zw.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fS(t,r,n,i),t.in=e.in,t.out=e.out});function Tb(t,e){return new Oh({type:"pipe",in:t,out:e})}var Vh=R("ZodCodec",(t,e)=>{Oh.init(t,e),Ah.init(t,e)});function XB(t,e,r){return new Vh({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function QB(t){let e=t._zod.def;return new Vh({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var hP=R("ZodPreprocess",(t,e)=>{Oh.init(t,e),OF.init(t,e)}),gP=R("ZodReadonly",(t,e)=>{VF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function vP(t){return new gP({type:"readonly",innerType:t})}var xP=R("ZodTemplateLiteral",(t,e)=>{UF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>qE(t,r,n,i)});function eI(t,e){return new xP({type:"template_literal",parts:t,...H.normalizeParams(e)})}var yP=R("ZodLazy",(t,e)=>{WF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>gS(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});function wP(t){return new yP({type:"lazy",getter:t})}var bP=R("ZodPromise",(t,e)=>{KF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>hS(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function tI(t){return new bP({type:"promise",innerType:t})}var _P=R("ZodFunction",(t,e)=>{jF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>QE(t,r,n,i)});function rI(t){return new _P({type:"function",input:Array.isArray(t?.input)?JS(t?.input):t?.input??Rh(Sc()),output:t?.output??Sc()})}var Uh=R("ZodCustom",(t,e)=>{LF.init(t,e),Ve.init(t,e),t._zod.processJSONSchema=(r,n,i)=>XE(t,r,n,i)});function iI(t){let e=new ht({check:"custom"});return e._zod.check=t,e}function nI(t,e){return PE(Uh,t??(()=>!0),e)}function AP(t,e={}){return ME(Uh,t,e)}function FP(t,e){return NE(t,e)}var aI=$E,oI=kE;function sI(t,e={}){let r=new Uh({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...H.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 lI=(...t)=>BE({Codec:Vh,Boolean:hp,String:pp},...t);function cI(t){let e=wP(()=>e0([Nh(t),TS(),DS(),OS(),Rh(e),YS(Nh(),e)]));return e}function uI(t,e){return new hP({type:"pipe",in:r0(t),out:e})}var nz={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 az(t){Wt({customError:t})}function oz(){return Wt().customError}var EP;EP||(EP={});var ne={...Mh,...Mb,iso:cp},sz=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 lz(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 cz(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 dI(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return ne.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 ne.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=cz(i,e),o=Qr(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 ne.null();if(i.length===0)return ne.never();if(i.length===1)return ne.literal(i[0]);if(i.every(o=>typeof o=="string"))return ne.enum(i);let a=i.map(o=>ne.literal(o));return a.length<2?a[0]:ne.union([a[0],a[1],...a.slice(2)])}if(t.const!==void 0)return ne.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(a=>{let o={...t,type:a};return dI(o,e)});return i.length===0?ne.never():i.length===1?i[0]:ne.union(i)}if(!r)return ne.any();let n;switch(r){case"string":{let i=ne.string();if(t.format){let a=t.format;a==="email"?i=i.check(ne.email()):a==="uri"||a==="uri-reference"?i=i.check(ne.url()):a==="uuid"||a==="guid"?i=i.check(ne.uuid()):a==="date-time"?i=i.check(ne.iso.datetime()):a==="date"?i=i.check(ne.iso.date()):a==="time"?i=i.check(ne.iso.time()):a==="duration"?i=i.check(ne.iso.duration()):a==="ipv4"?i=i.check(ne.ipv4()):a==="ipv6"?i=i.check(ne.ipv6()):a==="mac"?i=i.check(ne.mac()):a==="cidr"?i=i.check(ne.cidrv4()):a==="cidr-v6"?i=i.check(ne.cidrv6()):a==="base64"?i=i.check(ne.base64()):a==="base64url"?i=i.check(ne.base64url()):a==="e164"?i=i.check(ne.e164()):a==="jwt"?i=i.check(ne.jwt()):a==="emoji"?i=i.check(ne.emoji()):a==="nanoid"?i=i.check(ne.nanoid()):a==="cuid"?i=i.check(ne.cuid()):a==="cuid2"?i=i.check(ne.cuid2()):a==="ulid"?i=i.check(ne.ulid()):a==="xid"?i=i.check(ne.xid()):a==="ksuid"&&(i=i.check(ne.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"?ne.number().int():ne.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=ne.boolean();break}case"null":{n=ne.null();break}case"object":{let i={},a=t.properties||{},o=new Set(t.required||[]);for(let[c,u]of Object.entries(a)){let f=Qr(u,e);i[c]=o.has(c)?f:f.optional()}if(t.propertyNames){let c=Qr(t.propertyNames,e),u=t.additionalProperties&&typeof t.additionalProperties=="object"?Qr(t.additionalProperties,e):ne.any();if(Object.keys(i).length===0){n=ne.record(c,u);break}let f=ne.object(i).passthrough(),v=ne.looseRecord(c,u);n=ne.intersection(f,v);break}if(t.patternProperties){let c=t.patternProperties,u=Object.keys(c),f=[];for(let h of u){let y=Qr(c[h],e),_=ne.string().regex(new RegExp(h));f.push(ne.looseRecord(_,y))}let v=[];if(Object.keys(i).length>0&&v.push(ne.object(i).passthrough()),v.push(...f),v.length===0)n=ne.object({}).passthrough();else if(v.length===1)n=v[0];else{let h=ne.intersection(v[0],v[1]);for(let y=2;y<v.length;y++)h=ne.intersection(h,v[y]);n=h}break}let s=ne.object(i);t.additionalProperties===!1?n=s.strict():typeof t.additionalProperties=="object"?n=s.catchall(Qr(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=>Qr(c,e)),s=a&&typeof a=="object"&&!Array.isArray(a)?Qr(a,e):void 0;s?n=ne.tuple(o).rest(s):n=ne.tuple(o),typeof t.minItems=="number"&&(n=n.check(ne.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(ne.maxLength(t.maxItems)))}else if(Array.isArray(a)){let o=a.map(c=>Qr(c,e)),s=t.additionalItems&&typeof t.additionalItems=="object"?Qr(t.additionalItems,e):void 0;s?n=ne.tuple(o).rest(s):n=ne.tuple(o),typeof t.minItems=="number"&&(n=n.check(ne.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(ne.maxLength(t.maxItems)))}else if(a!==void 0){let o=Qr(a,e),s=ne.array(o);typeof t.minItems=="number"&&(s=s.min(t.minItems)),typeof t.maxItems=="number"&&(s=s.max(t.maxItems)),n=s}else n=ne.array(ne.any());break}default:throw new Error(`Unsupported type: ${r}`)}return n}function Qr(t,e){if(typeof t=="boolean")return t?ne.any():ne.never();let r=dI(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=>Qr(u,e)),c=ne.union(s);r=n?ne.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let s=t.oneOf.map(u=>Qr(u,e)),c=ne.xor(s);r=n?ne.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:ne.any();else{let s=n?r:Qr(t.allOf[0],e),c=n?0:1;for(let u=c;u<t.allOf.length;u++)s=ne.intersection(s,Qr(t.allOf[u],e));r=s}t.nullable===!0&&e.version==="openapi-3.0"&&(r=ne.nullable(r)),t.readOnly===!0&&(r=ne.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))sz.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 pI(t,e){if(typeof t=="boolean")return t?ne.any():ne.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=lz(r,e?.defaultTarget),i=r.$defs||r.definitions||{},a={version:n,defs:i,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??Or};return Qr(r,a)}var SP={};no(SP,{bigint:()=>fz,boolean:()=>pz,date:()=>mz,number:()=>dz,string:()=>uz});function uz(t){return qF(pp,t)}function dz(t){return iE(mp,t)}function pz(t){return uE(hp,t)}function fz(t){return pE(gp,t)}function mz(t){return AE(Dh,t)}Wt(Gw());var mI=[1,2,4,8],hI=[1,2,3,4,5,6,7,8],gI=["disable-track","mute-region"],vI=["none","all","previous-only"],xI=Ie.object({metronome:Ie.object({enabled:Ie.boolean(),beatSubDivision:Ie.union(mI.map(t=>Ie.literal(t))),gain:Ie.number().min(Number.NEGATIVE_INFINITY).max(0),monophonic:Ie.boolean()}).default({enabled:!1,beatSubDivision:1,gain:-6,monophonic:!0}),playback:Ie.object({timestampEnabled:Ie.boolean(),pauseOnLoopDisabled:Ie.boolean(),truncateNotesAtRegionEnd:Ie.boolean()}).default({timestampEnabled:!0,pauseOnLoopDisabled:!1,truncateNotesAtRegionEnd:!1}),debug:Ie.object({dspLoadMeasurement:Ie.boolean()}).default({dspLoadMeasurement:!1}),recording:Ie.object({countInBars:Ie.union(hI.map(t=>Ie.literal(t))),allowTakes:Ie.boolean(),automationEnabled:Ie.boolean(),olderTakeAction:Ie.union(gI.map(t=>Ie.literal(t))),olderTakeScope:Ie.union(vI.map(t=>Ie.literal(t))),inputLatency:Ie.number().min(-1)}).default({countInBars:1,allowTakes:!0,automationEnabled:!0,olderTakeAction:"mute-region",olderTakeScope:"previous-only",inputLatency:0})}),fI;(function(t){t.BeatSubDivisionOptions=mI,t.RecordingCountInBars=hI,t.OlderTakeActionOptions=gI,t.OlderTakeScopeOptions=vI})(fI||(fI={}));var Ls={[Mt.Instrument]:0,[Mt.Aux]:1,[Mt.Bus]:2,[Mt.Output]:3};var a0;(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}`),Xe.create(e,B.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=pi.collectIndexedBoxes(e.audioUnits,Xe),i=Ls[r],a=0;for(;a<n.length&&!(Ls[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 ge.Audio:return b.wrap(Aa.create(e,B.generate()));case ge.Notes:return b.wrap(Fa.create(e,B.generate()));default:return b.None}}})(a0||(a0={}));var yI;(function(t){t.create=(e,r,n,i,a)=>{console.debug(`createAudioBus '${r}', type: ${i}, color: ${a}`);let{boxGraph:o,mandatoryBoxes:{rootBox:s}}=e;re(s.isAttached(),"rootBox not attached");let c=B.generate(),u=Ln.create(o,c,v=>{v.collection.refer(s.audioBusses),v.label.setValue(r),v.icon.setValue(Oe.toName(n)),v.color.setValue(a.toString())}),f=a0.create(e,i,b.None);return u.output.refer(f.input),u}})(yI||(yI={}));var wI;(function(t){t.forAudioType=e=>{switch(e){case Mt.Output:return Go.blue;case Mt.Aux:return Go.purple;case Mt.Bus:return Go.orange;case Mt.Instrument:return Go.green;default:return Go.dark}},t.forTrackType=e=>{switch(e){case ge.Audio:return 200;case ge.Notes:return 45;case ge.Value:return 156;default:return 0}}})(wI||(wI={}));var bI;(function(t){t.Tape={defaultName:"Tape",defaultIcon:Oe.Tape,briefDescription:"Audio Player",description:"Plays audio regions & clips",manualPage:ie.Tape,trackType:ge.Audio,create:(n,i,a,o,s)=>au.create(n,B.generate(),c=>{c.label.setValue(a),c.icon.setValue(Oe.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:Oe.NanoWave,briefDescription:"Simple Sampler",description:"Simple sampler",manualPage:ie.Nano,trackType:ge.Notes,create:(n,i,a,o,s)=>iu.create(n,B.generate(),c=>{c.label.setValue(a),c.icon.setValue(Oe.toName(o)),K(s)&&c.file.refer(s),c.host.refer(i)})},t.Playfield={defaultName:"Playfield",defaultIcon:Oe.Playfield,briefDescription:"Drum Machine",description:"Drum computer",manualPage:ie.Playfield,trackType:ge.Notes,create:(n,i,a,o,s)=>{let c=nu.create(n,B.generate(),u=>{u.label.setValue(a),u.icon.setValue(Oe.toName(o)),u.host.refer(i)});return K(s)&&s.filter(({note:u,uuid:f,name:v,durationInSeconds:h,exclude:y})=>{let _=e(n,f,v,h);Ea.create(n,B.generate(),$=>{$.device.refer(c.samples),$.file.refer(_),$.index.setValue(u),$.exclude.setValue(y)})}),c}},t.Neon={defaultName:"Neon",defaultIcon:Oe.Neon,briefDescription:"CZ-style Synth",description:"CZ-style phase distortion synthesizer",manualPage:ie.Neon,trackType:ge.Notes,create:(n,i,a,o,s)=>ru.create(n,B.generate(),c=>{c.label.setValue(a),c.icon.setValue(Oe.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:Oe.Cube,briefDescription:"303-style Synth",description:"Acid bassline synthesizer",manualPage:"manuals/devices/instruments/cubed",trackType:ge.Notes,create:(n,i,a,o,s)=>su.create(n,B.generate(),c=>{c.label.setValue(a),c.icon.setValue(Oe.toName(o)),c.host.refer(i)})},t.Vaporisateur={defaultName:"Vaporisateur",defaultIcon:Oe.Vaporisateur,briefDescription:"Subtractive Synth",description:"Classic subtractive synthesizer",manualPage:ie.Vaporisateur,trackType:ge.Notes,create:(n,i,a,o,s)=>Qc.create(n,B.generate(),c=>{c.label.setValue(a),c.icon.setValue(Oe.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(ya.Polyphonic),c.lfo.rate.setInitValue(1),c.oscillators.fields()[0].waveform.setInitValue(ga.saw),c.oscillators.fields()[0].volume.setInitValue(-6),c.oscillators.fields()[1].volume.setInitValue(Number.NEGATIVE_INFINITY),c.oscillators.fields()[1].waveform.setInitValue(ga.square),c.host.refer(i),c.version.setValue(2)})},t.MIDIOutput={defaultName:"MIDIOutput",defaultIcon:Oe.Midi,briefDescription:"Send MIDI",description:"MIDI Output",manualPage:ie.MIDIOutput,trackType:ge.Notes,create:(n,i,a,o,s)=>eu.create(n,B.generate(),c=>{c.label.setValue(a),c.icon.setValue(Oe.toName(o)),c.host.refer(i)})},t.Soundfont={defaultName:"Soundfont",defaultIcon:Oe.SoundFont,briefDescription:"Soundfont Player",description:"Soundfont Player",manualPage:ie.Soundfont,trackType:ge.Notes,create:(n,i,a,o,s)=>tu.create(n,B.generate(),c=>{c.label.setValue(a),c.icon.setValue(Oe.toName(o)),K(s)&&c.file.refer(s),c.host.refer(i)})},t.Apparat={defaultName:"Apparat",defaultIcon:Oe.Code,briefDescription:"Scriptable Instrument",description:"User-scripted instrument",manualPage:ie.Apparat,trackType:ge.Notes,create:(n,i,a,o)=>ou.create(n,B.generate(),s=>{s.label.setValue(a),s.icon.setValue(Oe.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(()=>rn.create(n,i,s=>{s.fileName.setValue(a),s.endInSeconds.setValue(o)})),r=(n,i,a)=>n.findBox(i).unwrapOrElse(()=>_a.create(n,i,o=>o.fileName.setValue(a)))})(bI||(bI={}));var Mc;(function(t){t.empty=n=>{let i=new uo(b.wrap(mo.create)),a=new Date().toISOString();console.debug(`New Project created on ${a}`),i.beginTransaction();let o=Yc.create(i,B.generate(),h=>{h.label.setValue("Groove Shuffle")}),s=qo.create(i,B.generate(),h=>{h.groove.refer(o),h.created.setValue(a)}),c=Ln.create(i,B.generate(),h=>{h.collection.refer(s.audioBusses),h.label.setValue("Output"),h.icon.setValue(Oe.toName(Oe.SpeakerHeadphone)),h.color.setValue(Go.blue.toString())}),u=Xe.create(i,B.generate(),h=>{h.type.setValue(Mt.Output),h.collection.refer(s.audioUnits),h.output.refer(s.outputDevice),h.index.setValue(0)});n.createOutputMaximizer&&Xc.create(i,B.generate(),h=>{h.label.setValue("Master Maximizer"),h.index.setValue(0),h.host.refer(u.audioEffects),h.lookahead.setValue(!1)});let f=ol.create(i,B.generate());Wn.create(i,B.generate(),h=>f.tempoTrack.events.refer(h.owners)),s.timeline.refer(f.root),c.output.refer(u.input);let v=[];if(n.createDefaultUser){let h=ho.create(i,B.generate());h.root.refer(s.users),v.push(h)}return i.endTransaction(),{boxGraph:i,mandatoryBoxes:{rootBox:s,primaryAudioBusBox:c,primaryAudioUnitBox:u,timelineBox:f,userInterfaceBoxes:v}}},t.encode=n=>{let i=ir.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 it(n);re(i.readInt()===1330660686,"Corrupt header. Probably not an openDAW project file."),re(i.readInt()===2,"Deprecated Format");let a=i.readInt(),o=new Int8Array(a);i.readBytes(o);let s=new uo(b.wrap(mo.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=Re(i.outputDevice.pointerHub.incoming().at(0)?.box,Xe),o=Re(a.input.pointerHub.incoming().at(0)?.box,Ln),s=Re(i.timeline.targetVertex.unwrap("TimelineBox not found").box,ol),c=i.users.pointerHub.incoming().map(({box:u})=>Re(u,ho));return{rootBox:i,primaryAudioBusBox:o,primaryAudioUnitBox:a,timelineBox:s,userInterfaceBoxes:c}}return j("Could not find mandatory boxes")}})(Mc||(Mc={}));var Tt;(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===Jc.ClassName,t.generateMap=(n,i,a,o)=>{let s=B.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:B.generate()})),...i.map(c=>({source:c.address.uuid,target:c.resource==="preserved"?c.address.uuid:B.generate()}))]),s},t.copyBoxes=(n,i,a,o)=>{let s=B.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};k.decodeWith({map:(u,f)=>f.flatMap(v=>n.opt(v.uuid).match({some:({target:h})=>b.wrap(v.moveTo(h)),none:()=>i.findBox(v.uuid).nonEmpty()?b.wrap(v):b.None}))},()=>{a.forEach(u=>{let f=new it(u.toArrayBuffer()),v=n.get(u.address.uuid,"uuid mapping").target;i.createBox(u.name,v,h=>h.read(f))}),o.forEach(u=>{if(s.hasKey(u.address.uuid)||c(u))return;let f=new it(u.toArrayBuffer()),v=n.get(u.address.uuid,"uuid mapping").target;i.createBox(u.name,v,h=>h.read(f))})})},t.reorderAudioUnits=(n,i,a,o)=>{let s=i.toSorted(r).map(h=>Re(a.graph.findBox(n.get(h.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),Xe)),c=new Set(s),f=pi.collectIndexedBoxes(a.audioUnits,Xe).filter(h=>!c.has(h)),v;if(K(o)){let h=Fe(o,0,f.length);v=[...f.slice(0,h),...s,...f.slice(h)]}else{let h=f.toSorted(($,S)=>(Ls[$.type.getValue()]??0)-(Ls[S.type.getValue()]??0)),y=s.reduce(($,S)=>Math.max($,Ls[S.type.getValue()]??0),0),_=h.findIndex($=>(Ls[$.type.getValue()]??0)>y);_===-1&&(_=h.length),v=[...h.slice(0,_),...s,...h.slice(_)]}v.forEach((h,y)=>h.index.setValue(y))},t.extractRegions=(n,{boxGraph:i,mandatoryBoxes:{primaryAudioBusBox:a,rootBox:o}},s=0)=>{re(de.satisfy(n,e),"Region smust be from the same BoxGraph");let c=new Set(n),u=new Set,f=new cg;n.forEach(z=>{let O=Re(z.regions.targetVertex.unwrap("regions.target").box,fi);u.add(O);let J=Re(O.tracks.targetVertex.unwrap("tracks.target").box,Xe);f.add(J,O)}),console.debug(`Found ${f.keyCount()} audioUnits`),console.debug(`Found ${u.size} tracks`);let v=[...f.keys()],h=z=>t.shouldExclude(z)||gt(z,fi)&&!u.has(z)||ua.isRegionBox(z)&&!c.has(z),y=Array.from(v[0].graph.dependenciesOf(v,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:h}).boxes),_=t.generateMap(v,y,o.audioUnits.address.uuid,a.address.uuid);t.copyBoxes(_,i,v,y),t.reorderAudioUnits(_,v,o),f.forEach((z,O)=>[...O].sort(r).forEach((J,te)=>{let me=i.findBox(_.get(J.address.uuid,"uuid mapping").target).unwrap("Target Track has not been copied");Re(me,fi).index.setValue(te)}));let $=n.reduce((z,O)=>Math.min(z,O.position.getValue()),Number.MAX_VALUE),S=s-$;n.forEach(z=>{let O=i.findBox(_.get(z.address.uuid,"uuid mapping").target).unwrap("Target Track has not been copied"),{position:J}=ua.asRegionBox(O);J.setValue(J.getValue()+S)})}})(Tt||(Tt={}));var _I;(function(t){t.transfer=(e,{boxGraph:r,mandatoryBoxes:{primaryAudioBusBox:n,rootBox:i}},a={})=>{let o=e.filter(v=>v.type.getValue()!==Mt.Output);if(o.length===0)return[];let s=v=>Tt.shouldExclude(v)||a?.excludeTimeline===!0&&Tt.excludeTimelinePredicate(v),c=Array.from(o[0].graph.dependenciesOf(o,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:s}).boxes),u=Tt.generateMap(o,c,i.audioUnits.address.uuid,n.address.uuid);Tt.copyBoxes(u,r,o,c),Tt.reorderAudioUnits(u,o,i,a.insertIndex);let f=o.map(v=>Re(i.graph.findBox(u.get(v.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),Xe));if(a.deleteSource===!0){let v=Re(o[0].collection.targetVertex.unwrap("collection.target").box,qo);o.forEach(h=>h.delete()),pi.collectIndexedBoxes(v.audioUnits,Xe).forEach((h,y)=>h.index.setValue(y))}return f}})(_I||(_I={}));var AI;(function(t){t.transfer=(e,r,n,i=!0)=>{let a=r.graph,o=B.newSet(h=>h.address.uuid);o.add(e);for(let h of e.graph.dependenciesOf(e,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:y=>y.ephemeral}).boxes)o.add(h);let s=B.newSet(h=>h);o.forEach(h=>{h.resource==="preserved"&&a.findBox(h.address.uuid).nonEmpty()&&s.add(h.address.uuid)});let c=h=>{if(h.resource==="preserved"&&s.hasKey(h.address.uuid))return!0;for(let[,y]of h.outgoingEdges())if(s.hasKey(y.uuid)&&!y.isBox())return!0;return!1},u=o.values().filter(h=>!c(h)),f=B.newSet(h=>h.source);u.forEach(h=>{f.add({source:h.address.uuid,target:h.resource==="preserved"?h.address.uuid:B.generate()})}),s.forEach(h=>f.add({source:h,target:h}));let v=null;return k.decodeWith({map:(h,y)=>{let _=y.flatMap($=>f.opt($.uuid).map(S=>$.moveTo(S.target)));return _.nonEmpty()?_:h.pointerType===l.RegionCollection?b.wrap(r.regions.address):h.pointerType===l.ClipCollection?b.wrap(r.clips.address):b.None}},()=>u.forEach(h=>{let y=new it(h.toArrayBuffer()),_=f.get(h.address.uuid,"uuid mapping").target;a.createBox(h.name,_,$=>{if($.read(y),ua.isRegionBox($)){let S=ua.asRegionBox($);S.position.setValue(n),v=S}})})),i&&e.delete(),Ke(v,"Failed to create region copy")}})(AI||(AI={}));var Qt;(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={}))})(Qt||(Qt={}));var FI;(function(t){t.decode=(e,r)=>{let n=new it(e.slice(0,8));if(n.readInt()!==Qt.MAGIC_HEADER_OPEN)return Cc.notify({message:"Invalid preset file.",icon:"Warning"}),[];let i=n.readInt();if(i!==Qt.FORMAT_VERSION)return console.warn(`Unsupported preset version ${i} (supports ${Qt.FORMAT_VERSION})`),Cc.notify({message:"Unsupported preset version.",icon:"Warning"}),[];let a=new uo(b.wrap(mo.create));try{a.fromArrayBuffer(e.slice(8),!1)}catch(_){return console.warn(_),Cc.notify({message:"Could not import preset.",icon:"Warning"}),[]}let o={};for(let _ of a.boxes())o[_.name]=(o[_.name]??0)+1;console.info("PresetDecoder.decode: source graph boxes",o);let s=a.boxes().filter(_=>gt(_,Xe)).filter(_=>_.type.getValue()!==Mt.Output),c=_=>Tt.shouldExclude(_),u=Array.from(a.dependenciesOf(s,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:c}).boxes),{mandatoryBoxes:{rootBox:f,primaryAudioBusBox:v}}=r,h=Tt.generateMap(s,u,f.audioUnits.address.uuid,v.address.uuid);Tt.copyBoxes(h,r.boxGraph,s,u),Tt.reorderAudioUnits(h,s,f);let y=s.map(_=>Re(f.graph.findBox(h.get(_.address.uuid,"uuid mapping").target).unwrap("Target AudioUnit has not been copied"),Xe)).filter(_=>_.type.getValue()!==Mt.Output);return y.forEach(_=>{let $=_.input.pointerHub.incoming().at(0)?.box;if(!K($))return;let S=_.tracks.pointerHub.incoming().length;console.info(`PresetDecoder.decode: AudioUnit ${B.toString(_.address.uuid)} has ${S} pre-copied track(s)`),!(S>0)&&_.capture.targetVertex.ifSome(({box:z})=>{z instanceof Fa?fi.create(r.boxGraph,B.generate(),O=>{O.index.setValue(0),O.type.setValue(ge.Notes),O.target.refer(_),O.tracks.refer(_.tracks)}):z instanceof Aa&&fi.create(r.boxGraph,B.generate(),O=>{O.index.setValue(0),O.type.setValue(ge.Audio),O.target.refer(_),O.tracks.refer(_.tracks)})})}),y},t.peekHasTimeline=e=>{if(e.byteLength<8)return!1;let r=new it(e.slice(0,8));if(r.readInt()!==Qt.MAGIC_HEADER_OPEN||r.readInt()!==Qt.FORMAT_VERSION)return!1;let n=new uo(b.wrap(mo.create));if(Lt(()=>n.fromArrayBuffer(e.slice(8),!1)).status==="failure")return!1;for(let a of n.boxes())if(gt(a,fi))return!0;return!1},t.replaceAudioUnit=(e,r,n)=>{console.debug("ReplaceAudioUnit with preset...");let i=Mc.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:O})=>Re(O,Xe)).find(O=>O.type.getValue()!==Mt.Output);if(D0(s))return Pr.err("Preset contains no valid audio unit. Please send the file to the developers.");let c=s.capture.targetVertex.mapOr(({box:O})=>O.name,""),u=r.capture.targetVertex.mapOr(({box:O})=>O.name,"");if(c!==u)return Pr.err("Cannot replace incompatible instruments");let f=n?.keepMIDIEffects!==!0,v=n?.keepAudioEffects!==!0,h=n?.keepTimeline!==!0;console.debug("replaceMIDIEffects",f),console.debug("replaceAudioEffects",v),console.debug("replaceTimeline",h),Ke(r.input.pointerHub.incoming().at(0)?.box,"Target has no input").delete(),f?r.midiEffects.pointerHub.incoming().forEach(({box:O})=>O.delete()):(a.beginTransaction(),s.midiEffects.pointerHub.incoming().forEach(({box:O})=>O.delete()),a.endTransaction()),v?r.audioEffects.pointerHub.incoming().forEach(({box:O})=>O.delete()):(a.beginTransaction(),s.audioEffects.pointerHub.incoming().forEach(({box:O})=>O.delete()),a.endTransaction()),s.tracks.pointerHub.incoming().length>0&&h&&r.tracks.pointerHub.incoming().forEach(({box:O})=>O.delete());let _=O=>!!(O.accept({visitCaptureMidiBox:J=>!0,visitCaptureAudioBox:J=>!0})===!0||!h&&Tt.excludeTimelinePredicate(O)),$=B.newSet(({source:O})=>O),S=Array.from(a.dependenciesOf(s,{excludeBox:_,alwaysFollowMandatory:!0,stopAtResources:!0}).boxes);$.addMany([{source:s.address.uuid,target:r.address.uuid},...S.map(({address:{uuid:O},name:J})=>({source:O,target:J===rn.ClassName||J===_a.ClassName?O:B.generate()}))]);let z=B.newSet(O=>O);return S.forEach(O=>{(O instanceof rn||O instanceof _a)&&o.findBox(O.address.uuid).nonEmpty()&&z.add(O.address.uuid)}),k.decodeWith({map:(O,J)=>J.flatMap(te=>$.opt(te.uuid).match({some:({target:me})=>b.wrap(te.moveTo(me)),none:()=>o.findBox(te.uuid).nonEmpty()?b.wrap(te):b.None}))},()=>{S.forEach(O=>{if((O instanceof rn||O instanceof _a)&&z.opt(O.address.uuid).nonEmpty())return;let J=new it(O.toArrayBuffer()),te=O.name,me=$.get(O.address.uuid,"uuid mapping").target;o.createBox(te,me,he=>he.read(J))})}),Pr.Ok},t.insertEffectChain=(e,r,n,i)=>{if(e.byteLength<8)return Pr.err("Invalid preset header");let a=new it(e.slice(0,8));if(a.readInt()!==Qt.MAGIC_HEADER_OPEN)return Pr.err("Invalid preset header");let o=a.readInt();if(o!==Qt.FORMAT_VERSION)return Pr.err(`Unsupported preset version ${o} (this build supports ${Qt.FORMAT_VERSION}).`);let s=new uo(b.wrap(mo.create)),c=Lt(()=>s.fromArrayBuffer(e.slice(8),!1));if(c.status==="failure")return Pr.err(`Failed to decode preset: ${String(c.error)}`);let u=s.boxes().filter(he=>gt(he,Xe)).map(he=>Re(he,Xe)).find(he=>he.type.getValue()!==Mt.Output);if(D0(u))return Pr.err("Preset contains no audio unit");let f=i===Qt.ChainKind.Audio?u.audioEffects:u.midiEffects,v=pi.collectIndexedBoxes(f);if(v.length===0)return Pr.err("Preset contains no effects of the requested kind");let h=r.address,y=i===Qt.ChainKind.Audio?l.AudioEffectHost:l.MIDIEffectHost,_=r.box.graph,$=v.length,S=pi.collectIndexedBoxes(r);for(let he=S.length-1;he>=0;he--){let be=S[he],ue=be.index.getValue();ue>=n&&be.index.setValue(ue+$)}let z=he=>Tt.shouldExclude(he)||Tt.excludeTimelinePredicate(he)||he instanceof Xe,O=new Set(v),J=Array.from(s.dependenciesOf(v,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:z}).boxes).filter(he=>!O.has(he)),te=B.newSet(he=>he);J.forEach(he=>{he.resource==="preserved"&&_.findBox(he.address.uuid).nonEmpty()&&te.add(he.address.uuid)});let me=B.newSet(({source:he})=>he);return me.addMany([...v.map(he=>({source:he.address.uuid,target:B.generate()})),...J.map(he=>({source:he.address.uuid,target:he.resource==="preserved"?he.address.uuid:B.generate()}))]),k.decodeWith({map:(he,be)=>{let ue=be.flatMap(Se=>me.opt(Se.uuid).map(({target:Ut})=>Se.moveTo(Ut)));return ue.nonEmpty()?ue:he.pointerType===y?b.wrap(h):be.flatMap(Se=>_.findBox(Se.uuid).nonEmpty()?b.wrap(Se):b.None)}},()=>{v.forEach((he,be)=>{let ue=new it(he.toArrayBuffer()),Se=me.get(he.address.uuid,"uuid mapping").target;_.createBox(he.name,Se,Ut=>{Ut.read(ue),pi.isIndexedBox(Ut)&&Ut.index.setValue(n+be)})}),J.forEach(he=>{if(te.hasKey(he.address.uuid))return;let be=new it(he.toArrayBuffer()),ue=me.get(he.address.uuid,"uuid mapping").target;_.createBox(he.name,ue,Se=>Se.read(be))})}),Pr.Ok}})(FI||(FI={}));var EI;(function(t){t.encode=(e,r={})=>{let n=ir.create();n.writeInt(Qt.MAGIC_HEADER_OPEN),n.writeInt(Qt.FORMAT_VERSION);let i=Mc.empty({createOutputMaximizer:!1,createDefaultUser:!1}),{boxGraph:a,mandatoryBoxes:{rootBox:o,primaryAudioBusBox:s}}=i,c=[e],u=r.excludeEffect??(()=>!1),f=r.includeTimeline===!0,v=$=>Tt.shouldExclude($)||!f&&Tt.excludeTimelinePredicate($)||u($);a.beginTransaction();let h=Array.from(e.graph.dependenciesOf(c,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:v}).boxes),y={};for(let $ of h)y[$.name]=(y[$.name]??0)+1;console.info(`PresetEncoder.encode: includeTimeline=${f}, deps=${h.length}`,y);let _=Tt.generateMap(c,h,o.audioUnits.address.uuid,s.address.uuid);return Tt.copyBoxes(_,a,c,h),Tt.reorderAudioUnits(_,c,o),a.endTransaction(),de.concatArrayBuffers(n.toArrayBuffer(),a.toArrayBuffer())},t.encodeEffects=(e,r)=>{let n=ir.create();n.writeInt(Qt.MAGIC_HEADER_OPEN),n.writeInt(Qt.FORMAT_VERSION);let i=Mc.empty({createOutputMaximizer:!1,createDefaultUser:!1}),{boxGraph:a,mandatoryBoxes:{rootBox:o,primaryAudioBusBox:s}}=i;a.beginTransaction();let c=r===Qt.ChainKind.Audio?Aa.create(a,B.generate()):Fa.create(a,B.generate()),u=Xe.create(a,B.generate(),f=>{f.collection.refer(o.audioUnits),f.output.refer(s.input),f.index.setValue(0),f.type.setValue(Mt.Instrument),f.capture.refer(c)});if(lu.create(a,B.generate(),f=>{f.host.refer(u.input)}),e.length>0){let f=e[0].graph,v=z=>Tt.shouldExclude(z)||Tt.excludeTimelinePredicate(z)||z instanceof Xe,h=new Set(e),y=Array.from(f.dependenciesOf(e,{alwaysFollowMandatory:!0,stopAtResources:!0,excludeBox:v}).boxes).filter(z=>!h.has(z)),_=B.newSet(({source:z})=>z);_.addMany([...e.map(z=>({source:z.address.uuid,target:B.generate()})),...y.map(z=>({source:z.address.uuid,target:z.resource==="preserved"?z.address.uuid:B.generate()}))]);let $=r===Qt.ChainKind.Audio?u.audioEffects:u.midiEffects,S=r===Qt.ChainKind.Audio?l.AudioEffectHost:l.MIDIEffectHost;k.decodeWith({map:(z,O)=>{let J=O.flatMap(te=>_.opt(te.uuid).map(({target:me})=>te.moveTo(me)));return J.nonEmpty()?J:z.pointerType===S?b.wrap($.address):O.flatMap(te=>a.findBox(te.uuid).nonEmpty()?b.wrap(te):b.None)}},()=>{e.forEach((z,O)=>{let J=new it(z.toArrayBuffer()),te=_.get(z.address.uuid,"uuid mapping").target;a.createBox(z.name,te,me=>{me.read(J),pi.isIndexedBox(me)&&me.index.setValue(O)})}),y.forEach(z=>{let O=new it(z.toArrayBuffer()),J=_.get(z.address.uuid,"uuid mapping").target;a.createBox(z.name,J,te=>te.read(O))})})}return a.endTransaction(),de.concatArrayBuffers(n.toArrayBuffer(),a.toArrayBuffer())}})(EI||(EI={}));var SI;(function(t){t.existingInstrumentNames=e=>e.audioUnits.pointerHub.incoming().map(({box:r})=>{let n=Re(r,Xe).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"})})(SI||(SI={}));var PI;(function(t){t.Unknown={detect:async(e,r)=>(r(1),b.None)}})(PI||(PI={}));var MI=Ie.object({name:Ie.string(),bpm:Ie.number(),duration:Ie.number(),sample_rate:Ie.number(),origin:Ie.enum(["openDAW","recording","import"]),custom:Ie.string().optional()});var Cde=MI.extend({uuid:B.zType(Ie)});var hz,gz,vz,xz,yz,wz;hz=new WeakMap,gz=new WeakMap,vz=new WeakMap,xz=new WeakMap,yz=new WeakMap,wz=new WeakMap;var bz,_z,Az,Fz,Ez,Sz;bz=new WeakMap,_z=new WeakMap,Az=new WeakMap,Fz=new WeakMap,Ez=new WeakMap,Sz=new WeakMap;var Pz=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)},Zs,Mz,Nz,jh,NI,o0,PP,Kh,$z,MP,$I,kI,NP,BI;Mz=new WeakMap,Nz=new WeakMap,jh=new WeakMap,NI=new WeakMap,o0=new WeakMap,PP=new WeakMap,Kh=new WeakMap,Zs=new WeakSet,$z=function(e){let r=fr(this,Kh,"f");Pz(this,Kh,e.isEmpty()?b.None:b.wrap(e.unwrap()),"f"),r.ifSome(n=>fr(this,Zs,"m",MP).call(this,n)),fr(this,Kh,"f").ifSome(n=>{r.contains(n)||fr(this,Zs,"m",MP).call(this,n)})},MP=function(e){let r=fr(this,NI,"f").hasKey(e.address.uuid)&&!fr(this,Kh,"f").contains(e),n=fr(this,o0,"f").hasKey(e.address.uuid);r!==n&&(r?fr(this,o0,"f").add({user:e,terminable:fr(this,Zs,"m",$I).call(this,e)}):fr(this,o0,"f").removeByKey(e.address.uuid).terminable.terminate())},$I=function(e){let r=B.newSet(i=>i.box.address.uuid),n=e.selection.pointerHub.catchupAndSubscribe({onAdded:i=>{let a=Re(i.box,wa);a.selectable.targetVertex.ifSome(o=>{let s=o;r.add({box:a,selectable:s})&&fr(this,Zs,"m",kI).call(this,s,e)})},onRemoved:i=>{let a=Re(i.box,wa),o=r.removeByKeyIfExist(a.address.uuid);K(o)&&fr(this,Zs,"m",NP).call(this,o.selectable,e)}},l.Selection);return{terminate:()=>{n.terminate(),r.forEach(i=>fr(this,Zs,"m",NP).call(this,i.selectable,e)),r.clear()}}},kI=function(e,r){(fr(this,jh,"f").getOrNull(e.address)??fr(this,Zs,"m",BI).call(this,e)).owners.add(r),fr(this,PP,"f").proxy.onSelected(e,r)},NP=function(e,r){let n=fr(this,jh,"f").getOrNull(e.address);K(n)&&(n.owners.removeByKey(r.address.uuid),n.owners.size()===0&&fr(this,jh,"f").removeByKey(e.address),fr(this,PP,"f").proxy.onDeselected(e,r))},BI=function(e){let r={selectable:e,owners:B.newSet(n=>n.address.uuid)};return fr(this,jh,"f").add(r),r};var vp=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)},kz,Bz,$P,kP,BP,Iz,Tz,Dz;Bz=new WeakMap,$P=new WeakMap,kP=new WeakMap,BP=new WeakMap,Iz=new WeakMap,Tz=new WeakMap,kz=new WeakSet,Dz=function(e){return e.pointerHub.catchupAndSubscribe({onAdded:r=>{let n=Re(r.box,wa);re(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};vp(this,BP,"f").proxy.onSelected(i),re(vp(this,$P,"f").add(a),"Could not add to entityMap"),re(vp(this,kP,"f").add(a),"Could not add to selectableMap")},onRemoved:r=>{let n=Re(r.box,wa),i=vp(this,$P,"f").removeByKey(n.address.uuid);re(i.box===n,"Broken selection");let a=i.selectable;vp(this,BP,"f").proxy.onDeselected(a),vp(this,kP,"f").removeByKey(a.address)}},l.Selection)};var II=Ie.object({name:Ie.string(),size:Ie.number().int(),url:Ie.string(),license:Ie.string(),origin:Ie.enum(["openDAW","import"])});var ape=II.extend({uuid:B.zType(Ie)});var TI;(function(t){t.cut=(e,r,n)=>{if(e.position>=r||r>=e.complete)return b.None;if(y1.isLoopableRegion(e)){let{position:i,complete:a,loopOffset:o,loopDuration:s}=e;return e.duration=r-i,b.wrap(e.copyTo({position:r,duration:a-r,loopOffset:Js(o+(r-i),s),consolidate:n}))}else return j("Not yet implemented")},t.clip=(e,r,n)=>{if(y1.isLoopableRegion(e)){let{position:i,complete:a,loopOffset:o,loopDuration:s}=e;return r-i<=0?j(`first part duration will be zero or negative(${r-i})`):a-n<=0?j(`second part duration will be zero or negative(${a-n})`):(e.duration=r-i,e.copyTo({position:n,duration:a-n,loopOffset:Js(o+(n-i),s)}))}else return j("Not yet implemented")}})(TI||(TI={}));var s0=class{#e;#t;#r=0;#i=0;#n=0;#a=0;constructor(e){this.#e=new Int32Array(e),this.#t=new Float64Array(e)}start(){let e=Atomics.load(this.#e,1),r=Atomics.load(this.#e,2),n=this.#t[2],i=this.#t[3];this.#o();let a=0;return this.#r>0&&this.#i===this.#r+1&&(a=this.#a-this.#n),this.#r=e,this.#i=r,this.#n=n,this.#a=i,a}end(){this.#o()}#o(){Atomics.add(this.#e,0,1),Atomics.notify(this.#e,0)}};var l0=class t{static PEAK_DECAY=Math.exp(-1/(sampleRate*.25));static RMS_WINDOW=Math.floor(sampleRate*.3);#e;#t;#r;#i;#n;#a=0;#o=0;#s=0;#u=0;constructor(e,r){this.#e=e,this.#t=r,this.#r=new Float32Array(4),this.#i=de.create(()=>new _g(t.RMS_WINDOW),2),this.#n=this.#e.broadcastFloats(this.#t,this.#r,n=>{this.#r[0]=this.#a,this.#r[1]=this.#o,this.#r[2]=this.#s,this.#r[3]=this.#u})}clear(){this.#i[0].clear(),this.#i[1].clear(),this.#a=0,this.#o=0}process(e,r,n=0,i=ha){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.#o=Math.max(c,this.#o*o),this.#s=this.#i[0].processBlock(e,n,i),this.#u=this.#i[1].processBlock(r,n,i)}processStereo([e,r],n=0,i=ha){this.process(e,r,n,i)}terminate(){this.#n.terminate()}};var c0=class{#e=0;#t=0;#r=0;process(e,r,n){let i=e.length,a=0,o=0,s=0,c=0,u=0;for(let y=0;y<i;y++){let _=e[y],$=r[y];a+=_*$,o+=_*_,s+=$*$;let S=(_+$)*.5,z=(_-$)*.5;c+=S*S,u+=z*z}let f=o>1e-12&&s>1e-12?a/Math.sqrt(o*s):0,v=c+u>1e-12?u/(c+u):0,h=o+s>1e-12?(s-o)/(o+s):0;this.#e+=(f-this.#e)*.1,this.#t+=(v-this.#t)*.1,this.#r+=(h-this.#r)*.1,n[0]=this.#e,n[1]=this.#t,n[2]=this.#r,n[3]=Math.sqrt(c/Math.max(1,i)),n[4]=Math.sqrt(u/Math.max(1,i))}},u0=class{#e;#t=0;constructor(e){this.#e=e}process(e,r,n){let i=e.length;for(let a=0;a<i;a++){let o=this.#t*2;n[o]=e[a],n[o+1]=r[a],this.#t=(this.#t+1)%this.#e}}},d0=class t{static#e=-70;static#t=-70;static#r=.1;static#i=800;#n=new Mp;#a=new Mp;#o=new Ys;#s=new Ys;#u=new Ys;#l=new Ys;#c;#d;#p=new Float32Array(t.#i);#f=new Float32Array(t.#i);#v;#m=0;#y=0;#h=0;#x=0;#g=0;constructor(e){this.#n.setHighShelfParams(1681.974450955533/e,3.999843853973347),this.#a.setHighpassParams(38.13547087602444/e,.5003270373238773),this.#v=Math.max(1,Math.round(e*.1)),this.#c=new Float32Array(4),this.#d=new Float32Array(30)}process(e,r){let n=e.length;for(let i=0;i<n;i++){let a=e[i],o=r[i],s=this.#u.processFrame(this.#a,this.#o.processFrame(this.#n,a)),c=this.#l.processFrame(this.#a,this.#s.processFrame(this.#n,o));this.#h+=s*s+c*c;let u=Math.max(Math.abs(a),Math.abs(o));u>this.#g&&(this.#g=u),++this.#x>=this.#v&&(this.#F(this.#h/this.#x),this.#h=0,this.#x=0)}}fill(e){e[0]=t.#w(t.#A(this.#c)),e[1]=t.#w(t.#A(this.#d)),e[2]=this.#E(),e[3]=this.#P(),e[4]=this.#g>1e-7?20*Math.log10(this.#g):-120}#F(e){this.#c[this.#m]=e,this.#m=(this.#m+1)%this.#c.length,this.#d[this.#y]=e,this.#y=(this.#y+1)%this.#d.length;let r=t.#w(e);r>=t.#e&&t.#N(this.#p,r);let n=t.#w(t.#A(this.#d));n>=t.#e&&t.#N(this.#f,n)}#E(){let e=t.#M(this.#p,t.#e);if(e<=0)return-120;let r=t.#w(e)-10,n=t.#M(this.#p,r);return n>0?t.#w(n):-120}#P(){let e=t.#M(this.#f,t.#e);if(e<=0)return 0;let r=t.#w(e)-20,n=t.#$(this.#f,r,.1),i=t.#$(this.#f,r,.95);return Math.max(0,i-n)}static#A(e){let r=0;for(let n=0;n<e.length;n++)r+=e[n];return r/e.length}static#w(e){return e>1e-12?-.691+10*Math.log10(e):-120}static#_(e){let r=Math.floor((e-t.#t)/t.#r);return Math.max(0,Math.min(t.#i-1,r))}static#S(e){return t.#t+(e+.5)*t.#r}static#N(e,r){e[t.#_(r)]+=1}static#M(e,r){let n=0,i=0,a=t.#_(r);for(let o=a;o<t.#i;o++){let s=e[o];s<=0||(n+=s*Math.pow(10,(t.#S(o)+.691)/10),i+=s)}return i>0?n/i:0}static#$(e,r,n){let i=t.#_(r),a=0;for(let c=i;c<t.#i;c++)a+=e[c];if(a<=0)return t.#t;let o=a*n,s=0;for(let c=i;c<t.#i;c++)if(s+=e[c],s>=o)return t.#S(c);return t.#S(t.#i-1)}};var p0=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(tg(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,h=n|0,y=a<<1;return this.#r[y]=v,this.#r[y+1]=h,Atomics.store(this.#t,0,o),this.#e.postMessage(null),!0}};var f0=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 IP=16,m0=class{#e=new Map;#t=[new Uint8Array(1),new Uint8Array(2),new Uint8Array(3)];#r=null;connect(e,r){this.#r=new p0(e,r)}drain(e,r){let n=e.midi_out_count();if(n===0)return;let i=e.input_reserve(n*IP),a=e.midi_out_take(i),o=this.#r;if(o===null)return;let s=new Uint8Array(r.buffer,i,a*IP).slice(),c=new DataView(s.buffer);for(let u=0;u<a;u++){let f=u*IP,v=c.getUint32(f,!0),h=Math.min(Math.max(c.getUint8(f+7),1),3),y=c.getFloat64(f+8,!0),_=this.#t[h-1];_[0]=c.getUint8(f+4),h>1&&(_[1]=c.getUint8(f+5)),h>2&&(_[2]=c.getUint8(f+6)),o.send(this.#i(e,r,v),_,y)}}#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?"":f0(new Uint8Array(r.buffer,a,o));return this.#e.set(n,s),s}};var DI=(t,e)=>{let r=t.panic_message_len();return r===0?"":f0(new Uint8Array(e.buffer,t.panic_message_ptr(),r))};var Rz=["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"],h0=(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]},Cz=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]=h0(r,n);if(i===1){let[s,c]=h0(r,o),[,u]=h0(r,c),[f]=h0(r,u);return{memorySize:s,tableSize:f}}n=o+a}return{memorySize:0,tableSize:0}},TP=(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},RI=(t,e,r,n,i,a,o)=>{let{memorySize:s,tableSize:c}=Cz(n),u=t.device_alloc(s),f=c>0?r.grow(c):r.length,v=t.device_alloc(262144),h={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 z of Rz){let O=t[z];if(typeof O!="function")throw new Error(`engine is missing the device host export '${z}'`);h[z]=O}Object.assign(h,o);let y=new WebAssembly.Instance(n,{env:h}).exports;y.__wasm_apply_data_relocs?.(),y.__wasm_call_ctors?.();let _=z=>{if(z===void 0)return 0;let O=r.grow(1);return r.set(O,z),O},$=r.grow(1);r.set($,y.process_events??y.process);let S=t.device_register($,y.state_size(a),y.kind(),_(y.init),_(y.parameter_changed),_(y.field_changed),_(y.sample_changed),_(y.soundfont_changed),_(y.reset),_(y.terminate),y.midi_effects_field?.()??0,y.audio_effects_field?.()??0,y.observe_param_collection_field?.()??0,y.observe_sample_collection_field?.()??0);t.device_set_box_type(S,TP(t,e,i))},CI=(t,e,r)=>{t.composite_register(TP(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)},zI=(t,e,r)=>{t.effect_composite_register(TP(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])};var zz=1,g0=class{retained=[];scheduled=[];sourceToOutput=new Map;reset(){this.retained.length=0,this.scheduled.length=0,this.sourceToOutput.clear()}},Oz=(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)},DP=(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},Vz=(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,VI=(t,e,r,n,i,a,o,s,c,u,f,v,h,y)=>{let _=new DataView(r,n,i*40),$=new DataView(r,a,o*40),S=y?DP(r,n,i,a,o):0,z=(be,ue,Se,Ut,Xi,Je,ft)=>{if(S>=o)throw new Error(`Note flood: exceeded ${o} output notes per range`);Oz($,S++,be,ue,Se,Ut,Xi,Je,ft)};if((f&2)!==0){for(let be of t.retained)z(1,s,be.id,be.pitch,0,0,0);t.reset()}for(let be=t.retained.length-1;be>=0;be--){let ue=t.retained[be],Se=ue.position+ue.duration;Se<c&&(t.retained.splice(be,1),z(1,Se,ue.id,ue.pitch,0,0,0))}let O=[];for(let be=0;be<i;be++){let ue=be*40,Se=_.getUint32(ue+12,!0),Ut=_.getUint32(ue+16,!0),Xi=_.getFloat64(ue+0,!0),Je=_.getUint32(ue+20,!0);if(Se===0)O.push({gate:!0,id:Ut,position:Xi,duration:_.getFloat64(ue+32,!0),pitch:Je,velocity:_.getFloat32(ue+24,!0),cent:_.getFloat32(ue+28,!0)});else if(Se===1){let ft=t.sourceToOutput.get(Ut);if(ft!==void 0){for(let A0 of ft){let Zh=t.retained.findIndex(Gs=>Gs.id===A0);if(Zh>=0){let Gs=t.retained.splice(Zh,1)[0];z(1,Xi,Gs.id,Gs.pitch,0,0,0)}}t.sourceToOutput.delete(Ut)}O.push({gate:!1,id:Ut,position:Xi,pitch:Je})}}for(let be=t.scheduled.length-1;be>=0;be--){let ue=t.scheduled[be];ue.position>=s&&ue.position<c&&(t.scheduled.splice(be,1),z(0,ue.position,OI(t,ue),ue.pitch,ue.velocity,ue.cent,ue.duration))}let J=-1,te={[Symbol.iterator](){let be=0;return{next(){if(be>=O.length)return J=-1,{done:!0,value:void 0};let ue=O[be++];return ue.gate&&(J=ue.id),{done:!1,value:ue}}}}},me={from:s,to:c,bpm:u,s0:v,s1:h,flags:f},he=0;for(let be of e.process(me,te)){if(++he>128)throw new Error("Note flood: exceeded 128 notes per block");let ue=Vz(be,s);if(ue!==null)throw new Error(ue);let Se={position:be.position,duration:be.duration,pitch:be.pitch,velocity:be.velocity,cent:be.cent??0};if(Se.position>=c){if(t.scheduled.length>=128)throw new Error("Scheduler full: exceeded 128 scheduled notes");t.scheduled.push(Se)}else{let Ut=OI(t,Se);if(J>=0){let Xi=t.sourceToOutput.get(J);Xi===void 0&&(Xi=new Set,t.sourceToOutput.set(J,Xi)),Xi.add(Ut)}z(0,Se.position,Ut,Se.pitch,Se.velocity,Se.cent,Se.duration)}}return S},OI=(t,e)=>{let r=1073741824+(zz++&1073741823);return t.retained.push({id:r,position:e.position,duration:e.duration,pitch:e.pitch,velocity:e.velocity,cent:e.cent}),r};var v0=128,Uz=375,RP=0,jI=1,KI=2,jz={[RP]:"apparatProcessors",[jI]:"werkstattProcessors",[KI]:"spielwerkProcessors"},Kz=0,UI=1e3,CP=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},Wz=t=>{switch(t.mapping){case"unipolar":return F.unipolar();case"linear":return F.linear(t.min,t.max);case"exp":return F.exponential(t.min,t.max);case"int":return F.linearInteger(t.min,t.max);case"bool":return F.linearInteger(0,1);default:return F.unipolar()}},Lz=(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>UI||o<-UI)return`Signal overflow in channel ${n} at sample ${a} (amplitude: ${o.toFixed(1)})`}}return null},x0=class{#e;#t;#r;#i;#n=new Map;#a=new Map;#o=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.#s(e,r,n),host_script_audio:(e,r,n,i,a,o,s,c,u,f,v,h)=>this.#l(e,r,n,i,a,o,s,c,u,f,v,h),host_script_note_on:(e,r,n,i,a)=>this.#c(e,r,n,i,a),host_script_note_off:(e,r)=>this.#d(e,r),host_script_reset:e=>this.#p(e),host_script_param:(e,r,n,i)=>this.#f(e,r,n,i),host_script_sample:(e,r,n,i)=>this.#m(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)}}#s(e,r,n){let i=B.toString(new Uint8Array(this.#e.buffer,e,16).slice()),a=this.#a.get(i);K(a)&&this.#g(a);let o=this.#o++;return this.#n.set(o,new CP(i,r,jz[r]??"werkstattProcessors")),this.#a.set(i,o),o}#u(e){let r=globalThis.openDAW?.[e.registryName]?.[e.uuid];if(r===void 0&&e.currentUpdate===-1)return!e.warnedMissing&&++e.missingCalls>Uz&&(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:Wz(i)}])),e.sampleLabels=new Map(r.samples.map(i=>[i.index,i.label])),e.kind===RP){n.samples={};for(let i of e.sampleLabels.values())n.samples[i]=null;e.limiter??=new Ag(this.#r)}e.kind===KI&&(e.spielwerk=new g0),e.proc=n,e.currentUpdate=r.update,e.silenced=!1;for(let[i,a]of e.rawParams)this.#v(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,h){let y=this.#n.get(e);if(y===void 0)return 1;let _=this.#u(y);if(_===null)return 1;let $=this.#e.buffer,S=new Float32Array($,i,v0),z=new Float32Array($,a,v0),O={index:c,p0:u,p1:f,s0:o,s1:s,bpm:v,flags:h};try{if(y.kind===jI){let te={src:[new Float32Array($,r,v0),new Float32Array($,n,v0)],out:[S,z]};_.process(te,O)}else{for(let[te,me]of y.sampleHandles)this.#h(y,te,me);S.fill(0,o,s),z.fill(0,o,s),_.process([S,z],O)}}catch(te){return this.#x(y,`Runtime error: ${te}`),1}let J=Lz([S,z],o,s);return J!==null?(S.fill(0,o,s),z.fill(0,o,s),this.#x(y,J),1):(y.kind===RP&&y.limiter!==null&&y.limiter.replace({channels:()=>[S,z]},o,s),0)}#c(e,r,n,i,a){let o=this.#n.get(e);o!==void 0&&this.#u(o)?.noteOn?.(r,n,i,a)}#d(e,r){let n=this.#n.get(e);n!==void 0&&this.#u(n)?.noteOff?.(r)}#p(e){let r=this.#n.get(e);r?.proc?.reset?.(),r?.spielwerk?.reset()}#f(e,r,n,i){let a=this.#n.get(e);a!==void 0&&(a.rawParams.set(r,{kind:n,value:i}),this.#v(a,r,n,i))}#v(e,r,n,i){let a=e.paramMappings.get(r);if(a===void 0)return;let o=n===Kz?a.mapping.y(i):i;e.proc?.paramChanged?.(a.label,o)}#m(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 h=this.#n.get(e);if(h===void 0)return 0;let y=()=>h.pass?DP(this.#e.buffer,r,n,i,a):0,_=this.#u(h);if(_===null||h.spielwerk===null)return y();try{return VI(h.spielwerk,_,this.#e.buffer,r,n,i,a,o,s,c,u,f,v,h.pass)}catch($){return this.#x(h,`Runtime error: ${$}`),y()}}#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 h=0;h<u;h++)v.push(new Float32Array(this.#e.buffer,s+h*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}};var y0=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)},kt,Nc,$c,Wh,Lh=class t{constructor(e,r=128){if(kt.set(this,void 0),Nc.set(this,void 0),$c.set(this,void 0),Wh.set(this,void 0),y0(this,kt,e,"f"),y0(this,Wh,r,"f"),y0(this,Nc,e._malloc(r*4),"f"),y0(this,$c,e._malloc(r*4),"f"),rt(this,Nc,"f")===0||rt(this,$c,"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(){rt(this,kt,"f")._free(rt(this,Nc,"f")),rt(this,kt,"f")._free(rt(this,$c,"f"))}createInstance(){return rt(this,kt,"f")._nam_createInstance()}destroyInstance(e){rt(this,kt,"f")._nam_destroyInstance(e)}getInstanceCount(){return rt(this,kt,"f")._nam_getInstanceCount()}loadModel(e,r){let n=rt(this,kt,"f").lengthBytesUTF8(r)+1,i=rt(this,kt,"f")._malloc(n);if(i===0)return!1;try{return rt(this,kt,"f").stringToUTF8(r,i,n),rt(this,kt,"f")._nam_loadModel(e,i)}finally{rt(this,kt,"f")._free(i)}}unloadModel(e){rt(this,kt,"f")._nam_unloadModel(e)}hasModel(e){return rt(this,kt,"f")._nam_hasModel(e)}process(e,r,n){let i=Math.min(r.length,n.length,rt(this,Wh,"f")),a=rt(this,Nc,"f")>>2,o=rt(this,$c,"f")>>2;rt(this,kt,"f").HEAPF32.set(r.subarray(0,i),a),rt(this,kt,"f")._nam_process(e,rt(this,Nc,"f"),rt(this,$c,"f"),i),n.set(rt(this,kt,"f").HEAPF32.subarray(o,o+i))}processInPlace(e,r){this.process(e,r,r)}setSampleRate(e){rt(this,kt,"f")._nam_setSampleRate(e)}getSampleRate(){return rt(this,kt,"f")._nam_getSampleRate()}setMaxBufferSize(e){rt(this,kt,"f")._nam_setMaxBufferSize(e)}getMaxBufferSize(){return rt(this,kt,"f")._nam_getMaxBufferSize()}getModelLoudness(e){return rt(this,kt,"f")._nam_getModelLoudness(e)}hasModelLoudness(e){return rt(this,kt,"f")._nam_hasModelLoudness(e)}reset(e){rt(this,kt,"f")._nam_reset(e)}get bufferSize(){return rt(this,Wh,"f")}};kt=new WeakMap,Nc=new WeakMap,$c=new WeakMap,Wh=new WeakMap;var zP;(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)})(zP||(zP={}));var Zz=(()=>{var t=import.meta.url;return(function(e={}){var r=e,n,i;r.ready=new Promise((d,m)=>{n=d,i=m});var a=Object.assign({},r),o=[],s="./this.program",c=(d,m)=>{throw m},u=typeof window=="object",f=typeof importScripts=="function",v=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",h="";function y(d){return r.locateFile?r.locateFile(d,h):h+d}var _,$,S;(u||f)&&(f?h=self.location.href:typeof document<"u"&&document.currentScript&&(h=document.currentScript.src),t&&(h=t),h.indexOf("blob:")!==0?h=h.substr(0,h.replace(/[?#].*/,"").lastIndexOf("/")+1):h="",_=d=>{var m=new XMLHttpRequest;return m.open("GET",d,!1),m.send(null),m.responseText},f&&(S=d=>{var m=new XMLHttpRequest;return m.open("GET",d,!1),m.responseType="arraybuffer",m.send(null),new Uint8Array(m.response)}),$=(d,m,g)=>{var w=new XMLHttpRequest;w.open("GET",d,!0),w.responseType="arraybuffer",w.onload=()=>{if(w.status==200||w.status==0&&w.response){m(w.response);return}g()},w.onerror=g,w.send(null)});var z=r.print||console.log.bind(console),O=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 J;r.wasmBinary&&(J=r.wasmBinary),typeof WebAssembly!="object"&&kc("no native wasm support detected");var te,me=!1,he;function be(d,m){d||kc(m)}var ue,Se,Ut,Xi,Je,ft,A0,Zh;function Gs(){var d=te.buffer;r.HEAP8=ue=new Int8Array(d),r.HEAP16=Ut=new Int16Array(d),r.HEAPU8=Se=new Uint8Array(d),r.HEAPU16=Xi=new Uint16Array(d),r.HEAP32=Je=new Int32Array(d),r.HEAPU32=ft=new Uint32Array(d),r.HEAPF32=A0=new Float32Array(d),r.HEAPF64=Zh=new Float64Array(d)}var KP=[],WP=[],LP=[],tT=!1;function rT(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)aT(r.preRun.shift());S0(KP)}function iT(){tT=!0,!r.noFSInit&&!x.init.initialized&&x.init(),x.ignorePermissions=!1,Vo.init(),S0(WP)}function nT(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)sT(r.postRun.shift());S0(LP)}function aT(d){KP.unshift(d)}function oT(d){WP.unshift(d)}function sT(d){LP.unshift(d)}var Hs=0,F0=null,yp=null;function Xz(d){return d}function E0(d){Hs++,r.monitorRunDependencies?.(Hs)}function Gh(d){if(Hs--,r.monitorRunDependencies?.(Hs),Hs==0&&(F0!==null&&(clearInterval(F0),F0=null),yp)){var m=yp;yp=null,m()}}function kc(d){r.onAbort?.(d),d="Aborted("+d+")",O(d),me=!0,he=1,d+=". Build with -sASSERTIONS for more info.";var m=new WebAssembly.RuntimeError(d);throw i(m),m}var lT="data:application/octet-stream;base64,",ZP=d=>d.startsWith(lT),qs;r.locateFile?(qs="nam.wasm",ZP(qs)||(qs=y(qs))):qs=new URL("nam.wasm",import.meta.url).href;function GP(d){if(d==qs&&J)return new Uint8Array(J);if(S)return S(d);throw"both async and sync fetching of the wasm failed"}function cT(d){return!J&&(u||f)&&typeof fetch=="function"?fetch(d,{credentials:"same-origin"}).then(m=>{if(!m.ok)throw"failed to load wasm binary file at '"+d+"'";return m.arrayBuffer()}).catch(()=>GP(d)):Promise.resolve().then(()=>GP(d))}function HP(d,m,g){return cT(d).then(w=>WebAssembly.instantiate(w,m)).then(w=>w).then(g,w=>{O(`failed to asynchronously prepare wasm: ${w}`),kc(w)})}function uT(d,m,g,w){return!d&&typeof WebAssembly.instantiateStreaming=="function"&&!ZP(m)&&typeof fetch=="function"?fetch(m,{credentials:"same-origin"}).then(P=>{var C=WebAssembly.instantiateStreaming(P,g);return C.then(w,function(V){return O(`wasm streaming compile failed: ${V}`),O("falling back to ArrayBuffer instantiation"),HP(m,g,w)})}):HP(m,g,w)}function dT(){var d={a:LT};function m(w,P){return mt=w.exports,te=mt.l,Gs(),oT(mt.m),Gh("wasm-instantiate"),mt}E0("wasm-instantiate");function g(w){m(w.instance)}if(r.instantiateWasm)try{return r.instantiateWasm(d,m)}catch(w){O(`Module.instantiateWasm callback failed with error: ${w}`),i(w)}return uT(J,qs,d,g).catch(i),{}}var Ye,Ar,S0=d=>{for(;d.length>0;)d.shift()(r)},Qz=r.noExitRuntime||!0;function pT(d){this.excPtr=d,this.ptr=d-24,this.set_type=function(m){ft[this.ptr+4>>2]=m},this.get_type=function(){return ft[this.ptr+4>>2]},this.set_destructor=function(m){ft[this.ptr+8>>2]=m},this.get_destructor=function(){return ft[this.ptr+8>>2]},this.set_caught=function(m){m=m?1:0,ue[this.ptr+12>>0]=m},this.get_caught=function(){return ue[this.ptr+12>>0]!=0},this.set_rethrown=function(m){m=m?1:0,ue[this.ptr+13>>0]=m},this.get_rethrown=function(){return ue[this.ptr+13>>0]!=0},this.init=function(m,g){this.set_adjusted_ptr(0),this.set_type(m),this.set_destructor(g)},this.set_adjusted_ptr=function(m){ft[this.ptr+16>>2]=m},this.get_adjusted_ptr=function(){return ft[this.ptr+16>>2]},this.get_exception_ptr=function(){var m=lM(this.get_type());if(m)return ft[this.excPtr>>2];var g=this.get_adjusted_ptr();return g!==0?g:this.excPtr}}var qP=0,fT=0,mT=(d,m,g)=>{var w=new pT(d);throw w.init(m,g),qP=d,fT++,qP},hT=()=>{kc("")},gT=(d,m,g)=>Se.copyWithin(d,m,m+g),vT=()=>536870912,xT=d=>{var m=te.buffer,g=(d-m.byteLength+65535)/65536;try{return te.grow(g),Gs(),1}catch{}},yT=d=>{var m=Se.length;d>>>=0;var g=vT();if(d>g)return!1;for(var w=(ae,De)=>ae+(De-ae%De)%De,P=1;P<=4;P*=2){var C=m*(1+.2/P);C=Math.min(C,d+100663296);var V=Math.min(g,w(Math.max(d,C),65536)),W=xT(V);if(W)return!0}return!1},P0={},wT=()=>s||"./this.program",wp=()=>{if(!wp.strings){var d=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",m={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:d,_:wT()};for(var g in P0)P0[g]===void 0?delete m[g]:m[g]=P0[g];var w=[];for(var g in m)w.push(`${g}=${m[g]}`);wp.strings=w}return wp.strings},bT=(d,m)=>{for(var g=0;g<d.length;++g)ue[m++>>0]=d.charCodeAt(g);ue[m>>0]=0},ut={isAbs:d=>d.charAt(0)==="/",splitPath:d=>{var m=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return m.exec(d).slice(1)},normalizeArray:(d,m)=>{for(var g=0,w=d.length-1;w>=0;w--){var P=d[w];P==="."?d.splice(w,1):P===".."?(d.splice(w,1),g++):g&&(d.splice(w,1),g--)}if(m)for(;g;g--)d.unshift("..");return d},normalize:d=>{var m=ut.isAbs(d),g=d.substr(-1)==="/";return d=ut.normalizeArray(d.split("/").filter(w=>!!w),!m).join("/"),!d&&!m&&(d="."),d&&g&&(d+="/"),(m?"/":"")+d},dirname:d=>{var m=ut.splitPath(d),g=m[0],w=m[1];return!g&&!w?".":(w&&(w=w.substr(0,w.length-1)),g+w)},basename:d=>{if(d==="/")return"/";d=ut.normalize(d),d=d.replace(/\/$/,"");var m=d.lastIndexOf("/");return m===-1?d:d.substr(m+1)},join:function(){var d=Array.prototype.slice.call(arguments);return ut.normalize(d.join("/"))},join2:(d,m)=>ut.normalize(d+"/"+m)},_T=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return d=>crypto.getRandomValues(d);kc("initRandomDevice")},JP=d=>(JP=_T())(d),io={resolve:function(){for(var d="",m=!1,g=arguments.length-1;g>=-1&&!m;g--){var w=g>=0?arguments[g]:x.cwd();if(typeof w!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!w)return"";d=w+"/"+d,m=ut.isAbs(w)}return d=ut.normalizeArray(d.split("/").filter(P=>!!P),!m).join("/"),(m?"/":"")+d||"."},relative:(d,m)=>{d=io.resolve(d).substr(1),m=io.resolve(m).substr(1);function g(De){for(var qe=0;qe<De.length&&De[qe]==="";qe++);for(var at=De.length-1;at>=0&&De[at]==="";at--);return qe>at?[]:De.slice(qe,at-qe+1)}for(var w=g(d.split("/")),P=g(m.split("/")),C=Math.min(w.length,P.length),V=C,W=0;W<C;W++)if(w[W]!==P[W]){V=W;break}for(var ae=[],W=V;W<w.length;W++)ae.push("..");return ae=ae.concat(P.slice(V)),ae.join("/")}},YP=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Bc=(d,m,g)=>{for(var w=m+g,P=m;d[P]&&!(P>=w);)++P;if(P-m>16&&d.buffer&&YP)return YP.decode(d.subarray(m,P));for(var C="";m<P;){var V=d[m++];if(!(V&128)){C+=String.fromCharCode(V);continue}var W=d[m++]&63;if((V&224)==192){C+=String.fromCharCode((V&31)<<6|W);continue}var ae=d[m++]&63;if((V&240)==224?V=(V&15)<<12|W<<6|ae:V=(V&7)<<18|W<<12|ae<<6|d[m++]&63,V<65536)C+=String.fromCharCode(V);else{var De=V-65536;C+=String.fromCharCode(55296|De>>10,56320|De&1023)}}return C},M0=[],Hh=d=>{for(var m=0,g=0;g<d.length;++g){var w=d.charCodeAt(g);w<=127?m++:w<=2047?m+=2:w>=55296&&w<=57343?(m+=4,++g):m+=3}return m},N0=(d,m,g,w)=>{if(!(w>0))return 0;for(var P=g,C=g+w-1,V=0;V<d.length;++V){var W=d.charCodeAt(V);if(W>=55296&&W<=57343){var ae=d.charCodeAt(++V);W=65536+((W&1023)<<10)|ae&1023}if(W<=127){if(g>=C)break;m[g++]=W}else if(W<=2047){if(g+1>=C)break;m[g++]=192|W>>6,m[g++]=128|W&63}else if(W<=65535){if(g+2>=C)break;m[g++]=224|W>>12,m[g++]=128|W>>6&63,m[g++]=128|W&63}else{if(g+3>=C)break;m[g++]=240|W>>18,m[g++]=128|W>>12&63,m[g++]=128|W>>6&63,m[g++]=128|W&63}}return m[g]=0,g-P};function qh(d,m,g){var w=g>0?g:Hh(d)+1,P=new Array(w),C=N0(d,P,0,P.length);return m&&(P.length=C),P}var AT=()=>{if(!M0.length){var d=null;if(typeof window<"u"&&typeof window.prompt=="function"?(d=window.prompt("Input: "),d!==null&&(d+=`
114
114
  `)):typeof readline=="function"&&(d=readline(),d!==null&&(d+=`
115
115
  `)),!d)return null;M0=qh(d,!0)}return M0.shift()},Vo={ttys:[],init(){},shutdown(){},register(d,m){Vo.ttys[d]={input:[],output:[],ops:m},x.registerDevice(d,Vo.stream_ops)},stream_ops:{open(d){var m=Vo.ttys[d.node.rdev];if(!m)throw new x.ErrnoError(43);d.tty=m,d.seekable=!1},close(d){d.tty.ops.fsync(d.tty)},fsync(d){d.tty.ops.fsync(d.tty)},read(d,m,g,w,P){if(!d.tty||!d.tty.ops.get_char)throw new x.ErrnoError(60);for(var C=0,V=0;V<w;V++){var W;try{W=d.tty.ops.get_char(d.tty)}catch{throw new x.ErrnoError(29)}if(W===void 0&&C===0)throw new x.ErrnoError(6);if(W==null)break;C++,m[g+V]=W}return C&&(d.node.timestamp=Date.now()),C},write(d,m,g,w,P){if(!d.tty||!d.tty.ops.put_char)throw new x.ErrnoError(60);try{for(var C=0;C<w;C++)d.tty.ops.put_char(d.tty,m[g+C])}catch{throw new x.ErrnoError(29)}return w&&(d.node.timestamp=Date.now()),C}},default_tty_ops:{get_char(d){return AT()},put_char(d,m){m===null||m===10?(z(Bc(d.output,0)),d.output=[]):m!=0&&d.output.push(m)},fsync(d){d.output&&d.output.length>0&&(z(Bc(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,m,g){return 0},ioctl_tiocgwinsz(d){return[24,80]}},default_tty1_ops:{put_char(d,m){m===null||m===10?(O(Bc(d.output,0)),d.output=[]):m!=0&&d.output.push(m)},fsync(d){d.output&&d.output.length>0&&(O(Bc(d.output,0)),d.output=[])}}},XP=d=>{kc()},Ue={ops_table:null,mount(d){return Ue.createNode(null,"/",16895,0)},createNode(d,m,g,w){if(x.isBlkdev(g)||x.isFIFO(g))throw new x.ErrnoError(63);Ue.ops_table||={dir:{node:{getattr:Ue.node_ops.getattr,setattr:Ue.node_ops.setattr,lookup:Ue.node_ops.lookup,mknod:Ue.node_ops.mknod,rename:Ue.node_ops.rename,unlink:Ue.node_ops.unlink,rmdir:Ue.node_ops.rmdir,readdir:Ue.node_ops.readdir,symlink:Ue.node_ops.symlink},stream:{llseek:Ue.stream_ops.llseek}},file:{node:{getattr:Ue.node_ops.getattr,setattr:Ue.node_ops.setattr},stream:{llseek:Ue.stream_ops.llseek,read:Ue.stream_ops.read,write:Ue.stream_ops.write,allocate:Ue.stream_ops.allocate,mmap:Ue.stream_ops.mmap,msync:Ue.stream_ops.msync}},link:{node:{getattr:Ue.node_ops.getattr,setattr:Ue.node_ops.setattr,readlink:Ue.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Ue.node_ops.getattr,setattr:Ue.node_ops.setattr},stream:x.chrdev_stream_ops}};var P=x.createNode(d,m,g,w);return x.isDir(P.mode)?(P.node_ops=Ue.ops_table.dir.node,P.stream_ops=Ue.ops_table.dir.stream,P.contents={}):x.isFile(P.mode)?(P.node_ops=Ue.ops_table.file.node,P.stream_ops=Ue.ops_table.file.stream,P.usedBytes=0,P.contents=null):x.isLink(P.mode)?(P.node_ops=Ue.ops_table.link.node,P.stream_ops=Ue.ops_table.link.stream):x.isChrdev(P.mode)&&(P.node_ops=Ue.ops_table.chrdev.node,P.stream_ops=Ue.ops_table.chrdev.stream),P.timestamp=Date.now(),d&&(d.contents[m]=P,d.timestamp=P.timestamp),P},getFileDataAsTypedArray(d){return d.contents?d.contents.subarray?d.contents.subarray(0,d.usedBytes):new Uint8Array(d.contents):new Uint8Array(0)},expandFileStorage(d,m){var g=d.contents?d.contents.length:0;if(!(g>=m)){var w=1024*1024;m=Math.max(m,g*(g<w?2:1.125)>>>0),g!=0&&(m=Math.max(m,256));var P=d.contents;d.contents=new Uint8Array(m),d.usedBytes>0&&d.contents.set(P.subarray(0,d.usedBytes),0)}},resizeFileStorage(d,m){if(d.usedBytes!=m)if(m==0)d.contents=null,d.usedBytes=0;else{var g=d.contents;d.contents=new Uint8Array(m),g&&d.contents.set(g.subarray(0,Math.min(m,d.usedBytes))),d.usedBytes=m}},node_ops:{getattr(d){var m={};return m.dev=x.isChrdev(d.mode)?d.id:1,m.ino=d.id,m.mode=d.mode,m.nlink=1,m.uid=0,m.gid=0,m.rdev=d.rdev,x.isDir(d.mode)?m.size=4096:x.isFile(d.mode)?m.size=d.usedBytes:x.isLink(d.mode)?m.size=d.link.length:m.size=0,m.atime=new Date(d.timestamp),m.mtime=new Date(d.timestamp),m.ctime=new Date(d.timestamp),m.blksize=4096,m.blocks=Math.ceil(m.size/m.blksize),m},setattr(d,m){m.mode!==void 0&&(d.mode=m.mode),m.timestamp!==void 0&&(d.timestamp=m.timestamp),m.size!==void 0&&Ue.resizeFileStorage(d,m.size)},lookup(d,m){throw x.genericErrors[44]},mknod(d,m,g,w){return Ue.createNode(d,m,g,w)},rename(d,m,g){if(x.isDir(d.mode)){var w;try{w=x.lookupNode(m,g)}catch{}if(w)for(var P in w.contents)throw new x.ErrnoError(55)}delete d.parent.contents[d.name],d.parent.timestamp=Date.now(),d.name=g,m.contents[g]=d,m.timestamp=d.parent.timestamp,d.parent=m},unlink(d,m){delete d.contents[m],d.timestamp=Date.now()},rmdir(d,m){var g=x.lookupNode(d,m);for(var w in g.contents)throw new x.ErrnoError(55);delete d.contents[m],d.timestamp=Date.now()},readdir(d){var m=[".",".."];for(var g of Object.keys(d.contents))m.push(g);return m},symlink(d,m,g){var w=Ue.createNode(d,m,41471,0);return w.link=g,w},readlink(d){if(!x.isLink(d.mode))throw new x.ErrnoError(28);return d.link}},stream_ops:{read(d,m,g,w,P){var C=d.node.contents;if(P>=d.node.usedBytes)return 0;var V=Math.min(d.node.usedBytes-P,w);if(V>8&&C.subarray)m.set(C.subarray(P,P+V),g);else for(var W=0;W<V;W++)m[g+W]=C[P+W];return V},write(d,m,g,w,P,C){if(m.buffer===ue.buffer&&(C=!1),!w)return 0;var V=d.node;if(V.timestamp=Date.now(),m.subarray&&(!V.contents||V.contents.subarray)){if(C)return V.contents=m.subarray(g,g+w),V.usedBytes=w,w;if(V.usedBytes===0&&P===0)return V.contents=m.slice(g,g+w),V.usedBytes=w,w;if(P+w<=V.usedBytes)return V.contents.set(m.subarray(g,g+w),P),w}if(Ue.expandFileStorage(V,P+w),V.contents.subarray&&m.subarray)V.contents.set(m.subarray(g,g+w),P);else for(var W=0;W<w;W++)V.contents[P+W]=m[g+W];return V.usedBytes=Math.max(V.usedBytes,P+w),w},llseek(d,m,g){var w=m;if(g===1?w+=d.position:g===2&&x.isFile(d.node.mode)&&(w+=d.node.usedBytes),w<0)throw new x.ErrnoError(28);return w},allocate(d,m,g){Ue.expandFileStorage(d.node,m+g),d.node.usedBytes=Math.max(d.node.usedBytes,m+g)},mmap(d,m,g,w,P){if(!x.isFile(d.node.mode))throw new x.ErrnoError(43);var C,V,W=d.node.contents;if(!(P&2)&&W.buffer===ue.buffer)V=!1,C=W.byteOffset;else{if((g>0||g+m<W.length)&&(W.subarray?W=W.subarray(g,g+m):W=Array.prototype.slice.call(W,g,g+m)),V=!0,C=XP(m),!C)throw new x.ErrnoError(48);ue.set(W,C)}return{ptr:C,allocated:V}},msync(d,m,g,w,P){return Ue.stream_ops.write(d,m,0,w,g,!1),0}}},FT=(d,m,g,w)=>{var P=w?"":`al ${d}`;$(d,C=>{be(C,`Loading data file "${d}" failed (no arrayBuffer).`),m(new Uint8Array(C)),P&&Gh(P)},C=>{if(g)g();else throw`Loading data file "${d}" failed.`}),P&&E0(P)},ET=(d,m,g,w,P,C)=>{x.createDataFile(d,m,g,w,P,C)},ST=r.preloadPlugins||[],PT=(d,m,g,w)=>{typeof Browser<"u"&&Browser.init();var P=!1;return ST.forEach(C=>{P||C.canHandle(m)&&(C.handle(d,m,g,w),P=!0)}),P},MT=(d,m,g,w,P,C,V,W,ae,De)=>{var qe=m?io.resolve(ut.join2(d,m)):d,at=`cp ${qe}`;function Ne(_e){function Ae(Dt){De?.(),W||ET(d,m,Dt,w,P,ae),C?.(),Gh(at)}PT(_e,qe,Ae,()=>{V?.(),Gh(at)})||Ae(_e)}E0(at),typeof g=="string"?FT(g,_e=>Ne(_e),V):Ne(g)},NT=d=>{var m={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},g=m[d];if(typeof g>"u")throw new Error(`Unknown file open mode: ${d}`);return g},$0=(d,m)=>{var g=0;return d&&(g|=365),m&&(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,m={}){if(d=io.resolve(d),!d)return{path:"",node:null};var g={follow_mount:!0,recurse_count:0};if(m=Object.assign(g,m),m.recurse_count>8)throw new x.ErrnoError(32);for(var w=d.split("/").filter(at=>!!at),P=x.root,C="/",V=0;V<w.length;V++){var W=V===w.length-1;if(W&&m.parent)break;if(P=x.lookupNode(P,w[V]),C=ut.join2(C,w[V]),x.isMountpoint(P)&&(!W||W&&m.follow_mount)&&(P=P.mounted.root),!W||m.follow)for(var ae=0;x.isLink(P.mode);){var De=x.readlink(C);C=io.resolve(ut.dirname(C),De);var qe=x.lookupPath(C,{recurse_count:m.recurse_count+1});if(P=qe.node,ae++>40)throw new x.ErrnoError(32)}}return{path:C,node:P}},getPath(d){for(var m;;){if(x.isRoot(d)){var g=d.mount.mountpoint;return m?g[g.length-1]!=="/"?`${g}/${m}`:g+m:g}m=m?`${d.name}/${m}`:d.name,d=d.parent}},hashName(d,m){for(var g=0,w=0;w<m.length;w++)g=(g<<5)-g+m.charCodeAt(w)|0;return(d+g>>>0)%x.nameTable.length},hashAddNode(d){var m=x.hashName(d.parent.id,d.name);d.name_next=x.nameTable[m],x.nameTable[m]=d},hashRemoveNode(d){var m=x.hashName(d.parent.id,d.name);if(x.nameTable[m]===d)x.nameTable[m]=d.name_next;else for(var g=x.nameTable[m];g;){if(g.name_next===d){g.name_next=d.name_next;break}g=g.name_next}},lookupNode(d,m){var g=x.mayLookup(d);if(g)throw new x.ErrnoError(g,d);for(var w=x.hashName(d.id,m),P=x.nameTable[w];P;P=P.name_next){var C=P.name;if(P.parent.id===d.id&&C===m)return P}return x.lookup(d,m)},createNode(d,m,g,w){var P=new x.FSNode(d,m,g,w);return x.hashAddNode(P),P},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 m=["r","w","rw"][d&3];return d&512&&(m+="w"),m},nodePermissions(d,m){return x.ignorePermissions?0:m.includes("r")&&!(d.mode&292)||m.includes("w")&&!(d.mode&146)||m.includes("x")&&!(d.mode&73)?2:0},mayLookup(d){var m=x.nodePermissions(d,"x");return m||(d.node_ops.lookup?0:2)},mayCreate(d,m){try{var g=x.lookupNode(d,m);return 20}catch{}return x.nodePermissions(d,"wx")},mayDelete(d,m,g){var w;try{w=x.lookupNode(d,m)}catch(C){return C.errno}var P=x.nodePermissions(d,"wx");if(P)return P;if(g){if(!x.isDir(w.mode))return 54;if(x.isRoot(w)||x.getPath(w)===x.cwd())return 10}else if(x.isDir(w.mode))return 31;return 0},mayOpen(d,m){return d?x.isLink(d.mode)?32:x.isDir(d.mode)&&(x.flagsToPermissionString(m)!=="r"||m&512)?31:x.nodePermissions(d,x.flagsToPermissionString(m)):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 m=x.getStream(d);if(!m)throw new x.ErrnoError(8);return m},getStream:d=>x.streams[d],createStream(d,m=-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),m==-1&&(m=x.nextfd()),d.fd=m,x.streams[m]=d,d},closeStream(d){x.streams[d]=null},chrdev_stream_ops:{open(d){var m=x.getDevice(d.node.rdev);d.stream_ops=m.stream_ops,d.stream_ops.open?.(d)},llseek(){throw new x.ErrnoError(70)}},major:d=>d>>8,minor:d=>d&255,makedev:(d,m)=>d<<8|m,registerDevice(d,m){x.devices[d]={stream_ops:m}},getDevice:d=>x.devices[d],getMounts(d){for(var m=[],g=[d];g.length;){var w=g.pop();m.push(w),g.push.apply(g,w.mounts)}return m},syncfs(d,m){typeof d=="function"&&(m=d,d=!1),x.syncFSRequests++,x.syncFSRequests>1&&O(`warning: ${x.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var g=x.getMounts(x.root.mount),w=0;function P(V){return x.syncFSRequests--,m(V)}function C(V){if(V)return C.errored?void 0:(C.errored=!0,P(V));++w>=g.length&&P(null)}g.forEach(V=>{if(!V.type.syncfs)return C(null);V.type.syncfs(V,d,C)})},mount(d,m,g){var w=g==="/",P=!g,C;if(w&&x.root)throw new x.ErrnoError(10);if(!w&&!P){var V=x.lookupPath(g,{follow_mount:!1});if(g=V.path,C=V.node,x.isMountpoint(C))throw new x.ErrnoError(10);if(!x.isDir(C.mode))throw new x.ErrnoError(54)}var W={type:d,opts:m,mountpoint:g,mounts:[]},ae=d.mount(W);return ae.mount=W,W.root=ae,w?x.root=ae:C&&(C.mounted=W,C.mount&&C.mount.mounts.push(W)),ae},unmount(d){var m=x.lookupPath(d,{follow_mount:!1});if(!x.isMountpoint(m.node))throw new x.ErrnoError(28);var g=m.node,w=g.mounted,P=x.getMounts(w);Object.keys(x.nameTable).forEach(V=>{for(var W=x.nameTable[V];W;){var ae=W.name_next;P.includes(W.mount)&&x.destroyNode(W),W=ae}}),g.mounted=null;var C=g.mount.mounts.indexOf(w);g.mount.mounts.splice(C,1)},lookup(d,m){return d.node_ops.lookup(d,m)},mknod(d,m,g){var w=x.lookupPath(d,{parent:!0}),P=w.node,C=ut.basename(d);if(!C||C==="."||C==="..")throw new x.ErrnoError(28);var V=x.mayCreate(P,C);if(V)throw new x.ErrnoError(V);if(!P.node_ops.mknod)throw new x.ErrnoError(63);return P.node_ops.mknod(P,C,m,g)},create(d,m){return m=m!==void 0?m:438,m&=4095,m|=32768,x.mknod(d,m,0)},mkdir(d,m){return m=m!==void 0?m:511,m&=1023,m|=16384,x.mknod(d,m,0)},mkdirTree(d,m){for(var g=d.split("/"),w="",P=0;P<g.length;++P)if(g[P]){w+="/"+g[P];try{x.mkdir(w,m)}catch(C){if(C.errno!=20)throw C}}},mkdev(d,m,g){return typeof g>"u"&&(g=m,m=438),m|=8192,x.mknod(d,m,g)},symlink(d,m){if(!io.resolve(d))throw new x.ErrnoError(44);var g=x.lookupPath(m,{parent:!0}),w=g.node;if(!w)throw new x.ErrnoError(44);var P=ut.basename(m),C=x.mayCreate(w,P);if(C)throw new x.ErrnoError(C);if(!w.node_ops.symlink)throw new x.ErrnoError(63);return w.node_ops.symlink(w,P,d)},rename(d,m){var g=ut.dirname(d),w=ut.dirname(m),P=ut.basename(d),C=ut.basename(m),V,W,ae;if(V=x.lookupPath(d,{parent:!0}),W=V.node,V=x.lookupPath(m,{parent:!0}),ae=V.node,!W||!ae)throw new x.ErrnoError(44);if(W.mount!==ae.mount)throw new x.ErrnoError(75);var De=x.lookupNode(W,P),qe=io.relative(d,w);if(qe.charAt(0)!==".")throw new x.ErrnoError(28);if(qe=io.relative(m,g),qe.charAt(0)!==".")throw new x.ErrnoError(55);var at;try{at=x.lookupNode(ae,C)}catch{}if(De!==at){var Ne=x.isDir(De.mode),_e=x.mayDelete(W,P,Ne);if(_e)throw new x.ErrnoError(_e);if(_e=at?x.mayDelete(ae,C,Ne):x.mayCreate(ae,C),_e)throw new x.ErrnoError(_e);if(!W.node_ops.rename)throw new x.ErrnoError(63);if(x.isMountpoint(De)||at&&x.isMountpoint(at))throw new x.ErrnoError(10);if(ae!==W&&(_e=x.nodePermissions(W,"w"),_e))throw new x.ErrnoError(_e);x.hashRemoveNode(De);try{W.node_ops.rename(De,ae,C)}catch(Ae){throw Ae}finally{x.hashAddNode(De)}}},rmdir(d){var m=x.lookupPath(d,{parent:!0}),g=m.node,w=ut.basename(d),P=x.lookupNode(g,w),C=x.mayDelete(g,w,!0);if(C)throw new x.ErrnoError(C);if(!g.node_ops.rmdir)throw new x.ErrnoError(63);if(x.isMountpoint(P))throw new x.ErrnoError(10);g.node_ops.rmdir(g,w),x.destroyNode(P)},readdir(d){var m=x.lookupPath(d,{follow:!0}),g=m.node;if(!g.node_ops.readdir)throw new x.ErrnoError(54);return g.node_ops.readdir(g)},unlink(d){var m=x.lookupPath(d,{parent:!0}),g=m.node;if(!g)throw new x.ErrnoError(44);var w=ut.basename(d),P=x.lookupNode(g,w),C=x.mayDelete(g,w,!1);if(C)throw new x.ErrnoError(C);if(!g.node_ops.unlink)throw new x.ErrnoError(63);if(x.isMountpoint(P))throw new x.ErrnoError(10);g.node_ops.unlink(g,w),x.destroyNode(P)},readlink(d){var m=x.lookupPath(d),g=m.node;if(!g)throw new x.ErrnoError(44);if(!g.node_ops.readlink)throw new x.ErrnoError(28);return io.resolve(x.getPath(g.parent),g.node_ops.readlink(g))},stat(d,m){var g=x.lookupPath(d,{follow:!m}),w=g.node;if(!w)throw new x.ErrnoError(44);if(!w.node_ops.getattr)throw new x.ErrnoError(63);return w.node_ops.getattr(w)},lstat(d){return x.stat(d,!0)},chmod(d,m,g){var w;if(typeof d=="string"){var P=x.lookupPath(d,{follow:!g});w=P.node}else w=d;if(!w.node_ops.setattr)throw new x.ErrnoError(63);w.node_ops.setattr(w,{mode:m&4095|w.mode&-4096,timestamp:Date.now()})},lchmod(d,m){x.chmod(d,m,!0)},fchmod(d,m){var g=x.getStreamChecked(d);x.chmod(g.node,m)},chown(d,m,g,w){var P;if(typeof d=="string"){var C=x.lookupPath(d,{follow:!w});P=C.node}else P=d;if(!P.node_ops.setattr)throw new x.ErrnoError(63);P.node_ops.setattr(P,{timestamp:Date.now()})},lchown(d,m,g){x.chown(d,m,g,!0)},fchown(d,m,g){var w=x.getStreamChecked(d);x.chown(w.node,m,g)},truncate(d,m){if(m<0)throw new x.ErrnoError(28);var g;if(typeof d=="string"){var w=x.lookupPath(d,{follow:!0});g=w.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 P=x.nodePermissions(g,"w");if(P)throw new x.ErrnoError(P);g.node_ops.setattr(g,{size:m,timestamp:Date.now()})},ftruncate(d,m){var g=x.getStreamChecked(d);if((g.flags&2097155)===0)throw new x.ErrnoError(28);x.truncate(g.node,m)},utime(d,m,g){var w=x.lookupPath(d,{follow:!0}),P=w.node;P.node_ops.setattr(P,{timestamp:Math.max(m,g)})},open(d,m,g){if(d==="")throw new x.ErrnoError(44);m=typeof m=="string"?NT(m):m,g=typeof g>"u"?438:g,m&64?g=g&4095|32768:g=0;var w;if(typeof d=="object")w=d;else{d=ut.normalize(d);try{var P=x.lookupPath(d,{follow:!(m&131072)});w=P.node}catch{}}var C=!1;if(m&64)if(w){if(m&128)throw new x.ErrnoError(20)}else w=x.mknod(d,g,0),C=!0;if(!w)throw new x.ErrnoError(44);if(x.isChrdev(w.mode)&&(m&=-513),m&65536&&!x.isDir(w.mode))throw new x.ErrnoError(54);if(!C){var V=x.mayOpen(w,m);if(V)throw new x.ErrnoError(V)}m&512&&!C&&x.truncate(w,0),m&=-131713;var W=x.createStream({node:w,path:x.getPath(w),flags:m,seekable:!0,position:0,stream_ops:w.stream_ops,ungotten:[],error:!1});return W.stream_ops.open&&W.stream_ops.open(W),r.logReadFiles&&!(m&1)&&(x.readFiles||(x.readFiles={}),d in x.readFiles||(x.readFiles[d]=1)),W},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(m){throw m}finally{x.closeStream(d.fd)}d.fd=null},isClosed(d){return d.fd===null},llseek(d,m,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,m,g),d.ungotten=[],d.position},read(d,m,g,w,P){if(w<0||P<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 C=typeof P<"u";if(!C)P=d.position;else if(!d.seekable)throw new x.ErrnoError(70);var V=d.stream_ops.read(d,m,g,w,P);return C||(d.position+=V),V},write(d,m,g,w,P,C){if(w<0||P<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 V=typeof P<"u";if(!V)P=d.position;else if(!d.seekable)throw new x.ErrnoError(70);var W=d.stream_ops.write(d,m,g,w,P,C);return V||(d.position+=W),W},allocate(d,m,g){if(x.isClosed(d))throw new x.ErrnoError(8);if(m<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,m,g)},mmap(d,m,g,w,P){if((w&2)!==0&&(P&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,m,g,w,P)},msync(d,m,g,w,P){return d.stream_ops.msync?d.stream_ops.msync(d,m,g,w,P):0},munmap:d=>0,ioctl(d,m,g){if(!d.stream_ops.ioctl)throw new x.ErrnoError(59);return d.stream_ops.ioctl(d,m,g)},readFile(d,m={}){if(m.flags=m.flags||0,m.encoding=m.encoding||"binary",m.encoding!=="utf8"&&m.encoding!=="binary")throw new Error(`Invalid encoding type "${m.encoding}"`);var g,w=x.open(d,m.flags),P=x.stat(d),C=P.size,V=new Uint8Array(C);return x.read(w,V,0,C,0),m.encoding==="utf8"?g=Bc(V,0):m.encoding==="binary"&&(g=V),x.close(w),g},writeFile(d,m,g={}){g.flags=g.flags||577;var w=x.open(d,g.flags,g.mode);if(typeof m=="string"){var P=new Uint8Array(Hh(m)+1),C=N0(m,P,0,P.length);x.write(w,P,0,C,void 0,g.canOwn)}else if(ArrayBuffer.isView(m))x.write(w,m,0,m.byteLength,void 0,g.canOwn);else throw new Error("Unsupported data type");x.close(w)},cwd:()=>x.currentPath,chdir(d){var m=x.lookupPath(d,{follow:!0});if(m.node===null)throw new x.ErrnoError(44);if(!x.isDir(m.node.mode))throw new x.ErrnoError(54);var g=x.nodePermissions(m.node,"x");if(g)throw new x.ErrnoError(g);x.currentPath=m.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:(w,P,C,V,W)=>V}),x.mkdev("/dev/null",x.makedev(1,3)),Vo.register(x.makedev(5,0),Vo.default_tty_ops),Vo.register(x.makedev(6,0),Vo.default_tty1_ops),x.mkdev("/dev/tty",x.makedev(5,0)),x.mkdev("/dev/tty1",x.makedev(6,0));var d=new Uint8Array(1024),m=0,g=()=>(m===0&&(m=JP(d).byteLength),d[--m]);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 m=x.createNode(d,"fd",16895,73);return m.node_ops={lookup(g,w){var P=+w,C=x.getStreamChecked(P),V={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>C.path}};return V.parent=V,V}},m}},{},"/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),m=x.open("/dev/stdout",1),g=x.open("/dev/stderr",1)},ensureErrnoError(){x.ErrnoError||(x.ErrnoError=function(m,g){this.name="ErrnoError",this.node=g,this.setErrno=function(w){this.errno=w},this.setErrno(m),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(Ue,{},"/"),x.createDefaultDirectories(),x.createDefaultDevices(),x.createSpecialDirectories(),x.filesystems={MEMFS:Ue}},init(d,m,g){x.init.initialized=!0,x.ensureErrnoError(),r.stdin=d||r.stdin,r.stdout=m||r.stdout,r.stderr=g||r.stderr,x.createStandardStreams()},quit(){x.init.initialized=!1;for(var d=0;d<x.streams.length;d++){var m=x.streams[d];m&&x.close(m)}},findObject(d,m){var g=x.analyzePath(d,m);return g.exists?g.object:null},analyzePath(d,m){try{var g=x.lookupPath(d,{follow:!m});d=g.path}catch{}var w={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});w.parentExists=!0,w.parentPath=g.path,w.parentObject=g.node,w.name=ut.basename(d),g=x.lookupPath(d,{follow:!m}),w.exists=!0,w.path=g.path,w.object=g.node,w.name=g.node.name,w.isRoot=g.path==="/"}catch(P){w.error=P.errno}return w},createPath(d,m,g,w){d=typeof d=="string"?d:x.getPath(d);for(var P=m.split("/").reverse();P.length;){var C=P.pop();if(C){var V=ut.join2(d,C);try{x.mkdir(V)}catch{}d=V}}return V},createFile(d,m,g,w,P){var C=ut.join2(typeof d=="string"?d:x.getPath(d),m),V=$0(w,P);return x.create(C,V)},createDataFile(d,m,g,w,P,C){var V=m;d&&(d=typeof d=="string"?d:x.getPath(d),V=m?ut.join2(d,m):d);var W=$0(w,P),ae=x.create(V,W);if(g){if(typeof g=="string"){for(var De=new Array(g.length),qe=0,at=g.length;qe<at;++qe)De[qe]=g.charCodeAt(qe);g=De}x.chmod(ae,W|146);var Ne=x.open(ae,577);x.write(Ne,g,0,g.length,0,C),x.close(Ne),x.chmod(ae,W)}},createDevice(d,m,g,w){var P=ut.join2(typeof d=="string"?d:x.getPath(d),m),C=$0(!!g,!!w);x.createDevice.major||(x.createDevice.major=64);var V=x.makedev(x.createDevice.major++,0);return x.registerDevice(V,{open(W){W.seekable=!1},close(W){w?.buffer?.length&&w(10)},read(W,ae,De,qe,at){for(var Ne=0,_e=0;_e<qe;_e++){var Ae;try{Ae=g()}catch{throw new x.ErrnoError(29)}if(Ae===void 0&&Ne===0)throw new x.ErrnoError(6);if(Ae==null)break;Ne++,ae[De+_e]=Ae}return Ne&&(W.node.timestamp=Date.now()),Ne},write(W,ae,De,qe,at){for(var Ne=0;Ne<qe;Ne++)try{w(ae[De+Ne])}catch{throw new x.ErrnoError(29)}return qe&&(W.node.timestamp=Date.now()),Ne}}),x.mkdev(P,C,V)},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(_)try{d.contents=qh(_(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,m,g,w,P){function C(){this.lengthKnown=!1,this.chunks=[]}if(C.prototype.get=function(_e){if(!(_e>this.length-1||_e<0)){var Ae=_e%this.chunkSize,Dt=_e/this.chunkSize|0;return this.getter(Dt)[Ae]}},C.prototype.setDataGetter=function(_e){this.getter=_e},C.prototype.cacheLength=function(){var _e=new XMLHttpRequest;if(_e.open("HEAD",g,!1),_e.send(null),!(_e.status>=200&&_e.status<300||_e.status===304))throw new Error("Couldn't load "+g+". Status: "+_e.status);var Ae=Number(_e.getResponseHeader("Content-length")),Dt,Qi=(Dt=_e.getResponseHeader("Accept-Ranges"))&&Dt==="bytes",ei=(Dt=_e.getResponseHeader("Content-Encoding"))&&Dt==="gzip",q=1024*1024;Qi||(q=Ae);var ye=(St,On)=>{if(St>On)throw new Error("invalid range ("+St+", "+On+") or no bytes requested!");if(On>Ae-1)throw new Error("only "+Ae+" bytes available! programmer error!");var mr=new XMLHttpRequest;if(mr.open("GET",g,!1),Ae!==q&&mr.setRequestHeader("Range","bytes="+St+"-"+On),mr.responseType="arraybuffer",mr.overrideMimeType&&mr.overrideMimeType("text/plain; charset=x-user-defined"),mr.send(null),!(mr.status>=200&&mr.status<300||mr.status===304))throw new Error("Couldn't load "+g+". Status: "+mr.status);return mr.response!==void 0?new Uint8Array(mr.response||[]):qh(mr.responseText||"",!0)},Fr=this;Fr.setDataGetter(St=>{var On=St*q,mr=(St+1)*q-1;if(mr=Math.min(mr,Ae-1),typeof Fr.chunks[St]>"u"&&(Fr.chunks[St]=ye(On,mr)),typeof Fr.chunks[St]>"u")throw new Error("doXHR failed!");return Fr.chunks[St]}),(ei||!Ae)&&(q=Ae=1,Ae=this.getter(0).length,q=Ae,z("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=Ae,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 V=new C;Object.defineProperties(V,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var W={isDevice:!1,contents:V}}else var W={isDevice:!1,url:g};var ae=x.createFile(d,m,W,w,P);W.contents?ae.contents=W.contents:W.url&&(ae.contents=null,ae.url=W.url),Object.defineProperties(ae,{usedBytes:{get:function(){return this.contents.length}}});var De={},qe=Object.keys(ae.stream_ops);qe.forEach(Ne=>{var _e=ae.stream_ops[Ne];De[Ne]=function(){return x.forceLoadFile(ae),_e.apply(null,arguments)}});function at(Ne,_e,Ae,Dt,Qi){var ei=Ne.node.contents;if(Qi>=ei.length)return 0;var q=Math.min(ei.length-Qi,Dt);if(ei.slice)for(var ye=0;ye<q;ye++)_e[Ae+ye]=ei[Qi+ye];else for(var ye=0;ye<q;ye++)_e[Ae+ye]=ei.get(Qi+ye);return q}return De.read=(Ne,_e,Ae,Dt,Qi)=>(x.forceLoadFile(ae),at(Ne,_e,Ae,Dt,Qi)),De.mmap=(Ne,_e,Ae,Dt,Qi)=>{x.forceLoadFile(ae);var ei=XP(_e);if(!ei)throw new x.ErrnoError(48);return at(Ne,ue,ei,_e,Ae),{ptr:ei,allocated:!0}},ae.stream_ops=De,ae}},Jh=(d,m)=>d?Bc(Se,d,m):"",Uo={DEFAULT_POLLMASK:5,calculateAt(d,m,g){if(ut.isAbs(m))return m;var w;if(d===-100)w=x.cwd();else{var P=Uo.getStreamFromFD(d);w=P.path}if(m.length==0){if(!g)throw new x.ErrnoError(44);return w}return ut.join2(w,m)},doStat(d,m,g){try{var w=d(m)}catch(W){if(W&&W.node&&ut.normalize(m)!==ut.normalize(x.getPath(W.node)))return-54;throw W}Je[g>>2]=w.dev,Je[g+4>>2]=w.mode,ft[g+8>>2]=w.nlink,Je[g+12>>2]=w.uid,Je[g+16>>2]=w.gid,Je[g+20>>2]=w.rdev,Ar=[w.size>>>0,(Ye=w.size,+Math.abs(Ye)>=1?Ye>0?+Math.floor(Ye/4294967296)>>>0:~~+Math.ceil((Ye-+(~~Ye>>>0))/4294967296)>>>0:0)],Je[g+24>>2]=Ar[0],Je[g+28>>2]=Ar[1],Je[g+32>>2]=4096,Je[g+36>>2]=w.blocks;var P=w.atime.getTime(),C=w.mtime.getTime(),V=w.ctime.getTime();return Ar=[Math.floor(P/1e3)>>>0,(Ye=Math.floor(P/1e3),+Math.abs(Ye)>=1?Ye>0?+Math.floor(Ye/4294967296)>>>0:~~+Math.ceil((Ye-+(~~Ye>>>0))/4294967296)>>>0:0)],Je[g+40>>2]=Ar[0],Je[g+44>>2]=Ar[1],ft[g+48>>2]=P%1e3*1e3,Ar=[Math.floor(C/1e3)>>>0,(Ye=Math.floor(C/1e3),+Math.abs(Ye)>=1?Ye>0?+Math.floor(Ye/4294967296)>>>0:~~+Math.ceil((Ye-+(~~Ye>>>0))/4294967296)>>>0:0)],Je[g+56>>2]=Ar[0],Je[g+60>>2]=Ar[1],ft[g+64>>2]=C%1e3*1e3,Ar=[Math.floor(V/1e3)>>>0,(Ye=Math.floor(V/1e3),+Math.abs(Ye)>=1?Ye>0?+Math.floor(Ye/4294967296)>>>0:~~+Math.ceil((Ye-+(~~Ye>>>0))/4294967296)>>>0:0)],Je[g+72>>2]=Ar[0],Je[g+76>>2]=Ar[1],ft[g+80>>2]=V%1e3*1e3,Ar=[w.ino>>>0,(Ye=w.ino,+Math.abs(Ye)>=1?Ye>0?+Math.floor(Ye/4294967296)>>>0:~~+Math.ceil((Ye-+(~~Ye>>>0))/4294967296)>>>0:0)],Je[g+88>>2]=Ar[0],Je[g+92>>2]=Ar[1],0},doMsync(d,m,g,w,P){if(!x.isFile(m.node.mode))throw new x.ErrnoError(43);if(w&2)return 0;var C=Se.slice(d,d+g);x.msync(m,C,P,g,w)},varargs:void 0,get(){var d=Je[+Uo.varargs>>2];return Uo.varargs+=4,d},getp(){return Uo.get()},getStr(d){var m=Jh(d);return m},getStreamFromFD(d){var m=x.getStreamChecked(d);return m}},$T=(d,m)=>{var g=0;return wp().forEach((w,P)=>{var C=m+g;ft[d+P*4>>2]=C,bT(w,C),g+=w.length+1}),0},kT=(d,m)=>{var g=wp();ft[d>>2]=g.length;var w=0;return g.forEach(P=>w+=P.length+1),ft[m>>2]=w,0};function BT(d){try{var m=Uo.getStreamFromFD(d);return x.close(m),0}catch(g){if(typeof x>"u"||g.name!=="ErrnoError")throw g;return g.errno}}var IT=(d,m,g,w)=>{for(var P=0,C=0;C<g;C++){var V=ft[m>>2],W=ft[m+4>>2];m+=8;var ae=x.read(d,ue,V,W,w);if(ae<0)return-1;if(P+=ae,ae<W)break;typeof w<"u"&&(w+=ae)}return P};function TT(d,m,g,w){try{var P=Uo.getStreamFromFD(d),C=IT(P,m,g);return ft[w>>2]=C,0}catch(V){if(typeof x>"u"||V.name!=="ErrnoError")throw V;return V.errno}}var DT=(d,m)=>m+2097152>>>0<4194305-!!d?(d>>>0)+m*4294967296:NaN;function RT(d,m,g,w,P){var C=DT(m,g);try{if(isNaN(C))return 61;var V=Uo.getStreamFromFD(d);return x.llseek(V,C,w),Ar=[V.position>>>0,(Ye=V.position,+Math.abs(Ye)>=1?Ye>0?+Math.floor(Ye/4294967296)>>>0:~~+Math.ceil((Ye-+(~~Ye>>>0))/4294967296)>>>0:0)],Je[P>>2]=Ar[0],Je[P+4>>2]=Ar[1],V.getdents&&C===0&&w===0&&(V.getdents=null),0}catch(W){if(typeof x>"u"||W.name!=="ErrnoError")throw W;return W.errno}}var CT=(d,m,g,w)=>{for(var P=0,C=0;C<g;C++){var V=ft[m>>2],W=ft[m+4>>2];m+=8;var ae=x.write(d,ue,V,W,w);if(ae<0)return-1;P+=ae,typeof w<"u"&&(w+=ae)}return P};function zT(d,m,g,w){try{var P=Uo.getStreamFromFD(d),C=CT(P,m,g);return ft[w>>2]=C,0}catch(V){if(typeof x>"u"||V.name!=="ErrnoError")throw V;return V.errno}}var Yh=d=>d%4===0&&(d%100!==0||d%400===0),OT=(d,m)=>{for(var g=0,w=0;w<=m;g+=d[w++]);return g},QP=[31,29,31,30,31,30,31,31,30,31,30,31],eM=[31,28,31,30,31,30,31,31,30,31,30,31],VT=(d,m)=>{for(var g=new Date(d.getTime());m>0;){var w=Yh(g.getFullYear()),P=g.getMonth(),C=(w?QP:eM)[P];if(m>C-g.getDate())m-=C-g.getDate()+1,g.setDate(1),P<11?g.setMonth(P+1):(g.setMonth(0),g.setFullYear(g.getFullYear()+1));else return g.setDate(g.getDate()+m),g}return g},tM=(d,m)=>{ue.set(d,m)},UT=(d,m,g,w)=>{var P=ft[w+40>>2],C={tm_sec:Je[w>>2],tm_min:Je[w+4>>2],tm_hour:Je[w+8>>2],tm_mday:Je[w+12>>2],tm_mon:Je[w+16>>2],tm_year:Je[w+20>>2],tm_wday:Je[w+24>>2],tm_yday:Je[w+28>>2],tm_isdst:Je[w+32>>2],tm_gmtoff:Je[w+36>>2],tm_zone:P?Jh(P):""},V=Jh(g),W={"%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 ae in W)V=V.replace(new RegExp(ae,"g"),W[ae]);var De=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],qe=["January","February","March","April","May","June","July","August","September","October","November","December"];function at(q,ye,Fr){for(var St=typeof q=="number"?q.toString():q||"";St.length<ye;)St=Fr[0]+St;return St}function Ne(q,ye){return at(q,ye,"0")}function _e(q,ye){function Fr(On){return On<0?-1:On>0?1:0}var St;return(St=Fr(q.getFullYear()-ye.getFullYear()))===0&&(St=Fr(q.getMonth()-ye.getMonth()))===0&&(St=Fr(q.getDate()-ye.getDate())),St}function Ae(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 Dt(q){var ye=VT(new Date(q.tm_year+1900,0,1),q.tm_yday),Fr=new Date(ye.getFullYear(),0,4),St=new Date(ye.getFullYear()+1,0,4),On=Ae(Fr),mr=Ae(St);return _e(On,ye)<=0?_e(mr,ye)<=0?ye.getFullYear()+1:ye.getFullYear():ye.getFullYear()-1}var Qi={"%a":q=>De[q.tm_wday].substring(0,3),"%A":q=>De[q.tm_wday],"%b":q=>qe[q.tm_mon].substring(0,3),"%B":q=>qe[q.tm_mon],"%C":q=>{var ye=q.tm_year+1900;return Ne(ye/100|0,2)},"%d":q=>Ne(q.tm_mday,2),"%e":q=>at(q.tm_mday,2," "),"%g":q=>Dt(q).toString().substring(2),"%G":q=>Dt(q),"%H":q=>Ne(q.tm_hour,2),"%I":q=>{var ye=q.tm_hour;return ye==0?ye=12:ye>12&&(ye-=12),Ne(ye,2)},"%j":q=>Ne(q.tm_mday+OT(Yh(q.tm_year+1900)?QP:eM,q.tm_mon-1),3),"%m":q=>Ne(q.tm_mon+1,2),"%M":q=>Ne(q.tm_min,2),"%n":()=>`
116
- `,"%p":q=>q.tm_hour>=0&&q.tm_hour<12?"AM":"PM","%S":q=>Ne(q.tm_sec,2),"%t":()=>" ","%u":q=>q.tm_wday||7,"%U":q=>{var ye=q.tm_yday+7-q.tm_wday;return Ne(Math.floor(ye/7),2)},"%V":q=>{var ye=Math.floor((q.tm_yday+7-(q.tm_wday+6)%7)/7);if((q.tm_wday+371-q.tm_yday-2)%7<=2&&ye++,ye){if(ye==53){var St=(q.tm_wday+371-q.tm_yday)%7;St!=4&&(St!=3||!Yh(q.tm_year))&&(ye=1)}}else{ye=52;var Fr=(q.tm_wday+7-q.tm_yday-1)%7;(Fr==4||Fr==5&&Yh(q.tm_year%400-1))&&ye++}return Ne(ye,2)},"%w":q=>q.tm_wday,"%W":q=>{var ye=q.tm_yday+7-(q.tm_wday+6)%7;return Ne(Math.floor(ye/7),2)},"%y":q=>(q.tm_year+1900).toString().substring(2),"%Y":q=>q.tm_year+1900,"%z":q=>{var ye=q.tm_gmtoff,Fr=ye>=0;return ye=Math.abs(ye)/60,ye=ye/60*100+ye%60,(Fr?"+":"-")+("0000"+ye).slice(-4)},"%Z":q=>q.tm_zone,"%%":()=>"%"};V=V.replace(/%%/g,"\0\0");for(var ae in Qi)V.includes(ae)&&(V=V.replace(new RegExp(ae,"g"),Qi[ae](C)));V=V.replace(/\0\0/g,"%");var ei=qh(V,!1);return ei.length>m?0:(tM(ei,d),ei.length-1)},jT=(d,m,g,w,P)=>UT(d,m,g,w),rM=d=>{var m=r["_"+d];return m},iM=(d,m,g)=>N0(d,Se,m,g),KT=d=>{var m=Hh(d)+1,g=k0(m);return iM(d,g,m),g},nM=(d,m,g,w,P)=>{var C={string:Ae=>{var Dt=0;return Ae!=null&&Ae!==0&&(Dt=KT(Ae)),Dt},array:Ae=>{var Dt=k0(Ae.length);return tM(Ae,Dt),Dt}};function V(Ae){return m==="string"?Jh(Ae):m==="boolean"?!!Ae:Ae}var W=rM(d),ae=[],De=0;if(w)for(var qe=0;qe<w.length;qe++){var at=C[g[qe]];at?(De===0&&(De=oM()),ae[qe]=at(w[qe])):ae[qe]=w[qe]}var Ne=W.apply(null,ae);function _e(Ae){return De!==0&&sM(De),V(Ae)}return Ne=_e(Ne),Ne},WT=(d,m,g,w)=>{var P=!g||g.every(V=>V==="number"||V==="boolean"),C=m!=="string";return C&&P&&!w?rM(d):function(){return nM(d,m,g,arguments,w)}},aM=function(d,m,g,w){d||(d=this),this.parent=d,this.mount=d.mount,this.mounted=null,this.id=x.nextInode++,this.name=m,this.mode=g,this.node_ops={},this.stream_ops={},this.rdev=w},Xh=365,Qh=146;Object.defineProperties(aM.prototype,{read:{get:function(){return(this.mode&Xh)===Xh},set:function(d){d?this.mode|=Xh:this.mode&=~Xh}},write:{get:function(){return(this.mode&Qh)===Qh},set:function(d){d?this.mode|=Qh:this.mode&=~Qh}},isFolder:{get:function(){return x.isDir(this.mode)}},isDevice:{get:function(){return x.isChrdev(this.mode)}}}),x.FSNode=aM,x.createPreloadedFile=MT,x.staticInit();var LT={a:mT,b:hT,k:gT,i:yT,e:$T,f:kT,g:BT,h:TT,j:RT,c:zT,d:jT},mt=dT(),ZT=()=>(ZT=mt.m)(),GT=r._nam_createInstance=()=>(GT=r._nam_createInstance=mt.n)(),HT=r._nam_destroyInstance=d=>(HT=r._nam_destroyInstance=mt.o)(d),qT=r._nam_getInstanceCount=()=>(qT=r._nam_getInstanceCount=mt.p)(),JT=r._nam_loadModel=(d,m)=>(JT=r._nam_loadModel=mt.q)(d,m),YT=r._nam_unloadModel=d=>(YT=r._nam_unloadModel=mt.r)(d),XT=r._nam_hasModel=d=>(XT=r._nam_hasModel=mt.s)(d),QT=r._nam_process=(d,m,g,w)=>(QT=r._nam_process=mt.t)(d,m,g,w),eD=r._nam_setSampleRate=d=>(eD=r._nam_setSampleRate=mt.u)(d),tD=r._nam_getSampleRate=()=>(tD=r._nam_getSampleRate=mt.v)(),rD=r._nam_setMaxBufferSize=d=>(rD=r._nam_setMaxBufferSize=mt.w)(d),iD=r._nam_getMaxBufferSize=()=>(iD=r._nam_getMaxBufferSize=mt.x)(),nD=r._nam_getModelLoudness=d=>(nD=r._nam_getModelLoudness=mt.y)(d),aD=r._nam_hasModelLoudness=d=>(aD=r._nam_hasModelLoudness=mt.z)(d),oD=r._nam_reset=d=>(oD=r._nam_reset=mt.A)(d),sD=r._free=d=>(sD=r._free=mt.B)(d),lD=r._malloc=d=>(lD=r._malloc=mt.C)(d),cD=()=>(cD=mt.__errno_location)(),oM=()=>(oM=mt.E)(),sM=d=>(sM=mt.F)(d),k0=d=>(k0=mt.G)(d),uD=d=>(uD=mt.__cxa_increment_exception_refcount)(d),lM=d=>(lM=mt.H)(d);r.ccall=nM,r.cwrap=WT,r.stringToUTF8=iM,r.lengthBytesUTF8=Hh;var eg;yp=function d(){eg||cM(),eg||(yp=d)};function cM(){if(Hs>0||(rT(),Hs>0))return;function d(){eg||(eg=!0,r.calledRun=!0,!me&&(iT(),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),nT()))}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 cM(),e.ready})})(),OP=Zz;var VP=class{constructor(e){this.uuid=e}instances=[-1,-1];json=null;loaded=!1;mono=!0},Gz=(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},w0=class{#e;#t;#r;#i=new Map;#n=new Map;#a=1;#o=null;#s=null;#u=!1;#l=!1;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}async settle(){for(;this.#u;)await new Promise(e=>setTimeout(e,1))}imports(){return{host_nam_create:e=>this.#c(e),host_nam_load:(e,r,n)=>this.#d(e,r,n),host_nam_set_mono:(e,r)=>this.#p(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.#v(e),host_nam_release:e=>this.#m(e)}}#c(e){let r=B.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 VP(r)),this.#n.set(r,i),i}#d(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)&&Gz(i.json,a)||(i.json=a,K(this.#s)?this.#h(i):this.#y())}#p(e,r){let n=this.#i.get(e);if(!K(n))return;n.mono=r;let i=this.#s;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.#f(n.instances[1],n.json)&&n.loaded)))}#g(e,r,n,i,a,o,s){let c=this.#i.get(e),u=this.#s;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}#v(e){let r=this.#i.get(e),n=this.#s;if(!(!K(r)||!K(n)))for(let i of r.instances)i>=0&&n.reset(i)}#m(e){let r=this.#i.get(e);if(!K(r))return;let n=this.#s;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.#u||this.#l||K(this.#s)||(this.#u=!0,this.#t().then(e=>OP({wasmBinary:e,locateFile:()=>""})).then(e=>{this.#o=e;let r=Lh.fromModule(e);r.setSampleRate(this.#r),this.#s=r,this.#u=!1;for(let n of this.#i.values())K(n.json)&&this.#h(n)}).catch(e=>{this.#u=!1,this.#l=!0,console.error("Failed to load NAM WASM:",e)}))}#h(e){let r=this.#s;!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.#f(e.instances[0],e.json),e.instances[1]>=0&&(e.loaded=this.#f(e.instances[1],e.json)&&e.loaded))}#x(e){e.loaded=!1;let r=this.#s;if(K(r))for(let n of e.instances)n>=0&&r.unloadModel(n)}#f(e,r){let n=this.#o;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},Hz=1330857522,qz=32,WI=24,LI=40,ZI=8,Jz=({samples:t,presets:e})=>{let r=e.reduce((h,y)=>h+y.length,0),n=qz,i=n+t.length*WI,a=i+r*LI,o=a+e.length*ZI,s=t.reduce((h,y)=>h+y.pcm.length,0),c=new ArrayBuffer(o+s*4),u=new DataView(c);u.setUint32(0,Hz,!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((h,y)=>{let _=n+y*WI;u.setUint32(_,f,!0),u.setUint32(_+4,h.pcm.length,!0),u.setFloat32(_+8,h.sampleRate,!0),u.setUint32(_+12,h.loopStart,!0),u.setUint32(_+16,h.loopEnd,!0),new Float32Array(c,f,h.pcm.length).set(h.pcm),f+=h.pcm.length*4});let v=0;return e.forEach((h,y)=>{let _=a+y*ZI;u.setUint32(_,v,!0),u.setUint32(_+4,h.length,!0);for(let $ of h){let S=i+v*LI;u.setUint8(S,$.keyLo),u.setUint8(S+1,$.keyHi),u.setUint8(S+2,$.velLo),u.setUint8(S+3,$.velHi),u.setUint32(S+4,$.sampleIndex,!0),u.setUint32(S+8,$.rootKey,!0),u.setUint32(S+12,$.loopMode,!0),u.setFloat32(S+16,$.pan,!0),u.setFloat32(S+20,$.attack,!0),u.setFloat32(S+24,$.decay,!0),u.setFloat32(S+28,$.sustain,!0),u.setFloat32(S+32,$.release,!0),v++}}),c},_0=(t,e)=>t.generators[e]?.value,xp=(t,e,r)=>_0(e,r)??_0(t,r),UP=t=>t!==void 0?Math.pow(2,t/1200):.005,b0=(t,e)=>t.generators[e]?.range??{lo:0,hi:127},GI=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=b0(s,zn.KeyRange),u=b0(s,zn.VelRange);for(let f of s.instrument.zones){let v=b0(f,zn.KeyRange),h=b0(f,zn.VelRange),y=Math.max(c.lo,v.lo),_=Math.min(c.hi,v.hi),$=Math.max(u.lo,h.lo),S=Math.min(u.hi,h.hi);if(y>_||$>S)continue;let z=f.sample??t.samples[_0(f,zn.SampleId)??0];if(z===void 0)continue;let O=n(z),J=_0(f,zn.OverridingRootKey)??z.header.originalPitch??60,te=xp(s,f,zn.SampleModes)??0,me=xp(s,f,zn.SustainVolEnv);o.push({keyLo:y,keyHi:_,velLo:$,velHi:S,sampleIndex:O,rootKey:J,loopMode:te===1||te===3?1:0,pan:(xp(s,f,zn.Pan)??0)/1e3,attack:UP(xp(s,f,zn.AttackVolEnv)),decay:UP(xp(s,f,zn.DecayVolEnv)),sustain:1-(me??0)/1e3,release:UP(xp(s,f,zn.ReleaseVolEnv))})}}return o});return Jz({samples:e,presets:i})};var Yz=512,HI=(t,e,r)=>{let n=Lt(()=>DI(t,e));return n.status==="failure"||n.value.length===0?r:new Error(`wasm panic: ${n.value}`,{cause:r})},qI=(t,e,r,n)=>{let i=new WebAssembly.Table({initial:Yz,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 x0(e,o,r,(f,v)=>n.deviceMessage(f,v)),c=new w0(e,()=>n.fetchNamWasm(),r),u={...s.imports(),...c.imports()};return t.deviceModules.forEach((f,v)=>RI(o,e,i,f,t.deviceBoxTypes[v],r,u)),t.composites.forEach(f=>CI(o,e,f)),t.effectComposites.forEach(f=>zI(o,e,f)),o},JI=(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:h,sampleRate:y,frames:_}=f,$=v*Float32Array.BYTES_PER_ELEMENT,S=t.sample_allocate(c,h*$);if(S!==0){for(let z=0;z<h;z++)new Float32Array(e.buffer,S+z*$,v).set(_[z]);t.sample_set_ready(c,v,h,y)}},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(GI(f)),h=t.soundfont_allocate(c,v.byteLength);h!==0&&(new Uint8Array(e.buffer,h,v.byteLength).set(v),t.soundfont_set_ready(c))},f=>r.log(`soundfont load failed: ${f}`)))}};var YI="engine-wasm-processor",XI="engine-sync-bytes";var QI=()=>new WebAssembly.Memory({initial:256});var eT=512,jP=class extends AudioWorkletProcessor{#e=new Y;#t;#r;#i;#n=new Float32Array(hw);#a;#o;#s;#u;#l;#c=[];#d;#p;#g=new c0;#v=new u0(eT);#m=new d0(sampleRate);#y=new Float32Array(5);#h=new Float32Array(eT*2);#x=new Float32Array(5);#f=!1;#A=!1;#F=!1;#S=!1;#_=!1;#w=new m0;#P=new Set;#E=-1;#N=null;#M=[];#$=!1;#D=!0;#C=!1;#k=!1;#I=!1;#T=0;#B=0;constructor({processorOptions:e}){super();let{syncStreamBuffer:r,controlFlagsBuffer:n,hrClockBuffer:i,variant:a}=e,{engineModule:o,deviceModules:s,deviceBoxTypes:c,composites:u,effectComposites:f}=a;this.#t=QI();let v=bM.for(this.port);this.#a=va.sender(v.channel("engine-to-client"),S=>new class{log(z){S.dispatchAndForget(this.log,z)}error(z){S.dispatchAndForget(this.error,z)}deviceMessage(z,O){S.dispatchAndForget(this.deviceMessage,z,O)}fetchAudio(z){return S.dispatchAndReturn(this.fetchAudio,z)}fetchSoundfont(z){return S.dispatchAndReturn(this.fetchSoundfont,z)}fetchNamWasm(){return S.dispatchAndReturn(this.fetchNamWasm)}notifyClipSequenceChanges(z){S.dispatchAndForget(this.notifyClipSequenceChanges,z)}switchMarkerState(z){S.dispatchAndForget(this.switchMarkerState,z)}ready(){S.dispatchAndForget(this.ready)}});let h=qI({engineModule:o,deviceModules:s,deviceBoxTypes:c,composites:u,effectComposites:f},this.#t,sampleRate,this.#a);this.#r=h,this.#u=new Int32Array(n),this.#i=new s0(i),this.#s=mg.writer(zN(),r,S=>{let z=h.engine_state_ptr(),O=new DataView(this.#t.buffer,z,h.engine_state_len());S.position=O.getFloat32(0),S.bpm=O.getFloat32(4),S.playbackTimestamp=this.#B,S.countInBeatsRemaining=O.getFloat32(12),S.isPlaying=O.getUint8(16)===1,S.isCountingIn=O.getUint8(17)===1,S.isRecording=O.getUint8(18)===1,this.#I&&(S.perfBuffer.set(this.#n),S.perfIndex=this.#T)}),this.#l=this.#e.own(Mg.create(v,"engine-live-data")),this.#d=this.#e.own(new l0(this.#l,Xa.PEAKS)),this.#p=new gg;let y=new Float32Array(this.#p.numBins()),_=new Float32Array(this.#p.numBins()),$=new Float32Array(3);this.#o=new Dp(v.channel("engine-preferences"),xI.parse({})),this.#e.ownAll(this.#l.broadcastFloats(Xa.SPECTRUM,y,S=>{this.#f=S,S&&(y.set(this.#p.bins()),this.#p.decay=!0)}),this.#l.broadcastFloats(Xa.WAVEFORM,_,S=>{this.#A=S,S&&_.set(this.#p.waveform())}),this.#l.broadcastFloats(Xa.STEREO,this.#y,S=>{this.#F=S}),this.#l.broadcastFloats(Xa.GONIO,this.#h,S=>{this.#S=S}),this.#l.broadcastFloats(Xa.LOUDNESS,this.#x,S=>{this.#_=S,S&&this.#m.fill(this.#x)}),this.#l.broadcastFloats(Xa.HEAP,$,S=>{S&&($[0]=h.heap_used(),$[1]=h.heap_claimed(),$[2]=this.#t.buffer.byteLength)}),this.#o.catchupAndSubscribe(S=>h.set_metronome_enabled(S?1:0),"metronome","enabled"),this.#o.catchupAndSubscribe(S=>h.set_metronome_gain(S),"metronome","gain"),this.#o.catchupAndSubscribe(S=>h.set_metronome_beat_sub_division(S),"metronome","beatSubDivision"),this.#o.catchupAndSubscribe(S=>h.set_metronome_monophonic(S?1:0),"metronome","monophonic"),this.#o.catchupAndSubscribe(S=>h.set_allow_takes(S?1:0),"recording","allowTakes"),this.#o.catchupAndSubscribe(S=>h.set_pause_on_loop_disabled(S?1:0),"playback","pauseOnLoopDisabled"),this.#o.catchupAndSubscribe(S=>h.set_truncate_notes_at_region_end(S?1:0),"playback","truncateNotesAtRegionEnd"),this.#o.catchupAndSubscribe(S=>this.#I=S,"debug","dspLoadMeasurement"),va.executor(v.channel(XI),{applyUpdates:S=>this.#b(()=>this.#L(S)),checksum:S=>this.#z(S)}),va.executor(v.channel("engine-commands"),{play:()=>this.#b(()=>this.#K()),stop:S=>this.#b(()=>this.#W(S)),setPosition:S=>this.#b(()=>{this.#B=S,h.set_position(S)}),prepareRecordingState:S=>this.#b(()=>{this.#k=!0,h.prepare_recording_state(S?1:0,this.#o.settings.recording.countInBars)}),stopRecording:()=>this.#b(()=>{this.#k=!1,h.stop_recording()}),queryLoadingComplete:()=>Promise.all(this.#P).then(()=>!0),panic:()=>{this.#C=!0},loadClickSound:(S,z)=>this.#b(()=>{let{frames:O,numberOfFrames:J,numberOfChannels:te,sampleRate:me}=z,he=Math.min(te,2),be=h.click_allocate(J,he);for(let ue=0;ue<he;ue++)new Float32Array(this.#t.buffer,be+ue*J*4,J).set(O[ue]);h.set_click_sound(S,J,he,me)}),setFrozenAudio:(S,z)=>this.#b(()=>{if(z===null){let Se=h.input_reserve(16);new Uint8Array(this.#t.buffer,Se,16).set(S),h.clear_frozen_audio();return}let{frames:O,numberOfFrames:J,numberOfChannels:te,sampleRate:me}=z,he=Math.min(te,2),be=h.frozen_allocate(J,he);if(be===0)return;for(let Se=0;Se<he;Se++)new Float32Array(this.#t.buffer,be+Se*J*4,J).set(O[Se]);let ue=h.input_reserve(16);new Uint8Array(this.#t.buffer,ue,16).set(S),h.set_frozen_audio(J,he,me)}),updateMonitoringMap:S=>this.#b(()=>{this.#M=S;let z=h.input_reserve(S.length*24),O=new DataView(this.#t.buffer,z,S.length*24);S.forEach(({uuid:J,channels:te},me)=>{new Uint8Array(this.#t.buffer,z+me*24,16).set(J),O.setInt32(me*24+16,te[0],!0),O.setInt32(me*24+20,te.length>1?te[1]:-1,!0)}),h.set_monitoring_map(S.length)}),noteSignal:S=>this.#b(()=>this.#j(S)),ignoreNoteRegion:S=>this.#b(()=>{let z=h.input_reserve(16);new Uint8Array(this.#t.buffer,z,16).set(S),h.ignore_note_region()}),scheduleClipPlay:S=>this.#b(()=>S.forEach(z=>{let O=h.input_reserve(16);new Uint8Array(this.#t.buffer,O,16).set(z),h.schedule_clip_play()})),scheduleClipStop:S=>this.#b(()=>S.forEach(z=>{let O=h.input_reserve(16);new Uint8Array(this.#t.buffer,O,16).set(z),h.schedule_clip_stop()})),setupMIDI:(S,z)=>this.#w.connect(S,z),terminate:()=>{this.#D=!1,this.#c.forEach(S=>S.terminate()),this.#c.length=0,this.#e.terminate()}})),this.#a.ready()}process(e,r){if(!this.#D)return!1;if(Atomics.load(this.#u,0)===1)return this.#s.tryWrite(),!0;let{status:n,error:i}=Lt(()=>this.#O(e,r));return n==="failure"?(this.#R(i),!1):!0}#R(e){console.debug(e),this.#D=!1,this.#a.error(HI(this.#r,this.#t,e)),this.#e.terminate()}#b(e){let{status:r,error:n}=Lt(e);r==="failure"&&this.#R(n)}#z(e){let r=this.#r.checksum_ptr(),n=new Int8Array(this.#t.buffer,r,32);if(e.length===n.length&&e.every((a,o)=>a===n[o]))return Promise.resolve();let i=new Error("box-graph checksum mismatch: the engine mirror diverged from the source graph");return this.#a.error(i),Promise.reject(i)}#O(e,[r,n]){if(this.#C)return j("Manual Panic");let i=this.#I?this.#i.start():0,a=this.#r,o=this.#M;if(o.length>0){let _=e[0]??[],$=a.monitor_input_ptr(),S=new Float32Array(this.#t.buffer,$,8*ha);S.fill(0);for(let{channels:z}of o)for(let O of z){let J=_[O];J!==void 0&&O<8&&S.set(J,O*ha)}}if(a.render(),o.length>0&&n!==void 0){let _=a.monitor_output_ptr(),$=new Float32Array(this.#t.buffer,_,8*ha);for(let{channels:S}of o)for(let z of S){let O=n[z];O!==void 0&&z<8&&O.set($.subarray(z*ha,(z+1)*ha))}}let s=r[0].length,c=this.#t.buffer,u=a.output_ptr(),f=new Float32Array(c,u,s),v=new Float32Array(c,u+s*Float32Array.BYTES_PER_ELEMENT,s);r[0].set(f),r.length>1&&r[1].set(v);let h=r[0],y=r[1]??r[0];this.#d.process(h,y),(this.#f||this.#A)&&this.#p.process(h,y,0,ha),this.#F&&this.#g.process(h,y,this.#y),this.#S&&this.#v.process(h,y,this.#h),this.#_&&this.#m.process(h,y),this.#Z(),this.#I&&(this.#i.end(),this.#n[this.#T]=i,this.#T=(this.#T+1)%hw),this.#l.flush(),this.#s.tryWrite(),this.#V(),this.#U(),this.#w.drain(a,this.#t)}#V(){let e=this.#r,r=e.clip_changes_count();if(r===0)return;let n=e.input_reserve(r*20),i=e.clip_changes_take(n),a=new DataView(this.#t.buffer,n,i*20),o=[],s=[],c=[];for(let u=0;u<i;u++){let f=new Uint8Array(this.#t.buffer,n+u*20,16).slice(),v=a.getUint32(u*20+16,!0);v===0?o.push(f):v===1?s.push(f):c.push(f)}this.#a.notifyClipSequenceChanges({started:o,stopped:s,obsolete:c})}#U(){let e=this.#r,r=e.marker_changes_count();if(r===0)return;let n=e.input_reserve(r*24),i=e.marker_changes_take(n),a=new DataView(this.#t.buffer,n,i*24);for(let o=0;o<i;o++)if(a.getUint32(o*24+20,!0)===1){let c=new Uint8Array(this.#t.buffer,n+o*24,16).slice();this.#a.switchMarkerState([c,a.getUint32(o*24+16,!0)])}else this.#a.switchMarkerState(null)}#j(e){let r=this.#r.input_reserve(16);new Uint8Array(this.#t.buffer,r,16).set(e.uuid),Ro.isOn(e)?this.#r.note_signal_on(e.pitch,e.velocity):Ro.isOff(e)?this.#r.note_signal_off(e.pitch):Ro.isAudition(e)&&this.#r.note_signal_audition(e.pitch,e.duration,e.velocity)}#K(){this.#o.settings.playback.timestampEnabled&&this.#r.set_position(this.#B),this.#k=!0,this.#r.play()}#W(e){let r=this.#r.engine_state_ptr(),n=new DataView(this.#t.buffer,r,this.#r.engine_state_len()),i=this.#k||n.getUint8(16)===1,a=n.getUint8(17)===1||n.getUint8(18)===1;this.#k=!1,this.#r.pause(),a&&this.#r.set_position(this.#o.settings.playback.timestampEnabled?this.#B:0),(e||!i)&&(this.#r.stop(),this.#B=0,this.#d.clear())}#L(e){let r=new Uint8Array(e),n=this.#r.input_reserve(r.length);new Uint8Array(this.#t.buffer,n,r.length).set(r);let i=this.#r.apply_updates(r.length);if(i!==0){this.#a.error(new Error(`apply_updates rejected a transaction (code ${i})`));return}!this.#$&&this.#r.bind()===0&&(this.#$=!0),JI(this.#r,this.#t,this.#a,this.#P,sampleRate,a=>this.#R(a))}#Z(){let e=this.#t.buffer;e!==this.#N&&(this.#N=e,this.#E=-1);let r=this.#r.broadcast_generation();if(r===this.#E)return;this.#E=r,this.#c.forEach(i=>i.terminate()),this.#c.length=0;let n=this.#r.broadcast_count();for(let i=0;i<n;i++){let a=this.#r.input_reserve(48);if(this.#r.broadcast_entry(i,a)===0)continue;let o=new DataView(this.#t.buffer,a,48),s=new Uint8Array(this.#t.buffer,a,16).slice(),c=o.getUint32(16,!0),u=o.getUint32(20,!0),f=o.getUint32(24,!0),v=o.getUint32(28,!0),h=[];for(let _=0;_<v;_++)h.push(o.getUint16(32+_*2,!0));let y=Ce.compose(s,...h);if(c===0){let _=new Float32Array(this.#t.buffer,u,f);this.#c.push(this.#l.broadcastFloat(y,()=>_[0]))}else if(c===2){let _=new Int32Array(this.#t.buffer,u,f),$=new Int32Array(this.#t.buffer,u+4,f-1);this.#c.push(this.#l.broadcastIntegers(y,$,()=>{$[Math.min(_[0],$.length-1)]=0,_[0]=0}))}else if(c===3){let _=new Int32Array(this.#t.buffer,u,f);this.#c.push(this.#l.broadcastIntegers(y,_,()=>{}))}else{let _=new Float32Array(this.#t.buffer,u,f);this.#c.push(this.#l.broadcastFloats(y,_,$=>this.#r.broadcast_set_active(i,$?1:0)))}}}};registerProcessor(YI,jP);
116
+ `,"%p":q=>q.tm_hour>=0&&q.tm_hour<12?"AM":"PM","%S":q=>Ne(q.tm_sec,2),"%t":()=>" ","%u":q=>q.tm_wday||7,"%U":q=>{var ye=q.tm_yday+7-q.tm_wday;return Ne(Math.floor(ye/7),2)},"%V":q=>{var ye=Math.floor((q.tm_yday+7-(q.tm_wday+6)%7)/7);if((q.tm_wday+371-q.tm_yday-2)%7<=2&&ye++,ye){if(ye==53){var St=(q.tm_wday+371-q.tm_yday)%7;St!=4&&(St!=3||!Yh(q.tm_year))&&(ye=1)}}else{ye=52;var Fr=(q.tm_wday+7-q.tm_yday-1)%7;(Fr==4||Fr==5&&Yh(q.tm_year%400-1))&&ye++}return Ne(ye,2)},"%w":q=>q.tm_wday,"%W":q=>{var ye=q.tm_yday+7-(q.tm_wday+6)%7;return Ne(Math.floor(ye/7),2)},"%y":q=>(q.tm_year+1900).toString().substring(2),"%Y":q=>q.tm_year+1900,"%z":q=>{var ye=q.tm_gmtoff,Fr=ye>=0;return ye=Math.abs(ye)/60,ye=ye/60*100+ye%60,(Fr?"+":"-")+("0000"+ye).slice(-4)},"%Z":q=>q.tm_zone,"%%":()=>"%"};V=V.replace(/%%/g,"\0\0");for(var ae in Qi)V.includes(ae)&&(V=V.replace(new RegExp(ae,"g"),Qi[ae](C)));V=V.replace(/\0\0/g,"%");var ei=qh(V,!1);return ei.length>m?0:(tM(ei,d),ei.length-1)},jT=(d,m,g,w,P)=>UT(d,m,g,w),rM=d=>{var m=r["_"+d];return m},iM=(d,m,g)=>N0(d,Se,m,g),KT=d=>{var m=Hh(d)+1,g=k0(m);return iM(d,g,m),g},nM=(d,m,g,w,P)=>{var C={string:Ae=>{var Dt=0;return Ae!=null&&Ae!==0&&(Dt=KT(Ae)),Dt},array:Ae=>{var Dt=k0(Ae.length);return tM(Ae,Dt),Dt}};function V(Ae){return m==="string"?Jh(Ae):m==="boolean"?!!Ae:Ae}var W=rM(d),ae=[],De=0;if(w)for(var qe=0;qe<w.length;qe++){var at=C[g[qe]];at?(De===0&&(De=oM()),ae[qe]=at(w[qe])):ae[qe]=w[qe]}var Ne=W.apply(null,ae);function _e(Ae){return De!==0&&sM(De),V(Ae)}return Ne=_e(Ne),Ne},WT=(d,m,g,w)=>{var P=!g||g.every(V=>V==="number"||V==="boolean"),C=m!=="string";return C&&P&&!w?rM(d):function(){return nM(d,m,g,arguments,w)}},aM=function(d,m,g,w){d||(d=this),this.parent=d,this.mount=d.mount,this.mounted=null,this.id=x.nextInode++,this.name=m,this.mode=g,this.node_ops={},this.stream_ops={},this.rdev=w},Xh=365,Qh=146;Object.defineProperties(aM.prototype,{read:{get:function(){return(this.mode&Xh)===Xh},set:function(d){d?this.mode|=Xh:this.mode&=~Xh}},write:{get:function(){return(this.mode&Qh)===Qh},set:function(d){d?this.mode|=Qh:this.mode&=~Qh}},isFolder:{get:function(){return x.isDir(this.mode)}},isDevice:{get:function(){return x.isChrdev(this.mode)}}}),x.FSNode=aM,x.createPreloadedFile=MT,x.staticInit();var LT={a:mT,b:hT,k:gT,i:yT,e:$T,f:kT,g:BT,h:TT,j:RT,c:zT,d:jT},mt=dT(),ZT=()=>(ZT=mt.m)(),GT=r._nam_createInstance=()=>(GT=r._nam_createInstance=mt.n)(),HT=r._nam_destroyInstance=d=>(HT=r._nam_destroyInstance=mt.o)(d),qT=r._nam_getInstanceCount=()=>(qT=r._nam_getInstanceCount=mt.p)(),JT=r._nam_loadModel=(d,m)=>(JT=r._nam_loadModel=mt.q)(d,m),YT=r._nam_unloadModel=d=>(YT=r._nam_unloadModel=mt.r)(d),XT=r._nam_hasModel=d=>(XT=r._nam_hasModel=mt.s)(d),QT=r._nam_process=(d,m,g,w)=>(QT=r._nam_process=mt.t)(d,m,g,w),eD=r._nam_setSampleRate=d=>(eD=r._nam_setSampleRate=mt.u)(d),tD=r._nam_getSampleRate=()=>(tD=r._nam_getSampleRate=mt.v)(),rD=r._nam_setMaxBufferSize=d=>(rD=r._nam_setMaxBufferSize=mt.w)(d),iD=r._nam_getMaxBufferSize=()=>(iD=r._nam_getMaxBufferSize=mt.x)(),nD=r._nam_getModelLoudness=d=>(nD=r._nam_getModelLoudness=mt.y)(d),aD=r._nam_hasModelLoudness=d=>(aD=r._nam_hasModelLoudness=mt.z)(d),oD=r._nam_reset=d=>(oD=r._nam_reset=mt.A)(d),sD=r._free=d=>(sD=r._free=mt.B)(d),lD=r._malloc=d=>(lD=r._malloc=mt.C)(d),cD=()=>(cD=mt.__errno_location)(),oM=()=>(oM=mt.E)(),sM=d=>(sM=mt.F)(d),k0=d=>(k0=mt.G)(d),uD=d=>(uD=mt.__cxa_increment_exception_refcount)(d),lM=d=>(lM=mt.H)(d);r.ccall=nM,r.cwrap=WT,r.stringToUTF8=iM,r.lengthBytesUTF8=Hh;var eg;yp=function d(){eg||cM(),eg||(yp=d)};function cM(){if(Hs>0||(rT(),Hs>0))return;function d(){eg||(eg=!0,r.calledRun=!0,!me&&(iT(),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),nT()))}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 cM(),e.ready})})(),OP=Zz;var VP=class{constructor(e){this.uuid=e}instances=[-1,-1];json=null;loaded=!1;mono=!0},Gz=(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},w0=class{#e;#t;#r;#i=new Map;#n=new Map;#a=1;#o=null;#s=null;#u=!1;#l=!1;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n}async settle(){for(;this.#u;)await new Promise(e=>setTimeout(e,1))}imports(){return{host_nam_create:e=>this.#c(e),host_nam_load:(e,r,n)=>this.#d(e,r,n),host_nam_set_mono:(e,r)=>this.#p(e,r!==0),host_nam_process:(e,r,n,i,a,o,s)=>this.#f(e,r,n,i,a,o,s),host_nam_reset:e=>this.#v(e),host_nam_release:e=>this.#m(e)}}#c(e){let r=B.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 VP(r)),this.#n.set(r,i),i}#d(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)&&Gz(i.json,a)||(i.json=a,K(this.#s)?this.#h(i):this.#y())}#p(e,r){let n=this.#i.get(e);if(!K(n))return;n.mono=r;let i=this.#s;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)))}#f(e,r,n,i,a,o,s){let c=this.#i.get(e),u=this.#s;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}#v(e){let r=this.#i.get(e),n=this.#s;if(!(!K(r)||!K(n)))for(let i of r.instances)i>=0&&n.reset(i)}#m(e){let r=this.#i.get(e);if(!K(r))return;let n=this.#s;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.#u||this.#l||K(this.#s)||(this.#u=!0,this.#t().then(e=>OP({wasmBinary:e,locateFile:()=>""})).then(e=>{this.#o=e;let r=Lh.fromModule(e);r.setSampleRate(this.#r),this.#s=r,this.#u=!1;for(let n of this.#i.values())K(n.json)&&this.#h(n)}).catch(e=>{this.#u=!1,this.#l=!0,console.error("Failed to load NAM WASM:",e)}))}#h(e){let r=this.#s;!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.#s;if(K(r))for(let n of e.instances)n>=0&&r.unloadModel(n)}#g(e,r){let n=this.#o;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},Hz=1330857522,qz=32,WI=24,LI=40,ZI=8,Jz=({samples:t,presets:e})=>{let r=e.reduce((h,y)=>h+y.length,0),n=qz,i=n+t.length*WI,a=i+r*LI,o=a+e.length*ZI,s=t.reduce((h,y)=>h+y.pcm.length,0),c=new ArrayBuffer(o+s*4),u=new DataView(c);u.setUint32(0,Hz,!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((h,y)=>{let _=n+y*WI;u.setUint32(_,f,!0),u.setUint32(_+4,h.pcm.length,!0),u.setFloat32(_+8,h.sampleRate,!0),u.setUint32(_+12,h.loopStart,!0),u.setUint32(_+16,h.loopEnd,!0),new Float32Array(c,f,h.pcm.length).set(h.pcm),f+=h.pcm.length*4});let v=0;return e.forEach((h,y)=>{let _=a+y*ZI;u.setUint32(_,v,!0),u.setUint32(_+4,h.length,!0);for(let $ of h){let S=i+v*LI;u.setUint8(S,$.keyLo),u.setUint8(S+1,$.keyHi),u.setUint8(S+2,$.velLo),u.setUint8(S+3,$.velHi),u.setUint32(S+4,$.sampleIndex,!0),u.setUint32(S+8,$.rootKey,!0),u.setUint32(S+12,$.loopMode,!0),u.setFloat32(S+16,$.pan,!0),u.setFloat32(S+20,$.attack,!0),u.setFloat32(S+24,$.decay,!0),u.setFloat32(S+28,$.sustain,!0),u.setFloat32(S+32,$.release,!0),v++}}),c},_0=(t,e)=>t.generators[e]?.value,xp=(t,e,r)=>_0(e,r)??_0(t,r),UP=t=>t!==void 0?Math.pow(2,t/1200):.005,b0=(t,e)=>t.generators[e]?.range??{lo:0,hi:127},GI=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=b0(s,zn.KeyRange),u=b0(s,zn.VelRange);for(let f of s.instrument.zones){let v=b0(f,zn.KeyRange),h=b0(f,zn.VelRange),y=Math.max(c.lo,v.lo),_=Math.min(c.hi,v.hi),$=Math.max(u.lo,h.lo),S=Math.min(u.hi,h.hi);if(y>_||$>S)continue;let z=f.sample??t.samples[_0(f,zn.SampleId)??0];if(z===void 0)continue;let O=n(z),J=_0(f,zn.OverridingRootKey)??z.header.originalPitch??60,te=xp(s,f,zn.SampleModes)??0,me=xp(s,f,zn.SustainVolEnv);o.push({keyLo:y,keyHi:_,velLo:$,velHi:S,sampleIndex:O,rootKey:J,loopMode:te===1||te===3?1:0,pan:(xp(s,f,zn.Pan)??0)/1e3,attack:UP(xp(s,f,zn.AttackVolEnv)),decay:UP(xp(s,f,zn.DecayVolEnv)),sustain:1-(me??0)/1e3,release:UP(xp(s,f,zn.ReleaseVolEnv))})}}return o});return Jz({samples:e,presets:i})};var Yz=512,HI=(t,e,r)=>{let n=Lt(()=>DI(t,e));return n.status==="failure"||n.value.length===0?r:new Error(`wasm panic: ${n.value}`,{cause:r})},qI=(t,e,r,n)=>{let i=new WebAssembly.Table({initial:Yz,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 x0(e,o,r,(f,v)=>n.deviceMessage(f,v)),c=new w0(e,()=>n.fetchNamWasm(),r),u={...s.imports(),...c.imports()};return t.deviceModules.forEach((f,v)=>RI(o,e,i,f,t.deviceBoxTypes[v],r,u)),t.composites.forEach(f=>CI(o,e,f)),t.effectComposites.forEach(f=>zI(o,e,f)),o},JI=(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:h,sampleRate:y,frames:_}=f,$=v*Float32Array.BYTES_PER_ELEMENT,S=t.sample_allocate(c,h*$);if(S!==0){for(let z=0;z<h;z++)new Float32Array(e.buffer,S+z*$,v).set(_[z]);t.sample_set_ready(c,v,h,y)}},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(GI(f)),h=t.soundfont_allocate(c,v.byteLength);h!==0&&(new Uint8Array(e.buffer,h,v.byteLength).set(v),t.soundfont_set_ready(c))},f=>r.log(`soundfont load failed: ${f}`)))}};var YI="engine-wasm-processor",XI="engine-sync-bytes";var QI=()=>new WebAssembly.Memory({initial:256});var eT=512,jP=class extends AudioWorkletProcessor{#e=new Y;#t;#r;#i;#n=new Float32Array(hw);#a;#o;#s;#u;#l;#c=[];#d;#p;#f=new c0;#v=new u0(eT);#m=new d0(sampleRate);#y=new Float32Array(5);#h=new Float32Array(eT*2);#x=new Float32Array(5);#g=!1;#F=!1;#E=!1;#P=!1;#A=!1;#w=new m0;#_=new Set;#S=-1;#N=null;#M=[];#$=!1;#D=!0;#C=!1;#k=!1;#I=!1;#T=0;#B=0;constructor({processorOptions:e}){super();let{syncStreamBuffer:r,controlFlagsBuffer:n,hrClockBuffer:i,variant:a}=e,{engineModule:o,deviceModules:s,deviceBoxTypes:c,composites:u,effectComposites:f}=a;this.#t=QI();let v=bM.for(this.port);this.#a=va.sender(v.channel("engine-to-client"),S=>new class{log(z){S.dispatchAndForget(this.log,z)}error(z){S.dispatchAndForget(this.error,z)}deviceMessage(z,O){S.dispatchAndForget(this.deviceMessage,z,O)}fetchAudio(z){return S.dispatchAndReturn(this.fetchAudio,z)}fetchSoundfont(z){return S.dispatchAndReturn(this.fetchSoundfont,z)}fetchNamWasm(){return S.dispatchAndReturn(this.fetchNamWasm)}notifyClipSequenceChanges(z){S.dispatchAndForget(this.notifyClipSequenceChanges,z)}switchMarkerState(z){S.dispatchAndForget(this.switchMarkerState,z)}ready(){S.dispatchAndForget(this.ready)}});let h=qI({engineModule:o,deviceModules:s,deviceBoxTypes:c,composites:u,effectComposites:f},this.#t,sampleRate,this.#a);this.#r=h,this.#u=new Int32Array(n),this.#i=new s0(i),this.#s=mg.writer(zN(),r,S=>{let z=h.engine_state_ptr(),O=new DataView(this.#t.buffer,z,h.engine_state_len());S.position=O.getFloat32(0),S.bpm=O.getFloat32(4),S.playbackTimestamp=this.#B,S.countInBeatsRemaining=O.getFloat32(12),S.isPlaying=O.getUint8(16)===1,S.isCountingIn=O.getUint8(17)===1,S.isRecording=O.getUint8(18)===1,this.#I&&(S.perfBuffer.set(this.#n),S.perfIndex=this.#T)}),this.#l=this.#e.own(Mg.create(v,"engine-live-data")),this.#d=this.#e.own(new l0(this.#l,Xa.PEAKS)),this.#p=new gg;let y=new Float32Array(this.#p.numBins()),_=new Float32Array(this.#p.numBins()),$=new Float32Array(3);this.#o=new Dp(v.channel("engine-preferences"),xI.parse({})),this.#e.ownAll(this.#l.broadcastFloats(Xa.SPECTRUM,y,S=>{this.#g=S,S&&(y.set(this.#p.bins()),this.#p.decay=!0)}),this.#l.broadcastFloats(Xa.WAVEFORM,_,S=>{this.#F=S,S&&_.set(this.#p.waveform())}),this.#l.broadcastFloats(Xa.STEREO,this.#y,S=>{this.#E=S}),this.#l.broadcastFloats(Xa.GONIO,this.#h,S=>{this.#P=S}),this.#l.broadcastFloats(Xa.LOUDNESS,this.#x,S=>{this.#A=S,S&&this.#m.fill(this.#x)}),this.#l.broadcastFloats(Xa.HEAP,$,S=>{S&&($[0]=h.heap_used(),$[1]=h.heap_claimed(),$[2]=this.#t.buffer.byteLength)}),this.#o.catchupAndSubscribe(S=>h.set_metronome_enabled(S?1:0),"metronome","enabled"),this.#o.catchupAndSubscribe(S=>h.set_metronome_gain(S),"metronome","gain"),this.#o.catchupAndSubscribe(S=>h.set_metronome_beat_sub_division(S),"metronome","beatSubDivision"),this.#o.catchupAndSubscribe(S=>h.set_metronome_monophonic(S?1:0),"metronome","monophonic"),this.#o.catchupAndSubscribe(S=>h.set_allow_takes(S?1:0),"recording","allowTakes"),this.#o.catchupAndSubscribe(S=>h.set_pause_on_loop_disabled(S?1:0),"playback","pauseOnLoopDisabled"),this.#o.catchupAndSubscribe(S=>h.set_truncate_notes_at_region_end(S?1:0),"playback","truncateNotesAtRegionEnd"),this.#o.catchupAndSubscribe(S=>this.#I=S,"debug","dspLoadMeasurement"),va.executor(v.channel(XI),{applyUpdates:S=>this.#b(()=>this.#L(S)),checksum:S=>this.#z(S)}),va.executor(v.channel("engine-commands"),{play:()=>this.#b(()=>this.#K()),stop:S=>this.#b(()=>this.#W(S)),setPosition:S=>this.#b(()=>{this.#B=S,h.set_position(S)}),prepareRecordingState:S=>this.#b(()=>{this.#k=!0,h.prepare_recording_state(S?1:0,this.#o.settings.recording.countInBars)}),stopRecording:()=>this.#b(()=>{this.#k=!1,h.stop_recording()}),queryLoadingComplete:()=>Promise.all(this.#_).then(()=>!0),panic:()=>{this.#C=!0},loadClickSound:(S,z)=>this.#b(()=>{let{frames:O,numberOfFrames:J,numberOfChannels:te,sampleRate:me}=z,he=Math.min(te,2),be=h.click_allocate(J,he);for(let ue=0;ue<he;ue++)new Float32Array(this.#t.buffer,be+ue*J*4,J).set(O[ue]);h.set_click_sound(S,J,he,me)}),setFrozenAudio:(S,z)=>this.#b(()=>{if(z===null){let Se=h.input_reserve(16);new Uint8Array(this.#t.buffer,Se,16).set(S),h.clear_frozen_audio();return}let{frames:O,numberOfFrames:J,numberOfChannels:te,sampleRate:me}=z,he=Math.min(te,2),be=h.frozen_allocate(J,he);if(be===0)return;for(let Se=0;Se<he;Se++)new Float32Array(this.#t.buffer,be+Se*J*4,J).set(O[Se]);let ue=h.input_reserve(16);new Uint8Array(this.#t.buffer,ue,16).set(S),h.set_frozen_audio(J,he,me)}),updateMonitoringMap:S=>this.#b(()=>{this.#M=S;let z=h.input_reserve(S.length*24),O=new DataView(this.#t.buffer,z,S.length*24);S.forEach(({uuid:J,channels:te},me)=>{new Uint8Array(this.#t.buffer,z+me*24,16).set(J),O.setInt32(me*24+16,te[0],!0),O.setInt32(me*24+20,te.length>1?te[1]:-1,!0)}),h.set_monitoring_map(S.length)}),noteSignal:S=>this.#b(()=>this.#j(S)),ignoreNoteRegion:S=>this.#b(()=>{let z=h.input_reserve(16);new Uint8Array(this.#t.buffer,z,16).set(S),h.ignore_note_region()}),scheduleClipPlay:S=>this.#b(()=>S.forEach(z=>{let O=h.input_reserve(16);new Uint8Array(this.#t.buffer,O,16).set(z),h.schedule_clip_play()})),scheduleClipStop:S=>this.#b(()=>S.forEach(z=>{let O=h.input_reserve(16);new Uint8Array(this.#t.buffer,O,16).set(z),h.schedule_clip_stop()})),setupMIDI:(S,z)=>this.#w.connect(S,z),terminate:()=>{this.#D=!1,this.#c.forEach(S=>S.terminate()),this.#c.length=0,this.#e.terminate()}})),this.#a.ready()}process(e,r){if(!this.#D)return!1;if(Atomics.load(this.#u,0)===1)return this.#s.tryWrite(),!0;let{status:n,error:i}=Lt(()=>this.#O(e,r));return n==="failure"?(this.#R(i),!1):!0}#R(e){console.debug(e),this.#D=!1,this.#a.error(HI(this.#r,this.#t,e)),this.#e.terminate()}#b(e){let{status:r,error:n}=Lt(e);r==="failure"&&this.#R(n)}#z(e){let r=this.#r.checksum_ptr(),n=new Int8Array(this.#t.buffer,r,32);if(e.length===n.length&&e.every((a,o)=>a===n[o]))return Promise.resolve();let i=new Error("box-graph checksum mismatch: the engine mirror diverged from the source graph");return this.#a.error(i),Promise.reject(i)}#O(e,[r,n]){if(this.#C)return j("Manual Panic");let i=this.#I?this.#i.start():0,a=this.#r,o=this.#M;if(o.length>0){let _=e[0]??[],$=a.monitor_input_ptr(),S=new Float32Array(this.#t.buffer,$,8*ha);S.fill(0);for(let{channels:z}of o)for(let O of z){let J=_[O];J!==void 0&&O<8&&S.set(J,O*ha)}}if(a.render(),o.length>0&&n!==void 0){let _=a.monitor_output_ptr(),$=new Float32Array(this.#t.buffer,_,8*ha);for(let{channels:S}of o)for(let z of S){let O=n[z];O!==void 0&&z<8&&O.set($.subarray(z*ha,(z+1)*ha))}}let s=r[0].length,c=this.#t.buffer,u=a.output_ptr(),f=new Float32Array(c,u,s),v=new Float32Array(c,u+s*Float32Array.BYTES_PER_ELEMENT,s);r[0].set(f),r.length>1&&r[1].set(v);let h=r[0],y=r[1]??r[0];this.#d.process(h,y),(this.#g||this.#F)&&this.#p.process(h,y,0,ha),this.#E&&this.#f.process(h,y,this.#y),this.#P&&this.#v.process(h,y,this.#h),this.#A&&this.#m.process(h,y),this.#Z(),this.#I&&(this.#i.end(),this.#n[this.#T]=i,this.#T=(this.#T+1)%hw),this.#l.flush(),this.#s.tryWrite(),this.#V(),this.#U(),this.#w.drain(a,this.#t)}#V(){let e=this.#r,r=e.clip_changes_count();if(r===0)return;let n=e.input_reserve(r*20),i=e.clip_changes_take(n),a=new DataView(this.#t.buffer,n,i*20),o=[],s=[],c=[];for(let u=0;u<i;u++){let f=new Uint8Array(this.#t.buffer,n+u*20,16).slice(),v=a.getUint32(u*20+16,!0);v===0?o.push(f):v===1?s.push(f):c.push(f)}this.#a.notifyClipSequenceChanges({started:o,stopped:s,obsolete:c})}#U(){let e=this.#r,r=e.marker_changes_count();if(r===0)return;let n=e.input_reserve(r*24),i=e.marker_changes_take(n),a=new DataView(this.#t.buffer,n,i*24);for(let o=0;o<i;o++)if(a.getUint32(o*24+20,!0)===1){let c=new Uint8Array(this.#t.buffer,n+o*24,16).slice();this.#a.switchMarkerState([c,a.getUint32(o*24+16,!0)])}else this.#a.switchMarkerState(null)}#j(e){let r=this.#r.input_reserve(16);new Uint8Array(this.#t.buffer,r,16).set(e.uuid),Ro.isOn(e)?this.#r.note_signal_on(e.pitch,e.velocity):Ro.isOff(e)?this.#r.note_signal_off(e.pitch):Ro.isAudition(e)&&this.#r.note_signal_audition(e.pitch,e.duration,e.velocity)}#K(){this.#o.settings.playback.timestampEnabled&&this.#r.set_position(this.#B),this.#k=!0,this.#r.play()}#W(e){let r=this.#r.engine_state_ptr(),n=new DataView(this.#t.buffer,r,this.#r.engine_state_len()),i=this.#k||n.getUint8(16)===1,a=n.getUint8(17)===1||n.getUint8(18)===1;this.#k=!1,this.#r.pause(),a&&this.#r.set_position(this.#o.settings.playback.timestampEnabled?this.#B:0),(e||!i)&&(this.#r.stop(),this.#B=0,this.#d.clear())}#L(e){let r=new Uint8Array(e),n=this.#r.input_reserve(r.length);new Uint8Array(this.#t.buffer,n,r.length).set(r);let i=this.#r.apply_updates(r.length);if(i!==0){this.#a.error(new Error(`apply_updates rejected a transaction (code ${i})`));return}!this.#$&&this.#r.bind()===0&&(this.#$=!0),JI(this.#r,this.#t,this.#a,this.#_,sampleRate,a=>this.#R(a))}#Z(){let e=this.#t.buffer;e!==this.#N&&(this.#N=e,this.#S=-1);let r=this.#r.broadcast_generation();if(r===this.#S)return;this.#S=r,this.#c.forEach(i=>i.terminate()),this.#c.length=0;let n=this.#r.broadcast_count();for(let i=0;i<n;i++){let a=this.#r.input_reserve(48);if(this.#r.broadcast_entry(i,a)===0)continue;let o=new DataView(this.#t.buffer,a,48),s=new Uint8Array(this.#t.buffer,a,16).slice(),c=o.getUint32(16,!0),u=o.getUint32(20,!0),f=o.getUint32(24,!0),v=o.getUint32(28,!0),h=[];for(let _=0;_<v;_++)h.push(o.getUint16(32+_*2,!0));let y=Ce.compose(s,...h);if(c===0){let _=new Float32Array(this.#t.buffer,u,f);this.#c.push(this.#l.broadcastFloat(y,()=>_[0]))}else if(c===2){let _=new Int32Array(this.#t.buffer,u,f),$=new Int32Array(this.#t.buffer,u+4,f-1);this.#c.push(this.#l.broadcastIntegers(y,$,()=>{$[Math.min(_[0],$.length-1)]=0,_[0]=0}))}else if(c===3){let _=new Int32Array(this.#t.buffer,u,f);this.#c.push(this.#l.broadcastIntegers(y,_,()=>{}))}else{let _=new Float32Array(this.#t.buffer,u,f);this.#c.push(this.#l.broadcastFloats(y,_,$=>this.#r.broadcast_set_active(i,$?1:0)))}}}};registerProcessor(YI,jP);
117
117
  /*! Bundled license information:
118
118
 
119
119
  @opendaw/nam-wasm/dist/index.js: