@opendaw/studio-core 0.0.62 → 0.0.65

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,28 +1,28 @@
1
- var sB=Object.defineProperty;var Pa=(r,e)=>{for(var t in e)sB(r,t,{get:e[t],enumerable:!0})};var Ks=class r{static DEFAULT_SIZE=512;static DECAY=.9;#e;#t;#r;#i;#n;#o;#a;#l;#s=0;decay=!1;constructor(e=r.DEFAULT_SIZE){this.#e=e<<1,this.#r=new Ih(this.#e),this.#i=new Float32Array(this.#e),this.#n=new Float32Array(this.#e),this.#o=_c.create(_c.Type.Blackman,this.#e),this.#t=e,this.#a=new Float32Array(e),this.#l=new Float32Array(e)}clear(){this.#a.fill(0),this.#i.fill(0),this.#l.fill(0),this.#s=0}numBins(){return this.#t}bins(){return this.#a}waveform(){return this.#l}process(e,t,i,n){for(let o=i;o<n;++o)this.#i[this.#s]=e[o]+t[o],++this.#s===this.#e&&this.#u()}#u(){for(let t=0;t<this.#t;++t)this.#l[t]=this.#i[t<<1];for(let t=0;t<this.#e;++t)this.#i[t]*=this.#o[t];this.#r.process(this.#i,this.#n);let e=1/this.#t;for(let t=0;t<this.#t;++t){let i=this.#i[t],n=this.#n[t],o=Math.sqrt(i*i+n*n)*e;this.#a[t]<o?this.#a[t]=o:this.decay&&(this.#a[t]*=r.DECAY)}this.#s=0,this.#n.fill(0),this.decay=!1}};var Pc=r=>r,Z=r=>r!=null,Rn=r=>r===null;var Ws=r=>r===void 0,Ea=r=>r!==void 0,sP=r=>r==null,yx=(r,e)=>r!=null?e(r):void 0,Y=(r,e="asDefined failed")=>r??F(Sa(e)),Me=(r,e)=>r instanceof e,Be=(r,e)=>r instanceof e?r:F(`${r} is not instance of ${e}`),xx=(r,e)=>{r instanceof e||F(`${r} is not instance of ${e}`)};var Sa=r=>r instanceof Function?r():r;var _=(r,...e)=>r?.apply(null,e),Ch=r=>Z(r)&&typeof r=="object";var Th=r=>{throw new Error(`Unhandled ${r}`)},F=r=>{throw typeof r=="string"?new Error(r):r},D=(r,e)=>r?void 0:F(Sa(e));var Ba=r=>new Proxy({},{get(){return F(r)}});var gx=class{value;status="success";constructor(e){this.value=e}error=Ba("Cannot access error when succeeded")},vx=class{error;status="failure";constructor(e){this.error=e}value=Ba("Cannot access value when failed")},On=r=>{try{return new gx(r())}catch(e){return new vx(e)}};var Hr=(r,e)=>Object.keys(e).length===0?F("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(n=>isNaN(Number(n))).map(n=>e[n]).includes(r)?r:F(`Invalid enum value: ${String(r)}`),ki=()=>{};var wx;(function(r){r[r.Ascending=1]="Ascending",r[r.Descending=-1]="Descending"})(wx||(wx={}));var O=class{static#e=Object.freeze(new Array(0));static empty=()=>this.#e;static clear=e=>{e.length=0};static replace=(e,t)=>{e.length=0,e.push(...t)};static consume=(e,t)=>{for(let i=0;i<e.length;)t(e[i])?e.splice(i,1):i++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,t)=>Y(e.at(0),t);static getLast=(e,t)=>Y(e.at(-1),t);static getPrev=(e,t)=>{let i=e.indexOf(t);return i===-1?F(`${t} not found in ${e}`):Y(e.at((i-1)%e.length),"Internal Error")};static getNext=(e,t)=>{let i=e.indexOf(t);return i===-1?F(`${t} not found in ${e}`):Y(e.at((i+1)%e.length),"Internal Error")};static removeLast=(e,t)=>Y(e.pop(),t);static create=(e,t)=>{let i=new Array(t);for(let n=0;n<t;n++)i[n]=e(n);return i};static equals=(e,t)=>{if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0};static satisfy=(e,t)=>{if(e.length<2)return!0;let i=e[0];for(let n=1;n<e.length;n++)if(!t(i,e[n]))return!1;return!0};static remove=(e,t)=>{let i=e.indexOf(t);if(i===-1)return F(`${t} not found in ${e}`);e.splice(i,1)};static removeIf=(e,t)=>{for(let i=e.length-1;i>=0;i--)t(e[i])&&e.splice(i,1)};static removeOpt=(e,t)=>{let i=e.indexOf(t);return i===-1?!1:(e.splice(i,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let t=0,i=new Set;for(let n of e)i.has(n)||(i.add(n),e[t++]=n);return e.length=t,e};static removeDuplicateKeys=(e,t)=>{let i=0,n=new Set;for(let o of e){let a=o[t];n.has(a)||(n.add(a),e[i++]=o)}return e.length=i,e};static subtract(e,t,i){return e.filter(n=>!t.some(o=>i(n,o)))}static intersect(e,t,i){return e.filter(n=>t.some(o=>i(n,o)))}static merge(e,t,i){return[...e.filter(n=>!t.some(o=>i(n,o))),...t]}static*iterate(e){for(let t=0;t<e.length;t++)yield e[t]}static*iterateReverse(e){for(let t=e.length-1;t>=0;t--)yield e[t]}static*iterateStateFull(e){let t=e.length-1;for(let i=0;i<=t;i++)yield{value:e[i],isFirst:i===0,isLast:i===t}}static*iterateAdjacent(e){if(!(e.length<=1))for(let t=1,i=e[0];t<e.length;t++){let n=e[t];yield[i,n],i=n}}static isSorted(e,t=wx.Ascending){if(e.length<2)return!0;let i=e[0];for(let n=1;n<e.length;n++){let o=e[n];if(Math.sign(i-o)===t)return!1;i=o}return!0}static toRecord(e,t){return e.reduce((i,n)=>(i[t(n)]=n,i),{})}static concatArrayBuffers(e,t){let i=new ArrayBuffer(e.byteLength+t.byteLength),n=new Uint8Array(i);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),i}};var g;(function(r){r.wrap=t=>Z(t)?new e(t):r.None,r.from=t=>r.wrap(t()),r.tryFrom=t=>{try{return r.wrap(t())}catch{return r.None}},r.execute=(t,...i)=>r.wrap(t?.apply(null,i)),r.async=t=>t.then(i=>r.wrap(i),()=>r.None);class e{#e;constructor(i){this.#e=Y(i)}unwrap(){return this.#e}unwrapOrElse(i){return this.#e}unwrapOrNull(){return this.#e}unwrapOrUndefined(){return this.#e}contains(i){return i===this.#e}match(i){return i.some(this.#e)}ifSome(i){return i(this.#e)}ifAbsent(i){}isEmpty(){return!1}nonEmpty(){return!0}map(i){return r.wrap(i(this.#e))}mapOr(i,n){return i(this.#e)}flatMap(i){return i(this.#e)}equals(i){return this.unwrapOrNull()===i.unwrapOrNull()}assert(i){return this}toString(){return`{Option.Some(${this.#e})}`}get[Symbol.toStringTag](){return this.toString()}}r.Some=e,r.None=new class{unwrap=t=>F(Z(t)?Sa(t):"unwrap failed");unwrapOrElse=t=>Sa(t);unwrapOrNull=()=>null;unwrapOrUndefined=()=>{};contains=t=>!1;match=t=>t.none();ifSome=t=>{};ifAbsent=t=>t(void 0);isEmpty=()=>!0;nonEmpty=()=>!1;map=t=>r.None;mapOr=(t,i)=>Sa(i);flatMap=t=>r.None;equals=t=>t.isEmpty();assert=t=>F(Sa(t)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(g||(g={}));var Mr;(function(r){r.async=e=>e.then(t=>r.ok(t),t=>r.err(t)),r.tryGet=e=>{try{return r.ok(e())}catch(t){return r.err(t)}},r.ok=e=>new class{value;constructor(t){this.value=t}asOption=()=>g.wrap(this.value);failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>this.value;map=t=>{try{return r.ok(t(this.value))}catch(i){return r.err(i)}};flatMap=t=>t(this.value);match=t=>t.ok(this.value);toVoid=()=>r.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>`{Success: ${this.value}`;get[Symbol.toStringTag](){return"Success"}}(e),r.Ok=new class{constructor(){}asOption=()=>g.None;failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>{};map=e=>r.ok(e());flatMap=e=>e();match=e=>e.ok();toVoid=()=>r.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>"{Success: Ok";get[Symbol.toStringTag](){return"Success"}},r.err=e=>new class{reason;constructor(t){this.reason=t}asOption=()=>g.None;failureReason=()=>this.reason;isFailure=()=>!0;isSuccess=()=>!1;result=()=>F(`'${this.reason}'`);map=()=>this;flatMap=()=>this;match=t=>t.err(this.reason);toVoid=()=>r.err(this.reason);failure=()=>this;toString=()=>`{Failure: ${this.reason}`;get[Symbol.toStringTag](){return"Failure"}}(e)})(Mr||(Mr={}));var He;(function(r){r.exact=(e,t,i)=>{let n=0,o=e.length-1;for(;n<=o;){let a=n+o>>>1,s=i(e[a],t);if(s===0)return a;s<0?n=a+1:o=a-1}return-1},r.exactMapped=(e,t,i,n)=>{let o=0,a=e.length-1;for(;o<=a;){let s=o+a>>>1,u=i(n(e[s]),t);if(u===0)return s;u<0?o=s+1:a=s-1}return-1},r.leftMost=(e,t,i)=>{let n=0,o=e.length;for(;n<o;){let a=n+o>>>1;i(e[a],t)<0?n=a+1:o=a}return n},r.rightMost=(e,t,i)=>{let n=0,o=e.length;for(;n<o;){let a=n+o>>>1;i(e[a],t)<=0?n=a+1:o=a}return o-1},r.stableInsert=(e,t,i)=>{let n=0,o=e.length;for(;n<o;){let a=n+o>>>1;i(e[a],t)<0?n=a+1:o=a}for(;n<e.length&&i(e[n],t)===0;)n++;return n},r.leftMostMapped=(e,t,i,n)=>{let o=0,a=e.length;for(;o<a;){let s=o+a>>>1;i(n(e[s]),t)<0?o=s+1:a=s}return o},r.rightMostMapped=(e,t,i,n)=>{let o=0,a=e.length;for(;o<a;){let s=o+a>>>1;i(n(e[s]),t)<=0?o=s+1:a=s}return a-1},r.rangeMapped=(e,t,i,n)=>[r.leftMostMapped(e,t,i,n),r.rightMostMapped(e,t,i,n)]})(He||(He={}));var nt=class{static every=(e,t)=>(e&t)===t;static some=(e,t)=>(e&t)>0;#e;#t;constructor(e=32){this.#e=e,this.#t=new Int32Array((e-1>>>5)+1)}getBit(e){let t=e>>>5,i=1<<e-(t<<5);return(this.#t[t]&i)!==0}setBit(e,t){let i=e>>>5,n=1<<e-(i<<5),o=this.#t[i],a=t?o|n:o&~n;return a===o?!1:(this.#t[i]=a,!0)}isEmpty(){return this.#t.every(e=>e===0)}nonEmpty(){return this.#t.some(e=>e>0)}set buffer(e){this.#t.set(new Int32Array(e))}get buffer(){return this.#t.buffer}replace(e){let t=new Int32Array(e),i=!1;for(let n=0;n<t.length;n++)this.#t[n]!==t[n]&&(this.#t[n]=t[n],i=!0);return i}toString(){let e="";for(let t of O.iterateReverse(this.#t))e+=t.toString(2).padStart(32,"0");return e.substring(e.length-this.#e)}clear(){this.#t.fill(0)}};var Rh=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 xt=class r{static parseCssRgbOrRgba(e){let t=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(Z(t)&&t.every(i=>!isNaN(i))){if(t.length===3)return[t[0]/255,t[1]/255,t[2]/255,1];if(t.length===4)return[t[0]/255,t[1]/255,t[2]/255,t[3]]}throw new Error(`${e} is not proper formatted. Example: 'rgb(255, 255, 255)' or 'rgba(255, 255, 255, 1)'`)}static hslToHex(e,t,i){let n=u=>(u+e/30)%12,o=t*Math.min(i,1-i),a=u=>i-o*Math.max(-1,Math.min(n(u)-3,Math.min(9-n(u),1))),s=u=>Math.round(u*255).toString(16).padStart(2,"0");return`#${s(a(0))}${s(a(8))}${s(a(4))}`}static hexToHsl(e){let t=e.startsWith("#")?e.slice(1):e,i=parseInt(t.slice(0,2),16)/255,n=parseInt(t.slice(2,4),16)/255,o=parseInt(t.slice(4,6),16)/255,a=Math.max(i,n,o),s=Math.min(i,n,o),u=(a+s)/2,c=0,p=0;if(a!==s){let d=a-s;switch(p=u>.5?d/(2-a-s):d/(a+s),a){case i:c=((n-o)/d+(n<o?6:0))*60;break;case n:c=((o-i)/d+2)*60;break;case o:c=((i-n)/d+4)*60;break}}return{h:c,s:p,l:u}}static hslStringToHex(e){let[t,i,n]=e.match(/\d+(\.\d+)?/g).map(Number);return r.hslToHex(t,i/100,n/100)}#e;#t;#r;#i;constructor(e,t,i,n=1){this.#e=e,this.#t=t,this.#r=i,this.#i=n}opacity(e){return new r(this.#e,this.#t,this.#r,e)}brightness(e){let t=Math.max(0,Math.min(100,this.#r+e));return new r(this.#e,this.#t,t,this.#i)}saturate(e){return new r(this.#e,this.#t*e,this.#r,this.#i)}fade(e){let t=this.#t*(1-Math.sqrt(e)),i=this.#r+(100-this.#r)*e**3;return new r(this.#e,t,i,this.#i)}toString(){return this.#i===1?`hsl(${this.#e}, ${this.#t}%, ${this.#r}%)`:`hsla(${this.#e}, ${this.#t}%, ${this.#r}%, ${this.#i})`}};var Ec=(r,e)=>r-e;var $i=Math.PI*2,fM=Math.PI/2,bx=Math.PI/4,mM=1/Math.sqrt(2),ce=(r,e,t)=>Math.max(e,Math.min(r,t)),Jr=r=>Math.max(0,Math.min(r,1)),lP=(r,e)=>e+(1-2*e)*Math.max(0,Math.min(r,1)),Vn=(r,e)=>Math.floor(r/e)*e;var Oh=(r,e,t)=>r+(e-r)*t,uP=(r,e,t)=>r*Math.pow(e/r,t);var Sc=(r,e)=>lB(r/e)*e,lB=r=>r-Math.floor(r),go=r=>Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));var Ax=(r,e)=>r*e/((2*e-1)*(r-1)+e);var Qr;(function(r){r.valueAt=({slope:n,steps:o,y0:a,y1:s},u)=>r.normalizedAt(u/o,n)*(s-a)+a,r.normalizedAt=(n,o)=>{if(o>.499999&&o<.500001)return n;{let a=ce(o,1e-15,.999999999999999);return a*a/(1-a*2)*(Math.pow((1-a)/a,2*n)-1)}},r.inverseAt=(n,o)=>{let a=ce(o,1e-15,.999999999999999);return Math.log(n*(1-2*a)/(a*a)+1)/(2*Math.log((1-a)/a))},r.coefficients=n=>{let o=r.valueAt(n,1),s=(r.valueAt(n,2)-o)/(o-n.y0),u=o-s*n.y0;return{m:s,q:u}};function*t(n,o,a,s){let{m:u,q:c}=r.coefficients({slope:n,steps:o,y0:a,y1:s});for(let p=0,d=a;p<o;p++)yield d=u*d+c}r.walk=t;function*i(n,o){let a=1/o,s=r.normalizedAt(a,n),c=(r.normalizedAt(2*a,n)-s)/s;for(let p=0,d=0;p<o;p++)yield d=c*d+s}r.walkNormalized=i,r.byHalf=(n,o,a,s)=>({slope:r.slopeByHalf(o,a,s),steps:n,y0:o,y1:s}),r.slopeByHalf=(n,o,a)=>Math.abs(a-n)<1e-6?.5:(o-n)/(a-n)})(Qr||(Qr={}));var tn=new DataView(new ArrayBuffer(8)),tr;(function(r){r.MIN_VALUE=-2147483648,r.MAX_VALUE=2147483647,r.toByte=e=>(tn.setInt8(0,e),tn.getInt8(0)),r.toShort=e=>(tn.setInt16(0,e),tn.getInt16(0)),r.toInt=e=>(tn.setInt32(0,e),tn.getInt32(0))})(tr||(tr={}));var zn;(function(r){let i=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),n=new Float32Array(i),o=new Int32Array(i);r.floatToIntBits=a=>{let s=r.floatToRawIntBits(a);return(s&2139095040)===2139095040&&(s&8388607)!==0?2143289344:s},r.intBitsToFloat=a=>(o[0]=a,n[0]),r.floatToRawIntBits=a=>(n[0]=a,o[0]),r.toFloat32=a=>(tn.setFloat32(0,a),tn.getFloat32(0))})(zn||(zn={}));var cP;(function(r){r.floatToIntBits=e=>{let t=zn.floatToIntBits(e),i=t>>>16&32768,n=(t&2147483647)+4096;return n>=1199570944?(t&2147483647)>=1199570944?n<2139095040?i|31744:i|31744|(t&8388607)>>>13:i|31743:n>=947912704?i|n-939524096>>>13:n<855638016?i:(n=(t&2147483647)>>>23,i|(t&8388607|8388608)+(8388608>>>n-102)>>>126-n)},r.intBitsToFloat=e=>{let t=e&1023,i=e&31744;if(i===31744)i=261120;else if(i!==0){if(i+=114688,t===0&&i>115712)return zn.intBitsToFloat((e&32768)<<16|i<<13|1023)}else if(t!==0){i=115712;do t<<=1,i-=1024;while((t&1024)===0);t&=1023}return zn.intBitsToFloat((e&32768)<<16|(i|t)<<13)}})(cP||(cP={}));var Vh;(function(r){let e=9218868437227405312n,t=4503599627370495n,i=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),n=new Float64Array(i),o=new BigInt64Array(i);r.float64ToLongBits=a=>{let s=r.float64ToRawLongBits(a);return(s&e)===e&&(s&t)!==0n?0x7ff8000000000000n:s},r.longBitsToFloat64=a=>(o[0]=a,n[0]),r.float64ToRawLongBits=a=>(n[0]=a,o[0]),r.clamp=a=>(tn.setFloat64(0,a),tn.getFloat64(0))})(Vh||(Vh={}));var Je=class{static*empty(){}static one(e){return[e]}static count(e){let t=0;for(let i of e)t++;return t}static some(e,t){for(let i of e)if(t(i))return!0;return!1}static every(e,t){for(let i of e)if(!t(i))return!1;return!0}static reduce(e,t,i){let n=i,o=0;for(let a of e)n=t(n,a,o++);return n}static includes(e,t){for(let i of e)if(i===t)return!0;return!1}static forEach(e,t){for(let i of e)t(i)}static*map(e,t){let i=0;for(let n of e)yield t(n,i++)}static*take(e,t){let i=0;for(let n of e){if(i++>=t)return;yield n}}static filter(e,t){let i=[];for(let n of e)t(n)&&i.push(n);return i}static filterMap(e,t){let i=[];for(let n of e){let o=t(n);Z(o)&&i.push(o)}return i}static reverse(e){let t=[];for(let i of e)t.push(i);return t.reverse()}static*pairWise(e){let t=e[Symbol.iterator](),{done:i,value:n}=t.next(),o=n;if(i!==!0)for(;;){let{done:a,value:s}=t.next();if(a===!0){yield[o,null];return}yield[o,s],o=s}}};var Bt=class r{static create(e=1024){return this.use(new ArrayBuffer(e))}static use(e,t=0){return new r(new DataView(e,t))}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?F(`position(${e}) cannot be negative.`):e>this.#e.byteLength?F(`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 t=0;t<e.length;++t)this.#e.setInt8(this.#t++,e[t])}writeString(e){let t=e.length;this.#r(Int32Array.BYTES_PER_ELEMENT+t*Int16Array.BYTES_PER_ELEMENT),this.writeInt(t);for(let i=0;i<t;i++)this.writeShort(e.charCodeAt(i))}toArrayBuffer(){return this.#e.buffer.slice(0,this.#t)}#r(e){let t=this.#e.byteLength;if(this.#t+e>t){let i=this.#e;this.#e=new DataView(new ArrayBuffer(go(t+e)));for(let n=0;n<this.#t;n++)this.#e.setInt8(n,i.getInt8(n))}}},Zs=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}},zh=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((t,i)=>e.#e[i]===t)}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(t=>this.writeByte(t))}writeFloat(e){this.writeInt(zn.floatToIntBits(e))}writeDouble(e){this.writeLong(Vh.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 t=0;t<e.length;t++)this.writeShort(e.charCodeAt(t))}toHexString(){return Array.from(Je.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},ot=class{littleEndian=!1;#e;#t=0;constructor(e,t=0){this.#e=new DataView(e,t)}get position(){return this.#t}set position(e){e<0?F(`position(${e}) cannot be negative.`):e>this.#e.byteLength?F(`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 t=0;t<e.length;t++)e[t]=this.readByte()}readString(){let e=this.readInt(),t="";for(let i=0;i<e;i++)t+=String.fromCharCode(this.readShort());return t}available(e){return this.#t+e<=this.#e.byteLength}remaining(){return this.#e.byteLength-this.#t}skip(e){this.position+=e}};var uB=r=>Z(r)?r.value!==void 0?"value":r.get!==void 0?"get":F(`Cannot resolve method key of ${r}`):F("Cannot resolve method key of undefined descriptor"),Gs=(r,e,t)=>{if(!Z(t))return function(o,a){if(a&&a.kind==="getter")return function(){let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!Z(s?.get))return F(`Cannot find getter for property '${e}'`);let u=s.get.apply(this);return Object.defineProperty(this,e,{value:u,configurable:!1,writable:!1,enumerable:!1}),u}};let i=uB(t),n=Y(t[i]);return{[i]:function(...o){if(o.length>0)return F("lazy accessory must not have any construction parameters");let a=n.apply(this);return Object.defineProperty(this,e,{value:i==="get"?a:()=>a,configurable:!1,writable:!1,enumerable:!1}),a}}};var Un;(function(r){function*e(){}r.empty=e,r.next=i=>{let{value:n,done:o}=i.next();return o?null:n};function*t(...i){for(let n of i)for(let o of n)yield o}r.flatten=t})(Un||(Un={}));var Bc;(function(r){r.intersect1D=(e,t,i,n)=>Math.max(e,i)<=Math.min(t,n)})(Bc||(Bc={}));var Ft=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,t)=>(...i)=>this.#e.forEach(n=>Object.getPrototypeOf(n)===Object.getPrototypeOf({})?_(n[t],...i):n[t]?.apply(n,i))})}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 dP=(r,...e)=>new Proxy([],{get(t,i){if(typeof i=="string"){let n=Number(i);if(!isNaN(n)&&n>=0&&Number.isInteger(n))return new r(...e)}return i===Symbol.iterator?function*(){for(;;)yield new r(...e)}:t[i]},has(t,i){if(typeof i=="string"){let n=Number(i);if(!isNaN(n)&&n>=0)return!0}return i in t}});var Fa=class{static createIfAbsent(e,t,i){let n=e.get(t);return n===void 0&&(n=i(t),e.set(t,n)),n}};var Fc=class r{static#e=Object.freeze(new Set);static empty=()=>r.#e};var Uh=class r{#e;#t;constructor(e,t){this.#e=new Map(e),this.#t=g.wrap(t),this.#t.ifSome(i=>Array.from(this.#e.values()).forEach(n=>n.sort(i)))}[Symbol.iterator](){return this.#e.entries()}clear(){this.#e.clear()}containsEntry(e,t){return Je.some(this.#e.entries(),i=>e===i[0]&&i[1].includes(t))}containsKey(e){return Je.includes(this.#e.keys(),e)}containsValue(e){return Je.some(this.#e.values(),t=>t.includes(e))}get(e){return this.#e.get(e)??O.empty()}isEmpty(){return this.keyCount()===0}add(e,t){let i=Fa.createIfAbsent(this.#e,e,()=>[]);if(this.#t.isEmpty())i.push(t);else{let n=He.stableInsert(i,t,this.#t.unwrap());i.splice(n,0,t)}}addAll(e,t){let i=Fa.createIfAbsent(this.#e,e,()=>[]);i.push(...t),this.#t.nonEmpty()&&i.sort(this.#t.unwrap())}remove(e,t){let i=this.#e.get(e);if(i===void 0)return!1;{let n=i.indexOf(t);return n===-1?!1:(i.splice(n,1),i.length===0&&this.#e.delete(e),!0)}}removeFromKeyIf(e,t){let i=this.#e.get(e);if(i===void 0)return null;{let n=i.findIndex(t);if(n===-1)return null;{let o=i.splice(n,1)[0];return i.length===0&&this.#e.delete(e),o}}}removeValueIf(e){let t=[];for(let[i,n]of this.#e.entries())for(let o of n.filter(a=>e(a)))t.push([i,o]);for(let[i,n]of t)this.remove(i,n);return new Set(t.map(([,i])=>i))}removeKey(e){let t=this.#e.get(e);return this.#e.delete(e),t??O.empty()}forEach(e){Je.forEach(this.#e.entries(),t=>e(t[0],t[1]))}keyCount(){return this.#e.size}keys(){return this.#e.keys()}sortKeys(e){let t=this.clone(),i=Array.from(this.keys()).sort(e);this.#e.clear();for(let n of i)this.addAll(n,t.get(n));return this}clone(){let e=new r;return this.#e.forEach((t,i)=>{e.#e.set(i,t.map(n=>n))}),e}},qs=class r{map;constructor(e){this.map=new Map(e?.map(t=>{let i=t[0],n=t[1];return[i,new Set(n)]}))}clear(){this.map.clear()}containsEntry(e,t){return Je.some(this.map.entries(),i=>e===i[0]&&i[1].has(t))}containsKey(e){return Je.includes(this.map.keys(),e)}containsValue(e){return Je.some(this.map.values(),t=>t.has(e))}get(e){return this.map.get(e)??Fc.empty()}isEmpty(){return this.keyCount()===0}add(e,t){Fa.createIfAbsent(this.map,e,()=>new Set).add(t)}addAll(e,t){let i=Fa.createIfAbsent(this.map,e,()=>new Set);for(let n of t)i.add(n)}remove(e,t){let i=this.map.get(e);return i===void 0?!1:i.delete(t)?(i.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let t=new Set;for(let[i,n]of this.map.entries()){for(let o of n)e(o)&&(n.delete(o),t.add(o));n.size===0&&this.map.delete(i)}return t}removeFromKeyIf(e,t){let i=this.map.get(e);if(i===void 0)return null;for(let n of i)if(t(n))return i.delete(n),i.size===0&&this.map.delete(e),n;return null}removeKey(e){let t=this.map.get(e);return this.map.delete(e),t??Fc.empty()}forEach(e){Je.forEach(this.map.entries(),t=>e(t[0],t[1]))}keyCount(){return this.map.size}keys(){return this.map.keys()}sortKeys(e){let t=this.clone(),i=Array.from(this.keys()).sort(e);this.map.clear();for(let n of i)this.addAll(n,t.get(n));return this}clone(){let e=new r;return this.map.forEach((t,i)=>{e.map.set(i,new Set(Array.from(t)))}),e}};var K=Object.freeze({Empty:{terminate:ki},create:r=>({terminate:r}),many:(...r)=>({terminate:()=>{for(;r.length>0;)r.pop().terminate()}})}),z=class r{#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 t of e)this.#e.push(t)}spawn(){let e=new r;return e.own({terminate:()=>O.removeOpt(this.#e,e)}),this.own(e)}terminate(){for(;this.#e.length>0;)this.#e.pop().terminate()}};var ee=class{static subscribeMany(e,...t){return K.many(...t.map(i=>i.subscribe(()=>e(i))))}#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(t=>t(e))}observers(){return this.#e}terminate(){this.#e.clear()}};var Dr;(function(r){let e=Object.freeze({});r.empty=()=>e,r.mergeNoOverlap=(t,i)=>{let n=new Set(Object.keys(t));for(let o of Object.keys(i))if(n.has(o))return F(`'${o}' is an overlapping key`);return{...t,...i}},r.include=(t,...i)=>{let n={};for(let o of i)n[o]=t[o];return n},r.exclude=(t,...i)=>{let n=new Set(i);return Object.entries(t).reduce((o,[a,s])=>(n.has(a)||(o[a]=s),o),{})},r.overwrite=(t,i)=>Object.assign(t,i)})(Dr||(Dr={}));var pP;(function(r){r.seal=e=>new class{getValue(){return e}subscribe(t){return K.Empty}catchupAndSubscribe(t){return t(this),K.Empty}}})(pP||(pP={}));var hP;(function(r){r.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return K.Empty}catchupAndSubscribe(e){return e(this),K.Empty}},r.inverseBoolean=e=>new class{getValue(){return!e.getValue()}setValue(t){e.setValue(!t)}subscribe(t){return e.subscribe(t)}catchupAndSubscribe(t){return t(this),this.subscribe(t)}}})(hP||(hP={}));var Yr=class{#e;#t=g.None;constructor(e){this.#e=new ee,this.wrap(e)}wrap(e){this.wrapOption(g.wrap(e))}wrapOption(e){this.#t.equals(e)||(this.#t=e,this.#e.notify(this))}clear(e){this.#t.isEmpty()||(Z(e)&&e(this.#t.unwrap()),this.#t=g.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,t){return this.#t.mapOr(e,t)}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 Ir=class{#e;#t=g.None;#r;constructor(e,t){this.#e=new ee,this.#r=t?.guard(e)??e,this.#t=g.wrap(t)}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 _x=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=t-e}x(e){return(this.clamp(e)-this.#e)/this.#r}y(e){return this.#e+ce(e,0,1)*this.#r}clamp(e){return ce(e,this.#e,this.#t)}floating(){return!0}},Px=class{#e;#t;#r;constructor(e,t){this.#e=ce(Math.round(e),tr.MIN_VALUE,tr.MAX_VALUE),this.#t=ce(Math.round(t),tr.MIN_VALUE,tr.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(ce(e,0,1)*this.#r)}clamp(e){return ce(Math.round(e),this.#e,this.#t)}floating(){return!1}},Ex=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=Math.log(t/e)}x(e){return Math.log(ce(e,this.#e,this.#t)/this.#e)/this.#r}y(e){return this.#e*Math.exp(ce(e,0,1)*this.#r)}clamp(e){return Math.min(this.#t,Math.max(this.#e,e))}floating(){return!0}},Sx=class{#e;constructor(e){this.#e=e}x(e){let t=this.#e.findIndex(i=>i===e);return t===-1?F(`Could not find index for ${e}`):t/(this.#e.length-1)}y(e){let t=Math.round(ce(e,0,1)*(this.#e.length-1));return t>-1?Y(this.#e.at(t),`Could not find value for ${e}`):F(`Index ${t} is out of box.`)}clamp(e){return e}floating(){return!1}},Bx=class{#e;#t;#r;#i;#n;constructor(e,t,i){this.#e=e,this.#t=i;let n=e*e,o=i*i,a=t*t,s=e+i-2*t,u=i-t;this.#r=((2*i-t)*e-t*i)/s,this.#i=(u*n+(a-o)*e+t*o-a*i)/(n+(2*i-4*t)*e+o-4*t*i+4*a),this.#n=-u/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}},E;(function(r){r.linear=(o,a)=>new _x(o,a),r.linearInteger=(o,a)=>new Px(o,a),r.exponential=(o,a)=>new Ex(o,a),r.values=o=>new Sx(o),r.decibel=(o,a,s)=>new Bx(o,a,s);let e=new class{x(o){return o?1:0}y(o){return o>=.5}clamp(o){return o}floating(){return!1}},t=r.linear(0,1),i=r.linear(-1,1);r.bool=e;let n=r.decibel(-72,-12,0);r.unipolar=()=>t,r.bipolar=()=>i,r.DefaultDecibel=n})(E||(E={}));var P;(function(r){r.percent=({bipolar:o,fractionDigits:a}={})=>new e("%",a,!1,o),r.numeric=({unit:o,fractionDigits:a,unitPrefix:s,bipolar:u}={})=>new e(o,a,s,u),r.indices=(o,a)=>new class{x(s){return{unit:o,value:a[s]}}y(s){let u=a.indexOf(s);return u===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:u}}},r.values=(o,a,s)=>new class{x(u){return{unit:o,value:s.at(a.indexOf(u))??"N/A"}}y(u){let c=s.indexOf(u);return c===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:a[c]}}},r.bool=new class{y(o){switch(o.trim()){case"on":case"yes":case"true":return{type:"explicit",value:!0};default:return{type:"explicit",value:!1}}}x(o){return{value:o?"On":"Off",unit:""}}},r.boolValues=(o,a)=>new class{y(s){switch(s.trim()){case a:case"on":case"yes":case"true":return{type:"explicit",value:!0};case o:default:return{type:"explicit",value:!1}}}x(s){return{value:s?"On":"Off",unit:""}}};class e{#e;#t;#r;#i;constructor(a,s,u,c){this.#e=a??"",this.#t=s??0,this.#r=u??!1,this.#i=c??!1}y(a){let s=a.trim(),u=parseFloat(s);if(isNaN(u))return{type:"unknown",value:s};if(this.#e==="%")return{type:"explicit",value:u/100};if(s.endsWith("%"))return{type:"unitValue",value:this.#i?ce(u/200+.5,0,1):ce(u/100,0,1)};{s.endsWith(this.#e)&&this.#e.length>0&&(s=s.slice(0,-this.#e.length));let d=/(\d+)(\D+)/.exec(s)?.at(2)?.at(0);if(Z(d)){let f=t.indexOf(d);if(f>-1)return{type:"explicit",value:u*Math.pow(10,(f-4)*3)}}return{type:"explicit",value:u}}}x(a){if(Number.isNaN(a))return{value:"\u{1F4A3}",unit:this.#e};if(Number.isFinite(a)){if(this.#e==="%")return this.#i?{value:(a*200-100).toFixed(this.#t),unit:this.#e}:{value:(a*100).toFixed(this.#t),unit:this.#e};if(this.#r){let{value:s,prefix:u}=n(a);return{value:s.toFixed(this.#t),unit:`${u}${this.#e}`}}else return{value:a.toFixed(this.#t),unit:this.#e}}else return{value:a===Number.POSITIVE_INFINITY?"\u221E":"-\u221E",unit:this.#e}}}let t=Object.freeze(["p","n","\u03BC","m","","k","M","G","T"]),i=o=>Math.log(o)/Math.log(9.999999999999998),n=o=>{let a=Math.floor(i(o)/3),s=t[a+4];return Z(s)?{value:o*Math.pow(10,a*-3),prefix:s}:{value:o,prefix:""}};r.decible=r.numeric({unit:"db",fractionDigits:1}),r.panning=r.percent({unit:"%",fractionDigits:0})})(P||(P={}));var vo;(function(r){r.alwaysTrue=()=>!0,r.alwaysFalse=()=>!1,r.definedPredicate=e=>e!=null})(vo||(vo={}));var Hs;(function(r){r.create=(e=252854082)=>new Fx(e),r.monotoneAscending=(e,t=128,i=r.create())=>{let n=e.length;if(n<2)return F("Array must have at least 2 elements");let o=0;for(let s=1;s<n;s++){let u=Math.floor(i.uniform()*(1+t))+1;e[s]=u,o+=u}let a=0;e[0]=0;for(let s=1;s<n;s++)a+=e[s],e[s]=a/o;return e}})(Hs||(Hs={}));var Fx=class{#e=0;constructor(e){this.setSeed(e)}setSeed(e){this.#e=e&4294967295}nextDouble(e,t){return e+this.uniform()*(t-e)}nextInt(e,t){return e+Math.floor(this.uniform()*(t-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 vr;(function(r){class e{}r.createBuilder=i=>{let n=o=>{let a=o instanceof Array?[]:{};return Object.entries(o).forEach(([s,u])=>{u instanceof e?a[s]=u.initialValue():typeof u=="object"&&(a[s]=n(u))}),a};return()=>new t(i,Object.seal(n(i)))},r.bool=new class extends e{read(i){return i.readByte()===1}write(i,n){i.writeByte(n?1:0)}initialValue(){return!1}},r.int8=new class extends e{read(i){return i.readByte()}write(i,n){i.writeByte(n)}initialValue(){return 0}},r.int16=new class extends e{read(i){return i.readShort()}write(i,n){i.writeShort(n)}initialValue(){return 0}},r.int32=new class extends e{read(i){return i.readInt()}write(i,n){i.writeInt(n)}initialValue(){return 0}},r.float=new class extends e{read(i){return i.readFloat()}write(i,n){i.writeFloat(n)}initialValue(){return 0}},r.double=new class extends e{read(i){return i.readDouble()}write(i,n){i.writeDouble(n)}initialValue(){return 0}},r.int64=new class extends e{read(i){return i.readLong()}write(i,n){i.writeLong(n)}initialValue(){return 0n}},r.floats=i=>new class extends e{read(n,o){for(let a=0;a<o.length;a++)o[a]=n.readFloat();return o}write(n,o){for(let a=0;a<o.length;a++)n.writeFloat(o[a])}initialValue(){return new Float32Array(i)}},r.doubles=i=>new class extends e{read(n,o){for(let a=0;a<o.length;a++)o[a]=n.readDouble();return o}write(n,o){for(let a=0;a<o.length;a++)n.writeDouble(o[a])}initialValue(){return new Float64Array(i)}};class t{#e;#t;#r;constructor(n,o){this.#e=n,this.#t=o,this.#r=this.#i()}get object(){return this.#t}get bytesTotal(){return this.#r}read(n){let o=(a,s)=>{Object.entries(a).forEach(([u,c])=>{let p=s;c instanceof e?p[u]=c.read(n,p[u]):typeof c=="object"&&o(c,p[u])})};o(this.#e,this.#t)}write(n){let o=(a,s)=>{Object.entries(a).forEach(([u,c])=>{let p=s;c instanceof e?c.write(n,p[u]):typeof c=="object"&&o(c,p[u])})};o(this.#e,this.#t)}#i(){let n=new Zs;return this.write(n),n.count}}})(vr||(vr={}));var Js=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=[]}add(e,t=!1){let i=this.#e(e),n=He.leftMostMapped(this.#r,i,this.#t,this.#e),o=this.#r[n];return Z(o)&&this.#t(this.#e(o),i)===0?t?(this.#r.splice(n,1,e),!0):!1:(this.#r.splice(n,0,e),!0)}getOrCreate(e,t){let i=He.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[i];if(Z(n)&&this.#t(this.#e(n),e)===0)return n;let o=t(e);return this.#r.splice(i,0,o),o}addMany(e){for(let t of e)this.#r.push(t);try{return this.#r.sort((t,i)=>{let n=this.#t(this.#e(t),this.#e(i));if(n===0)throw"cancel";return n}),!0}catch(t){if(t==="cancel"){let i=new Map(this.entries());return this.#r.splice(0,this.#r.length,...i.values()),this.#r.sort((n,o)=>this.#t(this.#e(n),this.#e(o))),!1}return F(t)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let t=He.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[t];return Z(i)&&this.#t(this.#e(i),e)===0?(this.#r.splice(t,1),i):F(`Could not remove ${e}`)}removeByKeyIfExist(e){let t=He.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[t];return Z(i)&&this.#t(this.#e(i),e)===0?(this.#r.splice(t,1),i):null}removeRange(e,t){this.#r.splice(e,(t??this.#r.length)-e)}removeByPredicate(e){let t=0,i=this.#r.length;for(;--i>=0;)e(this.#r[i])&&(this.#r.splice(i,1),t++);return t}get(e){return Y(this.#i(e),`Unknown key: ${e}`)}getOrThrow(e,t){let i=this.#i(e);if(Z(i))return i;throw t()}opt(e){return g.wrap(this.#i(e))}getOrNull(e){return this.#i(e)??null}getByIndex(e){return this.#r[e]}hasKey(e){return Z(this.#i(e))}hasValue(e){return Z(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(){O.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let t=He.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[t];return Z(i)&&this.#t(this.#e(i),e)===0?i:void 0}};var Qs=(()=>{let r=g.None;return{info:e=>r.match({none:()=>Promise.resolve(),some:t=>t.info(e)}),approve:e=>r.match({none:()=>Promise.resolve(!0),some:t=>t.approve(e)}),progress:e=>r.match({none:()=>({message:"",terminate:ki}),some:t=>t.progress(e)}),install:e=>{D(r.isEmpty(),"RuntimeNotification already installed"),r=g.wrap(e)}}})();var Nc=class r{static POSITIVE_INFINITY=new r(Number.POSITIVE_INFINITY);static millis=e=>new r(e);static seconds=e=>new r(e*r.#e);static minutes=e=>new r(e*r.#t);static hours=e=>new r(e*r.#r);static days=e=>new r(e*r.#i);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)/r.#e}absMinutes(){return Math.abs(this.#n)/r.#t}absHours(){return Math.abs(this.#n)/r.#r}absDays(){return Math.abs(this.#n)/r.#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,t,i=Math.floor(Math.abs(this.#n)/1e3),n=Math.floor(i/60),o=Math.floor(n/60),a=Math.floor(o/24);return i<60?(e=i,t="second"):n<60?(e=n,t="minute"):o<24?(e=o,t="hour"):(e=a,t="day"),new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"long"}).format(e*Math.sign(this.#n),t)}toString(){if(isNaN(this.#n))return"NaN";if(!isFinite(this.#n))return"\u221E";let{d:e,h:t,m:i,s:n}=this.split();return e>0?[r.#o("d",e),r.#o("h",t),r.#o("m",i),r.#o("s",n)].join(", "):t>0?[r.#o("h",t),r.#o("m",i),r.#o("s",n)].join(", "):i>0?[r.#o("m",i),r.#o("s",n)].join(", "):n>0?r.#o("s",n):"now"}static#o=(e,t)=>{switch(e){case"d":return`${t} ${t<2?"day":"days"}`;case"h":return`${t} ${t<2?"hour":"hours"}`;case"m":return`${t} ${t<2?"minute":"minutes"}`;case"s":return`${t} ${t<2?"second":"seconds"}`;default:return Th(e)}}};var Ys;(function(r){let e;(function(t){t[t.READING=0]="READING",t[t.READ=1]="READ",t[t.WRITING=2]="WRITING",t[t.WRITTEN=3]="WRITTEN"})(e||(e={})),r.writer=(t,i,n)=>{if(t.bytesTotal+1>i.byteLength)return F("Insufficient memory allocated.");let o=new Uint8Array(i),a=Bt.use(i,1);return Atomics.store(o,0,e.READ),{tryWrite:()=>Atomics.compareExchange(o,0,e.READ,e.WRITING)===e.WRITING?(n(t.object),a.position=0,t.write(a),Atomics.store(o,0,e.WRITTEN),!0):!1}},r.reader=(t,i)=>{let n=new SharedArrayBuffer(t.bytesTotal+1),o=new Uint8Array(n),a=new ot(n,1);return{buffer:n,tryRead:()=>Atomics.compareExchange(o,0,e.WRITTEN,e.READING)===e.READING?(a.position=0,t.read(a),i(t.object),Atomics.store(o,0,e.READ),!0):!1}}})(Ys||(Ys={}));var A;(function(r){r.length=16,r.generate=()=>e(crypto.getRandomValues(new Uint8Array(r.length))),r.sha256=async t=>{let i=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",i?new Uint8Array(t.slice(0)):t).then(n=>e(new Uint8Array(n.slice(0,r.length))))},r.validateBytes=t=>r.parse(r.toString(t)),r.validateString=t=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t),r.asString=t=>r.validateString(t)?t:F(`Invalid UUID format: ${t}`),r.fromDataInput=t=>{let i=new Uint8Array(r.length);return t.readBytes(new Int8Array(i.buffer)),i},r.toDataOutput=(t,i)=>t.writeBytes(new Int8Array(i.buffer)),r.toString=t=>{let i=O.create(n=>(n+256).toString(16).substring(1),256);return i[t[0]]+i[t[1]]+i[t[2]]+i[t[3]]+"-"+i[t[4]]+i[t[5]]+"-"+i[t[6]]+i[t[7]]+"-"+i[t[8]]+i[t[9]]+"-"+i[t[10]]+i[t[11]]+i[t[12]]+i[t[13]]+i[t[14]]+i[t[15]]},r.parse=t=>{let i=t.replace(/-/g,"").toLowerCase();if(i.length!==32)return F("Invalid UUID format");let n=new Uint8Array(r.length);for(let o=0,a=0;o<32;o+=2,a++)n[a]=parseInt(i.slice(o,o+2),16);return n},r.Comparator=(t,i)=>{if(t.length!==r.length||i.length!==r.length)return F("Unexpected array length for uuid(v4)");for(let n=0;n<r.length;n++){let o=t[n]-i[n];if(o!==0)return o}return 0},r.equals=(t,i)=>r.Comparator(t,i)===0,r.newSet=t=>new Js(t,r.Comparator),r.Lowest=r.parse("00000000-0000-4000-8000-000000000000"),r.Highest=r.parse("FFFFFFFF-FFFF-4FFF-BFFF-FFFFFFFFFFFF"),r.fromInt=t=>{let i=new Uint8Array(r.Lowest),n=new Uint8Array(new Uint32Array([t]).buffer);for(let o=0;o<4;o++)i[o]=n[o];return i},r.zType=t=>t.string().refine(i=>r.validateString(i),{message:"Invalid UUID format"}).transform(i=>i);let e=t=>(D(t.length===r.length,"UUID must be 16 bytes long"),t[6]=t[6]&15|64,t[8]=t[8]&63|128,t)})(A||(A={}));var ge=class r{static Empty=new r(2);#e;constructor(e=2){this.#e=O.create(()=>new Float32Array(128),e)}clear(e,t){this.#e.forEach(i=>i.fill(0,e,t))}numChannels(){return this.#e.length}getChannel(e){return e<this.numChannels()?this.#e[e]:this.#e[this.numChannels()-1]}assertSanity(){D(!this.#e.some(e=>e.some(t=>isNaN(t))),"AudioBuffer is invalid (NaN)")}channels(){return this.#e}replace(e){this.replaceInto(e.#e)}replaceInto(e){D(e.length===2,"mixLayout: target.length must be 2"),D(this.#e.length===1||this.#e.length===2,"mixLayout: target.length must be 1 or 2"),this.#e.length===1?(e[0].set(this.#e[0]),e[1].set(this.#e[0])):(e[0].set(this.#e[0]),e[1].set(this.#e[1]))}mixInto(e){D(e.length===2,"mixLayout: target.length must be 2"),D(this.#e.length===1||this.#e.length===2,"mixLayout: target.length must be 1 or 2");let[t,i]=e;if(this.#e.length===1){let[n]=this.#e;for(let o=0;o<128;o++)t[o]+=n[o],i[o]+=n[o]}else{let[n,o]=this.#e;for(let a=0;a<128;a++)t[a]+=n[a],i[a]+=o[a]}}};var st;(function(r){r[r.Idle=0]="Idle",r[r.Attack=1]="Attack",r[r.Decay=2]="Decay",r[r.Sustain=3]="Sustain",r[r.Release=4]="Release"})(st||(st={}));var Xs=class{#e;#t=st.Idle;#r=0;#i=0;#n=0;#o=0;#a=0;#l=0;#s=0;#u=0;#c=0;constructor(e){this.#e=1/e}get gate(){return this.#t!==st.Idle&&this.#t!==st.Release}get complete(){return this.#t===st.Idle}get value(){return this.#r}get phase(){return this.#i}set(e,t,i,n){this.#n=e,this.#o=t,this.#a=i,this.#l=n,this.#d()}#d(){switch(this.#t){case st.Attack:{let e=1-this.#r;this.#s=e*this.#e/Math.max(this.#n,1e-6);break}case st.Decay:{let e=this.#r-this.#a;this.#u=e*this.#e/Math.max(this.#o,1e-6);break}case st.Release:{let e=this.#r;this.#c=e*this.#e/Math.max(this.#l,1e-6);break}case st.Sustain:case st.Idle:{this.#s=this.#e/Math.max(this.#n,1e-6),this.#u=(1-this.#a)*this.#e/Math.max(this.#o,1e-6),this.#c=this.#a*this.#e/Math.max(this.#l,1e-6);break}}}gateOn(){this.#t=st.Attack}gateOff(){this.#t!==st.Idle&&(this.#t=st.Release,this.#d())}forceStop(){this.#t=st.Idle,this.#r=0}process(e,t,i){for(let n=t;n<i;)switch(this.#t){case st.Attack:for(;n<i;){if(this.#r+=this.#s,this.#r>=1){this.#r=1,this.#i=1,e[n++]=this.#r,this.#t=st.Decay,this.#d();break}e[n++]=this.#i=this.#r}break;case st.Decay:for(;n<i;){if(this.#r-=this.#u,this.#r<=this.#a){this.#r=this.#a,this.#i=2,e[n++]=this.#r,this.#t=st.Sustain,this.#d();break}this.#i=1+(1-this.#r)/(1-this.#a),e[n++]=this.#r}break;case st.Sustain:e.fill(this.#a,n,i);return;case st.Release:for(;n<i;){if(this.#r-=this.#c,this.#r<=0){this.#r=0,this.#i=0,e[n++]=this.#r,this.#t=st.Idle,this.#d();break}this.#i=3+(1-this.#r/this.#a),e[n++]=this.#r}break;case st.Idle:e.fill(0,n,i);return}}};var rn=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,t=Math.SQRT1_2){if(e=ce(e,0,1),e>=.5)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let i=$i*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=(1-o)/2,s=a,u=2*a,c=a,p=1+n,d=-2*o,f=1-n;this.setNormalizedCoefficients(s,u,c,p,d,f)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}setHighpassParams(e,t=Math.SQRT1_2){if(e=ce(e,0,1),e===1)this.setNormalizedCoefficients(0,0,0,1,0,0);else if(e>0){let i=$i*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=(1+o)/2,s=a,u=-2*a,c=a,p=1+n,d=-2*o,f=1-n;this.setNormalizedCoefficients(s,u,c,p,d,f)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNormalizedCoefficients(e,t,i,n,o,a){let s=1/n;return this.b0=e*s,this.b1=t*s,this.b2=i*s,this.a1=o*s,this.a2=a*s,this}setLowShelfParams(e,t){e=ce(e,0,1);let i=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(i*i,0,0,1,0,0);else if(e>0){let n=$i*e,a=.5*Math.sin(n)*Math.sqrt((i+1/i)*(1/1-1)+2),s=Math.cos(n),u=2*Math.sqrt(i)*a,c=i+1,p=i-1,d=i*(c-p*s+u),f=2*i*(p-c*s),v=i*(c-p*s-u),m=c+p*s+u,y=-2*(p+c*s),x=c+p*s-u;this.setNormalizedCoefficients(d,f,v,m,y,x)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setHighShelfParams(e,t){e=ce(e,0,1);let i=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let n=$i*e,a=.5*Math.sin(n)*Math.sqrt((i+1/i)*(1/1-1)+2),s=Math.cos(n),u=2*Math.sqrt(i)*a,c=i+1,p=i-1,d=i*(c+p*s+u),f=-2*i*(p+c*s),v=i*(c+p*s-u),m=c-p*s+u,y=2*(p-c*s),x=c-p*s-u;this.setNormalizedCoefficients(d,f,v,m,y,x)}else this.setNormalizedCoefficients(i*i,0,0,1,0,0);return this}setPeakingParams(e,t,i){e=ce(e,0,1),t=Math.max(0,t);let n=Math.pow(10,i/40);if(e>0&&e<1)if(t>0){let o=$i*e,a=Math.sin(o)/(2*t),s=Math.cos(o),u=1+a*n,c=-2*s,p=1-a*n,d=1+a/n,f=-2*s,v=1-a/n;this.setNormalizedCoefficients(u,c,p,d,f,v)}else this.setNormalizedCoefficients(n*n,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setAllpassParams(e,t){if(e=ce(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let i=$i*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=1-n,s=-2*o,u=1+n,c=1+n,p=-2*o,d=1-n;this.setNormalizedCoefficients(a,s,u,c,p,d)}else this.setNormalizedCoefficients(-1,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNotchParams(e,t){if(e=ce(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let i=$i*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=1,s=-2*o,u=1,c=1+n,p=-2*o,d=1-n;this.setNormalizedCoefficients(a,s,u,c,p,d)}else this.setNormalizedCoefficients(0,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setBandpassParams(e,t){if(e=Math.max(0,e),t=Math.max(0,t),e>0&&e<1){let i=$i*e;if(t>0){let n=Math.sin(i)/(2*t),o=Math.cos(i),a=n,s=0,u=-n,c=1+n,p=-2*o,d=1-n;this.setNormalizedCoefficients(a,s,u,c,p,d)}else this.setNormalizedCoefficients(1,0,0,1,0,0)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}getFrequencyResponse(e,t,i){D(e.length===t.length&&e.length===i.length,"Array lengths do not match");let n=this.b0,o=this.b1,a=this.b2,s=this.a1,u=this.a2;for(let c=0;c<e.length;++c){let p=-Math.PI*2*e[c],d=Math.cos(p),f=Math.sin(p),v=n+((o+a*d)*d-a*f*f),m=(o+a*d)*f+a*f*d,y=1+((s+u*d)*d-u*f*f),x=(s+u*d)*f+u*f*d,$=y*y+x*x,I=(v*y+m*x)/$,T=(m*y-v*x)/$;t[c]=Math.sqrt(I*I+T*T),i[c]=Math.atan2(T,I)}}};var wt=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:t,b0:i,b1:n,b2:o},a,s,u,c){let p=this.#e,d=this.#t,f=this.#r,v=this.#i;for(let m=u;m<c;m++){let y=a[m],x=s[m]=i*y+n*p+o*d-e*f-t*v+1e-18-1e-18;d=p,p=y,v=f,f=x}this.#e=p,this.#t=d,this.#r=f,this.#i=v}processFrame({a1:e,a2:t,b0:i,b1:n,b2:o},a){let s=i*a+n*this.#e+o*this.#t-e*this.#r-t*this.#i+1e-18-1e-18;return this.#t=this.#e,this.#e=a,this.#i=this.#r,this.#r=s,s}},yo=class{#e;#t;constructor(e){this.#e=O.create(()=>new wt,e),this.#t=this.#e.length}get order(){return this.#t}set order(e){this.#t!==e&&(this.#t=e,this.reset())}reset(){this.#e.forEach(e=>e.reset())}process(e,t,i,n,o){for(let a=0;a<this.#t;a++)this.#e[a].process(e,t,i,n,o),t=i}processFrame(e,t){for(let i=0;i<this.#t;i++)t=this.#e[i].processFrame(e,t);return t}},kc=512,jh=class{#e;#t=new rn;#r;#i=-1;constructor(e,t,i){this.#r=new yo(4),this.#e=new Float32Array(kc+1);let n=Math.log(t/e),o=1/i;for(let a=0;a<=kc;a++)this.#e[a]=e*Math.exp(a/kc*n)*o}get order(){return this.#r.order}set order(e){this.#r.order=e}reset(){this.#r.reset()}process(e,t,i,n,o,a){let s=this.#e,u=this.#r,c=this.#t,p=n/u.order**1.25,d=o,f=this.#i;for(;d<a;){let v=Math.floor(Jr(i[d])*kc),m=d+1;for(;m<a&&Math.floor(Jr(i[m])*kc)===v;)++m;v!==f&&(f=v,c.setLowpassParams(s[v],p)),u.process(c,e,t,d,m),d=m}this.#i=f}};var fP=Math.log(10)/20,$c=(r=60,e=440)=>e*Math.pow(2,(r+3)/12-6);var Te=r=>Math.exp(r*fP),Nx=r=>Math.log(r)/fP,el=r=>Te(20*Math.log10(r));var cB=.02,mP=1e3,Lh=class{#e;#t;#r;#i;#n;#o;#a=NaN;#l=NaN;#s=0;#u=0;#c=0;#d=8;#p=0;#h=1;#f=!1;constructor(e){this.#e=e,this.#t=Math.ceil(e*cB)|0,this.#r=new rn,this.#r.setLowpassParams(.5),this.#i=[new wt,new wt],this.#n=[new Float32Array(128),new Float32Array(128)],this.#o=new Float32Array(2)}process(e,t,i,n){let[o,a]=e,[s,u]=t,[c,p]=this.#n;this.#i[0].process(this.#r,o,c,i,n),this.#i[1].process(this.#r,a,p,i,n);let d=Te(this.#p),f=Te(-this.#p/2),v=this.#e/this.#a,m=Math.pow(2,this.#d)-1,y=1/m;for(let x=i;x<n;x++)this.#u>0&&(this.#a+=this.#s,--this.#u===0&&(this.#s=0,this.#a=this.#l),this.#r.setLowpassParams(Math.max(this.#a,mP)/this.#e)),this.#c+=1,this.#c>=v&&(this.#c-=v,this.#o[0]=ce(Math.round(c[x]*d*m)*y,-1,1),this.#o[1]=ce(Math.round(p[x]*d*m)*y,-1,1)),s[x]=(o[x]*(1-this.#h)+this.#o[0]*this.#h)*f,u[x]=(a[x]*(1-this.#h)+this.#o[1]*this.#h)*f;this.#f=!0}setCrush(e){let t=uP(20,this.#e*.5,e);this.#f&&isFinite(this.#a)?(this.#l=t,this.#s=(t-this.#a)/this.#t,this.#u=this.#t):(this.#a=t,this.#r.setLowpassParams(Math.max(this.#a,mP)/this.#e))}setBitDepth(e){this.#d=ce(e,1,16)}setBoost(e){this.#p=e}setMix(e){this.#h=Jr(e)}reset(){this.#f=!1,this.#l=NaN,this.#s=0,this.#u=0,this.#c=0,this.#o.fill(0),this.#i[0].reset(),this.#i[1].reset()}};var Kh=class r{static#e=10;#t=1;#r=0;#i=0;#n=0;#o=0;#a=0;set(e,t,i){this.#t=e,this.#r=t*r.#e,this.#i=Oh(1e-5,1-1e-5,i),this.#n=2**Math.abs(this.#r),this.#o=1/this.#i,this.#a=1/(1-this.#i)}compute(e){let t=e-Math.floor(e),i,n,o,a;return this.#r<0?(i=1-t,n=1-this.#i,o=this.#a,a=this.#o):(i=t,n=this.#i,o=this.#o,a=this.#a),i<=n?1-(1-i*o)**this.#n*this.#t:((1-i)*a)**this.#n*this.#t-this.#t+1}};var Mc;(function(r){r.Comparator=(e,t)=>e.position-t.position,r.PositionExtractor=e=>e.position})(Mc||(Mc={}));var Na;(function(r){r.complete=e=>e.position+e.duration,r.DescendingComparator=(e,t)=>r.complete(t)-r.complete(e)})(Na||(Na={}));var Wt;(function(r){r.globalToLocal=(t,i)=>Sc(i-t.position+t.loopOffset,t.loopDuration),r.locateLoop=({position:t,complete:i,loopOffset:n,loopDuration:o},a,s)=>{let u=t-n,c=u+o;if(u>=s||c<=a)return g.None;let p=Math.max(u,a),d=Math.min(c,s);return g.wrap({index:0,rawStart:u,rawEnd:c,regionStart:Math.max(u,t),regionEnd:Math.min(c,i),resultStart:p,resultEnd:d,resultStartValue:u<p?(p-u)/o:0,resultEndValue:c>d?(d-u)/o:1})};function*e({position:t,complete:i,loopOffset:n,loopDuration:o},a,s){let u=t-n,c=Math.max(t,a),p=Math.min(i,s),d=Math.floor((c-u)/o),f=u+d*o;for(;f<p;){let v=f+o,m=Math.max(f,t),y=Math.min(v,i),x=Math.max(f,c),$=Math.min(v,p),I=f<x?(x-f)/o:0,T=v>$?($-f)/o:1;yield{index:d++,rawStart:f,rawEnd:v,regionStart:m,regionEnd:y,resultStart:x,resultEnd:$,resultStartValue:I,resultEndValue:T},f=v}}r.locateLoops=e})(Wt||(Wt={}));var yr=class r{static DefaultComparator=(e,t)=>e.position-t.position;static create(e){return new r(e??r.DefaultComparator)}#e;constructor(e){this.#e=new Wh(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,t){return this.#e.lowerEqual(e,t)}greaterEqual(e,t){return this.#e.greaterEqual(e,t)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,t){return this.#e.isEmpty()?Un.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t,i){return this.#e.isEmpty()?Un.empty():this.#e.iterate(this.#e.ceilFirstIndex(e),t,i)}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()}},xo=class r{static Comparator=(e,t)=>e.position-t.position;static create(e){return new r(e)}#e;constructor(e=r.Comparator){this.#e=new Wh(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,t){return this.#e.lowerEqual(e,t)}greaterEqual(e,t){return this.#e.greaterEqual(e,t)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,t){return this.#e.isEmpty()?Un.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t){if(this.#e.isEmpty())return Un.empty();let i=Math.max(0,this.#e.floorLastIndex(e)),n=this.#e.optAt(i);if(n===null)return Un.empty();for(;n.position+n.duration<=e;)if(n=this.#e.optAt(++i),n===null||n.position>=t)return Un.empty();return this.#e.iterate(i,t)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},tl=class{#e;constructor(){this.#e=[]}addAndRetain(e){if(this.#e.length===0)this.#e.push(e);else{let t=He.leftMost(this.#e,e,Na.DescendingComparator);this.#e.splice(t,0,e)}}*overlapping(e,t){let i=this.#e.filter(n=>n.position<=e&&e<n.position+n.duration);yield*Z(t)?i.sort(t):i}*releaseLinearCompleted(e){if(this.#e.length!==0)for(let t=this.#e.length-1;t>=0;t--){let i=this.#e[t];if(Na.complete(i)<e)this.#e.splice(t,1),yield i;else return}}*releaseAll(){if(this.#e.length!==0)for(let e=this.#e.length-1;e>=0;e--){let t=this.#e[e];Number.POSITIVE_INFINITY>t.duration&&(this.#e.splice(e,1),yield t)}}isEmpty(){return this.#e.length===0}nonEmpty(){return this.#e.length>0}clear(){O.clear(this.#e)}},Wh=class{comparator;#e=[];#t=!1;modCount=0;constructor(e){this.comparator=e}add(e){++this.modCount,this.#e.push(e),this.#e.length>1&&(this.#t=!0)}remove(e){++this.modCount;let t=this.#e.indexOf(e);return t===-1?!1:(this.#e.splice(t,1),!0)}contains(e){if(this.#e.length===0)return!1;this.#t&&this.#r();let i=e.position,n=He.leftMostMapped(this.#e,i,Ec,Mc.PositionExtractor);for(let o=n;o<this.#e.length;o++){let a=this.#e[o];if(a===e)return!0;if(a.position!==i)return!1}return!1}clear(){++this.modCount,O.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,t){if(t===void 0)return this.optAt(this.floorLastIndex(e));let i=this.floorLastIndex(e);for(;i>=0;){let n=this.#e[i--];if(t(n))return n}return null}greaterEqual(e,t){if(t===void 0)return this.optAt(this.ceilFirstIndex(e));let i=this.ceilFirstIndex(e);for(;i<this.#e.length;){let n=this.#e[i++];if(t(n))return n}return null}floorLastIndex(e){return this.#t&&this.#r(),He.rightMostMapped(this.#e,e,Ec,Mc.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),He.leftMostMapped(this.#e,e,Ec,Mc.PositionExtractor)}iterateFrom(e,t){let i=this.floorLastIndex(e),n=i;if(n<0)return this.iterate(0,tr.MAX_VALUE,t);for(;n>=0;){let o=this.optAt(n);if(o!==null&&t!==void 0&&t(o))return this.iterate(n,tr.MAX_VALUE,t);n--}return this.iterate(i,tr.MAX_VALUE,t)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,t,i=vo.alwaysTrue){for(this.#t&&this.#r();e<this.#e.length;){let n=this.#e[e++];if(n.position>=t)return;i(n)&&(yield n)}}#r(){this.#e.sort(this.comparator),this.#t=!1}};var Ih=class r{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 t=e/2;this.#t=32-Math.floor(Math.log2(e))|0,this.#r=new Float32Array(t),this.#i=new Float32Array(t);for(let i=0;i<t;i++){let n=2*Math.PI*i/e;this.#r[i]=Math.cos(n),this.#i[i]=Math.sin(n)}}process(e,t){let i,n,o,a;for(let c=0;c<this.#e;++c)n=r.reverse(c)>>>this.#t,n>c&&(a=e[c],e[c]=e[n],e[n]=a,a=t[c],t[c]=t[n],t[n]=a);let s=this.#r,u=this.#i;for(let c=2;c<=this.#e;c<<=1){let p=c>>1,d=this.#e/c;for(i=0;i<this.#e;i+=c){let f=i+p;for(n=i,o=0;n<f;n++,o=o+d|0){let v=n+p|0,m=s[o],y=u[o],x=e[v],$=t[v],I=x*m+$*y,T=$*m-x*y,R=e[n],L=t[n];e[v]=R-I,t[v]=L-T,e[n]=R+I,t[n]=L+T}}if(c===this.#e)break}}};var kx=r=>{let e=.25*r+.25;return 4*(Math.abs(e-Math.round(e))-.25)};var $x=(r,e)=>Math.floor(3840/e)*r,gP=(r,e=4,t=4)=>{let i=$x(1,t),n=Math.floor(r/i),o=Math.floor(n/e),s=(Math.floor(r)-$x(o*e,t))%i,u=Math.floor(s/240),c=s%240;return{bars:o,beats:n-o*e,semiquavers:u,ticks:c}},vP=(r,e)=>r*e/60*960,yP=(r,e)=>r*60/960/e,dB=(r,e)=>e*60/960/r,pB=(r,e,t)=>vP(r/t,e),hB=(r,e,t)=>yP(r,e)*t,Q={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:$x,toParts:gP,secondsToPulses:vP,pulsesToSeconds:yP,secondsToBpm:dB,samplesToPulses:pB,pulsesToSamples:hB,toString:(r,e=4,t=4)=>{let{bars:i,beats:n,semiquavers:o,ticks:a}=gP(r|0,e,t);return`${i+1}.${n+1}.${o+1}:${a}`}};var rr;(function(r){r.builder=()=>new e,r.toDouble=([t,i])=>t/i,r.toPPQN=([t,i])=>Q.fromSignature(t,i);class e{#e=[];add(i){return this.#e.push(i),this}asArray(){return this.#e}asAscendingArray(){return this.#e.toSorted((i,n)=>r.toDouble(i)-r.toDouble(n))}asDescendingArray(){return this.#e.toSorted((i,n)=>r.toDouble(n)-r.toDouble(i))}}})(rr||(rr={}));var nn=class{static*iterate(e,t,i){let n=Math.ceil(e/i),o=n*i;for(;o<t;)yield o,o=++n*i}static*iterateWithIndex(e,t,i){let n=Math.ceil(e/i),o=n*i;for(;o<t;)yield{position:o,index:n},o=++n*i}};var rl=class{#e=0;#t=NaN;#r=NaN;#i=0;#n=0;constructor(){}reset(){this.#e=0,this.#t=NaN,this.#r=NaN,this.#i=0,this.#n=0}init(e){this.#e=e,isNaN(this.#t)&&(this.#t=this.#e)}currentFrequency(){return this.#t}glideTo(e,t){if(t===0){this.#e=e;return}this.#e=this.#t,this.#r=e,this.#i=0,this.#n=t}process(e,t,i,n){if(isNaN(this.#r)){for(let o=i;o<n;o++)e[o]*=this.#e;this.#t=this.#e}else{let o=Q.samplesToPulses(1,t,sampleRate);for(let a=i;a<n;a++){if(this.#i+=o/this.#n,this.#i>=1){this.#i=1,this.#e=this.#r,this.#r=NaN;for(let s=a;s<n;s++)e[s]*=this.#e;break}e[a]*=this.#t=this.#e+(this.#r-this.#e)*this.#i}}}advance(e,t,i){if(isNaN(this.#r))this.#t=this.#e;else{let n=Q.samplesToPulses(i-t,e,sampleRate);this.#i+=n/this.#n,this.#i>=1?(this.#i=1,this.#e=this.#t=this.#r,this.#r=NaN):this.#t=this.#e+(this.#r-this.#e)*this.#i}}};var Zh=class{#e;#t;constructor(){this.#e=[],this.#t=new Map}addVertex(e){D(!this.#e.includes(e),"Vertex already exists"),this.#e.push(e),D(!this.#t.has(e),"Predecessor already exists"),this.#t.set(e,[])}removeVertex(e){O.remove(this.#e,e);let t=this.#t.delete(e);D(t,"Predecessor does not exists")}getPredecessors(e){return this.#t.get(e)??O.empty()}predecessors(){return this.#t}vertices(){return this.#e}addEdge([e,t]){let i=Y(this.#t.get(t),`[add] Edge has unannounced vertex. (${t})`);D(!i.includes(e),`${e} is already marked.`),i.push(e)}removeEdge([e,t]){let i=Y(this.#t.get(t),`[remove] Edge has unannounced vertex. (${t})`);D(i.includes(e),`${e} is not marked.`),O.remove(i,e)}isEmpty(){return this.#e.length===0}},Gh=class{#e;#t;#r;#i;#n;constructor(e){this.#e=e,this.#t=[],this.#r=new Set,this.#i=new Set,this.#n=new Map}update(){this.#o(),this.#e.vertices().forEach(e=>this.#a(e))}sorted(){return this.#t}hasLoops(){return this.#i.size!==0}#o(){this.#l();let e=new Map;for(let i of this.#e.vertices())this.#n.set(i,new Set),e.set(i,new Set);for(let i of this.#e.vertices())for(let n of this.#e.getPredecessors(i))Y(this.#n.get(n),`Could not find Successor for ${n}`).add(i);let t;do{t=!1;for(let i of this.#e.vertices()){Y(e.get(i)).clear();for(let n of Y(this.#n.get(i)))for(let o of Y(this.#n.get(n)))this.#n.get(i)?.has(o)||(t=!0,Y(e.get(i)).add(o))}for(let i of this.#e.vertices()){let n=Y(this.#n.get(i));Y(e.get(i)).forEach(o=>n.add(o))}}while(t)}#a(e){if(!this.#r.has(e)){this.#r.add(e);for(let t of this.#e.getPredecessors(e)){if(Y(this.#n.get(e)).has(t)){this.#i.add(e),this.#i.add(t);continue}this.#a(t)}this.#t.push(e)}}#l(){O.clear(this.#t),this.#r.clear(),this.#i.clear(),this.#n.clear()}};var Dc;(function(r){r.Identity={warp:e=>e,unwarp:e=>e}})(Dc||(Dc={}));var qh=class{#e;constructor(e){this.#e=e}warp(e){return this.#t(!0,e)}unwarp(e){return this.#t(!1,e)}#t(e,t){let i=this.#e.duration(),n=Vn(t,i),o=(t-n)/i,a=e?this.#e.fx(o):this.#e.fy(o);return n+a*i}};var Ue;(function(r){r[r.sine=0]="sine",r[r.triangle=1]="triangle",r[r.saw=2]="saw",r[r.square=3]="square"})(Ue||(Ue={}));var Hh=class{sampleRate;#e=0;constructor(e){this.sampleRate=e}fill(e,t,i,n,o){let a=i/this.sampleRate;switch(t){case Ue.sine:{for(let s=n;s<o;s++)e[s]=Math.sin(this.#e*Math.PI*2),this.#e+=a,this.#e>=1&&(this.#e-=1);break}case Ue.triangle:{for(let s=n;s<o;s++){let u=this.#e%1;e[s]=4*Math.abs(u-.5)-1,this.#e+=a,this.#e>=1&&(this.#e-=1)}break}case Ue.saw:{for(let s=n;s<o;s++){let u=this.#e%1;e[s]=2*u-1,this.#e+=a,this.#e>=1&&(this.#e-=1)}break}case Ue.square:{for(let s=n;s<o;s++){let u=this.#e%1;e[s]=u<.5?1:-1,this.#e+=a,this.#e>=1&&(this.#e-=1)}break}}}reset(){this.#e=0}};var on;(function(r){r[r.Linear=0]="Linear",r[r.EqualPower=1]="EqualPower"})(on||(on={}));var Jh;(function(r){r.BlackKeyIndices=[1,3,6,8,10],r.BlackKeyBits=r.BlackKeyIndices.reduce((t,i)=>t|=1<<i,0),r.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"]},r.isBlackKey=t=>(r.BlackKeyBits&1<<t%12)!==0,r.toFullString=t=>`${r.Names.English[t%12]}${Math.floor(t/12)-2}`,r.keyboardTracking=(t,i)=>Jr((t-60)*i);class e{#e;#t;constructor(i,...n){this.#e=i,this.#t=n.reduce((o,a)=>o|=1<<a,0)}get name(){return this.#e}get bits(){return this.#t}has(i){return(this.#t&1<<i%12)!==0}equals(i){return this.#t===i.bits}}r.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)]})(Jh||(Jh={}));var ir;(function(r){r.isOfType=e=>e.type==="note-event",r.Comparator=(e,t)=>{let i=e.position-t.position;if(i!==0)return i;let n=e.pitch-t.pitch;return n!==0?n:0},r.curveFunc=(e,t)=>t<0?e**2**-t:1-(1-e)**2**t,r.inverseCurveFunc=(e,t)=>t<0?e**2**t:1-Math.max(0,1-e)**2**-t,r.CompleteComparator=(e,t)=>{let i=Na.complete(e)-Na.complete(t);return i!==0?i:e.pitch-t.pitch}})(ir||(ir={}));var Ic=class{#e;#t=0;#r=0;constructor(e){this.#e=1/e}generate(e,t,i,n,o){let a=t*this.#e;switch(i){case Ue.sine:this.#i(e,a,n,o);break;case Ue.saw:this.#n(e,a,n,o);break;case Ue.square:this.#o(e,a,n,o);break;case Ue.triangle:this.#a(e,a,n,o);break}}generateFromFrequencies(e,t,i,n,o){switch(i){case Ue.sine:this.#l(e,t,n,o);break;case Ue.saw:this.#s(e,t,n,o);break;case Ue.square:this.#u(e,t,n,o);break;case Ue.triangle:this.#c(e,t,n,o);break}}#i(e,t,i,n){let o=this.#t;for(let a=i;a<n;a++)e[a]=Math.sin(2*Math.PI*(o%1)),o+=t;this.#t=o}#n(e,t,i,n){let o=this.#t;for(let a=i;a<n;a++){let s=o%1;e[a]=2*s-1-an(s,t),o+=t}this.#t=o}#o(e,t,i,n){let o=this.#t;for(let a=i;a<n;a++){let s=o%1;e[a]=(s<.5?1:-1)+an(s,t)-an((s+.5)%1,t),o+=t}this.#t=o}#a(e,t,i,n){let o=this.#t,a=this.#r,s=4*t;for(let u=i;u<n;u++){let c=o%1,p=(c<.5?1:-1)+an(c,t)-an((c+.5)%1,t);a=a*.9995+p*s,e[u]=a,o+=t}this.#t=o,this.#r=a}#l(e,t,i,n){let o=this.#e,a=this.#t;for(let s=i;s<n;s++)e[s]=Math.sin(2*Math.PI*(a%1)),a+=t[s]*o;this.#t=a}#s(e,t,i,n){let o=this.#e,a=this.#t;for(let s=i;s<n;s++){let u=t[s]*o,c=a%1;e[s]=2*c-1-an(c,u),a+=u}this.#t=a}#u(e,t,i,n){let o=this.#e,a=this.#t;for(let s=i;s<n;s++){let u=t[s]*o,c=a%1;e[s]=(c<.5?1:-1)+an(c,u)-an((c+.5)%1,u),a+=u}this.#t=a}#c(e,t,i,n){let o=this.#e,a=this.#t,s=this.#r;for(let u=i;u<n;u++){let c=t[u]*o,p=a%1,d=(p<.5?1:-1)+an(p,c)-an((p+.5)%1,c);s=s*.9995+d*(4*c),e[u]=s,a+=c}this.#t=a,this.#r=s}},an=(r,e)=>r<e?(r/=e,r+r-r*r-1):r>1-e?(r=(r-1)/e,r*r+r+r+1):0;var jn;(function(r){r.zero=()=>({ll:0,lr:0,rl:0,rr:0}),r.identity=()=>({ll:1,lr:0,rl:0,rr:1}),r.update=(e,{gain:t,panning:i,invertL:n,invertR:o,stereo:a,swap:s},u=on.EqualPower)=>{let[c,p]=r.panningToGains(i,u),d=c*t,f=p*t;n&&(d*=-1),o&&(f*=-1);let v=Math.max(0,-a),m=Math.max(0,a),y=1-m,x=1+m,$=v*.5,I=1-v,T=(y+x)*.5,R=(y-x)*.5,L=(y-x)*.5,ae=(y+x)*.5,xe=d*($+I)*T+f*$*R,J=d*($+I)*L+f*$*ae,oe=d*$*T+f*($+I)*R,se=d*$*L+f*($+I)*ae;s?(e.ll=J,e.rl=xe,e.lr=se,e.rr=oe):(e.ll=xe,e.lr=oe,e.rl=J,e.rr=se)},r.panningToGains=(e,t)=>{let i=ce(e,-1,1);switch(t){case on.Linear:return[Math.min(1-i,1),Math.min(i+1,1)];case on.EqualPower:return[Math.cos((i+1)*bx),Math.sin((i+1)*bx)]}},r.applyFrame=(e,t,i)=>[e.ll*t+e.rl*i,e.lr*t+e.rr*i],r.processFrames=(e,t,i,n,o)=>{let[a,s]=t,[u,c]=i;for(let p=n;p<o;p++){let d=a[p],f=s[p];u[p]=e.ll*d+e.rl*f,c[p]=e.lr*d+e.rr*f}},r.replaceFrames=(e,[t,i],n,o)=>{for(let a=n;a<o;a++){let s=t[a],u=i[a];t[a]=e.ll*s+e.rl*u,i[a]=e.lr*s+e.rr*u}}})(jn||(jn={}));var Zt;(function(r){r.linear=(i,n=.005)=>new e(Math.ceil(i*n)|0),r.stereoMatrix=(i,n=.005)=>new t(Math.ceil(i*n)|0);class e{#e;#t=0;#r=0;#i=0;#n=0;constructor(n){this.#e=n}set(n,o){this.#t!==n&&(o===!0?(this.#r=n,this.#i=(n-this.#t)/this.#e,this.#n=this.#e):(this.#t=this.#r=n,this.#i=0,this.#n=0))}get(){return this.#t}moveAndGet(){return 0<this.#n&&(this.#t+=this.#i,--this.#n===0&&(this.#i=0,this.#t=this.#r)),this.#t}isFixed(n){return this.#t===n&&this.#n===0}isInterpolating(){return this.#n>0}}class t{#e;#t=jn.zero();#r=jn.zero();#i=jn.zero();#n=0;constructor(n){this.#e=n}update(n,o,a){jn.update(this.#r,n,o),a===!0?(this.#i.ll=(this.#r.ll-this.#t.ll)/this.#e,this.#i.lr=(this.#r.lr-this.#t.lr)/this.#e,this.#i.rl=(this.#r.rl-this.#t.rl)/this.#e,this.#i.rr=(this.#r.rr-this.#t.rr)/this.#e,this.#n=this.#e):(this.#t.ll=this.#r.ll,this.#t.lr=this.#r.lr,this.#t.rl=this.#r.rl,this.#t.rr=this.#r.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#n=0)}processFrames(n,o,a,s){let[u,c]=n,[p,d]=o;if(this.isInterpolating())for(let f=a;f<s;f++){let v=u[f],m=c[f],y=this.moveAndGet();p[f]=y.ll*v+y.rl*m,d[f]=y.lr*v+y.rr*m}else{let f=this.#r;for(let v=a;v<s;v++){let m=u[v],y=c[v];p[v]=f.ll*m+f.rl*y,d[v]=f.lr*m+f.rr*y}}}set(n,o){this.#o(n)||(o===!0?(this.#r.ll=n.ll,this.#r.lr=n.lr,this.#r.rl=n.rl,this.#r.rr=n.rr,this.#i.ll=(n.ll-this.#t.ll)/this.#e,this.#i.lr=(n.lr-this.#t.lr)/this.#e,this.#i.rl=(n.rl-this.#t.rl)/this.#e,this.#i.rr=(n.rr-this.#t.rr)/this.#e,this.#n=this.#e):(this.#t.ll=this.#r.ll=n.ll,this.#t.lr=this.#r.lr=n.lr,this.#t.rl=this.#r.rl=n.rl,this.#t.rr=this.#r.rr=n.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#n=0))}get(){return this.#t}moveAndGet(){return 0<this.#n&&(this.#t.ll+=this.#i.ll,this.#t.lr+=this.#i.lr,this.#t.rl+=this.#i.rl,this.#t.rr+=this.#i.rr,--this.#n===0&&(this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#t.ll=this.#r.ll,this.#t.lr=this.#r.lr,this.#t.rl=this.#r.rl,this.#t.rr=this.#r.rr)),this.#t}isFixed(n){return this.#o(n)&&this.#n===0}isInterpolating(){return this.#n>0}#o(n){return this.#t.ll===n.ll&&this.#t.lr===n.lr&&this.#t.rl===n.rl&&this.#t.rr===n.rr}}r.StereoMatrixRamp=t})(Zt||(Zt={}));var Cc=new Float32Array([-.00048076361,0,.00174689293,0,-.00421638042,0,.00854519755,0,-.01627072692,0,.03203375191,0,-.08251235634,0,.31203505397,.5,.31203505397,0,-.08251235634,0,.03203375191,0,-.01627072692,0,.00854519755,0,-.00421638042,0,.00174689293,0,-.00048076361]),Mx=new Float32Array(12),xP=new Float32Array(11);for(let r=0,e=0,t=0;r<Cc.length;r++)r%2===0?Mx[e++]=Cc[r]:xP[t++]=Cc[r];var Dx=class{#e=new Float32Array(Mx.length);#t=new Float32Array(Cc.length);#r=0;#i=0;reset(){this.#e.fill(0),this.#t.fill(0),this.#r=0,this.#i=0}upsample(e,t,i,n){let o=this.#e,a=Mx,s=xP;for(let u=i;u<n;u++){let c=e[u],p=(u-i)*2;o[this.#r]=c;let d=0;for(let v=0;v<a.length;v++){let m=(this.#r-v+o.length)%o.length;d+=o[m]*a[v]}t[p]=d*2;let f=0;for(let v=0;v<s.length;v++){let m=(this.#r-v+o.length-1)%o.length;f+=o[m]*s[v]}t[p+1]=f*2,this.#r=(this.#r+1)%o.length}}downsample(e,t,i,n){let o=this.#t,a=Cc;for(let s=i;s<n;s++){let u=(s-i)*2;o[this.#i]=e[u],this.#i=(this.#i+1)%o.length,o[this.#i]=e[u+1],this.#i=(this.#i+1)%o.length;let c=0;for(let p=0;p<a.length;p++){let d=(this.#i-1-p+o.length)%o.length;c+=o[d]*a[p]}t[s]=c}}},Qh=class{#e;#t;#r;constructor(e){this.#e=e;let t=e===2?1:e===4?2:3;this.#t=O.create(()=>new Dx,t),this.#r=O.create(i=>new Float32Array(128*(2<<i)),t-1)}reset(){this.#t.forEach(e=>e.reset())}upsample(e,t,i,n){let o=n-i,a=e,s=i,u=n;for(let c=0;c<this.#t.length;c++){let d=c===this.#t.length-1?t:this.#r[c];this.#t[c].upsample(a,d,s,u),a=d,s=0,u=o*(2<<c)}}downsample(e,t,i,n){let o=n-i,a=e,s=o*this.#e;for(let u=this.#t.length-1;u>=0;u--){let c=u===0,p=c?t:this.#r[u-1],d=c?i:0,f=c?n:s/2;this.#t[u].downsample(a,p,d,f),a=p,s=f}}},Yh=class{#e;#t;constructor(e){this.#e=new Qh(e),this.#t=new Qh(e)}reset(){this.#e.reset(),this.#t.reset()}upsample(e,t,i,n){this.#e.upsample(e[0],t[0],i,n),this.#t.upsample(e[1],t[1],i,n)}downsample(e,t,i,n){this.#e.downsample(e[0],t[0],i,n),this.#t.downsample(e[1],t[1],i,n)}};var il=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 t=e*e;return this.#i-=this.#e[this.#r],this.#i+=t,this.#e[this.#r]=t,++this.#r===this.#e.length&&(this.#r=0),this.#i<=0?0:Math.sqrt(this.#i*this.#t)}processBlock(e,t,i){let n=this.#e,o=n.length,a=this.#r,s=this.#i;for(let u=t;u<i;u++){let c=e[u]*e[u];s+=c-n[a],n[a]=c,++a===o&&(a=0)}return this.#r=a,this.#i=s,s<=0?0:Math.sqrt(s*this.#t)}clear(){this.#e.fill(0),this.#i=0,this.#r=0}};var Xh=class r{static#e=.003;static#t=.02;#r;#i;#n=0;constructor(e){this.#r=Math.pow(.01,1/(r.#e*e)),this.#i=Math.pow(.01,1/(r.#t*e))}clear(){this.#n=0}replace(e,t,i){let n=this.#r,o=this.#i,[a,s]=e.channels(),u=this.#n;for(let c=t;c<i;++c){let p=a[c],d=s[c],f=Math.max(Math.abs(p),Math.abs(d));if(u=f>u?n*(u-f)+f:o*(u-f)+f,u>1){let v=1/u;a[c]=p*v,s[c]=d*v}}this.#n=u}};var Mi=class{#e;value=0;constructor(e,t){this.#e=1-Math.exp(-1/(e*t))}process(e){return this.value+=this.#e*(e-this.value),this.value}};var ef=class{#e=new z;#t;#r;constructor(e){this.#t=this.#e.own(new ee),this.#e.own(e.subscribe(t=>{this.#r=t.getValue(),this.#t.notify(this)})),this.#r=e.getValue()}subscribe(e){return this.#t.subscribe(e)}getTempoAt(e){return this.#r}ppqnToSeconds(e){return Q.pulsesToSeconds(e,this.#r)}secondsToPPQN(e){return Q.secondsToPulses(e,this.#r)}intervalToSeconds(e,t){return Q.pulsesToSeconds(t-e,this.#r)}intervalToPPQN(e,t){return Q.secondsToPulses(t-e,this.#r)}terminate(){this.#t.terminate()}};var nr;(function(r){r.Musical="musical",r.Seconds="seconds"})(nr||(nr={}));var wo;(function(r){function e(i,n,o){return new Cx(i,n,o)}r.musical=e;function t(i,n,o,a){return new Ix(i,n,o,a)}r.aware=t})(wo||(wo={}));var Ix=class{#e;#t;#r;#i;constructor(e,t,i,n){this.#i=n,this.#t=t,this.#r=i,this.#e=e}toPPQN(){let e=this.#i.getValue();if(this.getTimeBase()===nr.Musical)return e;let t=this.#r.getValue(),i=this.#e.ppqnToSeconds(t),n=i+e;return this.#e.intervalToPPQN(i,n)}fromPPQN(e){if(this.getTimeBase()===nr.Musical)this.#i.setValue(e);else{let t=this.#r.getValue(),i=this.#e.intervalToSeconds(t,t+e);this.#i.setValue(i)}}toSeconds(){let e=this.#i.getValue();if(this.getTimeBase()===nr.Seconds)return e;let t=this.#r.getValue();return this.#e.intervalToSeconds(t,t+e)}toSamples(e){return this.toSeconds()*e}rawValue(){return this.#i.getValue()}getTimeBase(){return Hr(this.#t.getValue(),nr)}},Cx=class{#e;#t;#r;constructor(e,t,i){this.#r=i,this.#t=t,this.#e=e}toPPQN(){return this.#r.getValue()}fromPPQN(e){this.#r.setValue(e)}toSeconds(){let e=this.#r.getValue(),t=this.#t.getValue();return this.#e.intervalToSeconds(t,t+e)}toSamples(e){return this.toSeconds()*e}rawValue(){return this.#r.getValue()}getTimeBase(){return nr.Musical}};var tf=Q.fromSignature(1,384);var bo={None:{type:"none"},Linear:{type:"linear"},Curve:r=>({type:"curve",slope:r})},rf;(function(r){r.Comparator=(n,o)=>{let a=n.position-o.position;if(a!==0)return a;let s=n.index-o.index;return s!==0?s:n===o?0:F(`${n} and ${o} are identical in terms of comparison`)};function*e(n,o,a){if(n.isEmpty())return Je.empty();for(let s of n.iterateFrom(o))if(yield s,s.position>=a)return}r.iterateWindow=e,r.nextEvent=(n,o)=>{let a=n.asArray(),s=He.rightMost(a,o,r.Comparator);return s===-1?null:a[s+1]??null},r.valueAt=(n,o,a)=>{if(n.isEmpty())return a;let s=n.iterateFrom(o),{done:u,value:c}=s.next();if(u)return a;if(c.position<=o){let{done:p,value:d}=s.next();if(p)return c.value;if(o<d.position)return i(c,d,o);if(c.interpolation===bo.None)return c.value}return c.value};function*t(n,o,a,s){if(n.isEmpty())return;let u=n.iterateFrom(o),{done:c,value:p}=u.next();if(c)return;let d=a/s,f=p;if(f.position>o){for(;o<f.position;)if(yield{position:o,value:f.value},o+=d,o>a)return;f.position<=a&&(yield f)}for(;o<=a;){let{done:v,value:m}=u.next();if(v)break;for(;o<m.position;){if(o>a)return;yield{position:o,value:i(f,m,o)},o+=d}m.position<a&&(f.interpolation===bo.None&&(yield{position:m.position,value:f.value}),yield m),f=m}for(;o<=a;)yield{position:o,value:f.value},o+=d}r.quantise=t;let i=({value:n,position:o,interpolation:a},s,u)=>a.type==="none"?n:a.type==="linear"?n+(u-o)/(s.position-o)*(s.value-n):a.type==="curve"?Qr.valueAt({slope:a.slope,steps:s.position-o,y0:n,y1:s.value},u-o):F("Unknown interpolation")})(rf||(rf={}));var _c;(function(r){let e;(function(t){t[t.Bartlett=0]="Bartlett",t[t.Blackman=1]="Blackman",t[t.BlackmanHarris=2]="BlackmanHarris",t[t.Hamming=3]="Hamming",t[t.Hanning=4]="Hanning"})(e=r.Type||(r.Type={})),r.create=(t,i)=>{let n=new Float32Array(i),o=Math.PI/(i-1);switch(t){case e.Bartlett:{let a=(i>>1)-1,s=0;for(;s<=a;++s)n[s]=2*s/(i-1);for(;s<i;++s)n[s]=2-2*s/(i-1);return n}case e.Blackman:{let a=2*o,s=4*o;for(let u=0;u<i;++u)n[u]=.42323-.49755*Math.cos(a*u)+.07922*Math.cos(s*u);return n}case e.BlackmanHarris:{let a=2*o,s=4*o,u=6*o;for(let c=0;c<i;++c)n[c]=.35875-.48829*Math.cos(a*c)+.14128*Math.cos(s*c)-.01168*Math.cos(u*c);return n}case e.Hamming:{let a=2*o;for(let s=0;s<i;++s)n[s]=.54-.46*Math.cos(a*s);return n}case e.Hanning:{let a=2*o;for(let s=0;s<i;++s)n[s]=.5-.5*Math.cos(a*s);return n}}}})(_c||(_c={}));var nf=class extends AudioWorkletProcessor{#e;#t;#r;#i;#n;#o=0;constructor({processorOptions:{sab:e,numberOfChannels:t,rmsWindowInSeconds:i,valueDecay:n}}){super(),this.#e=t,this.#t=new Float32Array(t),this.#r=new Float32Array(t),this.#i=O.create(()=>new il(sampleRate*i),t);let o=vr.createBuilder({peak:vr.floats(t),rms:vr.floats(t)})();this.#n=Ys.writer(o,e,a=>{let s=Math.exp(-(128*this.#o)/(sampleRate*n));for(let u=0;u<t;++u){let c=this.#t[u],p=this.#r[u];a.peak[u]=c,a.rms[u]=Math.sqrt(p),this.#t[u]=c*s,this.#r[u]=p*s}this.#o=0})}process([e]){for(let t=0;t<this.#e;++t){let i=e[t];if(i===void 0)this.#t[t]=0,this.#r[t]=0;else{let n=this.#i[t],o=this.#t[t],a=this.#r[t];for(let s=0;s<128;++s){let u=i[s];o=Math.max(o,Math.abs(u)),a=Math.max(a,n.pushPop(u*u))}this.#t[t]=o,this.#r[t]=a}}return this.#o++,this.#n.tryWrite(),!0}};var we=class r{static newSet(e){return new Js(e,r.Comparator)}static compose=(e,...t)=>{let i=t.length===0?this.#e:new Int16Array(t);return D(i.every((n,o)=>n===t[o]),`fieldKeys (${i.join(",")}) only allows i16`),new r(e,i)};static decode(e){let t=e.split("/");return D(t.length>0,"Unable to parse Address"),r.compose(A.parse(t[0]),...t.slice(1).map(i=>parseInt(i)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,t,i){let n=e.values(),o=He.leftMostMapped(n,t,A.Comparator,i),a=n.length;if(o<0||o>=a)return null;for(let s=o;s<a;s++)if(A.Comparator(i(n[s]),t)!==0)return o<s?[o,s]:null;return[o,a]}static Comparator=(e,t)=>{let i=A.Comparator(e.#t,t.#t);if(i!==0)return i;let n=Math.min(e.#r.length,t.#r.length);for(let o=0;o<n;o++){let a=e.#r[o]-t.#r[o];if(a!==0)return a}return e.#r.length-t.#r.length};static MinimalComparator=(e,t)=>{let i=A.Comparator(e.#t,t.#t);if(i!==0)return i;let n=Math.min(e.#r.length,t.#r.length);for(let o=0;o<n;o++){let a=e.#r[o]-t.#r[o];if(a!==0)return a}return 0};static LengthComparator=(e,t)=>{let i=A.Comparator(e.#t,t.#t);return i!==0?i:t.#r.length-e.#r.length};static#e=new Int16Array(0);#t;#r;constructor(e,t){this.#t=e,this.#r=t}get uuid(){return this.#t}get fieldKeys(){return this.#r}isBox(){return this.#r.length===0}isContent(){return!this.isBox()}equals(e){return r.Comparator(this,e)===0}compareTo(e){return r.Comparator(this,e)}append(e){return new r(this.#t,new Int16Array([...this.#r,e]))}startsWith(e){return A.Comparator(e.#t,this.#t)===0&&e.#r.length<=this.#r.length&&e.#r.every((t,i)=>this.#r[i]===t)}write(e){e.writeBytes(new Int8Array(this.#t.buffer)),e.writeByte(this.#r.length),this.#r.forEach(t=>e.writeShort(t))}moveTo(e){return new r(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(A.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,A.length),e.buffer}toString(){return[A.toString(this.#t),...this.#r].join("/")}static read(e){let t=A.fromDataInput(e),i=e.readByte();return r.compose(t,...O.create(()=>e.readShort(),i))}},ka;(function(r){r.AddressReader=e=>e.address,r.Comparator=({address:e},{address:t})=>we.Comparator(e,t),r.equals=(e,t)=>{let[i,n]=He.rangeMapped(t,e,we.Comparator,r.AddressReader);return t.slice(i,n+1)},r.startsWith=(e,t)=>{let[i,n]=He.rangeMapped(t,e,we.MinimalComparator,r.AddressReader);return t.slice(i,n+1).filter(o=>o.address.startsWith(e))},r.endsWith=(e,t)=>{let i=He.leftMostMapped(t,e,we.LengthComparator,r.AddressReader),n=He.rightMostMapped(t,e,we.MinimalComparator,r.AddressReader);return t.slice(i,n+1).filter(o=>e.startsWith(o.address))}})(ka||(ka={}));var sn=class r{static validate(e,t){if(e.address.equals(t.address))return g.wrap(`PointerField cannot point to itself: ${e}`);if(!t.pointerRules.accepts.some(i=>i===e.pointerType)){let i=t.pointerRules.accepts.join(", ");return g.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${i}).`)}return g.None}#e;#t;constructor(e){this.#e=e,this.#t=new Ft}subscribe(e,...t){return this.#r(this.#t,e,t)}catchupAndSubscribe(e,...t){let i=we.newSet(n=>n.address);return i.addMany(this.filter(...t)),i.forEach(n=>e.onAdded(n)),this.subscribe({onAdded:n=>{i.add(n)&&e.onAdded(n)},onRemoved:n=>{i.removeByKey(n.address),e.onRemoved(n)}},...t)}filter(...e){return e.length===0?this.incoming():Je.filter(this.incoming().values(),t=>e.some(i=>i===t.pointerType))}size(){return this.incoming().length}isEmpty(){return this.size()===0}nonEmpty(){return this.size()>0}contains(e){return this.incoming().some(t=>e.address.equals(t.address))}incoming(){return this.#e.graph.edges().incomingEdgesOf(this.#e).slice()}onAdded(e){let t=r.validate(e,this.#e);if(t.nonEmpty())return F(t.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,t,i){return e.subscribe({onAdded:n=>{(i.length===0||i.some(o=>o===n.pointerType))&&t.onAdded(n)},onRemoved:n=>{(i.length===0||i.some(o=>o===n.pointerType))&&t.onRemoved(n)}})}};var Tx=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(o=(n<3?a(o):n>3?a(e,t,o):a(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},nl=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},W=class r{static hook(e){return new r(e)}#e;#t;#r;#i;#n;constructor({parent:e,fieldKey:t,fieldName:i,pointerRules:n,deprecated:o}){this.#e=e,this.#t=t,this.#r=i,this.#i=n,this.#n=o,n.mandatory&&this.graph.edges().watchVertex(this)}accept(e){return _(e.visitField,this)}get box(){return this.#e.box}get graph(){return this.#e.graph}get parent(){return this.#e}get fieldKey(){return this.#t}get fieldName(){return this.#r}get pointerRules(){return this.#i}get deprecated(){return this.#n}get pointerHub(){return new sn(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 O.empty()}record(){return Dr.empty()}getField(e){return F()}optField(e){return g.None}read(e){}write(e){}toJSON(){}fromJSON(e){return F("fromJSON should never be called on a field")}disconnect(){if(this.pointerHub.isEmpty())return;let e=this.pointerHub.incoming();e.forEach(t=>{t.defer(),(t.mandatory||this.pointerRules.mandatory&&e.length===1)&&t.box.delete()})}toString(){return`{${this.box.constructor.name}:${this.constructor.name} (${this.fieldName}) ${this.address.toString()}`}};Tx([Gs,nl("design:type",sn),nl("design:paramtypes",[])],W.prototype,"pointerHub",null);Tx([Gs,nl("design:type",we),nl("design:paramtypes",[])],W.prototype,"address",null);Tx([Gs,nl("design:type",String),nl("design:paramtypes",[])],W.prototype,"debugPath",null);var h=Object.freeze({mandatory:!1,accepts:[]});var of=class r extends W{static create(e,t,i){return new r(e,t,i)}#e;constructor(e,t,i){super(e),this.#e=O.create(n=>t({parent:this,fieldKey:n,fieldName:String(n),pointerRules:h,deprecated:e.deprecated}),i)}accept(e){return _(e.visitArrayField,this)}fields(){return this.#e}record(){return O.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return Y(this.#e[e])}optField(e){return g.wrap(this.#e[e])}read(e){this.#e.forEach(t=>t.read(e))}write(e){this.#e.filter(t=>!t.deprecated).forEach(t=>t.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((t,i)=>this.#e[i].fromJSON(t));else return F("Type mismatch")}};var Ao;(function(r){r.writeFields=(t,i)=>{let n=Object.entries(i).filter(([o,a])=>!a.deprecated);t.writeInt(1179403347),t.writeShort(n.length),n.forEach(([o,a])=>{let s=Bt.create();a.write(s);let u=new Int8Array(s.toArrayBuffer());t.writeShort(Number(o)),t.writeInt(u.length),t.writeBytes(u)})},r.readFields=(t,i)=>{D(t.readInt()===1179403347,"Serializer header is corrupt");let n=t.readShort();for(let o=0;o<n;o++){let a=t.readShort();if(Ws(i[a]))continue;let s=t.readInt(),u=new Int8Array(s);t.readBytes(u);let{status:c,error:p}=On(()=>i[a]?.read(new ot(u.buffer)));c==="failure"&&console.warn(i,p)}}})(Ao||(Ao={}));var fB=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(o=(n<3?a(o):n>3?a(e,t,o):a(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},wP=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},N=class r{static DEBUG_DELETION=!1;static Index=0;#e;#t;#r;#i;#n;#o=r.Index++;constructor({uuid:e,graph:t,name:i,pointerRules:n}){this.#e=we.compose(e),this.#t=t,this.#r=i,this.#i=n,this.#n=this.initializeFields(),n.mandatory&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#n)}record(){return this.#n}getField(e){return Y(this.#n[e],()=>`Field ${String(e)} not found in ${this.toString()}`)}optField(e){return g.wrap(this.#n[e])}subscribe(e,t){return this.graph.subscribeVertexUpdates(e,this.address,t)}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 creationIndex(){return this.#o}get pointerHub(){return new sn(this)}estimateMemory(){let e=new Zs;return this.write(e),e.count}isBox(){return!0}asBox(e){return Be(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){Ao.readFields(e,this.#n)}write(e){Ao.writeFields(e,this.#n)}serialize(){let e=Bt.create();return e.writeInt(this.#o),e.writeString(this.name),e.writeBytes(new Int8Array(this.address.uuid.buffer)),this.write(e),e.toArrayBuffer()}toArrayBuffer(){let e=Bt.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#n).reduce((e,[t,i])=>{let n=i.toJSON();return Z(n)&&(e[t]=n),e},{})}fromJSON(e){if(Ch(e))Object.entries(e).forEach(([t,i])=>{let n=this.#n[parseInt(t)];Z(i)&&n.fromJSON(i)});else return F("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...t){if(t.length===0)return O.empty();let i=this.getField(t[0]),n=[e(i)];for(let o=1;o<t.length;o++)i=i.getField(t[o]),n.push(e(i));return n}searchVertex(e){if(e.length===0)return g.wrap(this);let t=this.optField(e[0]);if(t.isEmpty())return g.None;for(let i=1;i<e.length;i++)if(t=t.unwrap().optField(e[i]),t.isEmpty())return g.None;return t}delete(){if(!this.isAttached())return;let{boxes:e,pointers:t}=this.graph.dependenciesOf(this);r.DEBUG_DELETION&&(console.debug(`Delete ${this.toString()}`),console.debug(" unplugs",[...t].map(i=>i.toString()).join(`
1
+ var cB=Object.defineProperty;var ka=(r,e)=>{for(var t in e)cB(r,t,{get:e[t],enumerable:!0})};var qs=class r{static DEFAULT_SIZE=512;static DECAY=.9;#e;#t;#r;#i;#n;#o;#a;#u;#s=0;decay=!1;constructor(e=r.DEFAULT_SIZE){this.#e=e<<1,this.#r=new Oh(this.#e),this.#i=new Float32Array(this.#e),this.#n=new Float32Array(this.#e),this.#o=kc.create(kc.Type.Blackman,this.#e),this.#t=e,this.#a=new Float32Array(e),this.#u=new Float32Array(e)}clear(){this.#a.fill(0),this.#i.fill(0),this.#u.fill(0),this.#s=0}numBins(){return this.#t}bins(){return this.#a}waveform(){return this.#u}process(e,t,i,n){for(let o=i;o<n;++o)this.#i[this.#s]=e[o]+t[o],++this.#s===this.#e&&this.#l()}#l(){for(let t=0;t<this.#t;++t)this.#u[t]=this.#i[t<<1];for(let t=0;t<this.#e;++t)this.#i[t]*=this.#o[t];this.#r.process(this.#i,this.#n);let e=1/this.#t;for(let t=0;t<this.#t;++t){let i=this.#i[t],n=this.#n[t],o=Math.sqrt(i*i+n*n)*e;this.#a[t]<o?this.#a[t]=o:this.decay&&(this.#a[t]*=r.DECAY)}this.#s=0,this.#n.fill(0),this.decay=!1}};var $c=r=>r,Z=r=>r!=null,$a=r=>r===null;var Hs=r=>r===void 0,Ma=r=>r!==void 0,cP=r=>r==null,yx=(r,e)=>r!=null?e(r):void 0,ee=(r,e="asDefined failed")=>r??F(tn(e)),Te=(r,e)=>r instanceof e,Ne=(r,e)=>r instanceof e?r:F(`${r} is not instance of ${e}`),xx=(r,e)=>{r instanceof e||F(`${r} is not instance of ${e}`)};var tn=r=>r instanceof Function?r():r;var _=(r,...e)=>r?.apply(null,e),Vh=r=>Z(r)&&typeof r=="object";var zh=r=>{throw new Error(`Unhandled ${r}`)},F=r=>{throw typeof r=="string"?new Error(r):r},I=(r,e)=>r?void 0:F(tn(e));var Da=r=>new Proxy({},{get(){return F(r)}});var gx=class{value;status="success";constructor(e){this.value=e}error=Da("Cannot access error when succeeded")},vx=class{error;status="failure";constructor(e){this.error=e}value=Da("Cannot access value when failed")},zn=r=>{try{return new gx(r())}catch(e){return new vx(e)}};var Hr=(r,e)=>Object.keys(e).length===0?F("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(n=>isNaN(Number(n))).map(n=>e[n]).includes(r)?r:F(`Invalid enum value: ${String(r)}`),ki=()=>{};var wx;(function(r){r[r.Ascending=1]="Ascending",r[r.Descending=-1]="Descending"})(wx||(wx={}));var R=class{static#e=Object.freeze(new Array(0));static empty=()=>this.#e;static clear=e=>{e.length=0};static replace=(e,t)=>{e.length=0,e.push(...t)};static consume=(e,t)=>{for(let i=0;i<e.length;)t(e[i])?e.splice(i,1):i++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,t)=>ee(e.at(0),t);static getLast=(e,t)=>ee(e.at(-1),t);static getPrev=(e,t)=>{let i=e.indexOf(t);return i===-1?F(`${t} not found in ${e}`):ee(e.at((i-1)%e.length),"Internal Error")};static getNext=(e,t)=>{let i=e.indexOf(t);return i===-1?F(`${t} not found in ${e}`):ee(e.at((i+1)%e.length),"Internal Error")};static removeLast=(e,t)=>ee(e.pop(),t);static create=(e,t)=>{let i=new Array(t);for(let n=0;n<t;n++)i[n]=e(n);return i};static equals=(e,t)=>{if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0};static satisfy=(e,t)=>{if(e.length<2)return!0;let i=e[0];for(let n=1;n<e.length;n++)if(!t(i,e[n]))return!1;return!0};static remove=(e,t)=>{let i=e.indexOf(t);if(i===-1)return F(`${t} not found in ${e}`);e.splice(i,1)};static removeIf=(e,t)=>{for(let i=e.length-1;i>=0;i--)t(e[i])&&e.splice(i,1)};static removeOpt=(e,t)=>{let i=e.indexOf(t);return i===-1?!1:(e.splice(i,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let t=0,i=new Set;for(let n of e)i.has(n)||(i.add(n),e[t++]=n);return e.length=t,e};static removeDuplicateKeys=(e,t)=>{let i=0,n=new Set;for(let o of e){let a=o[t];n.has(a)||(n.add(a),e[i++]=o)}return e.length=i,e};static subtract(e,t,i){return e.filter(n=>!t.some(o=>i(n,o)))}static intersect(e,t,i){return e.filter(n=>t.some(o=>i(n,o)))}static merge(e,t,i){return[...e.filter(n=>!t.some(o=>i(n,o))),...t]}static*iterate(e){for(let t=0;t<e.length;t++)yield e[t]}static*iterateReverse(e){for(let t=e.length-1;t>=0;t--)yield e[t]}static*iterateStateFull(e){let t=e.length-1;for(let i=0;i<=t;i++)yield{value:e[i],isFirst:i===0,isLast:i===t}}static*iterateAdjacent(e){if(!(e.length<=1))for(let t=1,i=e[0];t<e.length;t++){let n=e[t];yield[i,n],i=n}}static isSorted(e,t=wx.Ascending){if(e.length<2)return!0;let i=e[0];for(let n=1;n<e.length;n++){let o=e[n];if(Math.sign(i-o)===t)return!1;i=o}return!0}static toRecord(e,t){return e.reduce((i,n)=>(i[t(n)]=n,i),{})}static concatArrayBuffers(e,t){let i=new ArrayBuffer(e.byteLength+t.byteLength),n=new Uint8Array(i);return n.set(new Uint8Array(e),0),n.set(new Uint8Array(t),e.byteLength),i}};var g;(function(r){r.wrap=t=>Z(t)?new e(t):r.None,r.from=t=>r.wrap(t()),r.tryFrom=t=>{try{return r.wrap(t())}catch{return r.None}},r.execute=(t,...i)=>r.wrap(t?.apply(null,i)),r.async=t=>t.then(i=>r.wrap(i),()=>r.None);class e{#e;constructor(i){this.#e=ee(i)}unwrap(){return this.#e}unwrapOrElse(i){return this.#e}unwrapOrNull(){return this.#e}unwrapOrUndefined(){return this.#e}contains(i){return i===this.#e}match(i){return i.some(this.#e)}ifSome(i){return i(this.#e)}ifAbsent(i){}isEmpty(){return!1}nonEmpty(){return!0}map(i){return r.wrap(i(this.#e))}mapOr(i,n){return i(this.#e)}flatMap(i){return i(this.#e)}equals(i){return this.unwrapOrNull()===i.unwrapOrNull()}assert(i){return this}toString(){return`{Option.Some(${this.#e})}`}get[Symbol.toStringTag](){return this.toString()}}r.Some=e,r.None=new class{unwrap=t=>F(Z(t)?tn(t):"unwrap failed");unwrapOrElse=t=>tn(t);unwrapOrNull=()=>null;unwrapOrUndefined=()=>{};contains=t=>!1;match=t=>t.none();ifSome=t=>{};ifAbsent=t=>t(void 0);isEmpty=()=>!0;nonEmpty=()=>!1;map=t=>r.None;mapOr=(t,i)=>tn(i);flatMap=t=>r.None;equals=t=>t.isEmpty();assert=t=>F(tn(t)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(g||(g={}));var Un;(function(r){r.async=e=>e.then(t=>r.ok(t),t=>r.err(t)),r.tryGet=e=>{try{return r.ok(e())}catch(t){return r.err(t)}},r.ok=e=>new class{value;constructor(t){this.value=t}asOption=()=>g.wrap(this.value);failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>this.value;map=t=>{try{return r.ok(t(this.value))}catch(i){return r.err(i)}};mapOr=(t,i)=>t(this.value);unwrapOrElse=t=>this.value;flatMap=t=>t(this.value);match=t=>t.ok(this.value);toVoid=()=>r.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>`{Success: ${this.value}`;get[Symbol.toStringTag](){return"Success"}}(e),r.Ok=new class{constructor(){}asOption=()=>g.None;failureReason=()=>{throw new Error("Attempt was successful.")};isFailure=()=>!1;isSuccess=()=>!0;result=()=>{};map=e=>r.ok(e());mapOr=(e,t)=>e();unwrapOrElse=e=>{};flatMap=e=>e();match=e=>e.ok();toVoid=()=>r.ok(void 0);failure=()=>{throw new Error("Attempt was successful.")};toString=()=>"{Success: Ok";get[Symbol.toStringTag](){return"Success"}},r.err=e=>new class{reason;constructor(t){this.reason=t}asOption=()=>g.None;failureReason=()=>this.reason;isFailure=()=>!0;isSuccess=()=>!1;result=()=>F(`'${this.reason}'`);map=()=>this;mapOr=(t,i)=>tn(i);unwrapOrElse=t=>tn(t);flatMap=()=>this;match=t=>t.err(this.reason);toVoid=()=>r.err(this.reason);failure=()=>this;toString=()=>`{Failure: ${this.reason}`;get[Symbol.toStringTag](){return"Failure"}}(e)})(Un||(Un={}));var Ye;(function(r){r.exact=(e,t,i)=>{let n=0,o=e.length-1;for(;n<=o;){let a=n+o>>>1,s=i(e[a],t);if(s===0)return a;s<0?n=a+1:o=a-1}return-1},r.exactMapped=(e,t,i,n)=>{let o=0,a=e.length-1;for(;o<=a;){let s=o+a>>>1,l=i(n(e[s]),t);if(l===0)return s;l<0?o=s+1:a=s-1}return-1},r.leftMost=(e,t,i)=>{let n=0,o=e.length;for(;n<o;){let a=n+o>>>1;i(e[a],t)<0?n=a+1:o=a}return n},r.rightMost=(e,t,i)=>{let n=0,o=e.length;for(;n<o;){let a=n+o>>>1;i(e[a],t)<=0?n=a+1:o=a}return o-1},r.stableInsert=(e,t,i)=>{let n=0,o=e.length;for(;n<o;){let a=n+o>>>1;i(e[a],t)<0?n=a+1:o=a}for(;n<e.length&&i(e[n],t)===0;)n++;return n},r.leftMostMapped=(e,t,i,n)=>{let o=0,a=e.length;for(;o<a;){let s=o+a>>>1;i(n(e[s]),t)<0?o=s+1:a=s}return o},r.rightMostMapped=(e,t,i,n)=>{let o=0,a=e.length;for(;o<a;){let s=o+a>>>1;i(n(e[s]),t)<=0?o=s+1:a=s}return a-1},r.rangeMapped=(e,t,i,n)=>[r.leftMostMapped(e,t,i,n),r.rightMostMapped(e,t,i,n)]})(Ye||(Ye={}));var rt=class{static every=(e,t)=>(e&t)===t;static some=(e,t)=>(e&t)>0;#e;#t;constructor(e=32){this.#e=e,this.#t=new Int32Array((e-1>>>5)+1)}getBit(e){let t=e>>>5,i=1<<e-(t<<5);return(this.#t[t]&i)!==0}setBit(e,t){let i=e>>>5,n=1<<e-(i<<5),o=this.#t[i],a=t?o|n:o&~n;return a===o?!1:(this.#t[i]=a,!0)}isEmpty(){return this.#t.every(e=>e===0)}nonEmpty(){return this.#t.some(e=>e>0)}set buffer(e){this.#t.set(new Int32Array(e))}get buffer(){return this.#t.buffer}replace(e){let t=new Int32Array(e),i=!1;for(let n=0;n<t.length;n++)this.#t[n]!==t[n]&&(this.#t[n]=t[n],i=!0);return i}toString(){let e="";for(let t of R.iterateReverse(this.#t))e+=t.toString(2).padStart(32,"0");return e.substring(e.length-this.#e)}clear(){this.#t.fill(0)}};var Uh=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 _t=class r{static parseCssRgbOrRgba(e){let t=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(Z(t)&&t.every(i=>!isNaN(i))){if(t.length===3)return[t[0]/255,t[1]/255,t[2]/255,1];if(t.length===4)return[t[0]/255,t[1]/255,t[2]/255,t[3]]}throw new Error(`${e} is not proper formatted. Example: 'rgb(255, 255, 255)' or 'rgba(255, 255, 255, 1)'`)}static hslToHex(e,t,i){let n=l=>(l+e/30)%12,o=t*Math.min(i,1-i),a=l=>i-o*Math.max(-1,Math.min(n(l)-3,Math.min(9-n(l),1))),s=l=>Math.round(l*255).toString(16).padStart(2,"0");return`#${s(a(0))}${s(a(8))}${s(a(4))}`}static hexToHsl(e){let t=e.startsWith("#")?e.slice(1):e,i=parseInt(t.slice(0,2),16)/255,n=parseInt(t.slice(2,4),16)/255,o=parseInt(t.slice(4,6),16)/255,a=Math.max(i,n,o),s=Math.min(i,n,o),l=(a+s)/2,c=0,p=0;if(a!==s){let d=a-s;switch(p=l>.5?d/(2-a-s):d/(a+s),a){case i:c=((n-o)/d+(n<o?6:0))*60;break;case n:c=((o-i)/d+2)*60;break;case o:c=((i-n)/d+4)*60;break}}return{h:c,s:p,l}}static hslStringToHex(e){let[t,i,n]=e.match(/\d+(\.\d+)?/g).map(Number);return r.hslToHex(t,i/100,n/100)}#e;#t;#r;#i;constructor(e,t,i,n=1){this.#e=e,this.#t=t,this.#r=i,this.#i=n}opacity(e){return new r(this.#e,this.#t,this.#r,e)}brightness(e){let t=Math.max(0,Math.min(100,this.#r+e));return new r(this.#e,this.#t,t,this.#i)}saturate(e){return new r(this.#e,this.#t*e,this.#r,this.#i)}fade(e){let t=this.#t*(1-Math.sqrt(e)),i=this.#r+(100-this.#r)*e**3;return new r(this.#e,t,i,this.#i)}toString(){return this.#i===1?`hsl(${this.#e}, ${this.#t}%, ${this.#r}%)`:`hsla(${this.#e}, ${this.#t}%, ${this.#r}%, ${this.#i})`}};var Mc=(r,e)=>r-e;var $i=Math.PI*2,xM=Math.PI/2,bx=Math.PI/4,wM=1/Math.sqrt(2),le=(r,e,t)=>Math.max(e,Math.min(r,t)),Jr=r=>Math.max(0,Math.min(r,1)),dP=(r,e)=>e+(1-2*e)*Math.max(0,Math.min(r,1)),jn=(r,e)=>Math.floor(r/e)*e;var jh=(r,e,t)=>r+(e-r)*t,pP=(r,e,t)=>r*Math.pow(e/r,t);var Dc=(r,e)=>dB(r/e)*e,dB=r=>r-Math.floor(r),wo=r=>Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));var Ax=(r,e)=>r*e/((2*e-1)*(r-1)+e);var Qr;(function(r){r.valueAt=({slope:n,steps:o,y0:a,y1:s},l)=>r.normalizedAt(l/o,n)*(s-a)+a,r.normalizedAt=(n,o)=>{if(o>.499999&&o<.500001)return n;{let a=le(o,1e-15,.999999999999999);return a*a/(1-a*2)*(Math.pow((1-a)/a,2*n)-1)}},r.inverseAt=(n,o)=>{let a=le(o,1e-15,.999999999999999);return Math.log(n*(1-2*a)/(a*a)+1)/(2*Math.log((1-a)/a))},r.coefficients=n=>{let o=r.valueAt(n,1),s=(r.valueAt(n,2)-o)/(o-n.y0),l=o-s*n.y0;return{m:s,q:l}};function*t(n,o,a,s){let{m:l,q:c}=r.coefficients({slope:n,steps:o,y0:a,y1:s});for(let p=0,d=a;p<o;p++)yield d=l*d+c}r.walk=t;function*i(n,o){let a=1/o,s=r.normalizedAt(a,n),c=(r.normalizedAt(2*a,n)-s)/s;for(let p=0,d=0;p<o;p++)yield d=c*d+s}r.walkNormalized=i,r.byHalf=(n,o,a,s)=>({slope:r.slopeByHalf(o,a,s),steps:n,y0:o,y1:s}),r.slopeByHalf=(n,o,a)=>Math.abs(a-n)<1e-6?.5:(o-n)/(a-n)})(Qr||(Qr={}));var rn=new DataView(new ArrayBuffer(8)),rr;(function(r){r.MIN_VALUE=-2147483648,r.MAX_VALUE=2147483647,r.toByte=e=>(rn.setInt8(0,e),rn.getInt8(0)),r.toShort=e=>(rn.setInt16(0,e),rn.getInt16(0)),r.toInt=e=>(rn.setInt32(0,e),rn.getInt32(0))})(rr||(rr={}));var Ln;(function(r){let i=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),n=new Float32Array(i),o=new Int32Array(i);r.floatToIntBits=a=>{let s=r.floatToRawIntBits(a);return(s&2139095040)===2139095040&&s&8388607?2143289344:s},r.intBitsToFloat=a=>(o[0]=a,n[0]),r.floatToRawIntBits=a=>(n[0]=a,o[0]),r.toFloat32=a=>(rn.setFloat32(0,a),rn.getFloat32(0))})(Ln||(Ln={}));var hP;(function(r){r.floatToIntBits=e=>{let t=Ln.floatToIntBits(e),i=t>>>16&32768,n=(t&2147483647)+4096;return n>=1199570944?(t&2147483647)>=1199570944?n<2139095040?i|31744:i|31744|(t&8388607)>>>13:i|31743:n>=947912704?i|n-939524096>>>13:n<855638016?i:(n=(t&2147483647)>>>23,i|(t&8388607|8388608)+(8388608>>>n-102)>>>126-n)},r.intBitsToFloat=e=>{let t=e&1023,i=e&31744;if(i===31744)i=261120;else if(i!==0){if(i+=114688,t===0&&i>115712)return Ln.intBitsToFloat((e&32768)<<16|i<<13|1023)}else if(t!==0){i=115712;do t<<=1,i-=1024;while(!(t&1024));t&=1023}return Ln.intBitsToFloat((e&32768)<<16|(i|t)<<13)}})(hP||(hP={}));var Lh;(function(r){let e=9218868437227405312n,t=4503599627370495n,i=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),n=new Float64Array(i),o=new BigInt64Array(i);r.float64ToLongBits=a=>{let s=r.float64ToRawLongBits(a);return(s&e)===e&&(s&t)!==0n?0x7ff8000000000000n:s},r.longBitsToFloat64=a=>(o[0]=a,n[0]),r.float64ToRawLongBits=a=>(n[0]=a,o[0]),r.clamp=a=>(rn.setFloat64(0,a),rn.getFloat64(0))})(Lh||(Lh={}));var Xe=class{static*empty(){}static one(e){return[e]}static count(e){let t=0;for(let i of e)t++;return t}static some(e,t){for(let i of e)if(t(i))return!0;return!1}static every(e,t){for(let i of e)if(!t(i))return!1;return!0}static reduce(e,t,i){let n=i,o=0;for(let a of e)n=t(n,a,o++);return n}static includes(e,t){for(let i of e)if(i===t)return!0;return!1}static forEach(e,t){for(let i of e)t(i)}static*map(e,t){let i=0;for(let n of e)yield t(n,i++)}static*take(e,t){let i=0;for(let n of e){if(i++>=t)return;yield n}}static filter(e,t){let i=[];for(let n of e)t(n)&&i.push(n);return i}static filterMap(e,t){let i=[];for(let n of e){let o=t(n);Z(o)&&i.push(o)}return i}static reverse(e){let t=[];for(let i of e)t.push(i);return t.reverse()}static*pairWise(e){let t=e[Symbol.iterator](),{done:i,value:n}=t.next(),o=n;if(i!==!0)for(;;){let{done:a,value:s}=t.next();if(a===!0){yield[o,null];return}yield[o,s],o=s}}};var kt=class r{static create(e=1024){return this.use(new ArrayBuffer(e))}static use(e,t=0){return new r(new DataView(e,t))}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?F(`position(${e}) cannot be negative.`):e>this.#e.byteLength?F(`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 t=0;t<e.length;++t)this.#e.setInt8(this.#t++,e[t])}writeString(e){let t=e.length;this.#r(Int32Array.BYTES_PER_ELEMENT+t*Int16Array.BYTES_PER_ELEMENT),this.writeInt(t);for(let i=0;i<t;i++)this.writeShort(e.charCodeAt(i))}toArrayBuffer(){return this.#e.buffer.slice(0,this.#t)}#r(e){let t=this.#e.byteLength;if(this.#t+e>t){let i=this.#e;this.#e=new DataView(new ArrayBuffer(wo(t+e)));for(let n=0;n<this.#t;n++)this.#e.setInt8(n,i.getInt8(n))}}},Js=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}},Kh=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((t,i)=>e.#e[i]===t)}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(t=>this.writeByte(t))}writeFloat(e){this.writeInt(Ln.floatToIntBits(e))}writeDouble(e){this.writeLong(Lh.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 t=0;t<e.length;t++)this.writeShort(e.charCodeAt(t))}toHexString(){return Array.from(Xe.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},ut=class{littleEndian=!1;#e;#t=0;constructor(e,t=0){this.#e=new DataView(e,t)}get position(){return this.#t}set position(e){e<0?F(`position(${e}) cannot be negative.`):e>this.#e.byteLength?F(`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 t=0;t<e.length;t++)e[t]=this.readByte()}readString(){let e=this.readInt(),t="";for(let i=0;i<e;i++)t+=String.fromCharCode(this.readShort());return t}available(e){return this.#t+e<=this.#e.byteLength}remaining(){return this.#e.byteLength-this.#t}skip(e){this.position+=e}};var pB=r=>Z(r)?r.value!==void 0?"value":r.get!==void 0?"get":F(`Cannot resolve method key of ${r}`):F("Cannot resolve method key of undefined descriptor"),Qs=(r,e,t)=>{if(!Z(t))return function(o,a){if(a&&a.kind==="getter")return function(){let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!Z(s?.get))return F(`Cannot find getter for property '${e}'`);let l=s.get.apply(this);return Object.defineProperty(this,e,{value:l,configurable:!1,writable:!1,enumerable:!1}),l}};let i=pB(t),n=ee(t[i]);return{[i]:function(...o){if(o.length>0)return F("lazy accessory must not have any construction parameters");let a=n.apply(this);return Object.defineProperty(this,e,{value:i==="get"?a:()=>a,configurable:!1,writable:!1,enumerable:!1}),a}}};var Kn;(function(r){function*e(){}r.empty=e,r.next=i=>{let{value:n,done:o}=i.next();return o?null:n};function*t(...i){for(let n of i)for(let o of n)yield o}r.flatten=t})(Kn||(Kn={}));var Ic;(function(r){r.intersect1D=(e,t,i,n)=>Math.max(e,i)<=Math.min(t,n)})(Ic||(Ic={}));var $t=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,t)=>(...i)=>this.#e.forEach(n=>Object.getPrototypeOf(n)===Object.getPrototypeOf({})?_(n[t],...i):n[t]?.apply(n,i))})}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 fP=(r,...e)=>new Proxy([],{get(t,i){if(typeof i=="string"){let n=Number(i);if(!isNaN(n)&&n>=0&&Number.isInteger(n))return new r(...e)}return i===Symbol.iterator?function*(){for(;;)yield new r(...e)}:t[i]},has(t,i){if(typeof i=="string"){let n=Number(i);if(!isNaN(n)&&n>=0)return!0}return i in t}});var Ia=class{static createIfAbsent(e,t,i){let n=e.get(t);return n===void 0&&(n=i(t),e.set(t,n)),n}};var Cc=class r{static#e=Object.freeze(new Set);static empty=()=>r.#e};var Wh=class r{#e;#t;constructor(e,t){this.#e=new Map(e),this.#t=g.wrap(t),this.#t.ifSome(i=>Array.from(this.#e.values()).forEach(n=>n.sort(i)))}[Symbol.iterator](){return this.#e.entries()}clear(){this.#e.clear()}containsEntry(e,t){return Xe.some(this.#e.entries(),i=>e===i[0]&&i[1].includes(t))}containsKey(e){return Xe.includes(this.#e.keys(),e)}containsValue(e){return Xe.some(this.#e.values(),t=>t.includes(e))}get(e){return this.#e.get(e)??R.empty()}isEmpty(){return this.keyCount()===0}add(e,t){let i=Ia.createIfAbsent(this.#e,e,()=>[]);if(this.#t.isEmpty())i.push(t);else{let n=Ye.stableInsert(i,t,this.#t.unwrap());i.splice(n,0,t)}}addAll(e,t){let i=Ia.createIfAbsent(this.#e,e,()=>[]);i.push(...t),this.#t.nonEmpty()&&i.sort(this.#t.unwrap())}remove(e,t){let i=this.#e.get(e);if(i===void 0)return!1;{let n=i.indexOf(t);return n===-1?!1:(i.splice(n,1),i.length===0&&this.#e.delete(e),!0)}}removeFromKeyIf(e,t){let i=this.#e.get(e);if(i===void 0)return null;{let n=i.findIndex(t);if(n===-1)return null;{let o=i.splice(n,1)[0];return i.length===0&&this.#e.delete(e),o}}}removeValueIf(e){let t=[];for(let[i,n]of this.#e.entries())for(let o of n.filter(a=>e(a)))t.push([i,o]);for(let[i,n]of t)this.remove(i,n);return new Set(t.map(([,i])=>i))}removeKey(e){let t=this.#e.get(e);return this.#e.delete(e),t??R.empty()}forEach(e){Xe.forEach(this.#e.entries(),t=>e(t[0],t[1]))}keyCount(){return this.#e.size}keys(){return this.#e.keys()}sortKeys(e){let t=this.clone(),i=Array.from(this.keys()).sort(e);this.#e.clear();for(let n of i)this.addAll(n,t.get(n));return this}clone(){let e=new r;return this.#e.forEach((t,i)=>{e.#e.set(i,t.map(n=>n))}),e}},Ys=class r{map;constructor(e){this.map=new Map(e?.map(t=>{let i=t[0],n=t[1];return[i,new Set(n)]}))}clear(){this.map.clear()}containsEntry(e,t){return Xe.some(this.map.entries(),i=>e===i[0]&&i[1].has(t))}containsKey(e){return Xe.includes(this.map.keys(),e)}containsValue(e){return Xe.some(this.map.values(),t=>t.has(e))}get(e){return this.map.get(e)??Cc.empty()}isEmpty(){return this.keyCount()===0}add(e,t){Ia.createIfAbsent(this.map,e,()=>new Set).add(t)}addAll(e,t){let i=Ia.createIfAbsent(this.map,e,()=>new Set);for(let n of t)i.add(n)}remove(e,t){let i=this.map.get(e);return i===void 0?!1:i.delete(t)?(i.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let t=new Set;for(let[i,n]of this.map.entries()){for(let o of n)e(o)&&(n.delete(o),t.add(o));n.size===0&&this.map.delete(i)}return t}removeFromKeyIf(e,t){let i=this.map.get(e);if(i===void 0)return null;for(let n of i)if(t(n))return i.delete(n),i.size===0&&this.map.delete(e),n;return null}removeKey(e){let t=this.map.get(e);return this.map.delete(e),t??Cc.empty()}forEach(e){Xe.forEach(this.map.entries(),t=>e(t[0],t[1]))}keyCount(){return this.map.size}keys(){return this.map.keys()}sortKeys(e){let t=this.clone(),i=Array.from(this.keys()).sort(e);this.map.clear();for(let n of i)this.addAll(n,t.get(n));return this}clone(){let e=new r;return this.map.forEach((t,i)=>{e.map.set(i,new Set(Array.from(t)))}),e}};var K=Object.freeze({Empty:{terminate:ki},create:r=>({terminate:r}),many:(...r)=>({terminate:()=>{for(;r.length>0;)r.pop().terminate()}})}),U=class r{#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 t of e)this.#e.push(t)}spawn(){let e=new r;return e.own({terminate:()=>R.removeOpt(this.#e,e)}),this.own(e)}terminate(){for(;this.#e.length>0;)this.#e.pop().terminate()}};var te=class{static subscribeMany(e,...t){return K.many(...t.map(i=>i.subscribe(()=>e(i))))}#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(t=>t(e))}observers(){return this.#e}terminate(){this.#e.clear()}};var Dr;(function(r){let e=Object.freeze({});r.empty=()=>e,r.mergeNoOverlap=(t,i)=>{let n=new Set(Object.keys(t));for(let o of Object.keys(i))if(n.has(o))return F(`'${o}' is an overlapping key`);return{...t,...i}},r.include=(t,...i)=>{let n={};for(let o of i)n[o]=t[o];return n},r.exclude=(t,...i)=>{let n=new Set(i);return Object.entries(t).reduce((o,[a,s])=>(n.has(a)||(o[a]=s),o),{})},r.overwrite=(t,i)=>Object.assign(t,i)})(Dr||(Dr={}));var mP;(function(r){r.seal=e=>new class{getValue(){return e}subscribe(t){return K.Empty}catchupAndSubscribe(t){return t(this),K.Empty}}})(mP||(mP={}));var gP;(function(r){r.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return K.Empty}catchupAndSubscribe(e){return e(this),K.Empty}},r.inverseBoolean=e=>new class{getValue(){return!e.getValue()}setValue(t){e.setValue(!t)}subscribe(t){return e.subscribe(t)}catchupAndSubscribe(t){return t(this),this.subscribe(t)}}})(gP||(gP={}));var Yr=class{#e;#t=g.None;constructor(e){this.#e=new te,this.wrap(e)}wrap(e){this.wrapOption(g.wrap(e))}wrapOption(e){this.#t.equals(e)||(this.#t=e,this.#e.notify(this))}clear(e){this.#t.isEmpty()||(Z(e)&&e(this.#t.unwrap()),this.#t=g.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,t){return this.#t.mapOr(e,t)}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 Ir=class{#e;#t=g.None;#r;constructor(e,t){this.#e=new te,this.#r=t?.guard(e)??e,this.#t=g.wrap(t)}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 _x=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=t-e}x(e){return(this.clamp(e)-this.#e)/this.#r}y(e){return this.#e+le(e,0,1)*this.#r}clamp(e){return le(e,this.#e,this.#t)}floating(){return!0}},Px=class{#e;#t;#r;constructor(e,t){this.#e=le(Math.round(e),rr.MIN_VALUE,rr.MAX_VALUE),this.#t=le(Math.round(t),rr.MIN_VALUE,rr.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(le(e,0,1)*this.#r)}clamp(e){return le(Math.round(e),this.#e,this.#t)}floating(){return!1}},Sx=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=Math.log(t/e)}x(e){return Math.log(le(e,this.#e,this.#t)/this.#e)/this.#r}y(e){return this.#e*Math.exp(le(e,0,1)*this.#r)}clamp(e){return Math.min(this.#t,Math.max(this.#e,e))}floating(){return!0}},Ex=class{#e;constructor(e){this.#e=e}x(e){let t=this.#e.findIndex(i=>i===e);return t===-1?F(`Could not find index for ${e}`):t/(this.#e.length-1)}y(e){let t=Math.round(le(e,0,1)*(this.#e.length-1));return t>-1?ee(this.#e.at(t),`Could not find value for ${e}`):F(`Index ${t} is out of box.`)}clamp(e){return e}floating(){return!1}},Bx=class{#e;#t;#r;#i;#n;constructor(e,t,i){this.#e=e,this.#t=i;let n=e*e,o=i*i,a=t*t,s=e+i-2*t,l=i-t;this.#r=((2*i-t)*e-t*i)/s,this.#i=(l*n+(a-o)*e+t*o-a*i)/(n+(2*i-4*t)*e+o-4*t*i+4*a),this.#n=-l/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}},S;(function(r){r.linear=(o,a)=>new _x(o,a),r.linearInteger=(o,a)=>new Px(o,a),r.exponential=(o,a)=>new Sx(o,a),r.values=o=>new Ex(o),r.decibel=(o,a,s)=>new Bx(o,a,s);let e=new class{x(o){return o?1:0}y(o){return o>=.5}clamp(o){return o}floating(){return!1}},t=r.linear(0,1),i=r.linear(-1,1);r.bool=e;let n=r.decibel(-72,-12,0);r.unipolar=()=>t,r.bipolar=()=>i,r.DefaultDecibel=n})(S||(S={}));var P;(function(r){r.percent=({bipolar:o,fractionDigits:a}={})=>new e("%",a,!1,o),r.numeric=({unit:o,fractionDigits:a,unitPrefix:s,bipolar:l}={})=>new e(o,a,s,l),r.indices=(o,a)=>new class{x(s){return{unit:o,value:a[s]}}y(s){let l=a.indexOf(s);return l===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:l}}},r.values=(o,a,s)=>new class{x(l){return{unit:o,value:s.at(a.indexOf(l))??"N/A"}}y(l){let c=s.indexOf(l);return c===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:a[c]}}},r.bool=new class{y(o){switch(o.trim()){case"on":case"yes":case"true":return{type:"explicit",value:!0};default:return{type:"explicit",value:!1}}}x(o){return{value:o?"On":"Off",unit:""}}},r.boolValues=(o,a)=>new class{y(s){switch(s.trim()){case a:case"on":case"yes":case"true":return{type:"explicit",value:!0};case o:default:return{type:"explicit",value:!1}}}x(s){return{value:s?"On":"Off",unit:""}}};class e{#e;#t;#r;#i;constructor(a,s,l,c){this.#e=a??"",this.#t=s??0,this.#r=l??!1,this.#i=c??!1}y(a){let s=a.trim(),l=parseFloat(s);if(isNaN(l))return{type:"unknown",value:s};if(this.#e==="%")return{type:"explicit",value:l/100};if(s.endsWith("%"))return{type:"unitValue",value:this.#i?le(l/200+.5,0,1):le(l/100,0,1)};{s.endsWith(this.#e)&&this.#e.length>0&&(s=s.slice(0,-this.#e.length));let d=/(\d+)(\D+)/.exec(s)?.at(2)?.at(0);if(Z(d)){let f=t.indexOf(d);if(f>-1)return{type:"explicit",value:l*Math.pow(10,(f-4)*3)}}return{type:"explicit",value:l}}}x(a){if(Number.isNaN(a))return{value:"\u{1F4A3}",unit:this.#e};if(Number.isFinite(a)){if(this.#e==="%")return this.#i?{value:(a*200-100).toFixed(this.#t),unit:this.#e}:{value:(a*100).toFixed(this.#t),unit:this.#e};if(this.#r){let{value:s,prefix:l}=n(a);return{value:s.toFixed(this.#t),unit:`${l}${this.#e}`}}else return{value:a.toFixed(this.#t),unit:this.#e}}else return{value:a===Number.POSITIVE_INFINITY?"\u221E":"-\u221E",unit:this.#e}}}let t=Object.freeze(["p","n","\u03BC","m","","k","M","G","T"]),i=o=>Math.log(o)/Math.log(9.999999999999998),n=o=>{let a=Math.floor(i(o)/3),s=t[a+4];return Z(s)?{value:o*Math.pow(10,a*-3),prefix:s}:{value:o,prefix:""}};r.decible=r.numeric({unit:"db",fractionDigits:1}),r.panning=r.percent({unit:"%",fractionDigits:0})})(P||(P={}));var bo;(function(r){r.alwaysTrue=()=>!0,r.alwaysFalse=()=>!1,r.definedPredicate=e=>e!=null})(bo||(bo={}));var Xs;(function(r){r.create=(e=252854082)=>new Fx(e),r.monotoneAscending=(e,t=128,i=r.create())=>{let n=e.length;if(n<2)return F("Array must have at least 2 elements");let o=0;for(let s=1;s<n;s++){let l=Math.floor(i.uniform()*(1+t))+1;e[s]=l,o+=l}let a=0;e[0]=0;for(let s=1;s<n;s++)a+=e[s],e[s]=a/o;return e}})(Xs||(Xs={}));var Fx=class{#e=0;constructor(e){this.setSeed(e)}setSeed(e){this.#e=e&4294967295}nextDouble(e,t){return e+this.uniform()*(t-e)}nextInt(e,t){return e+Math.floor(this.uniform()*(t-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 yr;(function(r){class e{}r.createBuilder=i=>{let n=o=>{let a=o instanceof Array?[]:{};return Object.entries(o).forEach(([s,l])=>{l instanceof e?a[s]=l.initialValue():typeof l=="object"&&(a[s]=n(l))}),a};return()=>new t(i,Object.seal(n(i)))},r.bool=new class extends e{read(i){return i.readByte()===1}write(i,n){i.writeByte(n?1:0)}initialValue(){return!1}},r.int8=new class extends e{read(i){return i.readByte()}write(i,n){i.writeByte(n)}initialValue(){return 0}},r.int16=new class extends e{read(i){return i.readShort()}write(i,n){i.writeShort(n)}initialValue(){return 0}},r.int32=new class extends e{read(i){return i.readInt()}write(i,n){i.writeInt(n)}initialValue(){return 0}},r.float=new class extends e{read(i){return i.readFloat()}write(i,n){i.writeFloat(n)}initialValue(){return 0}},r.double=new class extends e{read(i){return i.readDouble()}write(i,n){i.writeDouble(n)}initialValue(){return 0}},r.int64=new class extends e{read(i){return i.readLong()}write(i,n){i.writeLong(n)}initialValue(){return 0n}},r.floats=i=>new class extends e{read(n,o){for(let a=0;a<o.length;a++)o[a]=n.readFloat();return o}write(n,o){for(let a=0;a<o.length;a++)n.writeFloat(o[a])}initialValue(){return new Float32Array(i)}},r.doubles=i=>new class extends e{read(n,o){for(let a=0;a<o.length;a++)o[a]=n.readDouble();return o}write(n,o){for(let a=0;a<o.length;a++)n.writeDouble(o[a])}initialValue(){return new Float64Array(i)}};class t{#e;#t;#r;constructor(n,o){this.#e=n,this.#t=o,this.#r=this.#i()}get object(){return this.#t}get bytesTotal(){return this.#r}read(n){let o=(a,s)=>{Object.entries(a).forEach(([l,c])=>{let p=s;c instanceof e?p[l]=c.read(n,p[l]):typeof c=="object"&&o(c,p[l])})};o(this.#e,this.#t)}write(n){let o=(a,s)=>{Object.entries(a).forEach(([l,c])=>{let p=s;c instanceof e?c.write(n,p[l]):typeof c=="object"&&o(c,p[l])})};o(this.#e,this.#t)}#i(){let n=new Js;return this.write(n),n.count}}})(yr||(yr={}));var el=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=[]}add(e,t=!1){let i=this.#e(e),n=Ye.leftMostMapped(this.#r,i,this.#t,this.#e),o=this.#r[n];return Z(o)&&this.#t(this.#e(o),i)===0?t?(this.#r.splice(n,1,e),!0):!1:(this.#r.splice(n,0,e),!0)}getOrCreate(e,t){let i=Ye.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[i];if(Z(n)&&this.#t(this.#e(n),e)===0)return n;let o=t(e);return this.#r.splice(i,0,o),o}addMany(e){for(let t of e)this.#r.push(t);try{return this.#r.sort((t,i)=>{let n=this.#t(this.#e(t),this.#e(i));if(n===0)throw"cancel";return n}),!0}catch(t){if(t==="cancel"){let i=new Map(this.entries());return this.#r.splice(0,this.#r.length,...i.values()),this.#r.sort((n,o)=>this.#t(this.#e(n),this.#e(o))),!1}return F(t)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let t=Ye.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[t];return Z(i)&&this.#t(this.#e(i),e)===0?(this.#r.splice(t,1),i):F(`Could not remove ${e}`)}removeByKeyIfExist(e){let t=Ye.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[t];return Z(i)&&this.#t(this.#e(i),e)===0?(this.#r.splice(t,1),i):null}removeRange(e,t){this.#r.splice(e,(t??this.#r.length)-e)}removeByPredicate(e){let t=0,i=this.#r.length;for(;--i>=0;)e(this.#r[i])&&(this.#r.splice(i,1),t++);return t}get(e){return ee(this.#i(e),`Unknown key: ${e}`)}getOrThrow(e,t){let i=this.#i(e);if(Z(i))return i;throw t()}opt(e){return g.wrap(this.#i(e))}getOrNull(e){return this.#i(e)??null}getByIndex(e){return this.#r[e]}hasKey(e){return Z(this.#i(e))}hasValue(e){return Z(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(){R.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let t=Ye.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[t];return Z(i)&&this.#t(this.#e(i),e)===0?i:void 0}};var tl=(()=>{let r=g.None;return{info:e=>r.match({none:()=>Promise.resolve(),some:t=>t.info(e)}),approve:e=>r.match({none:()=>Promise.resolve(!0),some:t=>t.approve(e)}),progress:e=>r.match({none:()=>({message:"",terminate:ki}),some:t=>t.progress(e)}),install:e=>{I(r.isEmpty(),"RuntimeNotification already installed"),r=g.wrap(e)}}})();var Tc=class r{static POSITIVE_INFINITY=new r(Number.POSITIVE_INFINITY);static millis=e=>new r(e);static seconds=e=>new r(e*r.#e);static minutes=e=>new r(e*r.#t);static hours=e=>new r(e*r.#r);static days=e=>new r(e*r.#i);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)/r.#e}absMinutes(){return Math.abs(this.#n)/r.#t}absHours(){return Math.abs(this.#n)/r.#r}absDays(){return Math.abs(this.#n)/r.#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,t,i=Math.floor(Math.abs(this.#n)/1e3),n=Math.floor(i/60),o=Math.floor(n/60),a=Math.floor(o/24);return i<60?(e=i,t="second"):n<60?(e=n,t="minute"):o<24?(e=o,t="hour"):(e=a,t="day"),new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"long"}).format(e*Math.sign(this.#n),t)}toString(){if(isNaN(this.#n))return"NaN";if(!isFinite(this.#n))return"\u221E";let{d:e,h:t,m:i,s:n}=this.split();return e>0?[r.#o("d",e),r.#o("h",t),r.#o("m",i),r.#o("s",n)].join(", "):t>0?[r.#o("h",t),r.#o("m",i),r.#o("s",n)].join(", "):i>0?[r.#o("m",i),r.#o("s",n)].join(", "):n>0?r.#o("s",n):"now"}static#o=(e,t)=>{switch(e){case"d":return`${t} ${t<2?"day":"days"}`;case"h":return`${t} ${t<2?"hour":"hours"}`;case"m":return`${t} ${t<2?"minute":"minutes"}`;case"s":return`${t} ${t<2?"second":"seconds"}`;default:return zh(e)}}};var rl;(function(r){let e;(function(t){t[t.READING=0]="READING",t[t.READ=1]="READ",t[t.WRITING=2]="WRITING",t[t.WRITTEN=3]="WRITTEN"})(e||(e={})),r.writer=(t,i,n)=>{if(t.bytesTotal+1>i.byteLength)return F("Insufficient memory allocated.");let o=new Uint8Array(i),a=kt.use(i,1);return Atomics.store(o,0,e.READ),{tryWrite:()=>Atomics.compareExchange(o,0,e.READ,e.WRITING)===e.WRITING?(n(t.object),a.position=0,t.write(a),Atomics.store(o,0,e.WRITTEN),!0):!1}},r.reader=(t,i)=>{let n=new SharedArrayBuffer(t.bytesTotal+1),o=new Uint8Array(n),a=new ut(n,1);return{buffer:n,tryRead:()=>Atomics.compareExchange(o,0,e.WRITTEN,e.READING)===e.READING?(a.position=0,t.read(a),i(t.object),Atomics.store(o,0,e.READ),!0):!1}}})(rl||(rl={}));var A;(function(r){r.length=16,r.generate=()=>e(crypto.getRandomValues(new Uint8Array(r.length))),r.sha256=async t=>{let i=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",i?new Uint8Array(t.slice(0)):t).then(n=>e(new Uint8Array(n.slice(0,r.length))))},r.validateBytes=t=>r.parse(r.toString(t)),r.validateString=t=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t),r.asString=t=>r.validateString(t)?t:F(`Invalid UUID format: ${t}`),r.fromDataInput=t=>{let i=new Uint8Array(r.length);return t.readBytes(new Int8Array(i.buffer)),i},r.toDataOutput=(t,i)=>t.writeBytes(new Int8Array(i.buffer)),r.toString=t=>{let i=R.create(n=>(n+256).toString(16).substring(1),256);return i[t[0]]+i[t[1]]+i[t[2]]+i[t[3]]+"-"+i[t[4]]+i[t[5]]+"-"+i[t[6]]+i[t[7]]+"-"+i[t[8]]+i[t[9]]+"-"+i[t[10]]+i[t[11]]+i[t[12]]+i[t[13]]+i[t[14]]+i[t[15]]},r.parse=t=>{let i=t.replace(/-/g,"").toLowerCase();if(i.length!==32)return F("Invalid UUID format");let n=new Uint8Array(r.length);for(let o=0,a=0;o<32;o+=2,a++)n[a]=parseInt(i.slice(o,o+2),16);return n},r.Comparator=(t,i)=>{if(t.length!==r.length||i.length!==r.length)return F("Unexpected array length for uuid(v4)");for(let n=0;n<r.length;n++){let o=t[n]-i[n];if(o!==0)return o}return 0},r.equals=(t,i)=>r.Comparator(t,i)===0,r.newSet=t=>new el(t,r.Comparator),r.Lowest=r.parse("00000000-0000-4000-8000-000000000000"),r.Highest=r.parse("FFFFFFFF-FFFF-4FFF-BFFF-FFFFFFFFFFFF"),r.fromInt=t=>{let i=new Uint8Array(r.Lowest),n=new Uint8Array(new Uint32Array([t]).buffer);for(let o=0;o<4;o++)i[o]=n[o];return i},r.zType=t=>t.string().refine(i=>r.validateString(i),{message:"Invalid UUID format"}).transform(i=>i);let e=t=>(I(t.length===r.length,"UUID must be 16 bytes long"),t[6]=t[6]&15|64,t[8]=t[8]&63|128,t)})(A||(A={}));var xe=class r{static Empty=new r(2);#e;constructor(e=2){this.#e=R.create(()=>new Float32Array(128),e)}clear(e,t){this.#e.forEach(i=>i.fill(0,e,t))}numChannels(){return this.#e.length}getChannel(e){return e<this.numChannels()?this.#e[e]:this.#e[this.numChannels()-1]}assertSanity(){I(!this.#e.some(e=>e.some(t=>isNaN(t))),"AudioBuffer is invalid (NaN)")}channels(){return this.#e}replace(e){this.replaceInto(e.#e)}replaceInto(e){I(e.length===2,"mixLayout: target.length must be 2"),I(this.#e.length===1||this.#e.length===2,"mixLayout: target.length must be 1 or 2"),this.#e.length===1?(e[0].set(this.#e[0]),e[1].set(this.#e[0])):(e[0].set(this.#e[0]),e[1].set(this.#e[1]))}mixInto(e){I(e.length===2,"mixLayout: target.length must be 2"),I(this.#e.length===1||this.#e.length===2,"mixLayout: target.length must be 1 or 2");let[t,i]=e;if(this.#e.length===1){let[n]=this.#e;for(let o=0;o<128;o++)t[o]+=n[o],i[o]+=n[o]}else{let[n,o]=this.#e;for(let a=0;a<128;a++)t[a]+=n[a],i[a]+=o[a]}}};var dt;(function(r){r[r.Idle=0]="Idle",r[r.Attack=1]="Attack",r[r.Decay=2]="Decay",r[r.Sustain=3]="Sustain",r[r.Release=4]="Release"})(dt||(dt={}));var il=class{#e;#t=dt.Idle;#r=0;#i=0;#n=0;#o=0;#a=0;#u=0;#s=0;#l=0;#c=0;constructor(e){this.#e=1/e}get gate(){return this.#t!==dt.Idle&&this.#t!==dt.Release}get complete(){return this.#t===dt.Idle}get value(){return this.#r}get phase(){return this.#i}set(e,t,i,n){this.#n=e,this.#o=t,this.#a=i,this.#u=n,this.#d()}#d(){switch(this.#t){case dt.Attack:{let e=1-this.#r;this.#s=e*this.#e/Math.max(this.#n,1e-6);break}case dt.Decay:{let e=this.#r-this.#a;this.#l=e*this.#e/Math.max(this.#o,1e-6);break}case dt.Release:{let e=this.#r;this.#c=e*this.#e/Math.max(this.#u,1e-6);break}case dt.Sustain:case dt.Idle:{this.#s=this.#e/Math.max(this.#n,1e-6),this.#l=(1-this.#a)*this.#e/Math.max(this.#o,1e-6),this.#c=this.#a*this.#e/Math.max(this.#u,1e-6);break}}}gateOn(){this.#t=dt.Attack}gateOff(){this.#t!==dt.Idle&&(this.#t=dt.Release,this.#d())}forceStop(){this.#t=dt.Idle,this.#r=0}process(e,t,i){for(let n=t;n<i;)switch(this.#t){case dt.Attack:for(;n<i;){if(this.#r+=this.#s,this.#r>=1){this.#r=1,this.#i=1,e[n++]=this.#r,this.#t=dt.Decay,this.#d();break}e[n++]=this.#i=this.#r}break;case dt.Decay:for(;n<i;){if(this.#r-=this.#l,this.#r<=this.#a){this.#r=this.#a,this.#i=2,e[n++]=this.#r,this.#t=dt.Sustain,this.#d();break}this.#i=1+(1-this.#r)/(1-this.#a),e[n++]=this.#r}break;case dt.Sustain:e.fill(this.#a,n,i);return;case dt.Release:for(;n<i;){if(this.#r-=this.#c,this.#r<=0){this.#r=0,this.#i=0,e[n++]=this.#r,this.#t=dt.Idle,this.#d();break}this.#i=3+(1-this.#r/this.#a),e[n++]=this.#r}break;case dt.Idle:e.fill(0,n,i);return}}};var nn=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,t=Math.SQRT1_2){if(e=le(e,0,1),e>=.5)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let i=$i*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=(1-o)/2,s=a,l=2*a,c=a,p=1+n,d=-2*o,f=1-n;this.setNormalizedCoefficients(s,l,c,p,d,f)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}setHighpassParams(e,t=Math.SQRT1_2){if(e=le(e,0,1),e===1)this.setNormalizedCoefficients(0,0,0,1,0,0);else if(e>0){let i=$i*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=(1+o)/2,s=a,l=-2*a,c=a,p=1+n,d=-2*o,f=1-n;this.setNormalizedCoefficients(s,l,c,p,d,f)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNormalizedCoefficients(e,t,i,n,o,a){let s=1/n;return this.b0=e*s,this.b1=t*s,this.b2=i*s,this.a1=o*s,this.a2=a*s,this}setLowShelfParams(e,t){e=le(e,0,1);let i=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(i*i,0,0,1,0,0);else if(e>0){let n=$i*e,a=.5*Math.sin(n)*Math.sqrt((i+1/i)*(1/1-1)+2),s=Math.cos(n),l=2*Math.sqrt(i)*a,c=i+1,p=i-1,d=i*(c-p*s+l),f=2*i*(p-c*s),v=i*(c-p*s-l),m=c+p*s+l,y=-2*(p+c*s),x=c+p*s-l;this.setNormalizedCoefficients(d,f,v,m,y,x)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setHighShelfParams(e,t){e=le(e,0,1);let i=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let n=$i*e,a=.5*Math.sin(n)*Math.sqrt((i+1/i)*(1/1-1)+2),s=Math.cos(n),l=2*Math.sqrt(i)*a,c=i+1,p=i-1,d=i*(c+p*s+l),f=-2*i*(p+c*s),v=i*(c+p*s-l),m=c-p*s+l,y=2*(p-c*s),x=c-p*s-l;this.setNormalizedCoefficients(d,f,v,m,y,x)}else this.setNormalizedCoefficients(i*i,0,0,1,0,0);return this}setPeakingParams(e,t,i){e=le(e,0,1),t=Math.max(0,t);let n=Math.pow(10,i/40);if(e>0&&e<1)if(t>0){let o=$i*e,a=Math.sin(o)/(2*t),s=Math.cos(o),l=1+a*n,c=-2*s,p=1-a*n,d=1+a/n,f=-2*s,v=1-a/n;this.setNormalizedCoefficients(l,c,p,d,f,v)}else this.setNormalizedCoefficients(n*n,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setAllpassParams(e,t){if(e=le(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let i=$i*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=1-n,s=-2*o,l=1+n,c=1+n,p=-2*o,d=1-n;this.setNormalizedCoefficients(a,s,l,c,p,d)}else this.setNormalizedCoefficients(-1,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNotchParams(e,t){if(e=le(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let i=$i*e,n=Math.sin(i)/(2*t),o=Math.cos(i),a=1,s=-2*o,l=1,c=1+n,p=-2*o,d=1-n;this.setNormalizedCoefficients(a,s,l,c,p,d)}else this.setNormalizedCoefficients(0,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setBandpassParams(e,t){if(e=Math.max(0,e),t=Math.max(0,t),e>0&&e<1){let i=$i*e;if(t>0){let n=Math.sin(i)/(2*t),o=Math.cos(i),a=n,s=0,l=-n,c=1+n,p=-2*o,d=1-n;this.setNormalizedCoefficients(a,s,l,c,p,d)}else this.setNormalizedCoefficients(1,0,0,1,0,0)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}getFrequencyResponse(e,t,i){I(e.length===t.length&&e.length===i.length,"Array lengths do not match");let n=this.b0,o=this.b1,a=this.b2,s=this.a1,l=this.a2;for(let c=0;c<e.length;++c){let p=-Math.PI*2*e[c],d=Math.cos(p),f=Math.sin(p),v=n+((o+a*d)*d-a*f*f),m=(o+a*d)*f+a*f*d,y=1+((s+l*d)*d-l*f*f),x=(s+l*d)*f+l*f*d,M=y*y+x*x,D=(v*y+m*x)/M,O=(m*y-v*x)/M;t[c]=Math.sqrt(D*D+O*O),i[c]=Math.atan2(O,D)}}};var Pt=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:t,b0:i,b1:n,b2:o},a,s,l,c){let p=this.#e,d=this.#t,f=this.#r,v=this.#i;for(let m=l;m<c;m++){let y=a[m],x=s[m]=i*y+n*p+o*d-e*f-t*v+1e-18-1e-18;d=p,p=y,v=f,f=x}this.#e=p,this.#t=d,this.#r=f,this.#i=v}processFrame({a1:e,a2:t,b0:i,b1:n,b2:o},a){let s=i*a+n*this.#e+o*this.#t-e*this.#r-t*this.#i+1e-18-1e-18;return this.#t=this.#e,this.#e=a,this.#i=this.#r,this.#r=s,s}},Ao=class{#e;#t;constructor(e){this.#e=R.create(()=>new Pt,e),this.#t=this.#e.length}get order(){return this.#t}set order(e){this.#t!==e&&(this.#t=e,this.reset())}reset(){this.#e.forEach(e=>e.reset())}process(e,t,i,n,o){for(let a=0;a<this.#t;a++)this.#e[a].process(e,t,i,n,o),t=i}processFrame(e,t){for(let i=0;i<this.#t;i++)t=this.#e[i].processFrame(e,t);return t}},Rc=512,Zh=class{#e;#t=new nn;#r;#i=-1;constructor(e,t,i){this.#r=new Ao(4),this.#e=new Float32Array(Rc+1);let n=Math.log(t/e),o=1/i;for(let a=0;a<=Rc;a++)this.#e[a]=e*Math.exp(a/Rc*n)*o}get order(){return this.#r.order}set order(e){this.#r.order=e}reset(){this.#r.reset()}process(e,t,i,n,o,a){let s=this.#e,l=this.#r,c=this.#t,p=n/l.order**1.25,d=o,f=this.#i;for(;d<a;){let v=Math.floor(Jr(i[d])*Rc),m=d+1;for(;m<a&&Math.floor(Jr(i[m])*Rc)===v;)++m;v!==f&&(f=v,c.setLowpassParams(s[v],p)),l.process(c,e,t,d,m),d=m}this.#i=f}};var vP=Math.log(10)/20,Oc=(r=60,e=440)=>e*Math.pow(2,(r+3)/12-6);var Ve=r=>Math.exp(r*vP),Nx=r=>Math.log(r)/vP,nl=r=>Ve(20*Math.log10(r));var hB=.02,yP=1e3,Gh=class{#e;#t;#r;#i;#n;#o;#a=NaN;#u=NaN;#s=0;#l=0;#c=0;#d=8;#p=0;#h=1;#f=!1;constructor(e){this.#e=e,this.#t=Math.ceil(e*hB)|0,this.#r=new nn,this.#r.setLowpassParams(.5),this.#i=[new Pt,new Pt],this.#n=[new Float32Array(128),new Float32Array(128)],this.#o=new Float32Array(2)}process(e,t,i,n){let[o,a]=e,[s,l]=t,[c,p]=this.#n;this.#i[0].process(this.#r,o,c,i,n),this.#i[1].process(this.#r,a,p,i,n);let d=Ve(this.#p),f=Ve(-this.#p/2),v=this.#e/this.#a,m=Math.pow(2,this.#d)-1,y=1/m;for(let x=i;x<n;x++)this.#l>0&&(this.#a+=this.#s,--this.#l===0&&(this.#s=0,this.#a=this.#u),this.#r.setLowpassParams(Math.max(this.#a,yP)/this.#e)),this.#c+=1,this.#c>=v&&(this.#c-=v,this.#o[0]=le(Math.round(c[x]*d*m)*y,-1,1),this.#o[1]=le(Math.round(p[x]*d*m)*y,-1,1)),s[x]=(o[x]*(1-this.#h)+this.#o[0]*this.#h)*f,l[x]=(a[x]*(1-this.#h)+this.#o[1]*this.#h)*f;this.#f=!0}setCrush(e){let t=pP(20,this.#e*.5,e);this.#f&&isFinite(this.#a)?(this.#u=t,this.#s=(t-this.#a)/this.#t,this.#l=this.#t):(this.#a=t,this.#r.setLowpassParams(Math.max(this.#a,yP)/this.#e))}setBitDepth(e){this.#d=le(e,1,16)}setBoost(e){this.#p=e}setMix(e){this.#h=Jr(e)}reset(){this.#f=!1,this.#u=NaN,this.#s=0,this.#l=0,this.#c=0,this.#o.fill(0),this.#i[0].reset(),this.#i[1].reset()}};var qh=class r{static#e=10;#t=1;#r=0;#i=0;#n=0;#o=0;#a=0;set(e,t,i){this.#t=e,this.#r=t*r.#e,this.#i=jh(1e-5,1-1e-5,i),this.#n=2**Math.abs(this.#r),this.#o=1/this.#i,this.#a=1/(1-this.#i)}compute(e){let t=e-Math.floor(e),i,n,o,a;return this.#r<0?(i=1-t,n=1-this.#i,o=this.#a,a=this.#o):(i=t,n=this.#i,o=this.#o,a=this.#a),i<=n?1-(1-i*o)**this.#n*this.#t:((1-i)*a)**this.#n*this.#t-this.#t+1}};var Vc;(function(r){r.Comparator=(e,t)=>e.position-t.position,r.PositionExtractor=e=>e.position})(Vc||(Vc={}));var Ca;(function(r){r.complete=e=>e.position+e.duration,r.DescendingComparator=(e,t)=>r.complete(t)-r.complete(e)})(Ca||(Ca={}));var Gt;(function(r){r.globalToLocal=(t,i)=>Dc(i-t.position+t.loopOffset,t.loopDuration),r.locateLoop=({position:t,complete:i,loopOffset:n,loopDuration:o},a,s)=>{let l=t-n,c=l+o;if(l>=s||c<=a)return g.None;let p=Math.max(l,a),d=Math.min(c,s);return g.wrap({index:0,rawStart:l,rawEnd:c,regionStart:Math.max(l,t),regionEnd:Math.min(c,i),resultStart:p,resultEnd:d,resultStartValue:l<p?(p-l)/o:0,resultEndValue:c>d?(d-l)/o:1})};function*e({position:t,complete:i,loopOffset:n,loopDuration:o},a,s){let l=t-n,c=Math.max(t,a),p=Math.min(i,s),d=Math.floor((c-l)/o),f=l+d*o;for(;f<p;){let v=f+o,m=Math.max(f,t),y=Math.min(v,i),x=Math.max(f,c),M=Math.min(v,p),D=f<x?(x-f)/o:0,O=v>M?(M-f)/o:1;yield{index:d++,rawStart:f,rawEnd:v,regionStart:m,regionEnd:y,resultStart:x,resultEnd:M,resultStartValue:D,resultEndValue:O},f=v}}r.locateLoops=e})(Gt||(Gt={}));var xr=class r{static DefaultComparator=(e,t)=>e.position-t.position;static create(e){return new r(e??r.DefaultComparator)}#e;constructor(e){this.#e=new Hh(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,t){return this.#e.lowerEqual(e,t)}greaterEqual(e,t){return this.#e.greaterEqual(e,t)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,t){return this.#e.isEmpty()?Kn.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t,i){return this.#e.isEmpty()?Kn.empty():this.#e.iterate(this.#e.ceilFirstIndex(e),t,i)}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()}},_o=class r{static Comparator=(e,t)=>e.position-t.position;static create(e){return new r(e)}#e;constructor(e=r.Comparator){this.#e=new Hh(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,t){return this.#e.lowerEqual(e,t)}greaterEqual(e,t){return this.#e.greaterEqual(e,t)}floorLastIndex(e){return this.#e.floorLastIndex(e)}ceilFirstIndex(e){return this.#e.ceilFirstIndex(e)}iterateFrom(e,t){return this.#e.isEmpty()?Kn.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t){if(this.#e.isEmpty())return Kn.empty();let i=Math.max(0,this.#e.floorLastIndex(e)),n=this.#e.optAt(i);if(n===null)return Kn.empty();for(;n.position+n.duration<=e;)if(n=this.#e.optAt(++i),n===null||n.position>=t)return Kn.empty();return this.#e.iterate(i,t)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},ol=class{#e;constructor(){this.#e=[]}addAndRetain(e){if(this.#e.length===0)this.#e.push(e);else{let t=Ye.leftMost(this.#e,e,Ca.DescendingComparator);this.#e.splice(t,0,e)}}*overlapping(e,t){let i=this.#e.filter(n=>n.position<=e&&e<n.position+n.duration);yield*Z(t)?i.sort(t):i}*releaseLinearCompleted(e){if(this.#e.length!==0)for(let t=this.#e.length-1;t>=0;t--){let i=this.#e[t];if(Ca.complete(i)<e)this.#e.splice(t,1),yield i;else return}}*releaseAll(){if(this.#e.length!==0)for(let e=this.#e.length-1;e>=0;e--){let t=this.#e[e];Number.POSITIVE_INFINITY>t.duration&&(this.#e.splice(e,1),yield t)}}isEmpty(){return this.#e.length===0}nonEmpty(){return this.#e.length>0}clear(){R.clear(this.#e)}},Hh=class{comparator;#e=[];#t=!1;modCount=0;constructor(e){this.comparator=e}add(e){++this.modCount,this.#e.push(e),this.#e.length>1&&(this.#t=!0)}remove(e){++this.modCount;let t=this.#e.indexOf(e);return t===-1?!1:(this.#e.splice(t,1),!0)}contains(e){if(this.#e.length===0)return!1;this.#t&&this.#r();let i=e.position,n=Ye.leftMostMapped(this.#e,i,Mc,Vc.PositionExtractor);for(let o=n;o<this.#e.length;o++){let a=this.#e[o];if(a===e)return!0;if(a.position!==i)return!1}return!1}clear(){++this.modCount,R.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,t){if(t===void 0)return this.optAt(this.floorLastIndex(e));let i=this.floorLastIndex(e);for(;i>=0;){let n=this.#e[i--];if(t(n))return n}return null}greaterEqual(e,t){if(t===void 0)return this.optAt(this.ceilFirstIndex(e));let i=this.ceilFirstIndex(e);for(;i<this.#e.length;){let n=this.#e[i++];if(t(n))return n}return null}floorLastIndex(e){return this.#t&&this.#r(),Ye.rightMostMapped(this.#e,e,Mc,Vc.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),Ye.leftMostMapped(this.#e,e,Mc,Vc.PositionExtractor)}iterateFrom(e,t){let i=this.floorLastIndex(e),n=i;if(n<0)return this.iterate(0,rr.MAX_VALUE,t);for(;n>=0;){let o=this.optAt(n);if(o!==null&&t!==void 0&&t(o))return this.iterate(n,rr.MAX_VALUE,t);n--}return this.iterate(i,rr.MAX_VALUE,t)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,t,i=bo.alwaysTrue){for(this.#t&&this.#r();e<this.#e.length;){let n=this.#e[e++];if(n.position>=t)return;i(n)&&(yield n)}}#r(){this.#e.sort(this.comparator),this.#t=!1}};var Oh=class r{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 t=e/2;this.#t=32-Math.floor(Math.log2(e))|0,this.#r=new Float32Array(t),this.#i=new Float32Array(t);for(let i=0;i<t;i++){let n=2*Math.PI*i/e;this.#r[i]=Math.cos(n),this.#i[i]=Math.sin(n)}}process(e,t){let i,n,o,a;for(let c=0;c<this.#e;++c)n=r.reverse(c)>>>this.#t,n>c&&(a=e[c],e[c]=e[n],e[n]=a,a=t[c],t[c]=t[n],t[n]=a);let s=this.#r,l=this.#i;for(let c=2;c<=this.#e;c<<=1){let p=c>>1,d=this.#e/c;for(i=0;i<this.#e;i+=c){let f=i+p;for(n=i,o=0;n<f;n++,o=o+d|0){let v=n+p|0,m=s[o],y=l[o],x=e[v],M=t[v],D=x*m+M*y,O=M*m-x*y,T=e[n],V=t[n];e[v]=T-D,t[v]=V-O,e[n]=T+D,t[n]=V+O}}if(c===this.#e)break}}};var kx=r=>{let e=.25*r+.25;return 4*(Math.abs(e-Math.round(e))-.25)};var $x=(r,e)=>Math.floor(3840/e)*r,xP=(r,e=4,t=4)=>{let i=$x(1,t),n=Math.floor(r/i),o=Math.floor(n/e),s=(Math.floor(r)-$x(o*e,t))%i,l=Math.floor(s/240),c=s%240;return{bars:o,beats:n-o*e,semiquavers:l,ticks:c}},wP=(r,e)=>r*e/60*960,bP=(r,e)=>r*60/960/e,fB=(r,e)=>e*60/960/r,mB=(r,e,t)=>wP(r/t,e),gB=(r,e,t)=>bP(r,e)*t,Q={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:$x,toParts:xP,secondsToPulses:wP,pulsesToSeconds:bP,secondsToBpm:fB,samplesToPulses:mB,pulsesToSamples:gB,toString:(r,e=4,t=4)=>{let{bars:i,beats:n,semiquavers:o,ticks:a}=xP(r|0,e,t);return`${i+1}.${n+1}.${o+1}:${a}`}};var ir;(function(r){r.builder=()=>new e,r.toDouble=([t,i])=>t/i,r.toPPQN=([t,i])=>Q.fromSignature(t,i);class e{#e=[];add(i){return this.#e.push(i),this}asArray(){return this.#e}asAscendingArray(){return this.#e.toSorted((i,n)=>r.toDouble(i)-r.toDouble(n))}asDescendingArray(){return this.#e.toSorted((i,n)=>r.toDouble(n)-r.toDouble(i))}}})(ir||(ir={}));var on=class{static*iterate(e,t,i){let n=Math.ceil(e/i),o=n*i;for(;o<t;)yield o,o=++n*i}static*iterateWithIndex(e,t,i){let n=Math.ceil(e/i),o=n*i;for(;o<t;)yield{position:o,index:n},o=++n*i}};var al=class{#e=0;#t=NaN;#r=NaN;#i=0;#n=0;constructor(){}reset(){this.#e=0,this.#t=NaN,this.#r=NaN,this.#i=0,this.#n=0}init(e){this.#e=e,isNaN(this.#t)&&(this.#t=this.#e)}currentFrequency(){return this.#t}glideTo(e,t){if(t===0){this.#e=e;return}this.#e=this.#t,this.#r=e,this.#i=0,this.#n=t}process(e,t,i,n){if(isNaN(this.#r)){for(let o=i;o<n;o++)e[o]*=this.#e;this.#t=this.#e}else{let o=Q.samplesToPulses(1,t,sampleRate);for(let a=i;a<n;a++){if(this.#i+=o/this.#n,this.#i>=1){this.#i=1,this.#e=this.#r,this.#r=NaN;for(let s=a;s<n;s++)e[s]*=this.#e;break}e[a]*=this.#t=this.#e+(this.#r-this.#e)*this.#i}}}advance(e,t,i){if(isNaN(this.#r))this.#t=this.#e;else{let n=Q.samplesToPulses(i-t,e,sampleRate);this.#i+=n/this.#n,this.#i>=1?(this.#i=1,this.#e=this.#t=this.#r,this.#r=NaN):this.#t=this.#e+(this.#r-this.#e)*this.#i}}};var Jh=class{#e;#t;constructor(){this.#e=[],this.#t=new Map}addVertex(e){I(!this.#e.includes(e),"Vertex already exists"),this.#e.push(e),I(!this.#t.has(e),"Predecessor already exists"),this.#t.set(e,[])}removeVertex(e){R.remove(this.#e,e);let t=this.#t.delete(e);I(t,"Predecessor does not exists")}getPredecessors(e){return this.#t.get(e)??R.empty()}predecessors(){return this.#t}vertices(){return this.#e}addEdge([e,t]){let i=ee(this.#t.get(t),`[add] Edge has unannounced vertex. (${t})`);I(!i.includes(e),`${e} is already marked.`),i.push(e)}removeEdge([e,t]){let i=ee(this.#t.get(t),`[remove] Edge has unannounced vertex. (${t})`);I(i.includes(e),`${e} is not marked.`),R.remove(i,e)}isEmpty(){return this.#e.length===0}},Qh=class{#e;#t;#r;#i;#n;constructor(e){this.#e=e,this.#t=[],this.#r=new Set,this.#i=new Set,this.#n=new Map}update(){this.#o(),this.#e.vertices().forEach(e=>this.#a(e))}sorted(){return this.#t}hasLoops(){return this.#i.size!==0}#o(){this.#u();let e=new Map;for(let i of this.#e.vertices())this.#n.set(i,new Set),e.set(i,new Set);for(let i of this.#e.vertices())for(let n of this.#e.getPredecessors(i))ee(this.#n.get(n),`Could not find Successor for ${n}`).add(i);let t;do{t=!1;for(let i of this.#e.vertices()){ee(e.get(i)).clear();for(let n of ee(this.#n.get(i)))for(let o of ee(this.#n.get(n)))this.#n.get(i)?.has(o)||(t=!0,ee(e.get(i)).add(o))}for(let i of this.#e.vertices()){let n=ee(this.#n.get(i));ee(e.get(i)).forEach(o=>n.add(o))}}while(t)}#a(e){if(!this.#r.has(e)){this.#r.add(e);for(let t of this.#e.getPredecessors(e)){if(ee(this.#n.get(e)).has(t)){this.#i.add(e),this.#i.add(t);continue}this.#a(t)}this.#t.push(e)}}#u(){R.clear(this.#t),this.#r.clear(),this.#i.clear(),this.#n.clear()}};var zc;(function(r){r.Identity={warp:e=>e,unwarp:e=>e}})(zc||(zc={}));var Yh=class{#e;constructor(e){this.#e=e}warp(e){return this.#t(!0,e)}unwarp(e){return this.#t(!1,e)}#t(e,t){let i=this.#e.duration(),n=jn(t,i),o=(t-n)/i,a=e?this.#e.fx(o):this.#e.fy(o);return n+a*i}};var We;(function(r){r[r.sine=0]="sine",r[r.triangle=1]="triangle",r[r.saw=2]="saw",r[r.square=3]="square"})(We||(We={}));var Xh=class{sampleRate;#e=0;constructor(e){this.sampleRate=e}fill(e,t,i,n,o){let a=i/this.sampleRate;switch(t){case We.sine:{for(let s=n;s<o;s++)e[s]=Math.sin(this.#e*Math.PI*2),this.#e+=a,this.#e>=1&&(this.#e-=1);break}case We.triangle:{for(let s=n;s<o;s++){let l=this.#e%1;e[s]=4*Math.abs(l-.5)-1,this.#e+=a,this.#e>=1&&(this.#e-=1)}break}case We.saw:{for(let s=n;s<o;s++){let l=this.#e%1;e[s]=2*l-1,this.#e+=a,this.#e>=1&&(this.#e-=1)}break}case We.square:{for(let s=n;s<o;s++){let l=this.#e%1;e[s]=l<.5?1:-1,this.#e+=a,this.#e>=1&&(this.#e-=1)}break}}}reset(){this.#e=0}};var an;(function(r){r[r.Linear=0]="Linear",r[r.EqualPower=1]="EqualPower"})(an||(an={}));var ef;(function(r){r.BlackKeyIndices=[1,3,6,8,10],r.BlackKeyBits=r.BlackKeyIndices.reduce((t,i)=>t|=1<<i,0),r.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"]},r.isBlackKey=t=>(r.BlackKeyBits&1<<t%12)!==0,r.toFullString=t=>`${r.Names.English[t%12]}${Math.floor(t/12)-2}`,r.keyboardTracking=(t,i)=>Jr((t-60)*i);class e{#e;#t;constructor(i,...n){this.#e=i,this.#t=n.reduce((o,a)=>o|=1<<a,0)}get name(){return this.#e}get bits(){return this.#t}has(i){return(this.#t&1<<i%12)!==0}equals(i){return this.#t===i.bits}}r.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)]})(ef||(ef={}));var nr;(function(r){r.isOfType=e=>e.type==="note-event",r.Comparator=(e,t)=>{let i=e.position-t.position;if(i!==0)return i;let n=e.pitch-t.pitch;return n!==0?n:0},r.curveFunc=(e,t)=>t<0?e**2**-t:1-(1-e)**2**t,r.inverseCurveFunc=(e,t)=>t<0?e**2**t:1-Math.max(0,1-e)**2**-t,r.CompleteComparator=(e,t)=>{let i=Ca.complete(e)-Ca.complete(t);return i!==0?i:e.pitch-t.pitch}})(nr||(nr={}));var Uc=class{#e;#t=0;#r=0;constructor(e){this.#e=1/e}generate(e,t,i,n,o){let a=t*this.#e;switch(i){case We.sine:this.#i(e,a,n,o);break;case We.saw:this.#n(e,a,n,o);break;case We.square:this.#o(e,a,n,o);break;case We.triangle:this.#a(e,a,n,o);break}}generateFromFrequencies(e,t,i,n,o){switch(i){case We.sine:this.#u(e,t,n,o);break;case We.saw:this.#s(e,t,n,o);break;case We.square:this.#l(e,t,n,o);break;case We.triangle:this.#c(e,t,n,o);break}}#i(e,t,i,n){let o=this.#t;for(let a=i;a<n;a++)e[a]=Math.sin(2*Math.PI*(o%1)),o+=t;this.#t=o}#n(e,t,i,n){let o=this.#t;for(let a=i;a<n;a++){let s=o%1;e[a]=2*s-1-sn(s,t),o+=t}this.#t=o}#o(e,t,i,n){let o=this.#t;for(let a=i;a<n;a++){let s=o%1;e[a]=(s<.5?1:-1)+sn(s,t)-sn((s+.5)%1,t),o+=t}this.#t=o}#a(e,t,i,n){let o=this.#t,a=this.#r,s=4*t;for(let l=i;l<n;l++){let c=o%1,p=(c<.5?1:-1)+sn(c,t)-sn((c+.5)%1,t);a=a*.9995+p*s,e[l]=a,o+=t}this.#t=o,this.#r=a}#u(e,t,i,n){let o=this.#e,a=this.#t;for(let s=i;s<n;s++)e[s]=Math.sin(2*Math.PI*(a%1)),a+=t[s]*o;this.#t=a}#s(e,t,i,n){let o=this.#e,a=this.#t;for(let s=i;s<n;s++){let l=t[s]*o,c=a%1;e[s]=2*c-1-sn(c,l),a+=l}this.#t=a}#l(e,t,i,n){let o=this.#e,a=this.#t;for(let s=i;s<n;s++){let l=t[s]*o,c=a%1;e[s]=(c<.5?1:-1)+sn(c,l)-sn((c+.5)%1,l),a+=l}this.#t=a}#c(e,t,i,n){let o=this.#e,a=this.#t,s=this.#r;for(let l=i;l<n;l++){let c=t[l]*o,p=a%1,d=(p<.5?1:-1)+sn(p,c)-sn((p+.5)%1,c);s=s*.9995+d*(4*c),e[l]=s,a+=c}this.#t=a,this.#r=s}},sn=(r,e)=>r<e?(r/=e,r+r-r*r-1):r>1-e?(r=(r-1)/e,r*r+r+r+1):0;var Wn;(function(r){r.zero=()=>({ll:0,lr:0,rl:0,rr:0}),r.identity=()=>({ll:1,lr:0,rl:0,rr:1}),r.update=(e,{gain:t,panning:i,invertL:n,invertR:o,stereo:a,swap:s},l=an.EqualPower)=>{let[c,p]=r.panningToGains(i,l),d=c*t,f=p*t;n&&(d*=-1),o&&(f*=-1);let v=Math.max(0,-a),m=Math.max(0,a),y=1-m,x=1+m,M=v*.5,D=1-v,O=(y+x)*.5,T=(y-x)*.5,V=(y-x)*.5,Y=(y+x)*.5,ne=d*(M+D)*O+f*M*T,G=d*(M+D)*V+f*M*Y,de=d*M*O+f*(M+D)*T,oe=d*M*V+f*(M+D)*Y;s?(e.ll=G,e.rl=ne,e.lr=oe,e.rr=de):(e.ll=ne,e.lr=de,e.rl=G,e.rr=oe)},r.panningToGains=(e,t)=>{let i=le(e,-1,1);switch(t){case an.Linear:return[Math.min(1-i,1),Math.min(i+1,1)];case an.EqualPower:return[Math.cos((i+1)*bx),Math.sin((i+1)*bx)]}},r.applyFrame=(e,t,i)=>[e.ll*t+e.rl*i,e.lr*t+e.rr*i],r.processFrames=(e,t,i,n,o)=>{let[a,s]=t,[l,c]=i;for(let p=n;p<o;p++){let d=a[p],f=s[p];l[p]=e.ll*d+e.rl*f,c[p]=e.lr*d+e.rr*f}},r.replaceFrames=(e,[t,i],n,o)=>{for(let a=n;a<o;a++){let s=t[a],l=i[a];t[a]=e.ll*s+e.rl*l,i[a]=e.lr*s+e.rr*l}}})(Wn||(Wn={}));var qt;(function(r){r.linear=(i,n=.005)=>new e(Math.ceil(i*n)|0),r.stereoMatrix=(i,n=.005)=>new t(Math.ceil(i*n)|0);class e{#e;#t=0;#r=0;#i=0;#n=0;constructor(n){this.#e=n}set(n,o){this.#t!==n&&(o===!0?(this.#r=n,this.#i=(n-this.#t)/this.#e,this.#n=this.#e):(this.#t=this.#r=n,this.#i=0,this.#n=0))}get(){return this.#t}moveAndGet(){return 0<this.#n&&(this.#t+=this.#i,--this.#n===0&&(this.#i=0,this.#t=this.#r)),this.#t}isFixed(n){return this.#t===n&&this.#n===0}isInterpolating(){return this.#n>0}}class t{#e;#t=Wn.zero();#r=Wn.zero();#i=Wn.zero();#n=0;constructor(n){this.#e=n}update(n,o,a){Wn.update(this.#r,n,o),a===!0?(this.#i.ll=(this.#r.ll-this.#t.ll)/this.#e,this.#i.lr=(this.#r.lr-this.#t.lr)/this.#e,this.#i.rl=(this.#r.rl-this.#t.rl)/this.#e,this.#i.rr=(this.#r.rr-this.#t.rr)/this.#e,this.#n=this.#e):(this.#t.ll=this.#r.ll,this.#t.lr=this.#r.lr,this.#t.rl=this.#r.rl,this.#t.rr=this.#r.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#n=0)}processFrames(n,o,a,s){let[l,c]=n,[p,d]=o;if(this.isInterpolating())for(let f=a;f<s;f++){let v=l[f],m=c[f],y=this.moveAndGet();p[f]=y.ll*v+y.rl*m,d[f]=y.lr*v+y.rr*m}else{let f=this.#r;for(let v=a;v<s;v++){let m=l[v],y=c[v];p[v]=f.ll*m+f.rl*y,d[v]=f.lr*m+f.rr*y}}}set(n,o){this.#o(n)||(o===!0?(this.#r.ll=n.ll,this.#r.lr=n.lr,this.#r.rl=n.rl,this.#r.rr=n.rr,this.#i.ll=(n.ll-this.#t.ll)/this.#e,this.#i.lr=(n.lr-this.#t.lr)/this.#e,this.#i.rl=(n.rl-this.#t.rl)/this.#e,this.#i.rr=(n.rr-this.#t.rr)/this.#e,this.#n=this.#e):(this.#t.ll=this.#r.ll=n.ll,this.#t.lr=this.#r.lr=n.lr,this.#t.rl=this.#r.rl=n.rl,this.#t.rr=this.#r.rr=n.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#n=0))}get(){return this.#t}moveAndGet(){return 0<this.#n&&(this.#t.ll+=this.#i.ll,this.#t.lr+=this.#i.lr,this.#t.rl+=this.#i.rl,this.#t.rr+=this.#i.rr,--this.#n===0&&(this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#t.ll=this.#r.ll,this.#t.lr=this.#r.lr,this.#t.rl=this.#r.rl,this.#t.rr=this.#r.rr)),this.#t}isFixed(n){return this.#o(n)&&this.#n===0}isInterpolating(){return this.#n>0}#o(n){return this.#t.ll===n.ll&&this.#t.lr===n.lr&&this.#t.rl===n.rl&&this.#t.rr===n.rr}}r.StereoMatrixRamp=t})(qt||(qt={}));var jc=new Float32Array([-.00048076361,0,.00174689293,0,-.00421638042,0,.00854519755,0,-.01627072692,0,.03203375191,0,-.08251235634,0,.31203505397,.5,.31203505397,0,-.08251235634,0,.03203375191,0,-.01627072692,0,.00854519755,0,-.00421638042,0,.00174689293,0,-.00048076361]),Mx=new Float32Array(12),AP=new Float32Array(11);for(let r=0,e=0,t=0;r<jc.length;r++)r%2===0?Mx[e++]=jc[r]:AP[t++]=jc[r];var Dx=class{#e=new Float32Array(Mx.length);#t=new Float32Array(jc.length);#r=0;#i=0;reset(){this.#e.fill(0),this.#t.fill(0),this.#r=0,this.#i=0}upsample(e,t,i,n){let o=this.#e,a=Mx,s=AP;for(let l=i;l<n;l++){let c=e[l],p=(l-i)*2;o[this.#r]=c;let d=0;for(let v=0;v<a.length;v++){let m=(this.#r-v+o.length)%o.length;d+=o[m]*a[v]}t[p]=d*2;let f=0;for(let v=0;v<s.length;v++){let m=(this.#r-v+o.length-1)%o.length;f+=o[m]*s[v]}t[p+1]=f*2,this.#r=(this.#r+1)%o.length}}downsample(e,t,i,n){let o=this.#t,a=jc;for(let s=i;s<n;s++){let l=(s-i)*2;o[this.#i]=e[l],this.#i=(this.#i+1)%o.length,o[this.#i]=e[l+1],this.#i=(this.#i+1)%o.length;let c=0;for(let p=0;p<a.length;p++){let d=(this.#i-1-p+o.length)%o.length;c+=o[d]*a[p]}t[s]=c}}},tf=class{#e;#t;#r;constructor(e){this.#e=e;let t=e===2?1:e===4?2:3;this.#t=R.create(()=>new Dx,t),this.#r=R.create(i=>new Float32Array(128*(2<<i)),t-1)}reset(){this.#t.forEach(e=>e.reset())}upsample(e,t,i,n){let o=n-i,a=e,s=i,l=n;for(let c=0;c<this.#t.length;c++){let d=c===this.#t.length-1?t:this.#r[c];this.#t[c].upsample(a,d,s,l),a=d,s=0,l=o*(2<<c)}}downsample(e,t,i,n){let o=n-i,a=e,s=o*this.#e;for(let l=this.#t.length-1;l>=0;l--){let c=l===0,p=c?t:this.#r[l-1],d=c?i:0,f=c?n:s/2;this.#t[l].downsample(a,p,d,f),a=p,s=f}}},rf=class{#e;#t;constructor(e){this.#e=new tf(e),this.#t=new tf(e)}reset(){this.#e.reset(),this.#t.reset()}upsample(e,t,i,n){this.#e.upsample(e[0],t[0],i,n),this.#t.upsample(e[1],t[1],i,n)}downsample(e,t,i,n){this.#e.downsample(e[0],t[0],i,n),this.#t.downsample(e[1],t[1],i,n)}};var sl=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 t=e*e;return this.#i-=this.#e[this.#r],this.#i+=t,this.#e[this.#r]=t,++this.#r===this.#e.length&&(this.#r=0),this.#i<=0?0:Math.sqrt(this.#i*this.#t)}processBlock(e,t,i){let n=this.#e,o=n.length,a=this.#r,s=this.#i;for(let l=t;l<i;l++){let c=e[l]*e[l];s+=c-n[a],n[a]=c,++a===o&&(a=0)}return this.#r=a,this.#i=s,s<=0?0:Math.sqrt(s*this.#t)}clear(){this.#e.fill(0),this.#i=0,this.#r=0}};var nf=class r{static#e=.003;static#t=.02;#r;#i;#n=0;constructor(e){this.#r=Math.pow(.01,1/(r.#e*e)),this.#i=Math.pow(.01,1/(r.#t*e))}clear(){this.#n=0}replace(e,t,i){let n=this.#r,o=this.#i,[a,s]=e.channels(),l=this.#n;for(let c=t;c<i;++c){let p=a[c],d=s[c],f=Math.max(Math.abs(p),Math.abs(d));if(l=f>l?n*(l-f)+f:o*(l-f)+f,l>1){let v=1/l;a[c]=p*v,s[c]=d*v}}this.#n=l}};var Mi=class{#e;value=0;constructor(e,t){this.#e=1-Math.exp(-1/(e*t))}process(e){return this.value+=this.#e*(e-this.value),this.value}};var of=class{#e=new U;#t;#r;constructor(e){this.#t=this.#e.own(new te),this.#e.own(e.subscribe(t=>{this.#r=t.getValue(),this.#t.notify(this)})),this.#r=e.getValue()}subscribe(e){return this.#t.subscribe(e)}getTempoAt(e){return this.#r}ppqnToSeconds(e){return Q.pulsesToSeconds(e,this.#r)}secondsToPPQN(e){return Q.secondsToPulses(e,this.#r)}intervalToSeconds(e,t){return Q.pulsesToSeconds(t-e,this.#r)}intervalToPPQN(e,t){return Q.secondsToPulses(t-e,this.#r)}terminate(){this.#t.terminate()}};var or;(function(r){r.Musical="musical",r.Seconds="seconds"})(or||(or={}));var Po;(function(r){function e(i,n,o){return new Cx(i,n,o)}r.musical=e;function t(i,n,o,a){return new Ix(i,n,o,a)}r.aware=t})(Po||(Po={}));var Ix=class{#e;#t;#r;#i;constructor(e,t,i,n){this.#i=n,this.#t=t,this.#r=i,this.#e=e}toPPQN(){let e=this.#i.getValue();if(this.getTimeBase()===or.Musical)return e;let t=this.#r.getValue(),i=this.#e.ppqnToSeconds(t),n=i+e;return this.#e.intervalToPPQN(i,n)}fromPPQN(e){if(this.getTimeBase()===or.Musical)this.#i.setValue(e);else{let t=this.#r.getValue(),i=this.#e.intervalToSeconds(t,t+e);this.#i.setValue(i)}}toSeconds(){let e=this.#i.getValue();if(this.getTimeBase()===or.Seconds)return e;let t=this.#r.getValue();return this.#e.intervalToSeconds(t,t+e)}toSamples(e){return this.toSeconds()*e}rawValue(){return this.#i.getValue()}getTimeBase(){return Hr(this.#t.getValue(),or)}},Cx=class{#e;#t;#r;constructor(e,t,i){this.#r=i,this.#t=t,this.#e=e}toPPQN(){return this.#r.getValue()}fromPPQN(e){this.#r.setValue(e)}toSeconds(){let e=this.#r.getValue(),t=this.#t.getValue();return this.#e.intervalToSeconds(t,t+e)}toSamples(e){return this.toSeconds()*e}rawValue(){return this.#r.getValue()}getTimeBase(){return or.Musical}};var af=Q.fromSignature(1,384);var So={None:{type:"none"},Linear:{type:"linear"},Curve:r=>({type:"curve",slope:r})},sf;(function(r){r.Comparator=(n,o)=>{let a=n.position-o.position;if(a!==0)return a;let s=n.index-o.index;return s!==0?s:n===o?0:F(`${n} and ${o} are identical in terms of comparison`)};function*e(n,o,a){if(n.isEmpty())return Xe.empty();for(let s of n.iterateFrom(o))if(yield s,s.position>=a)return}r.iterateWindow=e,r.nextEvent=(n,o)=>{let a=n.asArray(),s=Ye.rightMost(a,o,r.Comparator);return s===-1?null:a[s+1]??null},r.valueAt=(n,o,a)=>{if(n.isEmpty())return a;let s=n.iterateFrom(o),{done:l,value:c}=s.next();if(l)return a;if(c.position<=o){let{done:p,value:d}=s.next();if(p)return c.value;if(o<d.position)return i(c,d,o);if(c.interpolation===So.None)return c.value}return c.value};function*t(n,o,a,s){if(n.isEmpty())return;let l=n.iterateFrom(o),{done:c,value:p}=l.next();if(c)return;let d=a/s,f=p;if(f.position>o){for(;o<f.position;)if(yield{position:o,value:f.value},o+=d,o>a)return;f.position<=a&&(yield f)}for(;o<=a;){let{done:v,value:m}=l.next();if(v)break;for(;o<m.position;){if(o>a)return;yield{position:o,value:i(f,m,o)},o+=d}m.position<a&&(f.interpolation===So.None&&(yield{position:m.position,value:f.value}),yield m),f=m}for(;o<=a;)yield{position:o,value:f.value},o+=d}r.quantise=t;let i=({value:n,position:o,interpolation:a},s,l)=>a.type==="none"?n:a.type==="linear"?n+(l-o)/(s.position-o)*(s.value-n):a.type==="curve"?Qr.valueAt({slope:a.slope,steps:s.position-o,y0:n,y1:s.value},l-o):F("Unknown interpolation")})(sf||(sf={}));var kc;(function(r){let e;(function(t){t[t.Bartlett=0]="Bartlett",t[t.Blackman=1]="Blackman",t[t.BlackmanHarris=2]="BlackmanHarris",t[t.Hamming=3]="Hamming",t[t.Hanning=4]="Hanning"})(e=r.Type||(r.Type={})),r.create=(t,i)=>{let n=new Float32Array(i),o=Math.PI/(i-1);switch(t){case e.Bartlett:{let a=(i>>1)-1,s=0;for(;s<=a;++s)n[s]=2*s/(i-1);for(;s<i;++s)n[s]=2-2*s/(i-1);return n}case e.Blackman:{let a=2*o,s=4*o;for(let l=0;l<i;++l)n[l]=.42323-.49755*Math.cos(a*l)+.07922*Math.cos(s*l);return n}case e.BlackmanHarris:{let a=2*o,s=4*o,l=6*o;for(let c=0;c<i;++c)n[c]=.35875-.48829*Math.cos(a*c)+.14128*Math.cos(s*c)-.01168*Math.cos(l*c);return n}case e.Hamming:{let a=2*o;for(let s=0;s<i;++s)n[s]=.54-.46*Math.cos(a*s);return n}case e.Hanning:{let a=2*o;for(let s=0;s<i;++s)n[s]=.5-.5*Math.cos(a*s);return n}}}})(kc||(kc={}));var lf=class extends AudioWorkletProcessor{#e;#t;#r;#i;#n;#o=0;constructor({processorOptions:{sab:e,numberOfChannels:t,rmsWindowInSeconds:i,valueDecay:n}}){super(),this.#e=t,this.#t=new Float32Array(t),this.#r=new Float32Array(t),this.#i=R.create(()=>new sl(sampleRate*i),t);let o=yr.createBuilder({peak:yr.floats(t),rms:yr.floats(t)})();this.#n=rl.writer(o,e,a=>{let s=Math.exp(-(128*this.#o)/(sampleRate*n));for(let l=0;l<t;++l){let c=this.#t[l],p=this.#r[l];a.peak[l]=c,a.rms[l]=Math.sqrt(p),this.#t[l]=c*s,this.#r[l]=p*s}this.#o=0})}process([e]){for(let t=0;t<this.#e;++t){let i=e[t];if(i===void 0)this.#t[t]=0,this.#r[t]=0;else{let n=this.#i[t],o=this.#t[t],a=this.#r[t];for(let s=0;s<128;++s){let l=i[s];o=Math.max(o,Math.abs(l)),a=Math.max(a,n.pushPop(l*l))}this.#t[t]=o,this.#r[t]=a}}return this.#o++,this.#n.tryWrite(),!0}};var Ae=class r{static newSet(e){return new el(e,r.Comparator)}static compose=(e,...t)=>{let i=t.length===0?this.#e:new Int16Array(t);return I(i.every((n,o)=>n===t[o]),`fieldKeys (${i.join(",")}) only allows i16`),new r(e,i)};static decode(e){let t=e.split("/");return I(t.length>0,"Unable to parse Address"),r.compose(A.parse(t[0]),...t.slice(1).map(i=>parseInt(i)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,t,i){let n=e.values(),o=Ye.leftMostMapped(n,t,A.Comparator,i),a=n.length;if(o<0||o>=a)return null;for(let s=o;s<a;s++)if(A.Comparator(i(n[s]),t)!==0)return o<s?[o,s]:null;return[o,a]}static Comparator=(e,t)=>{let i=A.Comparator(e.#t,t.#t);if(i!==0)return i;let n=Math.min(e.#r.length,t.#r.length);for(let o=0;o<n;o++){let a=e.#r[o]-t.#r[o];if(a!==0)return a}return e.#r.length-t.#r.length};static MinimalComparator=(e,t)=>{let i=A.Comparator(e.#t,t.#t);if(i!==0)return i;let n=Math.min(e.#r.length,t.#r.length);for(let o=0;o<n;o++){let a=e.#r[o]-t.#r[o];if(a!==0)return a}return 0};static LengthComparator=(e,t)=>{let i=A.Comparator(e.#t,t.#t);return i!==0?i:t.#r.length-e.#r.length};static#e=new Int16Array(0);#t;#r;constructor(e,t){this.#t=e,this.#r=t}get uuid(){return this.#t}get fieldKeys(){return this.#r}isBox(){return this.#r.length===0}isContent(){return!this.isBox()}equals(e){return r.Comparator(this,e)===0}compareTo(e){return r.Comparator(this,e)}append(e){return new r(this.#t,new Int16Array([...this.#r,e]))}startsWith(e){return A.Comparator(e.#t,this.#t)===0&&e.#r.length<=this.#r.length&&e.#r.every((t,i)=>this.#r[i]===t)}write(e){e.writeBytes(new Int8Array(this.#t.buffer)),e.writeByte(this.#r.length),this.#r.forEach(t=>e.writeShort(t))}moveTo(e){return new r(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(A.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,A.length),e.buffer}toString(){return[A.toString(this.#t),...this.#r].join("/")}static read(e){let t=A.fromDataInput(e),i=e.readByte();return r.compose(t,...R.create(()=>e.readShort(),i))}},Ta;(function(r){r.AddressReader=e=>e.address,r.Comparator=({address:e},{address:t})=>Ae.Comparator(e,t),r.equals=(e,t)=>{let[i,n]=Ye.rangeMapped(t,e,Ae.Comparator,r.AddressReader);return t.slice(i,n+1)},r.startsWith=(e,t)=>{let[i,n]=Ye.rangeMapped(t,e,Ae.MinimalComparator,r.AddressReader);return t.slice(i,n+1).filter(o=>o.address.startsWith(e))},r.endsWith=(e,t)=>{let i=Ye.leftMostMapped(t,e,Ae.LengthComparator,r.AddressReader),n=Ye.rightMostMapped(t,e,Ae.MinimalComparator,r.AddressReader);return t.slice(i,n+1).filter(o=>e.startsWith(o.address))}})(Ta||(Ta={}));var ln=class r{static validate(e,t){if(e.address.equals(t.address))return g.wrap(`PointerField cannot point to itself: ${e}`);if(!t.pointerRules.accepts.some(i=>i===e.pointerType)){let i=t.pointerRules.accepts.join(", ");return g.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${i}).`)}return g.None}#e;#t;constructor(e){this.#e=e,this.#t=new $t}subscribe(e,...t){return this.#r(this.#t,e,t)}catchupAndSubscribe(e,...t){let i=Ae.newSet(n=>n.address);return i.addMany(this.filter(...t)),i.forEach(n=>e.onAdded(n)),this.subscribe({onAdded:n=>{i.add(n)&&e.onAdded(n)},onRemoved:n=>{i.removeByKey(n.address),e.onRemoved(n)}},...t)}filter(...e){return e.length===0?this.incoming():Xe.filter(this.incoming().values(),t=>e.some(i=>i===t.pointerType))}size(){return this.incoming().length}isEmpty(){return this.size()===0}nonEmpty(){return this.size()>0}contains(e){return this.incoming().some(t=>e.address.equals(t.address))}incoming(){return this.#e.graph.edges().incomingEdgesOf(this.#e).slice()}onAdded(e){let t=r.validate(e,this.#e);if(t.nonEmpty())return F(t.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,t,i){return e.subscribe({onAdded:n=>{(i.length===0||i.some(o=>o===n.pointerType))&&t.onAdded(n)},onRemoved:n=>{(i.length===0||i.some(o=>o===n.pointerType))&&t.onRemoved(n)}})}};var Tx=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(o=(n<3?a(o):n>3?a(e,t,o):a(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ll=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},W=class r{static hook(e){return new r(e)}#e;#t;#r;#i;#n;constructor({parent:e,fieldKey:t,fieldName:i,pointerRules:n,deprecated:o}){this.#e=e,this.#t=t,this.#r=i,this.#i=n,this.#n=o,n.mandatory&&this.graph.edges().watchVertex(this)}accept(e){return _(e.visitField,this)}get box(){return this.#e.box}get graph(){return this.#e.graph}get parent(){return this.#e}get fieldKey(){return this.#t}get fieldName(){return this.#r}get pointerRules(){return this.#i}get deprecated(){return this.#n}get pointerHub(){return new ln(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 R.empty()}record(){return Dr.empty()}getField(e){return F()}optField(e){return g.None}read(e){}write(e){}toJSON(){}fromJSON(e){return F("fromJSON should never be called on a field")}disconnect(){if(this.pointerHub.isEmpty())return;let e=this.pointerHub.incoming();e.forEach(t=>{t.defer(),(t.mandatory||this.pointerRules.mandatory&&e.length===1)&&t.box.delete()})}toString(){return`{${this.box.constructor.name}:${this.constructor.name} (${this.fieldName}) ${this.address.toString()}`}};Tx([Qs,ll("design:type",ln),ll("design:paramtypes",[])],W.prototype,"pointerHub",null);Tx([Qs,ll("design:type",Ae),ll("design:paramtypes",[])],W.prototype,"address",null);Tx([Qs,ll("design:type",String),ll("design:paramtypes",[])],W.prototype,"debugPath",null);var h=Object.freeze({mandatory:!1,accepts:[]});var uf=class r extends W{static create(e,t,i){return new r(e,t,i)}#e;constructor(e,t,i){super(e),this.#e=R.create(n=>t({parent:this,fieldKey:n,fieldName:String(n),pointerRules:h,deprecated:e.deprecated}),i)}accept(e){return _(e.visitArrayField,this)}fields(){return this.#e}record(){return R.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return ee(this.#e[e])}optField(e){return g.wrap(this.#e[e])}read(e){this.#e.forEach(t=>t.read(e))}write(e){this.#e.filter(t=>!t.deprecated).forEach(t=>t.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((t,i)=>this.#e[i].fromJSON(t));else return F("Type mismatch")}};var Eo;(function(r){r.writeFields=(t,i)=>{let n=Object.entries(i).filter(([o,a])=>!a.deprecated);t.writeInt(1179403347),t.writeShort(n.length),n.forEach(([o,a])=>{let s=kt.create();a.write(s);let l=new Int8Array(s.toArrayBuffer());t.writeShort(Number(o)),t.writeInt(l.length),t.writeBytes(l)})},r.readFields=(t,i)=>{I(t.readInt()===1179403347,"Serializer header is corrupt");let n=t.readShort();for(let o=0;o<n;o++){let a=t.readShort();if(Hs(i[a]))continue;let s=t.readInt(),l=new Int8Array(s);t.readBytes(l);let{status:c,error:p}=zn(()=>i[a]?.read(new ut(l.buffer)));c==="failure"&&console.warn(i,p)}}})(Eo||(Eo={}));var vB=function(r,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,i);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(o=(n<3?a(o):n>3?a(e,t,o):a(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},_P=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},N=class r{static DEBUG_DELETION=!1;static Index=0;#e;#t;#r;#i;#n;#o=r.Index++;constructor({uuid:e,graph:t,name:i,pointerRules:n}){this.#e=Ae.compose(e),this.#t=t,this.#r=i,this.#i=n,this.#n=this.initializeFields(),n.mandatory&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#n)}record(){return this.#n}getField(e){return ee(this.#n[e],()=>`Field ${String(e)} not found in ${this.toString()}`)}optField(e){return g.wrap(this.#n[e])}subscribe(e,t){return this.graph.subscribeVertexUpdates(e,this.address,t)}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 creationIndex(){return this.#o}get pointerHub(){return new ln(this)}estimateMemory(){let e=new Js;return this.write(e),e.count}isBox(){return!0}asBox(e){return Ne(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){Eo.readFields(e,this.#n)}write(e){Eo.writeFields(e,this.#n)}serialize(){let e=kt.create();return e.writeInt(this.#o),e.writeString(this.name),e.writeBytes(new Int8Array(this.address.uuid.buffer)),this.write(e),e.toArrayBuffer()}toArrayBuffer(){let e=kt.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#n).reduce((e,[t,i])=>{let n=i.toJSON();return Z(n)&&(e[t]=n),e},{})}fromJSON(e){if(Vh(e))Object.entries(e).forEach(([t,i])=>{let n=this.#n[parseInt(t)];Z(i)&&n.fromJSON(i)});else return F("Type mismatch")}incomingEdges(){return this.graph.edges().incomingEdgesOf(this)}outgoingEdges(){return this.graph.edges().outgoingEdgesOf(this)}mapFields(e,...t){if(t.length===0)return R.empty();let i=this.getField(t[0]),n=[e(i)];for(let o=1;o<t.length;o++)i=i.getField(t[o]),n.push(e(i));return n}searchVertex(e){if(e.length===0)return g.wrap(this);let t=this.optField(e[0]);if(t.isEmpty())return g.None;for(let i=1;i<e.length;i++)if(t=t.unwrap().optField(e[i]),t.isEmpty())return g.None;return t}delete(){if(!this.isAttached())return;let{boxes:e,pointers:t}=this.graph.dependenciesOf(this);r.DEBUG_DELETION&&(console.debug(`Delete ${this.toString()}`),console.debug(" unplugs",[...t].map(i=>i.toString()).join(`
2
2
  `)),console.debug(" unstages",[...e].map(i=>i.toString()).join(`
3
- `),this));for(let i of t)i.defer();for(let i of e)i.unstage();this.unstage()}unstage(){this.graph.unstageBox(this)}isValid(){if(this.#i.mandatory&&this.pointerHub.incoming().length===0)return!1;let e=t=>t.every(i=>i.accept({visitPointerField:n=>!n.mandatory||n.nonEmpty(),visitArrayField:n=>e(n.fields()),visitObjectField:n=>e(n.fields()),visitPrimitiveField:n=>!0,visitField:n=>!0})??!0);return e(this.fields())}toString(){return`${this.constructor.name} ${this.address.toString()}`}};fB([Gs,wP("design:type",sn),wP("design:paramtypes",[])],N.prototype,"pointerHub",null);var Tc;(function(r){r.clampInt32=(e,t)=>t,r.clampFloat32=(e,t)=>t})(Tc||(Tc={}));var Fe;(function(r){r[r.This=0]="This",r[r.Parent=1]="Parent",r[r.Children=2]="Children"})(Fe||(Fe={}));var af;(function(r){r.create=()=>new Rx})(af||(af={}));var Rx=class{#e=new Rc(ka.equals);#t=new Rc(ka.startsWith);#r=new Rc(ka.endsWith);#i=[];#n=0;#o=!1;subscribe(e,t,i){let n=new Ox(t,e,this.#n++,i);if(this.#o){let o=new Vx(n,e);return this.#i.push(o),o}else return this.subscribeMonitor(n,e)}dispatch(e){this.#o=!0,[...this.#e.filter(e),...this.#t.filter(e),...this.#r.filter(e)].sort(({order:i},{order:n})=>i-n).forEach(i=>i.procedure(e)),this.#o=!1,this.#i.forEach(i=>i.subscribe(this)),this.#i.length=0}subscribeMonitor(e,t){switch(t){case Fe.This:return this.#e.subscribe(e);case Fe.Parent:return this.#t.subscribe(e);case Fe.Children:return this.#r.subscribe(e);default:return Th(t)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},Ox=class{address;propagation;order;procedure;constructor(e,t,i,n){this.address=e,this.propagation=t,this.order=i,this.procedure=n}toString(){return`{ Monitor address: ${this.address}, propagation: ${Fe[this.propagation]}, order: ${this.order} }`}},Rc=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 t=this.#e.length;for(;--t>=0;)this.#e[t]===e&&this.#e.splice(t,1)}}}stations(){return this.#t||(this.#e.sort(ka.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},Vx=class{monitor;propagation;#e=new z;#t=!1;constructor(e,t){this.monitor=e,this.propagation=t}subscribe(e){this.#t||(this.#e.terminate(),this.#e.own(e.subscribeMonitor(this.monitor,this.propagation)))}terminate(){this.#t=!0,this.#e.terminate()}};var dt;(function(r){r.Boolean="boolean",r.Float32="float32",r.Int32="int32",r.String="string",r.Bytes="bytes"})(dt||(dt={}));var Ma={[dt.Boolean]:{type:dt.Boolean,encode:(r,e)=>r.writeBoolean(e),decode:r=>r.readBoolean()},[dt.Float32]:{type:dt.Float32,encode:(r,e)=>r.writeFloat(e),decode:r=>r.readFloat()},[dt.Int32]:{type:dt.Int32,encode:(r,e)=>r.writeInt(e),decode:r=>r.readInt()},[dt.String]:{type:dt.String,encode:(r,e)=>r.writeString(e),decode:r=>r.readString()},[dt.Bytes]:{type:dt.Bytes,encode:(r,e)=>{r.writeInt(e.length),r.writeBytes(e)},decode:r=>{let e=new Int8Array(r.readInt());return r.readBytes(e),e}}},$a=class extends W{#e;#t;#r;constructor(e,t,i){super(e),this.#e=t,this.#t=i,this.#r=this.#t}accept(e){return _(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Fe.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){D(this.graph.constructingBox(),"Cannot change initial value at runtime"),this.setValue(this.#t=this.clamp(e))}getValue(){return this.#r}setValue(e){let t=this.#r,i=this.clamp(e);this.equals(i)||(this.#r=i,this.graph.onPrimitiveValueUpdate(this,t,i))}writeValue(e,t){D(!this.deprecated,"PrimitiveField.write: deprecated field"),this.serialization().encode(e,t)}readValue(e){return this.serialization().decode(e)}toJSON(){if(this.deprecated)return;let e=this.getValue();return ArrayBuffer.isView(e)?F("not implemented"):e}fromJSON(e){return F("Type mismatch")}reset(){this.setValue(this.#t)}},M=class r extends $a{static create(e,t=!1){return new r(e,t)}constructor(e,t){super(e,dt.Boolean,t)}toggle(){this.setValue(!this.getValue())}serialization(){return Ma[dt.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){D(!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()))}},w=class r extends $a{static create(e,t,i,n=0){return new r(e,t,i,n)}#e;#t;constructor(e,t,i,n){super(e,dt.Float32,n),this.#e=t,this.#t=i}serialization(){return Ma[dt.Float32]}equals(e){return this.getValue()===e}clamp(e){return Tc.clampFloat32(this.#e,zn.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){D(!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()))}},S=class r extends $a{static create(e,t,i,n=0){return new r(e,t,i,n)}#e;#t;constructor(e,t,i,n){super(e,dt.Int32,n),this.#e=t,this.#t=i}serialization(){return Ma[dt.Int32]}equals(e){return this.getValue()===e}clamp(e){return Tc.clampInt32(this.#e,tr.toInt(e))}read(e){this.setValue(e.readInt())}write(e){D(!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>=tr.MIN_VALUE&&e<=tr.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},C=class r extends $a{static create(e,t=""){return new r(e,t)}constructor(e,t){super(e,dt.String,t)}serialization(){return Ma[dt.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){D(!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()))}},bP=class r extends $a{static create(e,t=this.#e){return new r(e,t)}static#e=Object.freeze(new Int8Array(0));constructor(e,t){super(e,dt.Bytes,t)}serialization(){return Ma[dt.Bytes]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){let t=new Int8Array(e.readInt());e.readBytes(t),this.setValue(t)}write(e){D(!this.deprecated,"ByteArrayField.write: deprecated field");let t=this.getValue();e.writeInt(t.length),e.writeBytes(t)}toJSON(){if(!this.deprecated)return Array.from(this.getValue().values())}fromJSON(e){this.deprecated||(Array.isArray(e)&&e.every(t=>typeof t=="number")?this.setValue(new Int8Array(e)):console.warn("ByteArrayField Type mismatch",e,this.address.toString()))}};var AP;(function(r){r.decode=e=>{let t=e.readInt();return O.create(()=>{switch(e.readString()){case"new":{let n=A.fromDataInput(e),o=e.readString(),a=new Int8Array(e.readInt());return e.readBytes(a),new Oc(n,o,a.buffer)}case"pointer":{let n=we.read(e),o=e.readBoolean()?g.wrap(we.read(e)):g.None,a=e.readBoolean()?g.wrap(we.read(e)):g.None;return new zc(n,o,a)}case"primitive":{let n=we.read(e),o=e.readString(),a=Ma[o],s=a.decode(e),u=a.decode(e);return new Vc(n,a,s,u)}case"delete":{let n=A.fromDataInput(e),o=e.readString(),a=new Int8Array(e.readInt());return e.readBytes(a),new Uc(n,o,a.buffer)}}},t)}})(AP||(AP={}));var Oc=class{type="new";#e;#t;#r;constructor(e,t,i){this.#e=e,this.#t=t,this.#r=i}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.createBox(this.#t,this.#e,t=>t.read(new ot(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),A.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${A.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},Vc=class{type="primitive";#e;#t;#r;#i;constructor(e,t,i,n){this.#e=e,this.#t=t,this.#r=i,this.#i=n}get address(){return this.#e}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}`}},zc=class{type="pointer";#e;#t;#r;constructor(e,t,i){this.#e=e,this.#t=t,this.#r=i}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:t=>{e.writeBoolean(!0),t.write(e)}}),this.#r.match({none:()=>e.writeBoolean(!1),some:t=>{e.writeBoolean(!0),t.write(e)}})}toString(){return`{PointerUpdate oldValue: ${this.#t.unwrapOrNull()}, newValue: ${this.#r.unwrapOrNull()}`}},Uc=class{type="delete";#e;#t;#r;constructor(e,t,i){this.#e=e,this.#t=t,this.#r=i}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,t=>t.read(new ot(this.#r)))}write(e){e.writeString(this.type),A.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${A.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var jC=Symbol("Unreferenceable"),B=class r extends W{static create(e,t,i){return new r(e,t,i)}static encodeWith(e,t){D(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=g.wrap(e);let i=On(t);if(this.#e=g.None,i.status==="failure")throw i.error;return i.value}static decodeWith(e,t){D(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=g.wrap(e);let i=On(t);if(this.#t=g.None,i.status==="failure")throw i.error;return i.value}static#e=g.None;static#t=g.None;#r;#i;#n=g.None;#o=g.None;constructor(e,t,i){super(e),this.#r=t,this.#i=i,i&&this.graph.edges().watchVertex(this)}get pointerHub(){return F(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return _(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Fe.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}refer(e){this.targetVertex=g.wrap(e)}defer(){this.targetVertex=g.None}get targetVertex(){return this.graph.inTransaction()?this.#o.flatMap(e=>this.graph.findVertex(e)):this.#n}set targetVertex(e){if(e.nonEmpty()){let t=sn.validate(this,e.unwrap());t.nonEmpty()&&F(t.unwrap())}this.targetAddress=e.map(t=>t.address)}get targetAddress(){return this.#o}set targetAddress(e){let t=this.#o;t.isEmpty()&&e.isEmpty()||(e.nonEmpty()&&t.unwrapOrNull()?.equals(e.unwrap()))===!0||(this.#o=e,this.graph.onPointerAddressUpdated(this,t,e))}isEmpty(){return this.targetAddress.isEmpty()}nonEmpty(){return this.targetAddress.nonEmpty()}ifVertex(e){this.targetVertex.nonEmpty()&&e(this.targetVertex.unwrap())}resolvedTo(e){this.#n=e}read(e){let t=e.readBoolean()?g.wrap(we.read(e)):g.None;this.targetAddress=r.#t.match({none:()=>t,some:i=>i.map(this,t)})}write(e){D(!this.deprecated,"PointerField.write: deprecated field"),r.#e.match({none:()=>this.#o,some:t=>t.map(this)}).match({none:()=>e.writeBoolean(!1),some:t=>{e.writeBoolean(!0),t.write(e)}})}toJSON(){if(!this.deprecated)return r.#e.match({none:()=>this.#o,some:e=>e.map(this)}).match({none:()=>null,some:e=>e.toString()})}fromJSON(e){if(!this.deprecated)if(Rn(e)||typeof e=="string"){let t=g.wrap(Rn(e)?null:we.decode(e));this.targetAddress=r.#t.match({none:()=>t,some:i=>i.map(this,t)})}else return F(`Pointer: Type mismatch. value (${typeof e}) must be a string.`)}};var sf=class{#e;#t;#r;#i;constructor(){this.#e=we.newSet(e=>e.address),this.#t=we.newSet(e=>e.address),this.#r=we.newSet(([e])=>e),this.#i=we.newSet(([e])=>e.address)}watchVertex(e){if(Me(e,B)){if(!e.mandatory)return F("watchVertex called but has no edge requirement");this.#e.add(e)}else{if(!e.pointerRules.mandatory)return F("watchVertex called but has no edge requirement");this.#t.add(e)}}unwatchVerticesOf(...e){let t=({box:{address:{uuid:i}}})=>i;for(let{address:{uuid:i}}of e)this.#o(this.#e,i,t),this.#o(this.#t,i,t);for(let i of e){let n=this.outgoingEdgesOf(i);if(n.length>0)return F(`${i} has outgoing edges: ${n.map(([a,s])=>`[${a.toString()}, ${s.toString()}]`)}`);let o=this.incomingEdgesOf(i);if(o.length>0)return F(`${i} has incoming edges from: ${o.map(a=>a.toString())}`)}}connect(e,t){this.#i.add([e,t]),this.#r.opt(t).match({none:()=>this.#r.add([t,[e]]),some:([,i])=>i.push(e)})}disconnect(e){let[,t]=this.#i.removeByKey(e.address),[,i]=this.#r.get(t);O.remove(i,e),i.length===0&&this.#r.removeByKey(t)}isConnected(e,t){return this.#i.opt(e.address).mapOr(([,i])=>i.equals(t),!1)}outgoingEdgesOf(e){return this.#n(this.#i,e.address.uuid,([{box:{address:{uuid:t}}}])=>t)}incomingEdgesOf(e){return e.isBox()?this.#n(this.#r,e.address.uuid,([{uuid:t}])=>t).flatMap(([t,i])=>i):this.#r.opt(e.address).mapOr(([t,i])=>i,O.empty())}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?F(`Pointer ${e.toString()} requires an edge.`):F(`Illegal state: ${e} has no edge requirements.`)}),this.#t.forEach(e=>{if(e.pointerHub.isEmpty())return e.pointerRules.mandatory?F(`Target ${e.toString()} requires an edge.`):F(`Illegal state: ${e} has no edge requirements.`)})}#n(e,t,i){let n=we.boxRange(e,t,i);return Z(n)?e.values().slice(n[0],n[1]):O.empty()}#o(e,t,i){let n=we.boxRange(e,t,i);Z(n)&&e.removeRange(n[0],n[1])}};var Da=class{#e;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c=!1;#d=!1;constructor(e=g.None){this.#e=e,this.#t=A.newSet(t=>t.address.uuid),this.#r=[],this.#a=af.create(),this.#i=new Ft,this.#n=new Ft,this.#o=new Ft,this.#l=new sf,this.#s=we.newSet(({pointer:t})=>t.address),this.#u=[]}beginTransaction(){D(!this.#c,"Transaction already in progress"),this.#c=!0,this.#o.proxy.onBeginTransaction()}endTransaction(){for(D(this.#c,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:t})=>this.#p(e,t)),this.#r.length=0),this.#s.values().toSorted((e,t)=>e.index-t.index).forEach(({pointer:e,initial:t,final:i})=>{t.equals(i)||(t.ifSome(n=>this.findVertex(n).unwrapOrUndefined()?.pointerHub.onRemoved(e)),i.ifSome(n=>this.findVertex(n).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#s.clear(),this.#c=!1;this.#u.length>0;)this.#u.splice(0).forEach(e=>e()),this.#u.length>0&&console.debug(`${this.#u.length} new observers while notifying`);this.#o.proxy.onEndTransaction()}inTransaction(){return this.#c}constructingBox(){return this.#d}createBox(e,t,i){return this.#e.unwrap("No box-factory installed")(e,this,t,i)}stageBox(e,t){this.#h(),D(!this.#d,"Cannot construct box while other box is constructing"),Z(t)&&(this.#d=!0,t(e),this.#d=!1);let i=this.#t.add(e);D(i,`${e} already staged`);let n=new Oc(e.address.uuid,e.name,e.toArrayBuffer());return this.#i.proxy.onUpdate(n),this.#n.proxy.onUpdate(n),e}subscribeTransaction(e){return this.#o.subscribe(e)}subscribeToAllUpdates(e){return this.#i.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#n.subscribe(e)}subscribeVertexUpdates(e,t,i){return this.#a.subscribe(e,t,i)}subscribeEndTransaction(e){this.#u.push(e)}unstageBox(e){this.#h();let t=this.#t.removeByKey(e.address.uuid);D(t===e,`${e} could not be found to unstage`),this.#l.unwatchVerticesOf(e);let i=new Uc(e.address.uuid,e.name,e.toArrayBuffer());this.#i.proxy.onUpdate(i),this.#n.proxy.onUpdate(i)}findBox(e){return this.#t.opt(e)}findVertex(e){return this.#t.opt(e.uuid).flatMap(t=>t.searchVertex(e.fieldKeys))}boxes(){return this.#t.values()}edges(){return this.#l}checksum(){let e=new zh;return this.boxes().forEach(t=>t.write(e)),e.result()}onPrimitiveValueUpdate(e,t,i){if(this.#h(),e.isAttached()&&!this.#d){let n=new Vc(e.address,e.serialization(),t,i);this.#a.dispatch(n),this.#i.proxy.onUpdate(n),this.#n.proxy.onUpdate(n)}}onPointerAddressUpdated(e,t,i){this.#h(),t.nonEmpty()&&this.#l.disconnect(e),i.nonEmpty()&&this.#l.connect(e,i.unwrap());let n=new zc(e.address,t,i);this.#d?this.#r.push({pointerField:e,update:n}):(this.#p(e,n),this.#n.proxy.onUpdate(n))}#p(e,t){let{oldAddress:i,newAddress:n}=t;e.resolvedTo(n.flatMap(a=>this.findVertex(a))),this.#s.opt(e.address).match({none:()=>this.#s.add({pointer:e,initial:i,final:n,index:this.#s.size()}),some:a=>a.final=n}),this.#a.dispatch(t),this.#i.proxy.onUpdate(t)}dependenciesOf(e,t={}){let i=Z(t.excludeBox)?t.excludeBox:vo.alwaysFalse,n=Z(t.alwaysFollowMandatory)?t.alwaysFollowMandatory:!1,o=new Set,a=new Set,s=u=>{o.has(u)||i(u)||(o.add(u),u.outgoingEdges().filter(([c])=>!a.has(c)).forEach(([c,p])=>{let d=this.findVertex(p).unwrap(`Could not find target of ${c.toString()}`);if(a.add(c),d.pointerRules.mandatory&&(n||d.pointerHub.incoming().every(f=>a.has(f))))return s(d.box)}),u.incomingEdges().forEach(c=>{a.add(c),c.mandatory&&s(c.box)}))};return s(e),o.delete(e),{boxes:o,pointers:Array.from(a).reverse()}}verifyPointers(){this.#l.validateRequirements();let e=0,t=i=>{for(let n of i.fields())n.accept({visitPointerField:o=>{if(o.targetAddress.nonEmpty()){let a=o.targetVertex.nonEmpty(),s=this.findVertex(o.targetAddress.unwrap()).nonEmpty();D(a,`pointer ${o.address} is broken`),D(s,`Cannot find target for pointer ${o.address}`),e++}},visitObjectField:o=>t(o)})};return this.#t.forEach(i=>t(i)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#t.values().reduce((e,t)=>(e[A.toString(t.address.uuid)]={class:t.name,"incoming links":t.incomingEdges().length,"outgoing links":t.outgoingEdges().length,"est. memory (bytes)":t.estimateMemory()},e),{}))}debugDependencies(){console.debug("Dependencies:"),this.boxes().forEach(e=>{console.debug(` ${e}`);for(let t of this.dependenciesOf(e).boxes)console.debug(` ${t}`)})}addressToDebugPath(e){return e.flatMap(t=>t.isBox()?this.findBox(t.uuid).map(i=>i.name):this.findBox(t.uuid).flatMap(i=>i.searchVertex(t.fieldKeys).map(n=>n.isField()?n.debugPath:F("Unknown address"))))}toArrayBuffer(){let e=Bt.create(),t=this.#t.values();return e.writeInt(t.length),t.forEach(i=>{let n=i.serialize();e.writeInt(n.byteLength),e.writeBytes(new Int8Array(n))}),e.toArrayBuffer()}fromArrayBuffer(e){D(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let t=new ot(e),i=t.readInt();this.beginTransaction();let n=[];for(let o=0;o<i;o++){let a=t.readInt(),s=new Int8Array(a);t.readBytes(s);let u=new ot(s.buffer),c=u.readInt(),p=u.readString(),d=A.fromDataInput(u);n.push({creationIndex:c,name:p,uuid:d,boxStream:u})}n.sort((o,a)=>o.creationIndex-a.creationIndex).forEach(({name:o,uuid:a,boxStream:s})=>this.createBox(o,a,u=>u.read(s))),this.endTransaction()}toJSON(){return this.#t.values().map(e=>({name:e.name,uuid:e.address.toString(),fields:Y(e.toJSON())}))}#h(){D(this.#c,()=>"Modification only prohibited in transaction mode.")}};var ol;(function(r){r.insertOrder=(e,t=Number.MAX_SAFE_INTEGER)=>{let i=r.collectIndexedBoxes(e),n=ce(t,0,i.length);if(n<i.length)for(let o=n;o<i.length;o++)i[o].index.setValue(o+1);return n},r.removeOrder=(e,t)=>{let i=r.collectIndexedBoxes(e);if(t<i.length)for(let n=t+1;n<i.length;n++)i[n].index.setValue(n-1)},r.moveIndex=(e,t,i)=>{let n=r.collectIndexedBoxes(e),o=n[t];if(i<0){let a=ce(t+i,0,n.length-1);for(let s=a;s<t;s++)n[s].index.setValue(s+1);o.index.setValue(a)}else if(i>1){let a=ce(t+(i-1),0,n.length-1);for(let s=t;s<a;s++)n[s+1].index.setValue(s);o.index.setValue(a)}else console.warn(`moveIndex had no effect: startIndex: ${t}, delta: ${i}`)},r.isIndexedBox=e=>"index"in e&&e.index instanceof S,r.collectIndexedBoxes=(e,t)=>e.pointerHub.incoming().map(({box:i})=>r.isIndexedBox(i)&&(t===void 0||i instanceof t)?i:F(`${i} has no index field`)).sort((i,n)=>i.index.getValue()-n.index.getValue())})(ol||(ol={}));var Oe=class extends W{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return _(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return Y(this.#e[e])}optField(e){return g.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(Fe.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){Ao.readFields(e,this.#e)}write(e){Ao.writeFields(e,this.#e)}toJSON(){if(!this.deprecated)return Object.entries(this.#e).reduce((e,[t,i])=>(e[t]=i.toJSON(),e),{})}fromJSON(e){if(!this.deprecated)if(Ch(e))Object.entries(e).forEach(([t,i])=>{let n=this.#e[parseInt(t)];Z(i)&&n.fromJSON(i)});else return F("Type mismatch")}};var Ln;(function(r){r.sender=(n,o)=>o(new t(n)),r.executor=(n,o)=>new i(n,o);let e=n=>{let o=[];for(let a of n)a instanceof MessagePort&&o.push(a),typeof ImageBitmap<"u"&&a instanceof ImageBitmap&&o.push(a),typeof OffscreenCanvas<"u"&&a instanceof OffscreenCanvas&&o.push(a);return o};class t{#e;#t=new Map;#r;#i=0;constructor(o){this.#e=o,this.#r=o.subscribe(this.#n)}terminate(){this.#r.terminate()}dispatchAndForget=(o,...a)=>{let s=e(a);this.#e.send({type:"send",returnId:!1,func:o.name,args:Array.from(Je.map(a,u=>({value:u})))},s)};dispatchAndReturn=(o,...a)=>new Promise((s,u)=>{let c=Je.reduce(a,(d,f,v)=>(typeof f=="function"&&d.push([v,f]),d),[]);this.#t.set(this.#i,{executorTuple:{resolve:s,reject:u},callbacks:new Map(c)});let p=e(a);this.#e.send({type:"send",returnId:this.#i,func:o.name,args:Array.from(Je.map(a,(d,f)=>typeof d=="function"?{callback:f}:{value:d}))},p),this.#i++});#n=o=>{let a=this.#t.get(o.returnId);Z(a)?o.type==="resolve"?(a.executorTuple.resolve(o.resolve),this.#t.delete(o.returnId)):o.type==="reject"?(a.executorTuple.reject(o.reject),this.#t.delete(o.returnId)):o.type==="callback"&&a.callbacks?.get(o.funcAt).apply(this,o.args):F(`Promise has already been resolved. ${JSON.stringify(o)}`)}}class i{#e;#t;#r;constructor(o,a){this.#e=o,this.#t=a,this.#r=o.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=o=>{D(o.type==="send",()=>"Message type must be 'send'");let a=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),s=Y(a[o.func],`${o.func.toString()} does not exists on ${this.#t}`),u=o.returnId;if(u===!1)s.apply(this.#t,o.args.map(c=>"value"in c?c.value:F(`${o.func.toString()} has no promise.`)));else try{s.apply(this.#t,o.args.map(p=>"callback"in p?(...d)=>this.#a(u,p.callback,d):p.value)).then(p=>{try{this.#n(u,p)}catch(d){this.#o(u,d)}},p=>this.#o(u,p))}catch(c){this.#o(u,c)}};#n=(o,a)=>this.#e.send({type:"resolve",returnId:o,resolve:a});#o=(o,a)=>this.#e.send({type:"reject",returnId:o,reject:a});#a=(o,a,s)=>this.#e.send({type:"callback",returnId:o,funcAt:a,args:s})}r.Executor=i})(Ln||(Ln={}));var _P={for:r=>new zx(r)},mB=[],zx=class{#e;#t=new ee;constructor(e){if(this.#e=e,Z(e.onmessage)||Z(e.onmessageerror))throw console.error(e),new Error(`${e} is already wrapped.`);e.onmessage=t=>this.#t.notify(t.data),e.onmessageerror=t=>{throw new Error(t.type)}}send(e,t){this.#e.postMessage(e,t??mB)}channel(e){return new Ux(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},Ux=class r{#e;#t;#r=new ee;#i;constructor(e,t){this.#e=e,this.#t=t,this.#i=e.subscribe(i=>{"__id__"in i&&i.__id__==="42"&&"message"in i&&"channel"in i&&i.channel===t&&this.#r.notify(i.message)})}send(e,t){this.#e.send({__id__:"42",channel:this.#t,message:e},t)}channel(e){return new r(this,e)}subscribe(e){return this.#r.subscribe(e)}terminate(){this.#i.terminate(),this.#r.terminate()}};var lf;(function(r){r.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),r.frames=e=>new Promise(t=>{let i=e,n=()=>{--i<=0?t():requestAnimationFrame(n)};requestAnimationFrame(n)}),r.timeSpan=(e,...t)=>new Promise(i=>setTimeout(i,e.millis(),...t)),r.event=(e,t)=>new Promise(i=>e.addEventListener(t,i,{once:!0})),r.observable=e=>new Promise(t=>{let i=e.subscribe(()=>{i.terminate(),t()})}),r.complete=e=>new Promise((t,i)=>{let n=setInterval(()=>{let{status:o,value:a,error:s}=On(()=>e.next());if(o==="success"){let{done:u,value:c}=a;u&&(clearInterval(n),t(c))}else clearInterval(n),i(s)},0)})})(lf||(lf={}));var jx=class{maxRetry;timeSpan;#e=0;constructor(e,t){this.maxRetry=e,this.timeSpan=t}retry(e,t){return++this.#e===this.maxRetry?!1:(console.debug(`${e} > will retry in ${this.timeSpan.toString()}`),setTimeout(t,this.timeSpan.millis()),!0)}},uf;(function(r){class e{value;status="resolved";constructor(s){this.value=s}error=Ba("Cannot access error when promise is resolved")}r.ResolveResult=e;class t{error;status="rejected";constructor(s){this.error=s}value=Ba("Cannot access value when promise is rejected")}r.RejectedResult=t,r.makeAbortable=async(a,s)=>{let u=!0;return a.own(K.create(()=>u=!1)),new Promise((c,p)=>s.then(d=>{u&&c(d)},d=>{u&&p(d)}))},r.tryCatch=a=>a.then(s=>new e(s),s=>new t(s));let i=new jx(3,Nc.seconds(3));r.retry=(a,s=i)=>a().catch(u=>new Promise((c,p)=>{let d=f=>{s.retry(f,()=>a().then(v=>c(v),d))||p(f)};d(u)})),r.guardedRetry=(a,s)=>{let u=async(c=0)=>{try{return await a()}catch(p){if(s(p,++c))return console.debug("retrying after failure:",p),await lf.timeSpan(Nc.seconds(1)),u(c);throw new Error(`Failed after ${c} retries: ${p}`)}};return u()},r.approvedRetry=(a,s)=>{let u=async()=>{try{return await a()}catch(c){if(await Qs.approve(s(c)))return u();throw c}};return u()},r.fail=(a,s)=>{let u=()=>new Promise((c,p)=>setTimeout(()=>p("fails first"),a.millis()));return()=>{let c=u();return u=s,c}},r.timeout=(a,s,u)=>new Promise((c,p)=>{let d=!0,f=setTimeout(()=>{d=!1,p(new Error(u??"timeout"))},s.millis());a.then(v=>{d&&c(v)},v=>{d&&p(v)}).finally(()=>clearTimeout(f))}),r.sequentialAll=a=>a.reduce((s,u)=>s.then(async c=>[...c,await u()]),Promise.resolve([])),r.sequentialize=a=>{let s=Promise.resolve();return u=>{let c=()=>a(u),p=s.then(c,c);return s=p.catch(()=>{}),p}},r.memoizeAsync=(a,s)=>{let u=null,c=Date.now();return()=>{let p=Date.now();return(Rn(u)||Z(s)&&p-c>s.millis())&&(c=p,u=a(),u.catch(d=>(u=null,d))),u}},r.allWithLimit=async(a,s=1)=>{let u=new Array(a.length),c=0,p=!1,d=async()=>{for(;c<a.length&&!p;){let f=c++;try{let v=await a[f]();p||(u[f]=v)}catch(v){throw p=!0,v}}};return await Promise.all(Array.from({length:Math.min(s,a.length)},d)),u},r.allSettledWithLimit=async(a,s=1)=>{let u=new Array(a.length),c=0,p=async()=>{for(;c<a.length;){let d=c++;try{let f=await a[d]();u[d]={status:"fulfilled",value:f}}catch(f){u[d]={status:"rejected",reason:f}}}};return await Promise.all(Array.from({length:Math.min(s,a.length)},p)),u};class n{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 u=Promise.withResolvers();return this.#e.push([s,u]),u.promise.finally(()=>this.#r())}}#r(){if(D(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[s,{resolve:u,reject:c}]=this.#e.shift();this.#t++,s().then(u,c)}}}r.Limit=n;class o{#e;#t;#r;#i=g.None;constructor(s,u,c){this.#e=s,this.#t=u,this.#r=c}update(s){this.#i=g.wrap(s),s.then(u=>{this.#i.contains(s)&&this.#e(u)}).catch(u=>{this.#i.contains(s)&&this.#t(u)}).finally(()=>{this.#i.contains(s)&&(this.terminate(),_(this.#r))})}terminate(){this.#i=g.None}}r.Latest=o})(uf||(uf={}));var PP=(r,e)=>Ln.executor(e,new class{sendUpdates(t){r.beginTransaction(),t.forEach(i=>{let n=i.type;n==="new"?r.createBox(i.name,i.uuid,o=>o.read(new ot(i.buffer))):n==="update-primitive"?r.findVertex(we.reconstruct(i.address)).unwrap(()=>`Could not find primitive field ${i.address}`).setValue(i.value):n==="update-pointer"?r.findVertex(we.reconstruct(i.address)).unwrap(()=>`Could not find pointer field ${i.address}`).targetAddress=Z(i.target)?g.wrap(we.reconstruct(i.target)):g.None:i.type==="delete"&&r.unstageBox(r.findBox(i.uuid).unwrap(()=>`Could not find box ${A.toString(i.uuid)}`))}),r.endTransaction()}checksum(t){return O.equals(r.checksum(),t)?Promise.resolve():Promise.reject("Checksum mismatch")}});var cf=class{#e=0;#t=!1;#r=!1;isRecording=!1;isCountingIn=!1;metronomeEnabled=!1;getLeapStateAndReset(){let e=this.#r;return this.#r=!1,e}get position(){return this.#e}set position(e){this.#e=e,this.#r=!0}get transporting(){return this.#t}set transporting(e){this.#t!==e&&(this.#t=e)}pause(){this.#t=!1,this.isRecording=!1,this.isCountingIn=!1}advanceTo(e){this.#e=e}};var EP;(function(r){r.NoSync="nosync",r.Pitch="pitch",r.Timestretch="timestretch",r.AudioFit="audiofit"})(EP||(EP={}));var SP;(function(r){r[r.Pre=0]="Pre",r[r.Post=1]="Post"})(SP||(SP={}));var bt;(function(r){r.Instrument="instrument",r.Bus="bus",r.Aux="aux",r.Output="output"})(bt||(bt={}));var al={white:new xt(0,0,100),blue:new xt(189,100,65),green:new xt(150,77,69),yellow:new xt(60,100,84),cream:new xt(65,20,83),orange:new xt(31,100,73),red:new xt(354,100,65),purple:new xt(314,100,78),bright:new xt(197,0,100),gray:new xt(197,31,85),dark:new xt(197,15,62),shadow:new xt(197,10,42),black:new xt(197,10,14),background:new xt(197,6,3),panelBackground:new xt(197,14,7),panelBackgroundBright:new xt(197,14,10),panelBackgroundDark:new xt(197,14,4)};var ke;(function(r){r[r.Add=0]="Add",r[r.Adsr=1]="Adsr",r[r.ArrayDown=2]="ArrayDown",r[r.AudioBus=3]="AudioBus",r[r.AudioDevice=4]="AudioDevice",r[r.AudioFile=5]="AudioFile",r[r.AutoGain=6]="AutoGain",r[r.Automation=7]="Automation",r[r.BassGuitar=8]="BassGuitar",r[r.Book=9]="Book",r[r.Box=10]="Box",r[r.Bug=11]="Bug",r[r.Fold=12]="Fold",r[r.Checkbox=13]="Checkbox",r[r.Clips=14]="Clips",r[r.Close=15]="Close",r[r.CloudFolder=16]="CloudFolder",r[r.CollapseDown=17]="CollapseDown",r[r.Compressor=18]="Compressor",r[r.Connected=19]="Connected",r[r.Cube=20]="Cube",r[r.Cursor=21]="Cursor",r[r.Curve=22]="Curve",r[r.Dattorro=23]="Dattorro",r[r.Delete=24]="Delete",r[r.Dial=25]="Dial",r[r.DinSlot=26]="DinSlot",r[r.Disconnected=27]="Disconnected",r[r.Divide=28]="Divide",r[r.DragConnections=29]="DragConnections",r[r.Dropdown=30]="Dropdown",r[r.Dropbox=31]="Dropbox",r[r.DrumSet=32]="DrumSet",r[r.Tidal=33]="Tidal",r[r.Duration=34]="Duration",r[r.EditBox=35]="EditBox",r[r.Effects=36]="Effects",r[r.Embed=37]="Embed",r[r.EQ=38]="EQ",r[r.Eraser=39]="Eraser",r[r.Exclude=40]="Exclude",r[r.Exit=41]="Exit",r[r.ExpandWidth=42]="ExpandWidth",r[r.FileList=43]="FileList",r[r.Flask=44]="Flask",r[r.Focus=45]="Focus",r[r.Generator=46]="Generator",r[r.GoogleDrive=47]="GoogleDrive",r[r.Groove=48]="Groove",r[r.Guitar=49]="Guitar",r[r.GuitarTab=50]="GuitarTab",r[r.Headphone=51]="Headphone",r[r.Heart=52]="Heart",r[r.Help=53]="Help",r[r.HighPass=54]="HighPass",r[r.HighShelf=55]="HighShelf",r[r.Insert=56]="Insert",r[r.Invert=57]="Invert",r[r.Loop=58]="Loop",r[r.LowPass=59]="LowPass",r[r.LowShelf=60]="LowShelf",r[r.Magnet=61]="Magnet",r[r.MainMenu=62]="MainMenu",r[r.Maximized=63]="Maximized",r[r.Menu=64]="Menu",r[r.Merge=65]="Merge",r[r.Metronome=66]="Metronome",r[r.Microphone=67]="Microphone",r[r.Midi=68]="Midi",r[r.Minimized=69]="Minimized",r[r.Mix=70]="Mix",r[r.Mixing=71]="Mixing",r[r.Mute=72]="Mute",r[r.NanoWave=73]="NanoWave",r[r.New=74]="New",r[r.NoAudio=75]="NoAudio",r[r.Note=76]="Note",r[r.NotePad=77]="NotePad",r[r.OpenDAW=78]="OpenDAW",r[r.Panel=79]="Panel",r[r.Peak=80]="Peak",r[r.Pencil=81]="Pencil",r[r.Piano=82]="Piano",r[r.Play=83]="Play",r[r.Playfield=84]="Playfield",r[r.PlayOnce=85]="PlayOnce",r[r.PlayRepeat=86]="PlayRepeat",r[r.PlayAlternate=87]="PlayAlternate",r[r.Pointer=88]="Pointer",r[r.Popout=89]="Popout",r[r.Primary=90]="Primary",r[r.Random=91]="Random",r[r.Record=92]="Record",r[r.Rectangle=93]="Rectangle",r[r.Region=94]="Region",r[r.Robot=95]="Robot",r[r.RoundDown=96]="RoundDown",r[r.RoundUp=97]="RoundUp",r[r.Run=98]="Run",r[r.Sawtooth=99]="Sawtooth",r[r.Saxophone=100]="Saxophone",r[r.Scissors=101]="Scissors",r[r.Search=102]="Search",r[r.Shadertoy=103]="Shadertoy",r[r.Sine=104]="Sine",r[r.Solo=105]="Solo",r[r.SoundFont=106]="SoundFont",r[r.SpeakerHeadphone=107]="SpeakerHeadphone",r[r.Square=108]="Square",r[r.Stack=109]="Stack",r[r.Start=110]="Start",r[r.Stereo=111]="Stereo",r[r.Stop=112]="Stop",r[r.Subtract=113]="Subtract",r[r.Sun=114]="Sun",r[r.Swap=115]="Swap",r[r.System=116]="System",r[r.Table=117]="Table",r[r.Tape=118]="Tape",r[r.Time=119]="Time",r[r.Timeline=120]="Timeline",r[r.Tool=121]="Tool",r[r.Triangle=122]="Triangle",r[r.Unknown=123]="Unknown",r[r.UserFolder=124]="UserFolder",r[r.Velocity=125]="Velocity",r[r.Vinyl=126]="Vinyl",r[r.VUMeter=127]="VUMeter",r[r.Waveform=128]="Waveform",r[r.Zeitgeist=129]="Zeitgeist"})(ke||(ke={}));(function(r){r.toName=e=>r[e],r.fromName=e=>r[e]??r.Rectangle})(ke||(ke={}));var l;(function(r){r[r.Deprecated=NaN]="Deprecated",r[r.MetaData=0]="MetaData",r[r.AudioBusses=1]="AudioBusses",r[r.AudioConnection=2]="AudioConnection",r[r.AudioEffectHost=3]="AudioEffectHost",r[r.AudioFile=4]="AudioFile",r[r.AudioOutput=5]="AudioOutput",r[r.AudioPlayMode=6]="AudioPlayMode",r[r.AudioUnit=7]="AudioUnit",r[r.AudioUnits=8]="AudioUnits",r[r.Automation=9]="Automation",r[r.AuxSend=10]="AuxSend",r[r.Capture=11]="Capture",r[r.ClipCollection=12]="ClipCollection",r[r.ConnectionCollection=13]="ConnectionCollection",r[r.Device=14]="Device",r[r.DeviceUserInterface=15]="DeviceUserInterface",r[r.Editing=16]="Editing",r[r.FileUploadState=17]="FileUploadState",r[r.Groove=18]="Groove",r[r.InstrumentHost=19]="InstrumentHost",r[r.MarkerEvents=20]="MarkerEvents",r[r.MarkerTrack=21]="MarkerTrack",r[r.MidiControl=22]="MidiControl",r[r.MIDIDevice=23]="MIDIDevice",r[r.MidiEffectHost=24]="MidiEffectHost",r[r.ModularSetup=25]="ModularSetup",r[r.Modulation=26]="Modulation",r[r.ModuleCollection=27]="ModuleCollection",r[r.NoteEventCollection=28]="NoteEventCollection",r[r.NoteEventFeature=29]="NoteEventFeature",r[r.NoteEvents=30]="NoteEvents",r[r.NotesConnection=31]="NotesConnection",r[r.Parameter=32]="Parameter",r[r.ParameterController=33]="ParameterController",r[r.PianoMode=34]="PianoMode",r[r.RegionCollection=35]="RegionCollection",r[r.Sample=36]="Sample",r[r.Selection=37]="Selection",r[r.Shadertoy=38]="Shadertoy",r[r.SoundfontFile=39]="SoundfontFile",r[r.StepAutomation=40]="StepAutomation",r[r.Timeline=41]="Timeline",r[r.TrackCollection=42]="TrackCollection",r[r.TransientMarkers=43]="TransientMarkers",r[r.User=44]="User",r[r.ValueEventCollection=45]="ValueEventCollection",r[r.ValueEvents=46]="ValueEvents",r[r.ValueInterpolation=47]="ValueInterpolation",r[r.VoltageConnection=48]="VoltageConnection",r[r.WarpMarkers=49]="WarpMarkers"})(l||(l={}));var _o;(function(r){r[r.Once=0]="Once",r[r.Repeat=1]="Repeat",r[r.Pingpong=2]="Pingpong"})(_o||(_o={}));var ln;(function(r){r[r.Monophonic=0]="Monophonic",r[r.Polyphonic=1]="Polyphonic"})(ln||(ln={}));var BP=(r,e)=>{if(r===e)return 0;let t=r-e;return t===0?F(`Indices cannot be equal (${r}, ${e})`):t};var Kn=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ot=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},df,Di,Po,pf,Wn,Vt=class r{static create(e,t,i){return new r(e,t,i)}constructor(e,t,i){df.set(this,void 0),Di.set(this,void 0),Po.set(this,void 0),pf.set(this,void 0),Wn.set(this,null),Kn(this,df,e,"f"),Kn(this,Di,A.newSet(n=>n.adapter.uuid),"f"),Kn(this,Po,new Ft,"f"),Kn(this,pf,e.pointerHub.catchupAndSubscribe({onAdded:n=>{Kn(this,Wn,null,"f");let o=t(n.box),a=o.indexField.subscribe(()=>{Kn(this,Wn,null,"f"),Ot(this,Po,"f").proxy.onReorder(o)}),s=Ot(this,Di,"f").add({adapter:o,subscription:a});D(s,`Could not add ${o}`),Ot(this,Po,"f").proxy.onAdd(o)},onRemoved:n=>{Kn(this,Wn,null,"f");let o=n.box.address.uuid,{adapter:a,subscription:s}=Ot(this,Di,"f").removeByKey(o);s.terminate(),Ot(this,Po,"f").proxy.onRemove(a)}},i),"f")}field(){return Ot(this,df,"f")}subscribe(e){return Ot(this,Po,"f").subscribe(e)}catchupAndSubscribe(e){return Ot(this,Di,"f").forEach(({adapter:t})=>e.onAdd(t)),this.subscribe(e)}getAdapterByIndex(e){let t=He.exactMapped(this.adapters(),e,BP,i=>i.indexField.getValue());return t===-1?g.None:g.wrap(this.adapters()[t])}getAdapterById(e){return Ot(this,Di,"f").opt(e).map(({adapter:t})=>t)}getMinFreeIndex(){let e=this.adapters();for(let t=0;t<e.length;t++)if(e[t].indexField.getValue()>t)return t;return e.length}adapters(){return Ot(this,Wn,"f")===null&&Kn(this,Wn,Ot(this,Di,"f").values().map(({adapter:e})=>e).sort((e,t)=>e.indexField.getValue()-t.indexField.getValue()),"f"),Ot(this,Wn,"f")}move(e,t){this.moveIndex(e.indexField.getValue(),t)}moveIndex(e,t){let i=this.adapters(),n=i[e];if(t<0){let o=ce(e+t,0,i.length-1);for(let a=o;a<e;a++)i[a].indexField.setValue(a+1);n.indexField.setValue(o)}else if(t>1){let o=ce(e+(t-1),0,i.length-1);for(let a=e;a<o;a++)i[a+1].indexField.setValue(a);n.indexField.setValue(o)}else console.warn(`moveIndex had no effect: startIndex: ${e}, delta: ${t}`)}size(){return Ot(this,Di,"f").size()}isEmpty(){return this.size()===0}terminate(){Kn(this,Wn,null,"f"),Ot(this,Di,"f").forEach(({subscription:e})=>e.terminate()),Ot(this,Di,"f").clear(),Ot(this,Po,"f").terminate(),Ot(this,pf,"f").terminate()}};df=new WeakMap,Di=new WeakMap,Po=new WeakMap,pf=new WeakMap,Wn=new WeakMap;var Ia;(function(r){r.create=(e,t,i,n)=>{switch(e){case"MetaDataBox":return Zn.create(t,i,n);case"RootBox":return sl.create(t,i,n);case"SelectionBox":return un.create(t,i,n);case"UserInterfaceBox":return Ca.create(t,i,n);case"UploadFileBox":return hf.create(t,i,n);case"ShadertoyBox":return ff.create(t,i,n);case"TimelineBox":return Ta.create(t,i,n);case"TrackBox":return or.create(t,i,n);case"NoteEventBox":return Eo.create(t,i,n);case"NoteEventRepeatBox":return mf.create(t,i,n);case"NoteEventCollectionBox":return Gn.create(t,i,n);case"NoteRegionBox":return Ra.create(t,i,n);case"NoteClipBox":return ll.create(t,i,n);case"ValueEventBox":return So.create(t,i,n);case"ValueEventCollectionBox":return qn.create(t,i,n);case"ValueEventCurveBox":return Bo.create(t,i,n);case"ValueRegionBox":return Oa.create(t,i,n);case"ValueClipBox":return ul.create(t,i,n);case"AudioRegionBox":return Fo.create(t,i,n);case"AudioClipBox":return cl.create(t,i,n);case"AudioPitchBox":return gf.create(t,i,n);case"AudioTimeStretchBox":return vf.create(t,i,n);case"TransientMarkerBox":return yf.create(t,i,n);case"WarpMarkerBox":return xf.create(t,i,n);case"MarkerBox":return dl.create(t,i,n);case"AudioFileBox":return Cr.create(t,i,n);case"SoundfontFileBox":return Xr.create(t,i,n);case"AudioUnitBox":return Xe.create(t,i,n);case"CaptureAudioBox":return No.create(t,i,n);case"CaptureMidiBox":return ko.create(t,i,n);case"AudioBusBox":return Ii.create(t,i,n);case"AuxSendBox":return Va.create(t,i,n);case"GrooveShuffleBox":return pl.create(t,i,n);case"UnknownAudioEffectDeviceBox":return wf.create(t,i,n);case"UnknownMidiEffectDeviceBox":return bf.create(t,i,n);case"DeviceInterfaceKnobBox":return Af.create(t,i,n);case"ModularDeviceBox":return _f.create(t,i,n);case"StereoToolDeviceBox":return Pf.create(t,i,n);case"CompressorDeviceBox":return hl.create(t,i,n);case"DelayDeviceBox":return Ef.create(t,i,n);case"CrusherDeviceBox":return Sf.create(t,i,n);case"DattorroReverbDeviceBox":return Bf.create(t,i,n);case"VelocityDeviceBox":return Ff.create(t,i,n);case"FoldDeviceBox":return Nf.create(t,i,n);case"TidalDeviceBox":return kf.create(t,i,n);case"RevampDeviceBox":return $f.create(t,i,n);case"ReverbDeviceBox":return Mf.create(t,i,n);case"VaporisateurDeviceBox":return fl.create(t,i,n);case"MIDIOutputDeviceBox":return ml.create(t,i,n);case"MIDIOutputBox":return Ci.create(t,i,n);case"MIDIOutputParameterBox":return Ti.create(t,i,n);case"SoundfontDeviceBox":return gl.create(t,i,n);case"NanoDeviceBox":return vl.create(t,i,n);case"PlayfieldDeviceBox":return yl.create(t,i,n);case"PlayfieldSampleBox":return $o.create(t,i,n);case"TapeDeviceBox":return xl.create(t,i,n);case"ArpeggioDeviceBox":return Df.create(t,i,n);case"PitchDeviceBox":return If.create(t,i,n);case"ZeitgeistDeviceBox":return Cf.create(t,i,n);case"ModularBox":return Tf.create(t,i,n);case"ModuleConnectionBox":return Rf.create(t,i,n);case"ModularAudioInputBox":return Of.create(t,i,n);case"ModularAudioOutputBox":return Vf.create(t,i,n);case"ModuleDelayBox":return zf.create(t,i,n);case"ModuleMultiplierBox":return Uf.create(t,i,n);case"ModuleGainBox":return jf.create(t,i,n);default:return F(`Unknown box class '${e}'`)}},r.deserialize=(e,t)=>{let i=new ot(t),n=i.readString(),o=A.fromDataInput(i),a=r.create(n,e,o);return a.read(i),a}})(Ia||(Ia={}));var Zn=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MetaDataBox",pointerRules:h}),i)}static ClassName="MetaDataBox";constructor(e){super(e)}accept(e){return _(e.visitMetaDataBox,this)}get target(){return this.getField(1)}get origin(){return this.getField(2)}get value(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"target",deprecated:!1,pointerRules:h},l.MetaData,!0),2:C.create({parent:this,fieldKey:2,fieldName:"origin",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"value",deprecated:!1,pointerRules:h})}}};var Lf=class r extends Oe{static create(e){return new r(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:S.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:h},{length:4},"",0),2:w.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:h},{min:1,max:64,scaling:"linear"},"",8),3:w.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:h},{min:.5,max:2,scaling:"linear"},"",1),4:M.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:h},!1),5:S.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:h},{min:-48,max:48},"st",0)}}};var sl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"RootBox",pointerRules:h}),i)}static ClassName="RootBox";constructor(e){super(e)}accept(e){return _(e.visitRootBox,this)}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 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 editingChannel(){return this.getField(111)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:h},l.Timeline,!0),2:W.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[l.User],mandatory:!0}}),3:C.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:h}),4:B.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:h},l.Groove,!0),10:W.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!1}}),20:W.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[l.AudioUnits],mandatory:!1}}),21:W.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[l.AudioBusses],mandatory:!1}}),30:W.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!0}}),35:W.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!1}}),40:Lf.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:h}),100:B.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:h},l.Shadertoy,!1),111:B.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:h},l.Editing,!1)}}};var un=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"SelectionBox",pointerRules:h}),i)}static ClassName="SelectionBox";constructor(e){super(e)}accept(e){return _(e.visitSelectionBox,this)}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:h},l.Selection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:h},l.Selection,!0)}}};var Ca=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UserInterfaceBox",pointerRules:{accepts:[l.MetaData],mandatory:!1}}),i)}static ClassName="UserInterfaceBox";constructor(e){super(e)}accept(e){return _(e.visitUserInterfaceBox,this)}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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:h},l.User,!0),10:W.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[l.Selection],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[l.FileUploadState],mandatory:!1}}),21:B.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:h},l.Editing,!1),22:B.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:h},l.Editing,!1),23:B.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:h},l.Editing,!1)}}};var hf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UploadFileBox",pointerRules:h}),i)}static ClassName="UploadFileBox";constructor(e){super(e)}accept(e){return _(e.visitUploadFileBox,this)}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:h},l.FileUploadState,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:h},l.FileUploadState,!0)}}};var ff=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ShadertoyBox",pointerRules:{accepts:[l.Shadertoy],mandatory:!0}}),i)}static ClassName="ShadertoyBox";constructor(e){super(e)}accept(e){return _(e.visitShadertoyBox,this)}get shaderCode(){return this.getField(1)}get highres(){return this.getField(2)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"shaderCode",deprecated:!1,pointerRules:h}),2:M.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:h},!0)}}};var Kf=class r extends Oe{static create(e){return new r(e)}constructor(e){super(e)}get nominator(){return this.getField(1)}get denominator(){return this.getField(2)}initializeFields(){return{1:S.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:h},{min:1,max:32},"",4),2:S.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:h},{min:1,max:32},"",4)}}};var Wf=class r extends Oe{static create(e){return new r(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:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),2:S.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:h},"any","ppqn",0),3:S.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:h},"any","ppqn",15360)}}};var Zf=class r extends Oe{static create(e){return new r(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:W.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1}}),10:S.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),20:M.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:h},!0)}}};var Ta=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TimelineBox",pointerRules:h}),i)}static ClassName="TimelineBox";constructor(e){super(e)}accept(e){return _(e.visitTimelineBox,this)}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 durationInPulses(){return this.getField(30)}get bpm(){return this.getField(31)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[l.Timeline],mandatory:!0}}),10:Kf.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:h}),11:Wf.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:h}),20:W.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!1,pointerRules:{accepts:[l.MarkerTrack],mandatory:!1}}),21:Zf.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:h}),30:S.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:h},"positive","ppqn",491520),31:w.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:h},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var or=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TrackBox",pointerRules:{accepts:[l.Selection,l.PianoMode,l.MetaData],mandatory:!1}}),i)}static ClassName="TrackBox";constructor(e){super(e)}accept(e){return _(e.visitTrackBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:h},l.TrackCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:h},l.Automation,!0),3:W.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[l.RegionCollection],mandatory:!1}}),4:W.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[l.ClipCollection],mandatory:!1}}),10:S.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),11:S.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:h},{values:[0,1,2,3]},""),20:M.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),30:M.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:h},!1)}}};var Eo=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventBox",pointerRules:{accepts:[l.Selection,l.NoteEventFeature],mandatory:!1}}),i)}static ClassName="NoteEventBox";constructor(e){super(e)}accept(e){return _(e.visitNoteEventBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:h},l.NoteEvents,!0),10:S.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:S.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn",240),20:S.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:h},{min:0,max:127},"",60),21:w.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:h},"unipolar","%",.7874015748031497),22:S.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:h},{min:1,max:128},"",1),23:w.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:h},"bipolar","%",0),24:w.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:h},{min:-50,max:50,scaling:"linear"},"ct",0),25:S.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:h},{min:0,max:100},"",100)}}};var mf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventRepeatBox",pointerRules:h}),i)}static ClassName="NoteEventRepeatBox";constructor(e){super(e)}accept(e){return _(e.visitNoteEventRepeatBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:h},l.NoteEventFeature,!0),2:S.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:h},{min:1,max:128},"",1),3:w.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:h},"bipolar","%",0),4:w.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:h},"unipolar","%",1)}}};var Gn=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[l.Selection],mandatory:!1}}),i)}static ClassName="NoteEventCollectionBox";constructor(e){super(e)}accept(e){return _(e.visitNoteEventCollectionBox,this)}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.NoteEvents],mandatory:!1}}),2:W.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.NoteEventCollection],mandatory:!0}})}}};var Ra=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1}}),i)}static ClassName="NoteRegionBox";constructor(e){super(e)}accept(e){return _(e.visitNoteRegionBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:h},l.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},l.NoteEventCollection,!0),10:S.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:S.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),12:S.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:h},"any","ppqn"),13:S.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:h},"positive","ppqn"),14:S.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:h},"any","ppqn"),15:M.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:h}),16:C.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:h}),17:S.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var Mo=class r extends Oe{static create(e){return new r(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:M.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:h},!0),2:M.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:h}),3:M.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:h}),4:S.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:h},"non-negative",""),5:S.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:h},"non-negative",""),6:S.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:h},"non-negative","")}}};var ll=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1}}),i)}static ClassName="NoteClipBox";constructor(e){super(e)}accept(e){return _(e.visitNoteClipBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:h},l.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},l.NoteEventCollection,!0),3:S.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:Mo.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:h}),10:S.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:h}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:h}),13:S.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var So=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventBox",pointerRules:{accepts:[l.Selection],mandatory:!1}}),i)}static ClassName="ValueEventBox";constructor(e){super(e)}accept(e){return _(e.visitValueEventBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:h},l.ValueEvents,!0),10:S.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:S.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),12:S.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[l.ValueInterpolation],mandatory:!1}},{values:[0,1]},"",1),13:w.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:h},"unipolar","%"),14:w.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:h},"any","",NaN)}}};var qn=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[l.Selection],mandatory:!1}}),i)}static ClassName="ValueEventCollectionBox";constructor(e){super(e)}accept(e){return _(e.visitValueEventCollectionBox,this)}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[l.ValueEvents],mandatory:!1}}),2:W.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[l.ValueEventCollection],mandatory:!0}})}}};var Bo=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCurveBox",pointerRules:h}),i)}static ClassName="ValueEventCurveBox";constructor(e){super(e)}accept(e){return _(e.visitValueEventCurveBox,this)}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:h},l.ValueInterpolation,!0),2:w.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:h},"unipolar","%",.5)}}};var Oa=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1}}),i)}static ClassName="ValueRegionBox";constructor(e){super(e)}accept(e){return _(e.visitValueRegionBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:h},l.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},l.ValueEventCollection,!0),10:S.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:S.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),12:S.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:h},"any","ppqn"),13:S.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:h},"positive","ppqn"),14:M.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:h}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:h}),16:S.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var ul=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1}}),i)}static ClassName="ValueClipBox";constructor(e){super(e)}accept(e){return _(e.visitValueClipBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:h},l.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},l.ValueEventCollection,!0),3:S.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:Mo.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:h}),10:S.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:h}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:h}),13:S.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var Fo=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1}}),i)}static ClassName="AudioRegionBox";constructor(e){super(e)}accept(e){return _(e.visitAudioRegionBox,this)}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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:h},l.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:h},l.AudioFile,!0),3:C.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:h}),4:C.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:h},"musical"),5:B.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:h},l.ValueEventCollection,!0),6:B.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:h},l.Deprecated,!1),7:w.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:h},"any","seconds"),8:B.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:h},l.AudioPlayMode,!1),10:S.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:w.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"any","mixed"),12:w.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:h},"any","mixed"),13:w.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:h},"any","mixed"),14:M.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:h}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:h}),16:S.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0"),17:w.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:h},"decibel","db")}}};var cl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioClipBox",pointerRules:{accepts:[l.Selection,l.Editing,l.MetaData],mandatory:!1}}),i)}static ClassName="AudioClipBox";constructor(e){super(e)}accept(e){return _(e.visitAudioClipBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:h},l.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:h},l.AudioFile,!0),3:S.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:Mo.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:h}),5:B.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:h},l.ValueEventCollection,!0),6:B.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:h},l.Deprecated,!1),7:w.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:h},"any","seconds"),8:B.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:h},l.AudioPlayMode,!1),10:S.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:h},"any","ppqn"),11:M.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:h}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:h}),13:S.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0"),14:w.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:h},"decibel","db"),20:C.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!0,pointerRules:h}),21:C.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:h},"musical")}}};var gf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioPitchBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0}}),i)}static ClassName="AudioPitchBox";constructor(e){super(e)}accept(e){return _(e.visitAudioPitchBox,this)}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0}})}}};var vf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioTimeStretchBox",pointerRules:{accepts:[l.AudioPlayMode],mandatory:!0}}),i)}static ClassName="AudioTimeStretchBox";constructor(e){super(e)}accept(e){return _(e.visitAudioTimeStretchBox,this)}get warpMarkers(){return this.getField(1)}get transientPlayMode(){return this.getField(2)}get playbackRate(){return this.getField(3)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[l.WarpMarkers],mandatory:!0}}),2:S.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:h},"positive","enum",2),3:w.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:h},"positive","ratio",1)}}};var yf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TransientMarkerBox",pointerRules:{accepts:[l.Selection],mandatory:!1}}),i)}static ClassName="TransientMarkerBox";constructor(e){super(e)}accept(e){return _(e.visitTransientMarkerBox,this)}get owner(){return this.getField(1)}get position(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:h},l.TransientMarkers,!0),2:w.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:h},"non-negative","seconds")}}};var xf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"WarpMarkerBox",pointerRules:{accepts:[l.Selection],mandatory:!1}}),i)}static ClassName="WarpMarkerBox";constructor(e){super(e)}accept(e){return _(e.visitWarpMarkerBox,this)}get owner(){return this.getField(1)}get position(){return this.getField(2)}get seconds(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:h},l.WarpMarkers,!0),2:S.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),3:w.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:h},"non-negative","seconds")}}};var dl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MarkerBox",pointerRules:{accepts:[l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="MarkerBox";constructor(e){super(e)}accept(e){return _(e.visitMarkerBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:h},l.MarkerTrack,!0),2:S.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),3:S.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:h},"non-negative","",1),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:h}),5:S.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var Cr=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioFileBox",pointerRules:{accepts:[l.AudioFile,l.FileUploadState,l.MetaData],mandatory:!0}}),i)}static ClassName="AudioFileBox";constructor(e){super(e)}accept(e){return _(e.visitAudioFileBox,this)}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:w.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:h},"non-negative","s"),2:w.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:h},"non-negative","s"),3:C.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[l.TransientMarkers],mandatory:!1}})}}};var Xr=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[l.SoundfontFile],mandatory:!0}}),i)}static ClassName="SoundfontFileBox";constructor(e){super(e)}accept(e){return _(e.visitSoundfontFileBox,this)}get fileName(){return this.getField(1)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:h})}}};var Xe=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[l.Selection,l.Automation],mandatory:!1}}),i)}static ClassName="AudioUnitBox";constructor(e){super(e)}accept(e){return _(e.visitAudioUnitBox,this)}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)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"type",deprecated:!1,pointerRules:h},"instrument"),2:B.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:h},l.AudioUnits,!0),3:W.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1}}),11:S.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),12:w.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-96,mid:-9,max:6,scaling:"decibel"},"dB"),13:w.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"bipolar","%"),14:M.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}}),15:M.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}}),20:W.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[l.TrackCollection],mandatory:!1}}),21:W.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MidiEffectHost],mandatory:!1}}),22:W.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.InstrumentHost,l.AudioOutput],mandatory:!1}}),23:W.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1}}),24:W.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[l.AuxSend],mandatory:!1}}),25:B.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:h},l.AudioOutput,!1),26:B.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:h},l.Capture,!1)}}};var No=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[l.Capture],mandatory:!0}}),i)}static ClassName="CaptureAudioBox";constructor(e){super(e)}accept(e){return _(e.visitCaptureAudioBox,this)}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get requestChannels(){return this.getField(10)}get gainDb(){return this.getField(11)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:h}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:h},"normal"),10:S.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:h},"any","",1),11:w.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:h},"decibel","dB",0)}}};var ko=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[l.Capture],mandatory:!0}}),i)}static ClassName="CaptureMidiBox";constructor(e){super(e)}accept(e){return _(e.visitCaptureMidiBox,this)}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get channel(){return this.getField(10)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:h}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:h},"normal"),10:S.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:h},"any","",-1)}}};var Ii=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioBusBox",pointerRules:h}),i)}static ClassName="AudioBusBox";constructor(e){super(e)}accept(e){return _(e.visitAudioBusBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},l.AudioBusses,!0),2:B.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:h},l.AudioOutput,!0),3:W.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.AudioOutput],mandatory:!1}}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:C.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:h}),6:C.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:h}),7:C.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:h},"red"),8:M.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:h})}}};var Va=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AuxSendBox",pointerRules:h}),i)}static ClassName="AuxSendBox";constructor(e){super(e)}accept(e){return _(e.visitAuxSendBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:h},l.AuxSend,!0),2:B.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:h},l.AudioOutput,!0),3:S.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:S.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:h},{values:[0,1]},"",1),5:w.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"decibel","dB"),6:w.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"bipolar","")}}};var pl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[l.Groove],mandatory:!0}}),i)}static ClassName="GrooveShuffleBox";constructor(e){super(e)}accept(e){return _(e.visitGrooveShuffleBox,this)}get label(){return this.getField(1)}get amount(){return this.getField(10)}get duration(){return this.getField(11)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:h}),10:w.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",.6),11:S.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"non-negative","ppqn",480)}}};var wf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="UnknownAudioEffectDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitUnknownAudioEffectDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:h})}}};var bf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="UnknownMidiEffectDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitUnknownMidiEffectDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.MidiEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:h})}}};var Af=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:h}),i)}static ClassName="DeviceInterfaceKnobBox";constructor(e){super(e)}accept(e){return _(e.visitDeviceInterfaceKnobBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:h},l.DeviceUserInterface,!0),2:B.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:h},l.ParameterController,!0),3:S.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),10:w.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:h},"unipolar","%"),11:C.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:h})}}};var Gf=class r extends Oe{static create(e){return new r(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[l.DeviceUserInterface],mandatory:!1}})}}};var _f=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="ModularDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitModularDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:B.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:h},l.ModularSetup,!0),11:Gf.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:h})}}};var Pf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="StereoToolDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitStereoToolDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-72,mid:0,max:12,scaling:"decibel"},"dB",0),11:w.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"bipolar","%",0),12:w.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"bipolar","%",0),13:M.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}}),14:M.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}}),15:M.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}}),20:S.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:h},{values:[0,1]},"",1)}}};var hl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="CompressorDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitCompressorDeviceBox,this)}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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:M.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},!1),11:M.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},!0),12:M.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},!1),13:M.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},!1),14:w.create({parent:this,fieldKey:14,fieldName:"inputgain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-30,max:30,scaling:"linear"},"dB",0),15:w.create({parent:this,fieldKey:15,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-60,max:0,scaling:"linear"},"dB",-10),16:w.create({parent:this,fieldKey:16,fieldName:"ratio",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:1,max:24,scaling:"exponential"},"",2),17:w.create({parent:this,fieldKey:17,fieldName:"knee",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:0,max:24,scaling:"linear"},"dB",0),18:w.create({parent:this,fieldKey:18,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:0,max:100,scaling:"linear"},"ms",0),19:w.create({parent:this,fieldKey:19,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:5,max:1500,scaling:"linear"},"ms",5),20:w.create({parent:this,fieldKey:20,fieldName:"makeup",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-40,max:40,scaling:"linear"},"dB",0),21:w.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",1)}}};var Ef=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="DelayDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitDelayDeviceBox,this)}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 delay(){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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"delay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"any","",4),11:w.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",.5),12:w.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"bipolar","%",0),13:w.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"bipolar","%",0),14:w.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"decibel","dB",-6),15:w.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"decibel","dB",0)}}};var Sf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="CrusherDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitCrusherDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",0),11:S.create({parent:this,fieldKey:11,fieldName:"bits",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:1,max:16},"bits",16),12:w.create({parent:this,fieldKey:12,fieldName:"boost",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:0,max:24,scaling:"linear"},"dB",0),13:w.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",1)}}};var Bf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"DattorroReverbDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="DattorroReverbDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitDattorroReverbDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),11:w.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",.9999),12:w.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",.75),13:w.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",.625),14:w.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",.5),15:w.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",.7),16:w.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",.5),17:w.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",.005),18:w.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",.5),19:w.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",.7),20:w.create({parent:this,fieldKey:20,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"decibel","dB",-6),21:w.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"decibel","dB",0)}}};var Ff=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"VelocityDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="VelocityDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitVelocityDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.MidiEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",.5),11:w.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%"),12:S.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:h},"any","",2048),13:w.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%"),14:w.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"bipolar","%",0),15:w.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",1)}}};var Nf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="FoldDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitFoldDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"drive",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:0,max:30,scaling:"linear"},"dB",0),11:S.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:h},{length:3},"",0),12:w.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-18,max:0,scaling:"linear"},"dB",0)}}};var kf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TidalDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="TidalDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitTidalDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"bipolar","%",-.25),11:w.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",.5),20:w.create({parent:this,fieldKey:20,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",3),21:w.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","",1),22:w.create({parent:this,fieldKey:22,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0),23:w.create({parent:this,fieldKey:23,fieldName:"channelOffset",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0)}}};var jc=class r extends Oe{static create(e){return new r(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:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}}),10:w.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:S.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{length:4},""),12:w.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Lc=class r extends Oe{static create(e){return new r(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:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}}),10:w.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:w.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-24,max:24,scaling:"linear"},"dB")}}};var wl=class r extends Oe{static create(e){return new r(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:M.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}}),10:w.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:w.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-24,max:24,scaling:"linear"},"dB"),12:w.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var $f=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="RevampDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitRevampDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:jc.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:h}),11:Lc.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:h}),12:wl.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:h}),13:wl.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:h}),14:wl.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:h}),15:Lc.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:h}),16:jc.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:h}),17:w.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-18,max:18,scaling:"linear"},"db")}}};var Mf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="ReverbDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitReverbDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.AudioEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",.5),11:w.create({parent:this,fieldKey:11,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:.001,max:.5,scaling:"exponential"},"s",0),12:w.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",.5),13:w.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"bipolar","%",0),14:w.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"decibel","dB",-3),15:w.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"decibel","dB",0)}}};var qf=class r extends Oe{static create(e){return new r(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:S.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{values:[0,1,2,3]},""),2:w.create({parent:this,fieldKey:2,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"decibel","db",-1/0),3:S.create({parent:this,fieldKey:3,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-3,max:3},"oct",0),4:w.create({parent:this,fieldKey:4,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-1200,max:1200,scaling:"linear"},"ct")}}};var Hf=class r extends Oe{static create(e){return new r(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:S.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{values:[0,1,2,3]},""),2:w.create({parent:this,fieldKey:2,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:1e-4,max:30,scaling:"exponential"},"Hz",1e-4),3:M.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},!1),10:w.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"bipolar","%"),11:w.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"bipolar","%"),12:w.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"bipolar","%")}}};var Jf=class r extends Oe{static create(e){return new r(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:w.create({parent:this,fieldKey:1,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),2:w.create({parent:this,fieldKey:2,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),3:w.create({parent:this,fieldKey:3,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),4:w.create({parent:this,fieldKey:4,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"decibel","db",.001)}}};var fl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="VaporisateurDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitVaporisateurDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"decibel","dB",-6),11:S.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"any","oct"),12:w.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"any","ct"),13:S.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"any",""),14:w.create({parent:this,fieldKey:14,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),15:w.create({parent:this,fieldKey:15,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"q"),16:w.create({parent:this,fieldKey:16,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s"),17:w.create({parent:this,fieldKey:17,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s"),18:w.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"bipolar","%"),19:w.create({parent:this,fieldKey:19,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),20:w.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",1),21:w.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",0),22:S.create({parent:this,fieldKey:22,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{values:[0,1]},"",1),23:S.create({parent:this,fieldKey:23,fieldName:"unisonCount",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{values:[1,3,5]},"",1),24:w.create({parent:this,fieldKey:24,fieldName:"unisonDetune",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:1,max:1200,scaling:"exponential"},"ct",30),25:w.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",1),26:S.create({parent:this,fieldKey:26,fieldName:"filterOrder",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{values:[1,2,3,4]},"",1),27:w.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"bipolar","%"),30:Hf.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:h}),40:of.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:h},e=>qf.create(e),2),50:Jf.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:h}),99:S.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:h},"any","")}}};var Qf=class r extends Oe{static create(e){return new r(e)}constructor(e){super(e)}get id(){return this.getField(1)}get label(){return this.getField(2)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"id",deprecated:!1,pointerRules:h}),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h})}}};var ml=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="MIDIOutputDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIOutputDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:Qf.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:h}),11:S.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:h},{min:0,max:15},"ch"),12:S.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:h},"any","ms",10),13:W.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[l.Parameter],mandatory:!1}}),14:B.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:h},l.MIDIDevice,!1)}}};var Ci=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputBox",pointerRules:h}),i)}static ClassName="MIDIOutputBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIOutputBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:h},l.MIDIDevice,!0),2:W.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.MIDIDevice],mandatory:!0}}),3:C.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:h}),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:h}),5:S.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:h},{min:0,max:500},"ms",10),6:M.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:h},!0)}}};var Ti=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputParameterBox",pointerRules:h}),i)}static ClassName="MIDIOutputParameterBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIOutputParameterBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:h},l.Parameter,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h},""),3:S.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:h},{min:0,max:127},"#",64),4:w.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!0}},"unipolar","%")}}};var gl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="SoundfontDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitSoundfontDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:B.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:h},l.SoundfontFile,!1),11:S.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:h},{min:0,max:65535},"")}}};var vl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="NanoDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitNanoDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"decibel","dB",-3),15:B.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:h},l.AudioFile,!1),20:w.create({parent:this,fieldKey:20,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:.001,max:8,scaling:"exponential"},"s",.1)}}};var yl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="PlayfieldDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitPlayfieldDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:W.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[l.Sample],mandatory:!1}})}}};var $o=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[l.Editing],mandatory:!1}}),i)}static ClassName="PlayfieldSampleBox";constructor(e){super(e)}accept(e){return _(e.visitPlayfieldSampleBox,this)}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)}initializeFields(){return{10:B.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:h},l.Sample,!0),11:B.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:h},l.AudioFile,!0),12:W.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[l.MidiEffectHost],mandatory:!1}}),13:W.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[l.AudioEffectHost],mandatory:!1}}),15:S.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:h},{min:0,max:127},"",60),20:C.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!1,pointerRules:h}),21:C.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:h}),22:M.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),23:M.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),40:M.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:h}),41:M.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:h}),42:M.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:h}),43:M.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:h}),44:S.create({parent:this,fieldKey:44,fieldName:"gate",deprecated:!1,pointerRules:h},{length:3},"",0),45:w.create({parent:this,fieldKey:45,fieldName:"pitch",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-1200,max:1200,scaling:"linear"},"ct"),46:w.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",0),47:w.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%",1),48:w.create({parent:this,fieldKey:48,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),49:w.create({parent:this,fieldKey:49,fieldName:"release",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.02)}}};var xl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData,l.Automation],mandatory:!1}}),i)}static ClassName="TapeDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitTapeDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%"),11:w.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%"),12:w.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%"),13:w.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"unipolar","%")}}};var Df=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="ArpeggioDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitArpeggioDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.MidiEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:S.create({parent:this,fieldKey:10,fieldName:"modeIndex",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{length:3},"",0),11:S.create({parent:this,fieldKey:11,fieldName:"numOctaves",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:1,max:5},"oct",1),12:S.create({parent:this,fieldKey:12,fieldName:"rateIndex",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{length:17},"",9),13:w.create({parent:this,fieldKey:13,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:0,max:2,scaling:"linear"},"",1),14:S.create({parent:this,fieldKey:14,fieldName:"repeat",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:1,max:16},"",1),15:w.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},"bipolar","",0)}}};var If=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="PitchDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitPitchDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.MidiEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:S.create({parent:this,fieldKey:10,fieldName:"semiTones",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-36,max:36},"st",0),11:w.create({parent:this,fieldKey:11,fieldName:"cents",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-50,max:50,scaling:"linear"},"ct",0),12:S.create({parent:this,fieldKey:12,fieldName:"octaves",deprecated:!1,pointerRules:{accepts:[l.Modulation,l.Automation,l.MidiControl],mandatory:!1}},{min:-7,max:7},"oct",0)}}};var Cf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[l.Device,l.Selection,l.MetaData],mandatory:!1}}),i)}static ClassName="ZeitgeistDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitZeitgeistDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},l.MidiEffectHost,!0),2:S.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:M.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:M.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:B.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:h},l.Groove,!0)}}};var Tf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularBox",pointerRules:h}),i)}static ClassName="ModularBox";constructor(e){super(e)}accept(e){return _(e.visitModularBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},l.ModularSetup,!0),2:W.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[l.ModularSetup],mandatory:!0}}),3:W.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[l.Editing],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[l.ModuleCollection],mandatory:!1}}),12:W.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[l.ConnectionCollection],mandatory:!1}}),13:C.create({parent:this,fieldKey:13,fieldName:"label",deprecated:!1,pointerRules:h})}}};var Rf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleConnectionBox",pointerRules:h}),i)}static ClassName="ModuleConnectionBox";constructor(e){super(e)}accept(e){return _(e.visitModuleConnectionBox,this)}get collection(){return this.getField(1)}get source(){return this.getField(2)}get target(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},l.ConnectionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:h},l.VoltageConnection,!0),3:B.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:h},l.VoltageConnection,!0)}}};var ei=class r extends Oe{static create(e){return new r(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:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},l.ModuleCollection,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:S.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:h},"any","x"),4:S.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:h},"any","y"),5:M.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:h},!1),6:M.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:h},!0)}}};var Of=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[l.Selection],mandatory:!1}}),i)}static ClassName="ModularAudioInputBox";constructor(e){super(e)}accept(e){return _(e.visitModularAudioInputBox,this)}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:ei.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1}})}}};var Vf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[l.Selection],mandatory:!1}}),i)}static ClassName="ModularAudioOutputBox";constructor(e){super(e)}accept(e){return _(e.visitModularAudioOutputBox,this)}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:ei.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1}})}}};var zf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[l.Selection],mandatory:!1}}),i)}static ClassName="ModuleDelayBox";constructor(e){super(e)}accept(e){return _(e.visitModuleDelayBox,this)}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:ei.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1}}),20:w.create({parent:this,fieldKey:20,fieldName:"time",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",500)}}};var Uf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[l.Selection],mandatory:!1}}),i)}static ClassName="ModuleMultiplierBox";constructor(e){super(e)}accept(e){return _(e.visitModuleMultiplierBox,this)}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:ei.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1}}),12:W.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1}}),20:w.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:h},"unipolar","%")}}};var jf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[l.Selection],mandatory:!1}}),i)}static ClassName="ModuleGainBox";constructor(e){super(e)}accept(e){return _(e.visitModuleGainBox,this)}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:ei.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1}}),12:W.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[l.VoltageConnection],mandatory:!1}}),20:w.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[l.ParameterController],mandatory:!1}},"decibel","dB")}}};var cn;(function(r){r.write=(e,t)=>{if(t.type==="none")e.disconnect(),e.setValue(0);else if(t.type==="linear")e.disconnect(),e.setValue(1);else if(t.type==="curve"){e.setValue(0);let i=e.pointerHub.filter(l.ValueInterpolation).at(0)?.box;Z(i)?(xx(i,Bo),i.slope.setValue(t.slope)):Bo.create(e.box.graph,A.generate(),n=>{n.slope.setValue(t.slope),n.event.refer(e)})}},r.read=e=>{let t=e.pointerHub.incoming().at(0)?.box;return Z(t)?(xx(t,Bo),{type:"curve",slope:t.slope.getValue()}):e.getValue()===0?bo.None:e.getValue()===1?bo.Linear:F("Unknown Interpolation value")}})(cn||(cn={}));var Do=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},De=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Kc,bl,lt,Wc,Io,Zc,Hn=class r{constructor(e,t){this.type="value-event",Kc.set(this,new z),bl.set(this,void 0),lt.set(this,void 0),Wc.set(this,void 0),Io.set(this,void 0),Zc.set(this,!1),Do(this,bl,e,"f"),Do(this,lt,t,"f"),Do(this,Wc,De(this,Kc,"f").own(new Rh(()=>cn.read(De(this,lt,"f").interpolation))),"f");let i=()=>{De(this,Wc,"f").invalidate(),this.collection.ifSome(n=>n.onEventPropertyChanged())};De(this,Kc,"f").ownAll(De(this,lt,"f").subscribe(Fe.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let o=this.collection.unwrap(),a=n.address.fieldKeys,s=O.equals(De(this,lt,"f").index.address.fieldKeys,a),u=O.equals(De(this,lt,"f").position.address.fieldKeys,a);s||u?o.requestSorting():o.onEventPropertyChanged()}}),De(this,lt,"f").interpolation.subscribe(i),De(this,lt,"f").interpolation.pointerHub.subscribe({onAdded:({box:n})=>{De(this,Io,"f").terminate(),Do(this,Io,n.subscribe(Fe.Children,i),"f"),i()},onRemoved:()=>{De(this,Io,"f").terminate(),Do(this,Io,K.Empty,"f"),i()}})),Do(this,Io,De(this,lt,"f").interpolation.pointerHub.filter(l.ValueInterpolation).at(0)?.box.subscribe(Fe.Children,i)??K.Empty,"f")}onSelected(){Do(this,Zc,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Do(this,Zc,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){De(this,Io,"f").terminate(),De(this,Kc,"f").terminate()}get box(){return De(this,lt,"f")}get uuid(){return De(this,lt,"f").address.uuid}get address(){return De(this,lt,"f").address}get position(){return De(this,lt,"f").position.getValue()}get index(){return De(this,lt,"f").index.getValue()}set interpolation(e){cn.write(De(this,lt,"f").interpolation,e)}get interpolation(){return De(this,Wc,"f").get()}get value(){return De(this,lt,"f").value.getValue()}get isSelected(){return De(this,Zc,"f")}get collection(){return De(this,lt,"f").events.targetVertex.map(e=>De(this,bl,"f").boxAdapters.adapterFor(e.box,ar))}copyTo(e){let t=So.create(De(this,bl,"f").boxGraph,A.generate(),i=>{i.position.setValue(e?.position??this.position),i.index.setValue(e?.index??this.index),i.events.refer(e?.events??this.collection.unwrap().box.events),i.value.setValue(e?.value??this.value)});return cn.write(t.interpolation,e?.interpolation??this.interpolation),De(this,bl,"f").boxAdapters.adapterFor(t,r)}copyFrom(e){return De(this,lt,"f").position.setValue(e?.position??this.position),De(this,lt,"f").index.setValue(e?.index??this.index),De(this,lt,"f").events.refer(e?.events??this.collection.unwrap().box.events),De(this,lt,"f").value.setValue(e?.value??this.value),cn.write(De(this,lt,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};Kc=new WeakMap,bl=new WeakMap,lt=new WeakMap,Wc=new WeakMap,Io=new WeakMap,Zc=new WeakMap;Hn.Comparator=(r,e)=>{let t=r.position-e.position;if(t!==0)return t;let i=r.index-e.index;if(i!==0)return i;throw new Error(`${r} and ${e} are identical in terms of comparison`)};var Gc=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ie=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},qc,Hc,Co,ti,za,Jc,Jn,Yf,ar=class r{constructor(e,t){qc.add(this),Hc.set(this,new z),Co.set(this,void 0),ti.set(this,void 0),za.set(this,void 0),Jc.set(this,void 0),Jn.set(this,void 0),Gc(this,Co,e,"f"),Gc(this,ti,t,"f"),Gc(this,za,new ee,"f"),Gc(this,Jc,A.newSet(n=>n.uuid),"f"),Gc(this,Jn,yr.create(Hn.Comparator),"f");let i=n=>{let o=Y(n.accept({visitValueEventBox:a=>Ie(this,Co,"f").boxAdapters.adapterFor(a,Hn)}),`Could not find adapter for ${n}`);Ie(this,Jc,"f").add(o)&&(Ie(this,Jn,"f").add(o),Ie(this,qc,"m",Yf).call(this))};Ie(this,ti,"f").events.pointerHub.incoming().forEach(({box:n})=>i(n)),Ie(this,Hc,"f").own(Ie(this,ti,"f").events.pointerHub.subscribe({onAdded:({box:n})=>i(n),onRemoved:({box:{address:{uuid:n}}})=>{Ie(this,Jn,"f").remove(Ie(this,Jc,"f").removeByKey(n)),Ie(this,qc,"m",Yf).call(this)}})),Ie(this,Hc,"f").own(Ie(this,ti,"f").owners.pointerHub.subscribe({onAdded:()=>Ie(this,za,"f").notify(this),onRemoved:()=>Ie(this,za,"f").notify(this)}))}valueAt(e,t){return rf.valueAt(Ie(this,Jn,"f"),e,t)}copy(){let e=Ie(this,Co,"f").boxGraph,t=qn.create(e,A.generate());return Ie(this,Jn,"f").asArray().forEach(i=>i.copyTo({events:t.events})),Ie(this,Co,"f").boxAdapters.adapterFor(t,r)}cut(e){let t=this.events.lowerEqual(e),i=this.events.greaterEqual(e);if(i===null)return t===null?g.None:g.wrap(this.createEvent({position:e,value:t.value,index:t.index,interpolation:t.interpolation}));if(t===null)return g.wrap(this.createEvent({position:e,value:i.value,index:i.index,interpolation:i.interpolation}));if(t.position===e)return g.wrap(t);if(t.interpolation.type==="none")return g.wrap(this.createEvent({position:e,value:t.value,index:t.index,interpolation:t.interpolation}));if(t.interpolation.type==="linear"){let{position:n,value:o}=t,{position:a,value:s}=i;return g.wrap(this.createEvent({position:e,value:Oh(o,s,(e-n)/(a-n)),index:0,interpolation:t.interpolation}))}if(t.interpolation.type==="curve"){let{position:n,value:o}=t,{position:a,value:s}=i,u=a-n,c=e-n,p=Qr.byHalf(u,o,Qr.valueAt({slope:t.interpolation.slope,steps:u,y0:o,y1:s},u*.5),s),d=Qr.valueAt(p,c),f=Qr.slopeByHalf(o,Qr.valueAt(p,c*.5),d);return cn.write(t.box.interpolation,bo.Curve(f)),g.wrap(this.createEvent({position:e,value:d,index:0,interpolation:bo.Curve(Qr.slopeByHalf(d,Qr.valueAt(p,(c+u)*.5),s))}))}return F("Unknown interpolation type")}subscribeChange(e){return Ie(this,za,"f").subscribe(e)}createEvent({position:e,index:t,value:i,interpolation:n}){let o=So.create(Ie(this,Co,"f").boxGraph,A.generate(),a=>{a.position.setValue(e),a.index.setValue(t),a.value.setValue(i),a.events.refer(Ie(this,ti,"f").events)});return cn.write(o.interpolation,n),Ie(this,Co,"f").boxAdapters.adapterFor(o,Hn)}requestSorting(){Ie(this,Jn,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Ie(this,qc,"m",Yf).call(this)}terminate(){Ie(this,Hc,"f").terminate()}get box(){return Ie(this,ti,"f")}get uuid(){return Ie(this,ti,"f").address.uuid}get address(){return Ie(this,ti,"f").address}get numOwners(){return Ie(this,ti,"f").owners.pointerHub.filter(l.ValueEventCollection).length}get events(){return Ie(this,Jn,"f")}toString(){return`{ValueEventCollectionBox ${A.toString(Ie(this,ti,"f").address.uuid)}}`}};Hc=new WeakMap,Co=new WeakMap,ti=new WeakMap,za=new WeakMap,Jc=new WeakMap,Jn=new WeakMap,qc=new WeakSet,Yf=function(){Ie(this,za,"f").notify(this)};var Ua=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},be=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ja,To,La,At,Ka,Xc,Qc,Yc,Al,Ro=class{constructor(e,t){ja.add(this),this.type="value-clip",To.set(this,new z),La.set(this,void 0),At.set(this,void 0),Ka.set(this,void 0),Xc.set(this,void 0),Qc.set(this,void 0),Yc.set(this,K.Empty),Ua(this,La,e,"f"),Ua(this,At,t,"f"),Ua(this,Qc,!0,"f"),Ua(this,Ka,be(this,To,"f").own(new Ir(!1)),"f"),Ua(this,Xc,be(this,To,"f").own(new ee),"f"),be(this,To,"f").own(be(this,At,"f").pointerHub.subscribe({onAdded:()=>be(this,ja,"m",Al).call(this),onRemoved:()=>be(this,ja,"m",Al).call(this)})),be(this,To,"f").own(be(this,At,"f").subscribe(Fe.Children,i=>be(this,ja,"m",Al).call(this))),be(this,To,"f").own(be(this,At,"f").events.catchupAndSubscribe(({targetVertex:i})=>{be(this,Yc,"f").terminate(),Ua(this,Yc,i.match({none:()=>K.Empty,some:({box:n})=>be(this,La,"f").boxAdapters.adapterFor(n,ar).subscribeChange(()=>be(this,ja,"m",Al).call(this))}),"f"),be(this,ja,"m",Al).call(this)})),Ua(this,Qc,!1,"f")}valueAt(e,t){let i=this.optCollection;return i.isEmpty()?t:i.unwrap().valueAt(e%this.duration,t)}catchupAndSubscribeSelected(e){return be(this,Ka,"f").catchupAndSubscribe(e)}subscribeChange(e){return be(this,Xc,"f").subscribe(e)}accept(e){return _(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&be(this,At,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:be(this,At,"f").events.targetVertex.unwrap();ul.create(be(this,La,"f").boxGraph,A.generate(),i=>{i.index.setValue(this.indexField.getValue()),i.label.setValue(this.label),i.hue.setValue(this.hue),i.duration.setValue(this.duration),i.mute.setValue(this.mute),i.clips.refer(be(this,At,"f").clips.targetVertex.unwrap()),i.events.refer(t)})}onSelected(){be(this,Ka,"f").setValue(!0)}onDeselected(){be(this,Ka,"f").setValue(!1)}get isSelected(){return be(this,Ka,"f").getValue()}terminate(){be(this,Yc,"f").terminate(),be(this,To,"f").terminate()}get box(){return be(this,At,"f")}get uuid(){return be(this,At,"f").address.uuid}get address(){return be(this,At,"f").address}get indexField(){return be(this,At,"f").index}get duration(){return be(this,At,"f").duration.getValue()}get mute(){return be(this,At,"f").mute.getValue()}get hue(){return be(this,At,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return be(this,At,"f").events.targetVertex.map(e=>be(this,La,"f").boxAdapters.adapterFor(e.box,ar))}get label(){return be(this,At,"f").label.getValue()}get trackBoxAdapter(){return be(this,Qc,"f")?g.None:be(this,At,"f").clips.targetVertex.map(e=>be(this,La,"f").boxAdapters.adapterFor(e.box,pt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${A.toString(be(this,At,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};To=new WeakMap,La=new WeakMap,At=new WeakMap,Ka=new WeakMap,Xc=new WeakMap,Qc=new WeakMap,Yc=new WeakMap,ja=new WeakSet,Al=function(){be(this,Xc,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var FP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},_l=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Lx,Wa,Xf,Pl=class{constructor(e){this.type="transient-marker",Lx.set(this,new z),Wa.set(this,void 0),Xf.set(this,void 0),FP(this,Wa,e,"f"),FP(this,Xf,new ee,"f")}get box(){return _l(this,Wa,"f")}get uuid(){return _l(this,Wa,"f").address.uuid}get address(){return _l(this,Wa,"f").address}get position(){return _l(this,Wa,"f").position.getValue()}subscribe(e){return _l(this,Xf,"f").subscribe(e)}terminate(){_l(this,Lx,"f").terminate()}};Lx=new WeakMap,Wa=new WeakMap,Xf=new WeakMap;var ed=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},zt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},em,td,dn,rd,El,tm,Ri=class r{constructor(e,t){em.set(this,new z),td.set(this,void 0),dn.set(this,void 0),rd.set(this,void 0),El.set(this,void 0),tm.set(this,void 0),ed(this,td,e,"f"),ed(this,dn,t,"f"),ed(this,rd,A.newSet(({uuid:i})=>i),"f"),ed(this,El,yr.create(r.Comparator),"f"),ed(this,tm,uf.memoizeAsync(async()=>{if(this.data.nonEmpty())return this.data.unwrap();let{promise:i,resolve:n,reject:o}=Promise.withResolvers(),a=this.getOrCreateLoader(),s=a.subscribe(u=>{u.type==="loaded"?(s.terminate(),n(a.data.unwrap("State mismatch"))):u.type==="error"&&(s.terminate(),o(u.reason))});return i}),"f"),zt(this,em,"f").own(t.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:i=>{let n=zt(this,td,"f").boxAdapters.adapterFor(i.box,Pl);zt(this,rd,"f").add(n)&&zt(this,El,"f").add(n)},onRemoved:({box:{address:{uuid:i}}})=>{zt(this,El,"f").remove(zt(this,rd,"f").removeByKey(i))}}))}get box(){return zt(this,dn,"f")}get uuid(){return zt(this,dn,"f").address.uuid}get address(){return zt(this,dn,"f").address}get startInSeconds(){return zt(this,dn,"f").startInSeconds.getValue()}get endInSeconds(){return zt(this,dn,"f").endInSeconds.getValue()}get transients(){return zt(this,El,"f")}get fileName(){return zt(this,dn,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return zt(this,tm,"f").call(this)}getOrCreateLoader(){return zt(this,td,"f").sampleManager.getOrCreate(zt(this,dn,"f").address.uuid)}terminate(){zt(this,em,"f").terminate()}};em=new WeakMap,td=new WeakMap,dn=new WeakMap,rd=new WeakMap,El=new WeakMap,tm=new WeakMap;Ri.Comparator=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),F("Events at the same position: "+r.position+", "+e.position)):t};var id=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},sr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},nd,rm,im,Qn,ad,od,nm,Oo=class{constructor(e,t){nd.add(this),this.type="warp-marker",rm.set(this,new z),im.set(this,void 0),Qn.set(this,void 0),ad.set(this,void 0),od.set(this,!1),id(this,im,e,"f"),id(this,Qn,t,"f"),id(this,ad,new ee,"f"),sr(this,rm,"f").own(t.subscribe(Fe.Children,()=>sr(this,nd,"m",nm).call(this)))}onSelected(){id(this,od,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),sr(this,nd,"m",nm).call(this)}onDeselected(){id(this,od,!1,"f"),sr(this,nd,"m",nm).call(this)}get box(){return sr(this,Qn,"f")}get uuid(){return sr(this,Qn,"f").address.uuid}get address(){return sr(this,Qn,"f").address}get position(){return sr(this,Qn,"f").position.getValue()}get seconds(){return sr(this,Qn,"f").seconds.getValue()}get isSelected(){return sr(this,od,"f")}get optWarping(){return sr(this,Qn,"f").owner.targetVertex.map(e=>sr(this,im,"f").boxAdapters.adapterFor(e.box,pn.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return sr(this,ad,"f").subscribe(e)}terminate(){sr(this,rm,"f").terminate()}};rm=new WeakMap,im=new WeakMap,Qn=new WeakMap,ad=new WeakMap,od=new WeakMap,nd=new WeakSet,nm=function(){sr(this,ad,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var om=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),F("Events at the same position: "+r.position+", "+e.position)):t};var sd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},lr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},am,sm,Sl,Za,ld,Bl,hn=class{constructor(e,t){am.set(this,new z),sm.set(this,void 0),Sl.set(this,void 0),Za.set(this,void 0),ld.set(this,void 0),Bl.set(this,void 0),sd(this,sm,e,"f"),sd(this,Sl,t,"f"),sd(this,Za,new ee,"f"),sd(this,ld,A.newSet(({uuid:i})=>i),"f"),sd(this,Bl,yr.create(om),"f"),lr(this,am,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:i=>{let n=lr(this,sm,"f").boxAdapters.adapterFor(i.box,Oo);lr(this,ld,"f").add(n)&&(lr(this,Bl,"f").add(n),lr(this,Za,"f").notify())},onRemoved:({box:{address:{uuid:i}}})=>{lr(this,Bl,"f").remove(lr(this,ld,"f").removeByKey(i)),lr(this,Za,"f").notify()}}))}get box(){return lr(this,Sl,"f")}get uuid(){return lr(this,Sl,"f").address.uuid}get address(){return lr(this,Sl,"f").address}get warpMarkers(){return lr(this,Bl,"f")}subscribe(e){return lr(this,Za,"f").subscribe(e)}onChanged(){lr(this,Za,"f").notify()}terminate(){lr(this,am,"f").terminate()}};am=new WeakMap,sm=new WeakMap,Sl=new WeakMap,Za=new WeakMap,ld=new WeakMap,Bl=new WeakMap;var ud=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ut=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},lm,um,Vo,Ga,cd,Fl,fn=class{constructor(e,t){lm.set(this,new z),um.set(this,void 0),Vo.set(this,void 0),Ga.set(this,void 0),cd.set(this,void 0),Fl.set(this,void 0),ud(this,um,e,"f"),ud(this,Vo,t,"f"),ud(this,Ga,new ee,"f"),ud(this,cd,A.newSet(({uuid:i})=>i),"f"),ud(this,Fl,yr.create(om),"f"),Ut(this,lm,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:i=>{let n=Ut(this,um,"f").boxAdapters.adapterFor(i.box,Oo);Ut(this,cd,"f").add(n)&&(Ut(this,Fl,"f").add(n),Ut(this,Ga,"f").notify())},onRemoved:({box:{address:{uuid:i}}})=>{Ut(this,Fl,"f").remove(Ut(this,cd,"f").removeByKey(i)),Ut(this,Ga,"f").notify()}}))}get box(){return Ut(this,Vo,"f")}get uuid(){return Ut(this,Vo,"f").address.uuid}get address(){return Ut(this,Vo,"f").address}get warpMarkers(){return Ut(this,Fl,"f")}get playbackRate(){return Ut(this,Vo,"f").playbackRate.getValue()}get transientPlayMode(){return Hr(Ut(this,Vo,"f").transientPlayMode.getValue(),_o)}subscribe(e){return Ut(this,Ga,"f").subscribe(e)}onChanged(){Ut(this,Ga,"f").notify()}terminate(){Ut(this,lm,"f").terminate()}};lm=new WeakMap,um=new WeakMap,Vo=new WeakMap,Ga=new WeakMap,cd=new WeakMap,Fl=new WeakMap;var pn;(function(r){r.isAudioPlayMode=e=>e instanceof hn||e instanceof fn})(pn||(pn={}));var Tr=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ie=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},qa,Nl,Ha,at,kl,Ja,dd,hd,pd,Qa,$l,Ml,Dl,Yn=class r{constructor(e,t){qa.add(this),this.type="audio-clip",Nl.set(this,new z),Ha.set(this,void 0),at.set(this,void 0),kl.set(this,void 0),Ja.set(this,void 0),dd.set(this,void 0),hd.set(this,void 0),pd.set(this,void 0),Qa.set(this,g.None),$l.set(this,g.None),Ml.set(this,K.Empty),Tr(this,Ha,e,"f"),Tr(this,at,t,"f"),Tr(this,pd,!0,"f"),Tr(this,kl,new Yr,"f"),Tr(this,Ja,ie(this,Nl,"f").own(new Ir(!1)),"f"),Tr(this,dd,wo.aware(e.tempoMap,t.timeBase,r.STATIC_POSITION,t.duration),"f"),Tr(this,hd,ie(this,Nl,"f").own(new ee),"f"),ie(this,Nl,"f").ownAll(ie(this,at,"f").pointerHub.subscribe({onAdded:()=>ie(this,qa,"m",Dl).call(this),onRemoved:()=>ie(this,qa,"m",Dl).call(this)}),ie(this,at,"f").playMode.catchupAndSubscribe(({targetVertex:i})=>{ie(this,Ml,"f").terminate(),i.match({none:()=>ie(this,kl,"f").clear(),some:({box:n})=>{let o=ie(this,Ha,"f").boxAdapters.adapterFor(n,pn.isAudioPlayMode);Tr(this,Ml,o.subscribe(()=>ie(this,qa,"m",Dl).call(this)),"f"),ie(this,kl,"f").wrap(o)}})}),ie(this,at,"f").file.catchupAndSubscribe(i=>{Tr(this,Qa,i.targetVertex.map(n=>ie(this,Ha,"f").boxAdapters.adapterFor(n.box,Ri)),"f"),ie(this,$l,"f").ifSome(n=>n.terminate()),Tr(this,$l,ie(this,Qa,"f").map(n=>n.getOrCreateLoader().subscribe(()=>ie(this,qa,"m",Dl).call(this))),"f")}),ie(this,at,"f").subscribe(Fe.Children,i=>ie(this,qa,"m",Dl).call(this))),Tr(this,pd,!1,"f")}catchupAndSubscribeSelected(e){return ie(this,Ja,"f").catchupAndSubscribe(e)}subscribeChange(e){return ie(this,hd,"f").subscribe(e)}accept(e){return _(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){cl.create(ie(this,Ha,"f").boxGraph,A.generate(),t=>{t.index.setValue(this.indexField.getValue()),t.gain.setValue(this.gain.getValue()),t.timeBase.setValue(this.timeBase),t.label.setValue(this.label),t.hue.setValue(this.hue),t.duration.setValue(this.duration),t.mute.setValue(this.mute),t.clips.refer(ie(this,at,"f").clips.targetVertex.unwrap()),t.file.refer(ie(this,at,"f").file.targetVertex.unwrap()),t.events.refer(ie(this,at,"f").events.targetVertex.unwrap()),ie(this,at,"f").playMode.ifVertex(i=>t.playMode.refer(i.box))})}onSelected(){ie(this,Ja,"f").setValue(!0)}onDeselected(){ie(this,Ja,"f").setValue(!1)}get isSelected(){return ie(this,Ja,"f").getValue()}get box(){return ie(this,at,"f")}get uuid(){return ie(this,at,"f").address.uuid}get address(){return ie(this,at,"f").address}get indexField(){return ie(this,at,"f").index}get duration(){return ie(this,dd,"f").toPPQN()}set duration(e){ie(this,dd,"f").fromPPQN(e)}get mute(){return ie(this,at,"f").mute.getValue()}get hue(){return ie(this,at,"f").hue.getValue()}get gain(){return ie(this,at,"f").gain}get file(){return ie(this,Qa,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return ie(this,kl,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return g.None}get timeBase(){return Hr(ie(this,at,"f").timeBase.getValue(),nr)}get waveformOffset(){return ie(this,at,"f").waveformOffset}get isPlayModeNoWarp(){return ie(this,at,"f").playMode.isEmpty()}get asPlayModePitch(){return this.observableOptPlayMode.map(e=>Me(e,hn)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Me(e,fn)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>pn.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(ie(this,Qa,"f").isEmpty())return"No Audio File";let e=ie(this,Qa,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):ie(this,at,"f").label.getValue()}get trackBoxAdapter(){return ie(this,pd,"f")?g.None:ie(this,at,"f").clips.targetVertex.map(e=>ie(this,Ha,"f").boxAdapters.adapterFor(e.box,pt))}get isMirrowed(){return!1}get canMirror(){return!1}terminate(){ie(this,$l,"f").ifSome(e=>e.terminate()),Tr(this,$l,g.None,"f"),ie(this,Ml,"f").terminate(),Tr(this,Ml,K.Empty,"f"),ie(this,Nl,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${A.toString(ie(this,at,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};Nl=new WeakMap,Ha=new WeakMap,at=new WeakMap,kl=new WeakMap,Ja=new WeakMap,dd=new WeakMap,hd=new WeakMap,pd=new WeakMap,Qa=new WeakMap,$l=new WeakMap,Ml=new WeakMap,qa=new WeakSet,Dl=function(){ie(this,hd,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};Yn.STATIC_POSITION={getValue:()=>0};var fd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},mt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Il,Nt,cm,md,Ya=class r{constructor(e,t){this.type="note-event",Il.set(this,void 0),Nt.set(this,void 0),cm.set(this,void 0),md.set(this,!1),fd(this,Il,e,"f"),fd(this,Nt,t,"f"),fd(this,cm,mt(this,Nt,"f").subscribe(Fe.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.collection.unwrap(),o=i.address.fieldKeys,a=O.equals(mt(this,Nt,"f").pitch.address.fieldKeys,o),s=O.equals(mt(this,Nt,"f").position.address.fieldKeys,o);a||s?n.requestSorting():n.onEventPropertyChanged()}}),"f")}onSelected(){fd(this,md,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){fd(this,md,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){mt(this,cm,"f").terminate()}get box(){return mt(this,Nt,"f")}get uuid(){return mt(this,Nt,"f").address.uuid}get address(){return mt(this,Nt,"f").address}get position(){return mt(this,Nt,"f").position.getValue()}get duration(){return mt(this,Nt,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return mt(this,Nt,"f").velocity.getValue()}get pitch(){return mt(this,Nt,"f").pitch.getValue()}get cent(){return mt(this,Nt,"f").cent.getValue()}get chance(){return mt(this,Nt,"f").chance.getValue()}get playCount(){return mt(this,Nt,"f").playCount.getValue()}get playCurve(){return mt(this,Nt,"f").playCurve.getValue()}get isSelected(){return mt(this,md,"f")}get collection(){return mt(this,Nt,"f").events.targetVertex.map(e=>mt(this,Il,"f").boxAdapters.adapterFor(e.box,ri))}normalizedPitch(){if(this.collection.isEmpty())return .5;let{minPitch:e,maxPitch:t}=this.collection.unwrap();return e===t?.5:1-(this.pitch-e)/(t-e)}copyAsNoteEvent(){return{type:"note-event",position:this.position,duration:this.duration,pitch:this.pitch,cent:this.cent,velocity:this.velocity}}copyTo(e){return mt(this,Il,"f").boxAdapters.adapterFor(Eo.create(mt(this,Il,"f").boxGraph,A.generate(),t=>{t.position.setValue(e?.position??this.position),t.duration.setValue(e?.duration??this.duration),t.pitch.setValue(e?.pitch??this.pitch),t.playCount.setValue(e?.playCount??this.playCount),t.events.refer(e?.events??this.collection.unwrap().box.events),t.velocity.setValue(this.velocity),t.cent.setValue(this.cent),t.chance.setValue(this.chance)}),r)}computeCurveValue(e){return ir.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,t=this.collection.unwrap().box.events,i=O.create(n=>{let o=Math.floor(this.computeCurveValue(n/e)*this.duration),a=Math.floor(this.computeCurveValue((n+1)/e)*this.duration);return this.copyTo({position:Math.floor(this.position+o),duration:Math.max(1,a-o),playCount:1,events:t})},e);return mt(this,Nt,"f").delete(),i}};Il=new WeakMap,Nt=new WeakMap,cm=new WeakMap,md=new WeakMap;var mn=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},me=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Xn,gd,zo,Oi,Xa,vd,ii,pm,hm,fm,Uo,dm,yd,ri=class r{constructor(e,t){Xn.add(this),gd.set(this,new z),zo.set(this,void 0),Oi.set(this,void 0),Xa.set(this,void 0),vd.set(this,void 0),ii.set(this,void 0),pm.set(this,60),hm.set(this,60),fm.set(this,0),Uo.set(this,!1),mn(this,zo,e,"f"),mn(this,Oi,t,"f"),mn(this,Xa,new ee,"f"),mn(this,vd,A.newSet(i=>i.uuid),"f"),mn(this,ii,yr.create(ir.Comparator),"f"),me(this,gd,"f").own(me(this,Oi,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:i})=>{let n=me(this,zo,"f").boxAdapters.adapterFor(i,Ya);me(this,vd,"f").add(n)&&(me(this,ii,"f").add(n),me(this,Xn,"m",dm).call(this))},onRemoved:({box:{address:{uuid:i}}})=>{me(this,ii,"f").remove(me(this,vd,"f").removeByKey(i)),me(this,Xn,"m",dm).call(this)}})),me(this,gd,"f").own(me(this,Oi,"f").owners.pointerHub.subscribe({onAdded:()=>me(this,Xa,"f").notify(this),onRemoved:()=>me(this,Xa,"f").notify(this)}))}copy(){let e=me(this,zo,"f").boxGraph,t=Gn.create(e,A.generate());return me(this,ii,"f").asArray().forEach(i=>i.copyTo({events:t.events})),me(this,zo,"f").boxAdapters.adapterFor(t,r)}createEvent({position:e,duration:t,velocity:i,pitch:n,chance:o,playCount:a,cent:s}){return me(this,zo,"f").boxAdapters.adapterFor(Eo.create(me(this,zo,"f").boxGraph,A.generate(),u=>{u.position.setValue(e),u.duration.setValue(t),u.velocity.setValue(i),u.pitch.setValue(n),u.chance.setValue(o),u.playCount.setValue(a),u.cent.setValue(s),u.events.refer(me(this,Oi,"f").events)}),Ya)}subscribeChange(e){return me(this,Xa,"f").subscribe(e)}selectable(){return me(this,ii,"f").asArray()}selectableAt(e){for(let t of me(this,ii,"f").asArray())if(t.position<=e.u&&e.u<t.complete&&t.pitch===e.v)return Je.one(t);return Je.empty()}selectablesBetween(e,t){let i=[];for(let n of me(this,ii,"f").asArray())Bc.intersect1D(n.position,n.complete,e.u,t.u)&&Bc.intersect1D(n.pitch,n.pitch,e.v,t.v)&&i.push(n);return i}requestSorting(){me(this,ii,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){me(this,Xn,"m",dm).call(this)}terminate(){me(this,gd,"f").terminate()}get box(){return me(this,Oi,"f")}get uuid(){return me(this,Oi,"f").address.uuid}get address(){return me(this,Oi,"f").address}get numOwners(){return me(this,Oi,"f").owners.pointerHub.filter(l.NoteEventCollection).length}get events(){return me(this,Uo,"f")||me(this,Xn,"m",yd).call(this),me(this,ii,"f")}get minPitch(){return me(this,Uo,"f")||me(this,Xn,"m",yd).call(this),me(this,pm,"f")}get maxPitch(){return me(this,Uo,"f")||me(this,Xn,"m",yd).call(this),me(this,hm,"f")}get maxDuration(){return me(this,Uo,"f")||me(this,Xn,"m",yd).call(this),me(this,fm,"f")}toString(){return`{NoteEventCollectionBox ${A.toString(me(this,Oi,"f").address.uuid)}}`}};gd=new WeakMap,zo=new WeakMap,Oi=new WeakMap,Xa=new WeakMap,vd=new WeakMap,ii=new WeakMap,pm=new WeakMap,hm=new WeakMap,fm=new WeakMap,Uo=new WeakMap,Xn=new WeakSet,dm=function(){mn(this,Uo,!1,"f"),me(this,Xa,"f").notify(this)},yd=function(){let e=127,t=0,i=0;me(this,ii,"f").asArray().forEach(({pitch:n,duration:o})=>{e=Math.min(e,n),t=Math.max(t,n),i=Math.max(i,o)}),mn(this,pm,e,"f"),mn(this,hm,t,"f"),mn(this,fm,i,"f"),mn(this,Uo,!0,"f")};var es=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Pe=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ts,Cl,rs,_t,is,bd,xd,wd,Tl,Rl=class{constructor(e,t){ts.add(this),this.type="note-clip",Cl.set(this,new z),rs.set(this,void 0),_t.set(this,void 0),is.set(this,void 0),bd.set(this,void 0),xd.set(this,void 0),wd.set(this,K.Empty),es(this,rs,e,"f"),es(this,_t,t,"f"),es(this,xd,!0,"f"),es(this,is,Pe(this,Cl,"f").own(new Ir(!1)),"f"),es(this,bd,Pe(this,Cl,"f").own(new ee),"f"),Pe(this,Cl,"f").ownAll(Pe(this,_t,"f").pointerHub.subscribe({onAdded:()=>Pe(this,ts,"m",Tl).call(this),onRemoved:()=>Pe(this,ts,"m",Tl).call(this)}),Pe(this,_t,"f").subscribe(Fe.Children,i=>Pe(this,ts,"m",Tl).call(this)),Pe(this,_t,"f").events.catchupAndSubscribe(({targetVertex:i})=>{Pe(this,wd,"f").terminate(),es(this,wd,i.match({none:()=>K.Empty,some:({box:n})=>Pe(this,rs,"f").boxAdapters.adapterFor(n,ri).subscribeChange(()=>Pe(this,ts,"m",Tl).call(this))}),"f"),Pe(this,ts,"m",Tl).call(this)})),es(this,xd,!1,"f")}catchupAndSubscribeSelected(e){return Pe(this,is,"f").catchupAndSubscribe(e)}subscribeChange(e){return Pe(this,bd,"f").subscribe(e)}accept(e){return _(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Pe(this,_t,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:Pe(this,_t,"f").events.targetVertex.unwrap();ll.create(Pe(this,rs,"f").boxGraph,A.generate(),i=>{i.index.setValue(this.indexField.getValue()),i.label.setValue(this.label),i.hue.setValue(this.hue),i.duration.setValue(this.duration),i.mute.setValue(this.mute),i.clips.refer(Pe(this,_t,"f").clips.targetVertex.unwrap()),i.events.refer(t)})}onSelected(){Pe(this,is,"f").setValue(!0)}onDeselected(){Pe(this,is,"f").setValue(!1)}get isSelected(){return Pe(this,is,"f").getValue()}terminate(){Pe(this,wd,"f").terminate(),Pe(this,Cl,"f").terminate()}get box(){return Pe(this,_t,"f")}get uuid(){return Pe(this,_t,"f").address.uuid}get address(){return Pe(this,_t,"f").address}get indexField(){return Pe(this,_t,"f").index}get duration(){return Pe(this,_t,"f").duration.getValue()}get mute(){return Pe(this,_t,"f").mute.getValue()}get hue(){return Pe(this,_t,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return Pe(this,_t,"f").events.targetVertex.map(e=>Pe(this,rs,"f").boxAdapters.adapterFor(e.box,ri))}get label(){return Pe(this,_t,"f").label.getValue()}get trackBoxAdapter(){return Pe(this,xd,"f")?g.None:Pe(this,_t,"f").clips.targetVertex.map(e=>Pe(this,rs,"f").boxAdapters.adapterFor(e.box,pt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${A.toString(Pe(this,_t,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};Cl=new WeakMap,rs=new WeakMap,_t=new WeakMap,is=new WeakMap,bd=new WeakMap,xd=new WeakMap,wd=new WeakMap,ts=new WeakSet,Tl=function(){Pe(this,bd,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var mm={for:(r,e)=>Y(e.accept({visitNoteClipBox:t=>r.adapterFor(t,Rl),visitValueClipBox:t=>r.adapterFor(t,Ro),visitAudioClipBox:t=>r.adapterFor(t,Yn)}),"")};var gm=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},jo=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},vm,Ol,Ad,_d,ym=class{constructor(e,t){vm.set(this,void 0),Ol.set(this,void 0),Ad.set(this,void 0),_d.set(this,void 0),gm(this,vm,e,"f"),gm(this,Ol,new z,"f"),gm(this,Ad,jo(this,Ol,"f").own(new ee),"f"),gm(this,_d,jo(this,Ol,"f").own(Vt.create(e.box.clips,i=>mm.for(t,i),l.ClipCollection)),"f"),jo(this,_d,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return jo(this,vm,"f")}get collection(){return jo(this,_d,"f")}dispatchChange(){jo(this,Ad,"f").notify()}subscribeChanges(e){return jo(this,Ad,"f").subscribe(e)}terminate(){jo(this,Ol,"f").terminate()}};vm=new WeakMap,Ol=new WeakMap,Ad=new WeakMap,_d=new WeakMap;var ht=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},G=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Rr,Pd,gn,Ve,Ed,Sd,Bd,Vl,Fd,Nd,ns,zl,Ul,jl,Ll,Kl,ni,Lo=class r{constructor(e,t){Rr.add(this),this.type="audio-region",Pd.set(this,void 0),gn.set(this,void 0),Ve.set(this,void 0),Ed.set(this,void 0),Sd.set(this,void 0),Bd.set(this,void 0),Vl.set(this,void 0),Fd.set(this,void 0),Nd.set(this,void 0),ns.set(this,g.None),zl.set(this,K.Empty),Ul.set(this,K.Empty),jl.set(this,K.Empty),Ll.set(this,K.Empty),Kl.set(this,void 0),ht(this,gn,e,"f"),ht(this,Ve,t,"f"),ht(this,Pd,new z,"f");let{timeBase:i,position:n,duration:o,loopOffset:a,loopDuration:s}=t;ht(this,Ed,wo.aware(e.tempoMap,i,n,o),"f"),ht(this,Sd,wo.aware(e.tempoMap,i,n,a),"f"),ht(this,Bd,wo.aware(e.tempoMap,i,n,s),"f"),ht(this,Vl,new Yr,"f"),ht(this,Fd,new ee,"f"),ht(this,Kl,!1,"f"),ht(this,Nd,!0,"f"),G(this,Pd,"f").ownAll(G(this,Ve,"f").pointerHub.subscribe({onAdded:()=>G(this,Rr,"m",ni).call(this),onRemoved:()=>G(this,Rr,"m",ni).call(this)}),G(this,Ve,"f").file.catchupAndSubscribe(u=>{ht(this,ns,u.targetVertex.map(c=>G(this,gn,"f").boxAdapters.adapterFor(c.box,Ri)),"f"),G(this,zl,"f").terminate(),ht(this,zl,G(this,ns,"f").mapOr(c=>c.getOrCreateLoader().subscribe(()=>G(this,Rr,"m",ni).call(this)),K.Empty),"f")}),G(this,Ve,"f").playMode.catchupAndSubscribe(({targetVertex:u})=>{G(this,Ul,"f").terminate(),u.match({none:()=>G(this,Vl,"f").clear(),some:({box:c})=>{let p=G(this,gn,"f").boxAdapters.adapterFor(c,pn.isAudioPlayMode);ht(this,Ul,p.subscribe(()=>G(this,Rr,"m",ni).call(this)),"f"),G(this,Vl,"f").wrap(p)}})}),G(this,Ve,"f").timeBase.catchupAndSubscribe(u=>{G(this,jl,"f").terminate(),Hr(u.getValue(),nr)===nr.Seconds&&ht(this,jl,e.tempoMap.subscribe(()=>G(this,Rr,"m",ni).call(this)),"f")}),G(this,Ve,"f").subscribe(Fe.Children,u=>{if(!this.trackBoxAdapter.isEmpty()&&(u.type==="primitive"||u.type==="pointer")){let c=this.trackBoxAdapter.unwrap();G(this,Ve,"f").position.address.equals(u.address)?(c.regions.onIndexingChanged(),G(this,Rr,"m",ni).call(this)):G(this,Rr,"m",ni).call(this)}}),G(this,Ve,"f").events.catchupAndSubscribe(({targetVertex:u})=>{G(this,Ll,"f").terminate(),ht(this,Ll,u.match({none:()=>K.Empty,some:({box:c})=>G(this,gn,"f").boxAdapters.adapterFor(c,ar).subscribeChange(()=>G(this,Rr,"m",ni).call(this))}),"f"),G(this,Rr,"m",ni).call(this)})),ht(this,Nd,!1,"f")}subscribeChange(e){return G(this,Fd,"f").subscribe(e)}accept(e){return _(e.visitAudioRegionBoxAdapter,this)}onSelected(){ht(this,Kl,!0,"f"),G(this,Rr,"m",ni).call(this)}onDeselected(){ht(this,Kl,!1,"f"),G(this,Rr,"m",ni).call(this)}get isSelected(){return G(this,Kl,"f")}get box(){return G(this,Ve,"f")}get uuid(){return G(this,Ve,"f").address.uuid}get address(){return G(this,Ve,"f").address}get position(){return G(this,Ve,"f").position.getValue()}get duration(){return G(this,Ed,"f").toPPQN()}get complete(){return this.position+this.duration}get loopOffset(){return G(this,Sd,"f").toPPQN()}get loopDuration(){return G(this,Bd,"f").toPPQN()}get offset(){return this.position-this.loopOffset}get mute(){return G(this,Ve,"f").mute.getValue()}get hue(){return G(this,Ve,"f").hue.getValue()}get gain(){return G(this,Ve,"f").gain}get file(){return G(this,ns,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return G(this,Vl,"f")}get timeBase(){return Hr(G(this,Ve,"f").timeBase.getValue(),nr)}get waveformOffset(){return G(this,Ve,"f").waveformOffset}get isPlayModeNoWarp(){return G(this,Ve,"f").playMode.isEmpty()}get asPlayModePitch(){return this.observableOptPlayMode.map(e=>Me(e,hn)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Me(e,fn)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>pn.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(G(this,ns,"f").isEmpty())return"No Audio File";let e=G(this,ns,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):G(this,Ve,"f").label.getValue()}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get trackBoxAdapter(){return G(this,Ve,"f").regions.targetVertex.map(e=>G(this,gn,"f").boxAdapters.adapterFor(e.box,pt))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return G(this,Ve,"f").events.targetVertex.map(e=>G(this,gn,"f").boxAdapters.adapterFor(e.box,ar))}set position(e){G(this,Ve,"f").position.setValue(e)}set duration(e){G(this,Ed,"f").fromPPQN(e)}set loopOffset(e){G(this,Sd,"f").fromPPQN(e)}set loopDuration(e){G(this,Bd,"f").fromPPQN(e)}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),i=e?.consolidate===!0?t.copy().box.owners:t.box.owners,n=G(this,gn,"f").boxAdapters.adapterFor(Fo.create(G(this,gn,"f").boxGraph,A.generate(),o=>{o.timeBase.setValue(G(this,Ve,"f").timeBase.getValue()),o.position.setValue(e?.position??G(this,Ve,"f").position.getValue()),o.regions.refer(e?.track??G(this,Ve,"f").regions.targetVertex.unwrap()),o.file.refer(G(this,Ve,"f").file.targetVertex.unwrap()),o.events.refer(i),o.mute.setValue(this.mute),o.hue.setValue(this.hue),o.label.setValue(this.label),o.gain.setValue(this.gain.getValue()),G(this,Ve,"f").playMode.ifVertex(a=>o.playMode.refer(a.box))}),r);return n.duration=e?.duration??this.duration,n.loopOffset=e?.loopOffset??this.loopOffset,n.loopDuration=e?.loopDuration??this.loopDuration,n}consolidate(){}canFlatten(e){return!1}flatten(e){return g.None}terminate(){G(this,zl,"f").terminate(),ht(this,zl,K.Empty,"f"),G(this,jl,"f").terminate(),ht(this,jl,K.Empty,"f"),G(this,Ul,"f").terminate(),ht(this,Ul,K.Empty,"f"),G(this,Ll,"f").terminate(),ht(this,Ll,K.Empty,"f"),G(this,Pd,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${A.toString(G(this,Ve,"f").address.uuid)}}`}};Pd=new WeakMap,gn=new WeakMap,Ve=new WeakMap,Ed=new WeakMap,Sd=new WeakMap,Bd=new WeakMap,Vl=new WeakMap,Fd=new WeakMap,Nd=new WeakMap,ns=new WeakMap,zl=new WeakMap,Ul=new WeakMap,jl=new WeakMap,Ll=new WeakMap,Kl=new WeakMap,Rr=new WeakSet,ni=function(){G(this,Nd,"f")||(G(this,Fd,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var eo=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},de=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},vn,xm,yn,Qe,Md,kd,Wl,$d,to,Ko=class r{constructor(e,t){vn.add(this),this.type="note-region",xm.set(this,new z),yn.set(this,void 0),Qe.set(this,void 0),Md.set(this,void 0),kd.set(this,void 0),Wl.set(this,void 0),$d.set(this,K.Empty),eo(this,yn,e,"f"),eo(this,Qe,t,"f"),eo(this,Md,new ee,"f"),eo(this,Wl,!1,"f"),eo(this,kd,!0,"f"),de(this,xm,"f").ownAll(de(this,Qe,"f").pointerHub.subscribe({onAdded:()=>de(this,vn,"m",to).call(this),onRemoved:()=>de(this,vn,"m",to).call(this)}),de(this,Qe,"f").subscribe(Fe.Children,i=>{if(!this.trackBoxAdapter.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.trackBoxAdapter.unwrap();de(this,Qe,"f").position.address.equals(i.address)?(n.regions.onIndexingChanged(),de(this,vn,"m",to).call(this)):de(this,vn,"m",to).call(this)}}),de(this,Qe,"f").events.catchupAndSubscribe(({targetVertex:i})=>{de(this,$d,"f").terminate(),eo(this,$d,i.match({none:()=>K.Empty,some:({box:n})=>de(this,yn,"f").boxAdapters.adapterFor(n,ri).subscribeChange(()=>de(this,vn,"m",to).call(this))}),"f"),de(this,vn,"m",to).call(this)})),eo(this,kd,!1,"f")}set position(e){de(this,Qe,"f").position.setValue(e)}set duration(e){de(this,Qe,"f").duration.setValue(e)}set loopOffset(e){de(this,Qe,"f").loopOffset.setValue(e)}set loopDuration(e){de(this,Qe,"f").loopDuration.setValue(e)}subscribeChange(e){return de(this,Md,"f").subscribe(e)}accept(e){return _(e.visitNoteRegionBoxAdapter,this)}onSelected(){eo(this,Wl,!0,"f"),de(this,vn,"m",to).call(this)}onDeselected(){eo(this,Wl,!1,"f"),de(this,vn,"m",to).call(this)}get isSelected(){return de(this,Wl,"f")}*iterateActiveNotesAt(e){let t=this.optCollection;if(t.isEmpty())return;let i=t.unwrap(),n=Wt.globalToLocal(this,e);for(let o of i.events.iterateFrom(n-i.maxDuration)){if(n<o.position)return;n<o.complete&&(yield o.copyAsNoteEvent())}}terminate(){de(this,$d,"f").terminate(),de(this,xm,"f").terminate()}get box(){return de(this,Qe,"f")}get uuid(){return de(this,Qe,"f").address.uuid}get address(){return de(this,Qe,"f").address}get position(){return de(this,Qe,"f").position.getValue()}get duration(){return de(this,Qe,"f").duration.getValue()}get loopOffset(){return de(this,Qe,"f").loopOffset.getValue()}get loopDuration(){return de(this,Qe,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return de(this,Qe,"f").mute.getValue()}get hue(){return de(this,Qe,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return de(this,Qe,"f").events.targetVertex.map(e=>de(this,yn,"f").boxAdapters.adapterFor(e.box,ri))}get label(){return de(this,Qe,"f").label.getValue()}get trackBoxAdapter(){return de(this,kd,"f")?g.None:de(this,Qe,"f").regions.targetVertex.map(e=>de(this,yn,"f").boxAdapters.adapterFor(e.box,pt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),i=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return de(this,yn,"f").boxAdapters.adapterFor(Ra.create(de(this,yn,"f").boxGraph,A.generate(),n=>{n.position.setValue(e?.position??this.position),n.duration.setValue(e?.duration??this.duration),n.loopOffset.setValue(e?.loopOffset??this.loopOffset),n.loopDuration.setValue(e?.loopDuration??this.loopDuration),n.hue.setValue(this.hue),n.label.setValue(this.label),n.mute.setValue(this.mute),n.events.refer(i),n.regions.refer(e?.track??de(this,Qe,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let t=de(this,yn,"f").boxGraph,i=Gn.create(t,A.generate());e.events.asArray().forEach(n=>n.copyTo({events:i.events})),de(this,Qe,"f").events.refer(i.owners)})}canFlatten(e){return e.length>0&&O.satisfy(e,(t,i)=>t.trackBoxAdapter.contains(i.trackBoxAdapter.unwrap()))&&e.every(t=>t.isSelected&&t instanceof r)}flatten(e){if(!this.canFlatten(e))return g.None;let t=de(this,yn,"f").boxGraph,i=e.toSorted(xo.Comparator),n=O.getFirst(i,"Internal error (no first)"),o=O.getLast(i,"Internal error (no last)"),a=n.position,s=o.position+o.duration,u=n.trackBoxAdapter.unwrap(),c=Gn.create(t,A.generate()),p=Array.from(u.regions.collection.iterateRange(a,s));return p.filter(d=>d.isSelected).forEach(d=>{let f=d;for(let{resultStart:v,resultEnd:m,rawStart:y}of Wt.locateLoops(f,f.position,f.complete)){let x=Math.floor(v-y),$=Math.floor(m-y);for(let I of f.optCollection.unwrap().events.iterateRange(x,$))I.copyTo({position:I.position+y-n.position,events:c.events})}}),p.forEach(({box:d})=>d.delete()),g.wrap(Ra.create(t,A.generate(),d=>{d.position.setValue(a),d.duration.setValue(s-a),d.loopDuration.setValue(s-a),d.loopOffset.setValue(0),d.hue.setValue(this.hue),d.mute.setValue(this.mute),d.label.setValue(this.label),d.events.refer(c.owners),d.regions.refer(u.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${A.toString(de(this,Qe,"f").address.uuid)} p: ${Q.toString(this.position)}, c: ${Q.toString(this.complete)}}`}};xm=new WeakMap,yn=new WeakMap,Qe=new WeakMap,Md=new WeakMap,kd=new WeakMap,Wl=new WeakMap,$d=new WeakMap,vn=new WeakSet,to=function(){de(this,Md,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var ro=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},le=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Vi,Zl,xn,Ye,Cd,Gl,Dd,Id,wn,io=class r{constructor(e,t){Vi.add(this),this.type="value-region",Zl.set(this,new z),xn.set(this,void 0),Ye.set(this,void 0),Cd.set(this,void 0),Gl.set(this,void 0),Dd.set(this,void 0),Id.set(this,K.Empty),ro(this,xn,e,"f"),ro(this,Ye,t,"f"),ro(this,Dd,!0,"f"),ro(this,Cd,new ee,"f"),ro(this,Gl,!1,"f"),le(this,Zl,"f").own(le(this,Ye,"f").pointerHub.subscribe({onAdded:()=>le(this,Vi,"m",wn).call(this),onRemoved:()=>le(this,Vi,"m",wn).call(this)})),le(this,Zl,"f").own(le(this,Ye,"f").subscribe(Fe.Children,i=>{if(!this.trackBoxAdapter.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.trackBoxAdapter.unwrap();le(this,Ye,"f").position.address.equals(i.address)?(n.regions.onIndexingChanged(),le(this,Vi,"m",wn).call(this)):le(this,Vi,"m",wn).call(this)}})),le(this,Zl,"f").own(le(this,Ye,"f").events.catchupAndSubscribe(({targetVertex:i})=>{le(this,Id,"f").terminate(),ro(this,Id,i.match({none:()=>K.Empty,some:({box:n})=>le(this,xn,"f").boxAdapters.adapterFor(n,ar).subscribeChange(()=>le(this,Vi,"m",wn).call(this))}),"f"),le(this,Vi,"m",wn).call(this)})),ro(this,Dd,!1,"f")}valueAt(e,t){let i=this.optCollection;return i.isEmpty()?t:i.unwrap().valueAt(Wt.globalToLocal(this,e),t)}incomingValue(e){return this.valueAt(this.position,e)}outgoingValue(e){let t=this.optCollection;if(t.isEmpty())return e;let i=t.unwrap();return(this.complete-this.offset)%this.loopDuration===0?i.valueAt(this.loopDuration,e):i.valueAt(Wt.globalToLocal(this,this.complete),e)}subscribeChange(e){return le(this,Cd,"f").subscribe(e)}accept(e){return _(e.visitValueRegionBoxAdapter,this)}onSelected(){ro(this,Gl,!0,"f"),le(this,Vi,"m",wn).call(this)}onDeselected(){ro(this,Gl,!1,"f"),le(this,Vi,"m",wn).call(this)}get isSelected(){return le(this,Gl,"f")}onValuesPropertyChanged(){le(this,Vi,"m",wn).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){le(this,Id,"f").terminate(),le(this,Zl,"f").terminate()}get box(){return le(this,Ye,"f")}get uuid(){return le(this,Ye,"f").address.uuid}get address(){return le(this,Ye,"f").address}get position(){return le(this,Ye,"f").position.getValue()}get duration(){return le(this,Ye,"f").duration.getValue()}get loopOffset(){return le(this,Ye,"f").loopOffset.getValue()}get loopDuration(){return le(this,Ye,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return le(this,Ye,"f").mute.getValue()}get hue(){return le(this,Ye,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return le(this,Ye,"f").events.targetVertex.map(e=>le(this,xn,"f").boxAdapters.adapterFor(e.box,ar))}get label(){return le(this,Ye,"f").label.getValue()}get trackBoxAdapter(){return le(this,Dd,"f")?g.None:le(this,Ye,"f").regions.targetVertex.map(e=>le(this,xn,"f").boxAdapters.adapterFor(e.box,pt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}set position(e){le(this,Ye,"f").position.setValue(e)}set duration(e){le(this,Ye,"f").duration.setValue(e)}set loopOffset(e){le(this,Ye,"f").loopOffset.setValue(e)}set loopDuration(e){le(this,Ye,"f").loopDuration.setValue(e)}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),i=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return le(this,xn,"f").boxAdapters.adapterFor(Oa.create(le(this,xn,"f").boxGraph,A.generate(),n=>{n.position.setValue(e?.position??this.position),n.duration.setValue(e?.duration??this.duration),n.loopOffset.setValue(e?.loopOffset??this.loopOffset),n.loopDuration.setValue(e?.loopDuration??this.loopDuration),n.hue.setValue(this.hue),n.label.setValue(this.label),n.mute.setValue(this.mute),n.events.refer(i),n.regions.refer(e?.track??le(this,Ye,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let t=le(this,xn,"f").boxGraph,i=qn.create(t,A.generate());e.asArray().forEach(n=>n.copyTo({events:i.events})),le(this,Ye,"f").events.refer(i.owners)})}canFlatten(e){return!1}flatten(e){if(!this.canFlatten(e))return g.None;let t=le(this,xn,"f").boxGraph,i=e.toSorted(xo.Comparator),n=O.getFirst(i,"Internal error (no first)"),o=O.getLast(i,"Internal error (no last)"),a=n.position,s=o.position+o.duration,u=n.trackBoxAdapter.unwrap(),c=qn.create(t,A.generate()),p=Array.from(u.regions.collection.iterateRange(a,s));return p.filter(d=>d.isSelected).forEach(d=>{let f=d;for(let{resultStart:v,resultEnd:m,rawStart:y}of Wt.locateLoops(f,f.position,f.complete)){let x=Math.floor(v-y),$=Math.floor(m-y);for(let I of f.events.unwrap().iterateRange(x,$));}}),p.forEach(({box:d})=>d.delete()),g.wrap(Oa.create(t,A.generate(),d=>{d.position.setValue(a),d.duration.setValue(s-a),d.loopDuration.setValue(s-a),d.loopOffset.setValue(0),d.hue.setValue(this.hue),d.mute.setValue(this.mute),d.label.setValue(this.label),d.events.refer(c.owners),d.regions.refer(u.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${A.toString(le(this,Ye,"f").address.uuid)} p: ${Q.toString(this.position)}, c: ${Q.toString(this.complete)}}`}};Zl=new WeakMap,xn=new WeakMap,Ye=new WeakMap,Cd=new WeakMap,Gl=new WeakMap,Dd=new WeakMap,Id=new WeakMap,Vi=new WeakSet,wn=function(){le(this,Cd,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var NP=(r,e)=>r.position-e.position,kP={for:(r,e)=>Y(e.accept({visitNoteRegionBox:t=>r.adapterFor(t,Ko),visitAudioRegionBox:t=>r.adapterFor(t,Lo),visitValueRegionBox:t=>r.adapterFor(t,io)}),"")};var ql=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Rt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Td,os,Rd,Hl,as,Jl,wm=class{constructor(e,t){Td.set(this,void 0),os.set(this,void 0),Rd.set(this,void 0),Hl.set(this,void 0),as.set(this,void 0),Jl.set(this,void 0),ql(this,Td,e,"f"),ql(this,os,new z,"f"),ql(this,Rd,Rt(this,os,"f").own(new ee),"f"),ql(this,Hl,Rt(this,os,"f").own(new Ft),"f"),ql(this,as,xo.create(NP),"f"),ql(this,Jl,A.newSet(i=>i.uuid),"f"),Rt(this,os,"f").ownAll(Rt(this,Td,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:i})=>{let n=kP.for(t,i),o=Rt(this,Jl,"f").add(n);D(o,`Cannot add ${i}`),Rt(this,as,"f").add(n),Rt(this,Hl,"f").forEach(a=>a.onAdded(n)),this.dispatchChange()},onRemoved:({box:{address:{uuid:i}}})=>{let n=Rt(this,Jl,"f").removeByKey(i);Rt(this,as,"f").remove(n),Rt(this,Hl,"f").forEach(o=>o.onRemoved(n)),this.dispatchChange()}},l.RegionCollection))}get trackBoxAdapter(){return Rt(this,Td,"f")}get collection(){return Rt(this,as,"f")}get adapters(){return Rt(this,Jl,"f")}onIndexingChanged(){Rt(this,as,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),Rt(this,Hl,"f").subscribe(e)}subscribeChanges(e){return Rt(this,Rd,"f").subscribe(e)}dispatchChange(){Rt(this,Rd,"f").notify()}terminate(){Rt(this,os,"f").terminate()}};Td=new WeakMap,os=new WeakMap,Rd=new WeakMap,Hl=new WeakMap,as=new WeakMap,Jl=new WeakMap;var te;(function(r){r[r.Undefined=0]="Undefined",r[r.Notes=1]="Notes",r[r.Audio=2]="Audio",r[r.Value=3]="Value"})(te||(te={}));(function(r){r.toLabelString=e=>{switch(e){case r.Audio:return"Audio";case r.Notes:return"Notes";case r.Value:return"Automation";case r.Undefined:default:return"N/A"}},r.toIconSymbol=e=>{switch(e){case r.Audio:return ke.Waveform;case r.Notes:return ke.Piano;case r.Value:return ke.Automation;case r.Undefined:return ke.AudioBus;default:return ke.Unknown}}})(te||(te={}));var bm;(function(r){r.isDeviceBox=e=>"host"in e&&Me(e.host,B)&&"label"in e&&Me(e.label,C)&&"enabled"in e&&Me(e.enabled,M)&&"minimized"in e&&Me(e.minimized,M),r.isInstrumentDeviceBox=e=>r.isDeviceBox(e)&&e.host.pointerType===l.InstrumentHost,r.isEffectDeviceBox=e=>r.isDeviceBox(e)&&"index"in e&&Me(e.index,S)&&(e.host.pointerType===l.MidiEffectHost||e.host.pointerType===l.AudioEffectHost),r.lookupHostField=e=>Z(e)&&"host"in e&&Me(e.host,B)?e.host:F(`Could not find 'host' field in '${e?.name}'`),r.lookupLabelField=e=>Z(e)&&"label"in e&&Me(e.label,C)?e.label:F(`Could not find 'label' field in '${e?.name}'`),r.lookupEnabledField=e=>Z(e)&&"enabled"in e&&Me(e.enabled,M)?e.enabled:F(`Could not find 'enabled' field in '${e?.name}'`),r.lookupMinimizedField=e=>Z(e)&&"minimized"in e&&Me(e.minimized,M)?e.minimized:F(`Could not find 'minimized' field in '${e?.name}'`),r.lookupIndexField=e=>Z(e)&&"index"in e&&Me(e.index,S)?e.index:F(`Could not find 'index' field in '${e?.name}'`)})(bm||(bm={}));var $P;(function(r){r.toTrackType=e=>{switch(e){case"midi":return te.Notes;case"audio":return te.Audio;default:return F()}}})($P||($P={}));var re;(function(r){r.isAny=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="bus"||e.type==="instrument"||e.type==="audio-effect"),r.isEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="audio-effect"),r.isInstrument=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="instrument",r.isMidiEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="midi-effect",r.isAudioEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="audio-effect",r.isHost=e=>e!==null&&typeof e=="object"&&"class"in e&&e.class==="device-host",r.deleteEffectDevices=e=>{if(e.length===0)return;D(O.satisfy(e,(n,o)=>n.deviceHost().address.equals(o.deviceHost().address)),"Devices are not connected to the same host");let t=e[0];(t.accepts==="audio"?t.deviceHost().audioEffects.field().pointerHub.filter(l.AudioEffectHost):t.accepts==="midi"?t.deviceHost().midiEffects.field().pointerHub.filter(l.MidiEffectHost):F("unknown type")).map(({box:n})=>bm.lookupIndexField(n)).filter(n=>e.some(o=>A.Comparator(o.uuid,n.address.uuid)!==0)).sort((n,o)=>n.getValue()-o.getValue()).forEach((n,o)=>n.setValue(o)),e.forEach(n=>n.box.delete())}})(re||(re={}));var Am=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},jt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Od,_m,zi,ss,Pm,Em=class{constructor(e,t){Od.set(this,void 0),_m.set(this,new ee),zi.set(this,void 0),ss.set(this,void 0),Pm.set(this,void 0),Am(this,Od,e,"f"),Am(this,zi,Vt.create(e.box.tracks,i=>t.adapterFor(i,pt),l.TrackCollection),"f"),Am(this,ss,A.newSet(({uuid:i})=>i),"f"),Am(this,Pm,jt(this,zi,"f").catchupAndSubscribe({onAdd:i=>jt(this,ss,"f").add({uuid:i.uuid,subscription:i.regions.subscribeChanges(()=>jt(this,_m,"f").notify())}),onRemove:({uuid:i})=>jt(this,ss,"f").removeByKey(i).subscription.terminate(),onReorder:i=>{}}),"f")}create(e,t,i){let n=jt(this,Od,"f").box.graph,o=jt(this,Od,"f").box.tracks;or.create(n,A.generate(),a=>{a.index.setValue(i??jt(this,zi,"f").getMinFreeIndex()),a.type.setValue(e),a.tracks.refer(o),a.target.refer(t)})}controls(e){return g.wrap(jt(this,zi,"f").adapters().find(t=>t.target.targetVertex.contains(e),!1))}delete(e){let t=jt(this,zi,"f").adapters(),i=t.indexOf(e);if(i===-1)return F(`Cannot delete ${e}. Does not exist.`);for(let n=i+1;n<t.length;n++)t[n].indexField.setValue(n-1);e.box.delete()}get collection(){return jt(this,zi,"f")}values(){return jt(this,zi,"f").adapters()}catchupAndSubscribe(e){return jt(this,zi,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return jt(this,_m,"f").subscribe(e)}terminate(){jt(this,zi,"f").terminate(),jt(this,Pm,"f").terminate(),jt(this,ss,"f").forEach(({subscription:e})=>e.terminate()),jt(this,ss,"f").clear()}};Od=new WeakMap,_m=new WeakMap,zi=new WeakMap,ss=new WeakMap,Pm=new WeakMap;var MP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ui=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Sm,Or,ur=class{constructor(e,t){this.type="bus",this.accepts="audio",Sm.set(this,void 0),Or.set(this,void 0),MP(this,Sm,e,"f"),MP(this,Or,t,"f")}catchupAndSubscribe(e){return e(this),Ui(this,Or,"f").subscribe(Fe.Children,()=>e(this))}get uuid(){return Ui(this,Or,"f").address.uuid}get address(){return Ui(this,Or,"f").address}get box(){return Ui(this,Or,"f")}get enabledField(){return Ui(this,Or,"f").enabled}get minimizedField(){return Ui(this,Or,"f").minimized}get iconField(){return Ui(this,Or,"f").icon}get labelField(){return Ui(this,Or,"f").label}get colorField(){return Ui(this,Or,"f").color}get iconSymbol(){return ke.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return Ui(this,Sm,"f").boxAdapters.adapterFor(Ui(this,Or,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}toString(){return`{${this.constructor.name}}`}};Sm=new WeakMap,Or=new WeakMap;var Vd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ut=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},no,Ql,Yl,oi,zd,Bm=class{constructor(e,t){no.set(this,void 0),Ql.set(this,void 0),Yl.set(this,void 0),oi.set(this,void 0),zd.set(this,K.Empty),Vd(this,no,new z,"f"),Vd(this,Ql,ut(this,no,"f").own(new ee),"f"),Vd(this,Yl,ut(this,no,"f").own(new Ir(ke.Unknown)),"f"),Vd(this,oi,ut(this,no,"f").own(new Ir(g.None)),"f"),ut(this,no,"f").own(ut(this,oi,"f").subscribe(i=>{ut(this,zd,"f").terminate(),Vd(this,zd,i.getValue().match({none:()=>(ut(this,Ql,"f").notify(g.None),K.Empty),some:({labelField:n,iconField:o})=>K.many(o.catchupAndSubscribe(a=>ut(this,Yl,"f").setValue(ke.fromName(a.getValue()))),n.catchupAndSubscribe(a=>ut(this,Ql,"f").notify(g.wrap(a.getValue()))))}),"f")})),ut(this,no,"f").own(e.catchupAndSubscribe({onAdded:({box:i})=>{D(ut(this,oi,"f").getValue().isEmpty(),"Already set");let n=i instanceof Ii?t.adapterFor(i,ur):t.adapterFor(i,re.isInstrument);ut(this,oi,"f").getValue().unwrapOrNull()!==n&&ut(this,oi,"f").setValue(g.wrap(n))},onRemoved:({box:i})=>{D(ut(this,oi,"f").getValue().unwrap("Cannot remove").box.address.equals(i.address),"Unexpected value to remove"),ut(this,oi,"f").setValue(g.None)}},l.InstrumentHost,l.AudioOutput))}getValue(){return ut(this,oi,"f").getValue()}subscribe(e){return ut(this,oi,"f").subscribe(e)}catchupAndSubscribe(e){return e(ut(this,oi,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),ut(this,Ql,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return ut(this,Yl,"f").catchupAndSubscribe(e)}set label(e){this.getValue().ifSome(t=>t.labelField.setValue(e))}get label(){return this.getValue().map(e=>e.labelField.getValue())}set icon(e){this.getValue().ifSome(t=>t.iconField.setValue(ke.toName(e)))}get icon(){return this.getValue().match({none:()=>ke.Unknown,some:e=>ke.fromName(e.iconField.getValue())})}get iconValue(){return ut(this,Yl,"f")}terminate(){ut(this,no,"f").terminate(),ut(this,zd,"f").terminate()}};no=new WeakMap,Ql=new WeakMap,Yl=new WeakMap,oi=new WeakMap,zd=new WeakMap;var DP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ls=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Fm,oo,pe=class{constructor(e){Fm.set(this,void 0),oo.set(this,void 0),DP(this,Fm,e,"f"),DP(this,oo,we.newSet(t=>t.address),"f")}terminate(){ls(this,oo,"f").forEach(e=>e.terminate()),ls(this,oo,"f").clear()}parameters(){return ls(this,oo,"f").values()}parameterAt(e){return ls(this,oo,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,t,i,n,o){let a=new us(ls(this,Fm,"f"),e,t,i,n,o),s=ls(this,oo,"f").add(a);return D(s,`Could not add adapter for ${e}`),a}removeParameter(e){return ls(this,oo,"f").removeByKey(e)}};Fm=new WeakMap,oo=new WeakMap;var cs=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},et=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ds,ai,Wo,Xl,Nm,km,Ud,eu=class{constructor(e,t){ds.set(this,void 0),ai.set(this,void 0),Wo.set(this,void 0),Xl.set(this,void 0),Nm.set(this,void 0),km.set(this,void 0),Ud.set(this,K.Empty),cs(this,ds,e,"f"),cs(this,ai,t,"f"),cs(this,Wo,new z,"f"),cs(this,Xl,et(this,Wo,"f").own(new ee),"f"),et(this,Wo,"f").own(t.targetBus.catchupAndSubscribe(()=>{et(this,Ud,"f").terminate(),cs(this,Ud,this.optTargetBus.match({none:()=>(et(this,Xl,"f").notify(g.None),K.Empty),some:i=>i.catchupAndSubscribe(n=>et(this,Xl,"f").notify(g.wrap(n)))}),"f")})),cs(this,Nm,et(this,Wo,"f").own(new us(et(this,ds,"f"),et(this,ai,"f").sendPan,E.bipolar(),P.percent({unit:"%",fractionDigits:0}),"panning")),"f"),cs(this,km,et(this,Wo,"f").own(new us(et(this,ds,"f"),et(this,ai,"f").sendGain,E.DefaultDecibel,P.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),et(this,Xl,"f").subscribe(e)}get uuid(){return et(this,ai,"f").address.uuid}get address(){return et(this,ai,"f").address}get box(){return et(this,ai,"f")}get indexField(){return et(this,ai,"f").index}get sendPan(){return et(this,Nm,"f")}get sendGain(){return et(this,km,"f")}get targetBus(){return et(this,ds,"f").boxAdapters.adapterFor(et(this,ai,"f").targetBus.targetVertex.unwrap("no audioUnit").box,ur)}get optTargetBus(){return et(this,ai,"f").targetBus.targetVertex.flatMap(e=>g.wrap(e.box.accept({visitAudioBusBox:t=>et(this,ds,"f").boxAdapters.adapterFor(t,ur)})))}delete(){et(this,ai,"f").delete()}terminate(){et(this,Wo,"f").terminate(),et(this,Ud,"f").terminate()}};ds=new WeakMap,ai=new WeakMap,Wo=new WeakMap,Xl=new WeakMap,Nm=new WeakMap,km=new WeakMap,Ud=new WeakMap;var jd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},bn=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},$m,Mm,tu,ru,Ld,Dm=class{constructor(e,t){$m.set(this,void 0),Mm.set(this,void 0),tu.set(this,void 0),ru.set(this,void 0),Ld.set(this,K.Empty),jd(this,$m,e,"f"),jd(this,Mm,t,"f"),jd(this,tu,new z,"f"),jd(this,ru,bn(this,tu,"f").own(new ee),"f"),bn(this,tu,"f").own(e.catchupAndSubscribe(()=>{bn(this,Ld,"f").terminate(),jd(this,Ld,this.adapter.match({none:()=>(bn(this,ru,"f").notify(g.None),K.Empty),some:i=>i.catchupAndSubscribe(n=>bn(this,ru,"f").notify(g.wrap(n)))}),"f")}))}subscribe(e){return bn(this,ru,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return bn(this,$m,"f").targetVertex.flatMap(e=>g.wrap(e.box.accept({visitAudioBusBox:t=>bn(this,Mm,"f").adapterFor(t,ur)})))}terminate(){bn(this,tu,"f").terminate(),bn(this,Ld,"f").terminate()}};$m=new WeakMap,Mm=new WeakMap,tu=new WeakMap,ru=new WeakMap,Ld=new WeakMap;var ao=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ne=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Im,IP,An,Vr,ft,hs,iu,ps,Cm,Tm,Rm,Om,CP,TP,si=class{constructor(e,t){Im.add(this),this.class="device-host",An.set(this,new z),Vr.set(this,void 0),ft.set(this,void 0),hs.set(this,void 0),iu.set(this,void 0),ps.set(this,void 0),Cm.set(this,void 0),Tm.set(this,void 0),Rm.set(this,void 0),Om.set(this,void 0),ao(this,Vr,e,"f"),ao(this,ft,t,"f"),ao(this,hs,ne(this,An,"f").own(new pe(ne(this,Vr,"f"))),"f"),ao(this,iu,ne(this,An,"f").own(new Em(this,ne(this,Vr,"f").boxAdapters)),"f"),ao(this,ps,ne(this,An,"f").own(new Bm(ne(this,ft,"f").input.pointerHub,ne(this,Vr,"f").boxAdapters)),"f"),ao(this,Cm,ne(this,An,"f").own(Vt.create(ne(this,ft,"f").midiEffects,i=>ne(this,Vr,"f").boxAdapters.adapterFor(i,re.isMidiEffect),l.MidiEffectHost)),"f"),ao(this,Tm,ne(this,An,"f").own(Vt.create(ne(this,ft,"f").audioEffects,i=>ne(this,Vr,"f").boxAdapters.adapterFor(i,re.isAudioEffect),l.AudioEffectHost)),"f"),ao(this,Rm,ne(this,An,"f").own(Vt.create(ne(this,ft,"f").auxSends,i=>ne(this,Vr,"f").boxAdapters.adapterFor(i,eu),l.AuxSend)),"f"),ao(this,Om,ne(this,An,"f").own(new Dm(ne(this,ft,"f").output,ne(this,Vr,"f").boxAdapters)),"f"),this.namedParameter=ne(this,Im,"m",CP).call(this,t),ne(this,Im,"m",TP).call(this)}get box(){return ne(this,ft,"f")}get uuid(){return ne(this,ft,"f").address.uuid}get address(){return ne(this,ft,"f").address}get indexField(){return ne(this,ft,"f").index}get type(){return ne(this,ft,"f").type.getValue()}get captureBox(){return ne(this,ft,"f").capture.targetVertex}get tracks(){return ne(this,iu,"f")}get input(){return ne(this,ps,"f")}get midiEffects(){return ne(this,Cm,"f")}get audioEffects(){return ne(this,Tm,"f")}get inputAdapter(){return ne(this,ps,"f").getValue()}get auxSends(){return ne(this,Rm,"f")}get output(){return ne(this,Om,"f")}get isBus(){return this.input.getValue().mapOr(e=>e.type==="bus",!1)}get isInstrument(){return this.input.getValue().mapOr(e=>e.type==="instrument",!1)}get isOutput(){return ne(this,ft,"f").output.targetVertex.mapOr(e=>e.box.address.equals(ne(this,Vr,"f").rootBoxAdapter.address),!1)}get midiEffectsField(){return ne(this,ft,"f").midiEffects}get inputField(){return ne(this,ft,"f").input}get audioEffectsField(){return ne(this,ft,"f").audioEffects}get tracksField(){return ne(this,ft,"f").tracks}get minimizedField(){return ne(this,ps,"f").getValue().unwrap().minimizedField}get isAudioUnit(){return!0}get label(){return ne(this,ps,"f").getValue().mapOr(e=>e.labelField.getValue(),"")}audioUnitBoxAdapter(){return this}indicesLimit(){let e=ne(this,Vr,"f").rootBoxAdapter.audioUnits.adapters(),t=this.indexField.getValue(),i=this.type,n=t,o=t;for(;n>0&&e[n-1].type===i;)n--;for(;o<e.length-1&&e[o+1].type===i;)o++;return[n,o+1]}move(e){ne(this,Vr,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,t){ne(this,iu,"f").collection.move(e,t)}deleteTrack(e){ne(this,iu,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){ne(this,An,"f").terminate()}};IP=si,An=new WeakMap,Vr=new WeakMap,ft=new WeakMap,hs=new WeakMap,iu=new WeakMap,ps=new WeakMap,Cm=new WeakMap,Tm=new WeakMap,Rm=new WeakMap,Om=new WeakMap,Im=new WeakSet,CP=function(e){return{volume:ne(this,hs,"f").createParameter(e.volume,IP.VolumeMapper,P.decible,"volume"),panning:ne(this,hs,"f").createParameter(e.panning,E.bipolar(),P.panning,"panning",.5),mute:ne(this,hs,"f").createParameter(e.mute,E.bool,P.bool,"mute"),solo:ne(this,hs,"f").createParameter(e.solo,E.bool,P.bool,"solo")}},TP=function(){let e=this.address.toString(),t=ne(this,ft,"f").capture.targetAddress.unwrapOrUndefined(),i=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${ne(this,ft,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${t}`;D(this.type!==bt.Instrument||ne(this,ft,"f").capture.targetAddress.nonEmpty(),i)};si.VolumeMapper=E.decibel(-96,-9,6);var nu=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ke=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Vm,Zo,cr,fs,zm,Um,Kd,RP,OP,pt=class{constructor(e,t){Vm.add(this),Zo.set(this,void 0),cr.set(this,void 0),fs.set(this,void 0),zm.set(this,void 0),Um.set(this,void 0),Kd.set(this,void 0),nu(this,Zo,e,"f"),nu(this,cr,t,"f"),nu(this,fs,new z,"f"),nu(this,zm,Ke(this,fs,"f").own(new ym(this,e.boxAdapters)),"f"),nu(this,Um,Ke(this,fs,"f").own(new wm(this,e.boxAdapters)),"f"),nu(this,Kd,Ke(this,fs,"f").own(new Ir(-1)),"f")}catchupAndSubscribePath(e){let t=[g.None,g.None],i=()=>{t.every(n=>n.nonEmpty())?e(g.wrap(t.map(n=>n.unwrap()))):e(g.None)};return K.many(Ke(this,Vm,"m",RP).call(this,n=>{t[0].equals(n)||(t[0]=n,i())}),Ke(this,Vm,"m",OP).call(this,n=>{t[1].equals(n)||(t[1]=n,i())}))}set targetDeviceName(e){Ke(this,cr,"f").target.targetVertex.ifSome(t=>{let i=t.box;if(i instanceof Xe)return Ke(this,Zo,"f").boxAdapters.adapterFor(i,si).input.getValue().ifSome(({labelField:o})=>o.setValue(e));if("label"in i&&i.label instanceof C)return i.label.setValue(e)})}get targetDeviceName(){return Ke(this,cr,"f").target.targetVertex.flatMap(e=>{let t=e.box;return t instanceof Xe?Ke(this,Zo,"f").boxAdapters.adapterFor(t,si).input.label:"label"in t&&t.label instanceof C?g.wrap(t.label.getValue()):g.wrap(t.name)})}terminate(){Ke(this,fs,"f").terminate()}get audioUnit(){return Be(Ke(this,cr,"f").tracks.targetVertex.unwrap().box,Xe)}get target(){return Ke(this,cr,"f").target}get clips(){return Ke(this,zm,"f")}get regions(){return Ke(this,Um,"f")}get enabled(){return Ke(this,cr,"f").enabled}get indexField(){return Ke(this,cr,"f").index}get type(){return Ke(this,cr,"f").type.getValue()}get box(){return Ke(this,cr,"f")}get uuid(){return Ke(this,cr,"f").address.uuid}get address(){return Ke(this,cr,"f").address}get listIndex(){return Ke(this,Kd,"f").getValue()}set listIndex(e){Ke(this,Kd,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===te.Audio;case"note-clip":return this.type===te.Notes;case"value-clip":return this.type===te.Value;case"audio-region":return this.type===te.Audio;case"note-region":return this.type===te.Notes;case"value-region":return this.type===te.Value}}valueAt(e,t){if(!this.enabled.getValue())return t;let i=t,n=Ke(this,Zo,"f").clipSequencing.iterate(this.uuid,e,e+tf);for(let{optClip:o,sectionFrom:a}of n)i=o.match({none:()=>{let s=this.regions.collection.lowerEqual(e,u=>!u.mute);if(s===null){let u=this.regions.collection.optAt(0);return Me(u,io)?u.incomingValue(t):t}else if(Me(s,io))return e<s.complete?s.valueAt(e,t):s.outgoingValue(t);return t},some:s=>a===e&&Me(s,Ro)?s.valueAt(e,t):t});return i}};Zo=new WeakMap,cr=new WeakMap,fs=new WeakMap,zm=new WeakMap,Um=new WeakMap,Kd=new WeakMap,Vm=new WeakSet,RP=function(e){let t=Ke(this,cr,"f").target.targetVertex;if(t.nonEmpty()){let i=t.unwrap().box;return i instanceof Xe?Ke(this,Zo,"f").boxAdapters.adapterFor(i,si).input.catchupAndSubscribeLabelChange(o=>e(o)):"label"in i&&i.label instanceof C?i.label.catchupAndSubscribe(n=>e(g.wrap(n.getValue()))):(e(g.wrap(i.name)),K.Empty)}return e(g.None),K.Empty},OP=function(e){let t=this.type;switch(t){case te.Audio:case te.Notes:return e(g.wrap(te[t])),K.Empty;case te.Value:{let i=Ke(this,cr,"f").target.targetVertex.unwrap();if(i.isField())e(Ke(this,Zo,"f").parameterFieldAdapters.opt(i.address).map(n=>n.name));else if(i.isBox())e(g.wrap(i.name));else return F("Illegal State. Vertex is not a field nor box.");return K.Empty}case te.Undefined:return e(g.wrap("")),K.Empty;default:return e(g.None),K.Empty}};var Lt=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ue=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Go,zr,qo,ms,jm,Lm,gs,vs,Ho,Jo,ys,ou,Wd,VP=[l.Automation,l.Modulation,l.MidiControl,l.ParameterController],us=class{constructor(e,t,i,n,o,a){Go.set(this,void 0),zr.set(this,void 0),qo.set(this,void 0),ms.set(this,void 0),jm.set(this,void 0),Lm.set(this,void 0),gs.set(this,new z),vs.set(this,void 0),Ho.set(this,void 0),Jo.set(this,g.None),ys.set(this,g.None),ou.set(this,null),Wd.set(this,!1),Lt(this,Go,e,"f"),Lt(this,zr,t,"f"),Lt(this,qo,i,"f"),Lt(this,ms,n,"f"),Lt(this,jm,o,"f"),Lt(this,Lm,a??0,"f"),ue(this,gs,"f").own(ue(this,Go,"f").parameterFieldAdapters.register(this)),Lt(this,vs,ue(this,gs,"f").own(new ee),"f"),Lt(this,Ho,new Ft,"f"),ue(this,gs,"f").own(ue(this,zr,"f").subscribe(()=>ue(this,vs,"f").notify(this))),ue(this,gs,"f").own(ue(this,zr,"f").pointerHub.catchupAndSubscribe({onAdded:s=>{ue(this,Ho,"f").proxy.onControlSourceAdd(Kx(s.pointerType)),s.box.accept({visitTrackBox:u=>{D(ue(this,Jo,"f").isEmpty(),"Already assigned");let c=ue(this,Go,"f").boxAdapters.adapterFor(u,pt);Lt(this,Jo,g.wrap(c),"f"),ue(this,Go,"f").isMainThread&&Lt(this,ys,g.wrap(ue(this,Go,"f").liveStreamReceiver.subscribeFloat(ue(this,zr,"f").address,p=>{ue(this,ou,"f")!==p&&(Lt(this,ou,p,"f"),ue(this,vs,"f").notify(this))})),"f")}})},onRemoved:s=>{ue(this,Ho,"f").proxy.onControlSourceRemove(Kx(s.pointerType)),s.box.accept({visitTrackBox:u=>{D(ue(this,Jo,"f").unwrapOrNull()?.address?.equals(u.address)===!0,`Unknown ${u}`),Lt(this,Jo,g.None,"f"),ue(this,Go,"f").isMainThread&&(ue(this,ys,"f").ifSome(c=>c.terminate()),Lt(this,ys,g.None,"f"),Lt(this,ou,null,"f"),ue(this,vs,"f").notify(this))}})}},...VP)),t.getValue()!==i.clamp(t.getValue())&&console.warn(`${o} (${t.getValue()}) is out of bounds`,"constraints"in t?t.constraints:"no constraints",i,t.address.fieldKeys.join(", "),t.box.name)}registerMidiControl(){return ue(this,Ho,"f").proxy.onControlSourceAdd("midi"),Lt(this,Wd,!0,"f"),{terminate:()=>{Lt(this,Wd,!1,"f"),ue(this,Ho,"f").proxy.onControlSourceRemove("midi")}}}get field(){return ue(this,zr,"f")}get valueMapping(){return ue(this,qo,"f")}get stringMapping(){return ue(this,ms,"f")}get name(){return ue(this,jm,"f")}get anchor(){return ue(this,Lm,"f")}get type(){return ue(this,zr,"f").type}get address(){return ue(this,zr,"f").address}get track(){return ue(this,Jo,"f")}valueAt(e){let t=ue(this,Jo,"f");if(t.nonEmpty()){let i=t.unwrap();if(i.enabled)return this.valueMapping.y(i.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return ue(this,vs,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return ue(this,Wd,"f")&&e.onControlSourceAdd("midi"),ue(this,zr,"f").pointerHub.filter(...VP).forEach(t=>e.onControlSourceAdd(Kx(t.pointerType))),ue(this,Ho,"f").subscribe(e)}getValue(){return ue(this,zr,"f").getValue()}setValue(e){ue(this,zr,"f").setValue(e)}setUnitValue(e){this.setValue(ue(this,qo,"f").y(e))}getUnitValue(){return ue(this,qo,"f").x(this.getValue())}getControlledValue(){return ue(this,qo,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return ue(this,ou,"f")??this.getUnitValue()}getControlledPrintValue(){return ue(this,ms,"f").x(this.getControlledValue())}getPrintValue(){return ue(this,ms,"f").x(this.getValue())}setPrintValue(e){let t=ue(this,ms,"f").y(e);t.type==="unitValue"?this.setUnitValue(ce(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(ue(this,qo,"f").clamp(ue(this,zr,"f").initValue))}terminate(){ue(this,ys,"f").ifSome(e=>e.terminate()),Lt(this,ys,g.None,"f"),ue(this,gs,"f").terminate()}};Go=new WeakMap,zr=new WeakMap,qo=new WeakMap,ms=new WeakMap,jm=new WeakMap,Lm=new WeakMap,gs=new WeakMap,vs=new WeakMap,Ho=new WeakMap,Jo=new WeakMap,ys=new WeakMap,ou=new WeakMap,Wd=new WeakMap;var Kx=r=>{switch(r){case l.Automation:return"automated";case l.Modulation:return"modulated";case l.MidiControl:return"midi";case l.ParameterController:return"external";default:return F(`${r.toString()} is an unknown pointer type`)}};var Wx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ji=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},so,xs,Km,Wm=class{constructor(e,t,i){so.set(this,void 0),xs.set(this,void 0),Km.set(this,void 0),Wx(this,so,A.newSet(n=>n.uuid),"f"),Wx(this,xs,new Ft,"f"),Wx(this,Km,e.catchupAndSubscribe({onAdded:n=>{let o=t(n.box),a=ji(this,so,"f").add(o);D(a,`Could not add ${o}`),ji(this,xs,"f").proxy.onAdd(o)},onRemoved:n=>{let o=n.box.address.uuid;ji(this,xs,"f").proxy.onRemove(ji(this,so,"f").removeByKey(o))}},i),"f")}subscribe(e){return ji(this,xs,"f").subscribe(e)}catchupAndSubscribe(e){return ji(this,so,"f").forEach(t=>e.onAdd(t)),this.subscribe(e)}adapters(){return ji(this,so,"f").values()}size(){return ji(this,so,"f").size()}isEmpty(){return this.size()===0}terminate(){ji(this,so,"f").clear(),ji(this,xs,"f").terminate(),ji(this,Km,"f").terminate()}};so=new WeakMap,xs=new WeakMap,Km=new WeakMap;var Zx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},kt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Gx,Zm,Zd,li,_n,zP,ui=class{constructor(e,t){Gx.add(this),this.type="audio-effect",this.accepts="audio",Zd.set(this,void 0),li.set(this,void 0),_n.set(this,void 0),Zx(this,Zd,e,"f"),Zx(this,li,t,"f"),Zx(this,_n,new pe(kt(this,Zd,"f")),"f"),this.namedParameter=kt(this,Gx,"m",zP).call(this,t)}get box(){return kt(this,li,"f")}get uuid(){return kt(this,li,"f").address.uuid}get address(){return kt(this,li,"f").address}get indexField(){return kt(this,li,"f").index}get labelField(){return kt(this,li,"f").label}get enabledField(){return kt(this,li,"f").enabled}get minimizedField(){return kt(this,li,"f").minimized}get host(){return kt(this,li,"f").host}deviceHost(){return kt(this,Zd,"f").boxAdapters.adapterFor(kt(this,li,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){kt(this,_n,"f").terminate()}};Zm=ui,Zd=new WeakMap,li=new WeakMap,_n=new WeakMap,Gx=new WeakSet,zP=function(e){return{delay:kt(this,_n,"f").createParameter(e.delay,E.linearInteger(0,Zm.OffsetFractions.length-1),Zm.OffsetStringMapping,"delay"),feedback:kt(this,_n,"f").createParameter(e.feedback,E.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:kt(this,_n,"f").createParameter(e.cross,E.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"cross"),filter:kt(this,_n,"f").createParameter(e.filter,E.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:kt(this,_n,"f").createParameter(e.dry,E.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"dry"),wet:kt(this,_n,"f").createParameter(e.wet,E.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"wet")}};ui.OffsetFractions=rr.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();ui.OffsetStringMapping=P.indices("",Zm.OffsetFractions.map(([r,e])=>`${r}/${e}`));var qx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},$t=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Hx,Gd,ci,Pn,UP,au=class{constructor(e,t){Hx.add(this),this.type="audio-effect",this.accepts="audio",Gd.set(this,void 0),ci.set(this,void 0),Pn.set(this,void 0),qx(this,Gd,e,"f"),qx(this,ci,t,"f"),qx(this,Pn,new pe($t(this,Gd,"f")),"f"),this.namedParameter=$t(this,Hx,"m",UP).call(this,t)}get box(){return $t(this,ci,"f")}get uuid(){return $t(this,ci,"f").address.uuid}get address(){return $t(this,ci,"f").address}get indexField(){return $t(this,ci,"f").index}get labelField(){return $t(this,ci,"f").label}get enabledField(){return $t(this,ci,"f").enabled}get minimizedField(){return $t(this,ci,"f").minimized}get host(){return $t(this,ci,"f").host}deviceHost(){return $t(this,Gd,"f").boxAdapters.adapterFor($t(this,ci,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){$t(this,Pn,"f").terminate()}};Gd=new WeakMap,ci=new WeakMap,Pn=new WeakMap,Hx=new WeakSet,UP=function(e){return{decay:$t(this,Pn,"f").createParameter(e.decay,E.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:$t(this,Pn,"f").createParameter(e.preDelay,E.exponential(.001,.5),P.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:$t(this,Pn,"f").createParameter(e.damp,E.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"damping"),filter:$t(this,Pn,"f").createParameter(e.filter,E.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"filter"),dry:$t(this,Pn,"f").createParameter(e.dry,E.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"dry"),wet:$t(this,Pn,"f").createParameter(e.wet,E.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"wet")}};var Jx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},gt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Yx,qd,Ur,Li,KP,su=class{constructor(e,t){Yx.add(this),this.type="audio-effect",this.accepts="audio",qd.set(this,void 0),Ur.set(this,void 0),Li.set(this,void 0),Jx(this,qd,e,"f"),Jx(this,Ur,t,"f"),Jx(this,Li,new pe(gt(this,qd,"f")),"f"),this.namedParameter=gt(this,Yx,"m",KP).call(this,t)}get box(){return gt(this,Ur,"f")}get uuid(){return gt(this,Ur,"f").address.uuid}get address(){return gt(this,Ur,"f").address}get indexField(){return gt(this,Ur,"f").index}get labelField(){return gt(this,Ur,"f").label}get enabledField(){return gt(this,Ur,"f").enabled}get minimizedField(){return gt(this,Ur,"f").minimized}get host(){return gt(this,Ur,"f").host}get spectrum(){return gt(this,Ur,"f").address.append(4095)}deviceHost(){return gt(this,qd,"f").boxAdapters.adapterFor(gt(this,Ur,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){gt(this,Li,"f").terminate()}};qd=new WeakMap,Ur=new WeakMap,Li=new WeakMap,Yx=new WeakSet,KP=function(e){return{highPass:jP(gt(this,Li,"f"),e.highPass,"High-Pass"),lowShelf:LP(gt(this,Li,"f"),e.lowShelf,"Low-Shelf"),lowBell:Qx(gt(this,Li,"f"),e.lowBell,"Low-Bell"),midBell:Qx(gt(this,Li,"f"),e.midBell,"Mid-Bell"),highBell:Qx(gt(this,Li,"f"),e.highBell,"High-Bell"),highShelf:LP(gt(this,Li,"f"),e.highShelf,"High-Shelf"),lowPass:jP(gt(this,Li,"f"),e.lowPass,"Low-Pass")}};var Xx=E.exponential(20,2e4),WP=E.linear(-24,24),ZP=E.exponential(.01,10),jP=(r,e,t)=>({enabled:r.createParameter(e.enabled,E.bool,P.bool,"enabled"),frequency:r.createParameter(e.frequency,Xx,P.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),order:r.createParameter(e.order,E.linearInteger(0,3),P.indices("db",["12","24","36","48"]),`${t} Order`),q:r.createParameter(e.q,ZP,P.numeric({fractionDigits:3}),`${t} Q`)}),LP=(r,e,t)=>({enabled:r.createParameter(e.enabled,E.bool,P.bool,"enabled"),frequency:r.createParameter(e.frequency,Xx,P.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,WP,P.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5)}),Qx=(r,e,t)=>({enabled:r.createParameter(e.enabled,E.bool,P.bool,"enabled"),frequency:r.createParameter(e.frequency,Xx,P.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,WP,P.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5),q:r.createParameter(e.q,ZP,P.numeric({fractionDigits:3}),`${t} Q`)});var GP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},xr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Gm,qm,wr,Qo=class{constructor(e,t){this.type="marker-event",Gm.set(this,new z),qm.set(this,void 0),wr.set(this,void 0),GP(this,qm,e,"f"),GP(this,wr,t,"f"),xr(this,Gm,"f").own(xr(this,wr,"f").subscribe(Fe.Children,i=>{if(!this.trackAdapter.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.trackAdapter.unwrap();xr(this,wr,"f").position.address.equals(i.address)?n.onSortingChanged():n.dispatchChange()}}))}get box(){return xr(this,wr,"f")}get uuid(){return xr(this,wr,"f").address.uuid}get address(){return xr(this,wr,"f").address}get position(){return xr(this,wr,"f").position.getValue()}get plays(){return xr(this,wr,"f").plays.getValue()}get hue(){return xr(this,wr,"f").hue.getValue()}get label(){return xr(this,wr,"f").label.getValue()}get trackAdapter(){return xr(this,wr,"f").track.targetVertex.map(e=>xr(this,qm,"f").boxAdapters.adapterFor(e.box,En).markerTrack)}terminate(){xr(this,Gm,"f").terminate()}toString(){return`{MarkerBoxAdapter ${A.toString(xr(this,wr,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};Gm=new WeakMap,qm=new WeakMap,wr=new WeakMap;Qo.Comparator=(r,e)=>r.position-e.position;var Hd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},di=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Jd,lu,Qd,ws,Hm,Jm=class{constructor(e,t){Jd.set(this,void 0),lu.set(this,void 0),Qd.set(this,void 0),ws.set(this,void 0),Hm.set(this,void 0),Hd(this,Jd,e,"f"),Hd(this,lu,t,"f"),this.changeNotifier=new ee,Hd(this,Qd,A.newSet(i=>i.uuid),"f"),Hd(this,ws,yr.create(Qo.Comparator),"f"),Hd(this,Hm,di(this,lu,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:i})=>{if(i instanceof dl){let n=di(this,Jd,"f").boxAdapters.adapterFor(i,Qo),o=di(this,Qd,"f").add(n);D(o,"Could not add adapter"),di(this,ws,"f").add(n),this.dispatchChange()}},onRemoved:({box:{address:{uuid:i}}})=>{di(this,ws,"f").remove(di(this,Qd,"f").removeByKey(i)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return di(this,Jd,"f")}get enabled(){return di(this,lu,"f").enabled.getValue()}get events(){return di(this,ws,"f")}get object(){return di(this,lu,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){di(this,ws,"f").onIndexingChanged(),this.dispatchChange()}terminate(){di(this,Hm,"f").terminate()}};Jd=new WeakMap,lu=new WeakMap,Qd=new WeakMap,ws=new WeakMap,Hm=new WeakMap;var qP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},lo=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ki,Qm,En=class{constructor(e,t){Ki.set(this,void 0),Qm.set(this,void 0),qP(this,Ki,t,"f"),qP(this,Qm,new Jm(e,lo(this,Ki,"f").markerTrack),"f")}terminate(){}get box(){return lo(this,Ki,"f")}get uuid(){return lo(this,Ki,"f").address.uuid}get address(){return lo(this,Ki,"f").address}get markerTrack(){return lo(this,Qm,"f")}get signature(){return[lo(this,Ki,"f").signature.nominator.getValue(),lo(this,Ki,"f").signature.denominator.getValue()]}get signatureDuration(){let{nominator:e,denominator:t}=lo(this,Ki,"f").signature;return Q.fromSignature(e.getValue(),t.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),lo(this,Ki,"f").signature.subscribe(()=>e(this.signature))}};Ki=new WeakMap,Qm=new WeakMap;var gB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Yd=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Yo,Xo=class{constructor(e,t){Yo.set(this,void 0),gB(this,Yo,t,"f")}get box(){return Yd(this,Yo,"f")}get uuid(){return Yd(this,Yo,"f").address.uuid}get address(){return Yd(this,Yo,"f").address}get source(){return Yd(this,Yo,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return Yd(this,Yo,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};Yo=new WeakMap;var bs=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},pi=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ym,As,_s,Xm,eg,Xd,hi=class{constructor(e,t){Ym.set(this,void 0),As.set(this,void 0),_s.set(this,void 0),Xm.set(this,void 0),eg.set(this,void 0),Xd.set(this,!1),bs(this,Ym,e,"f"),bs(this,As,t,"f"),bs(this,_s,new z,"f"),bs(this,Xm,t.attributes,"f"),bs(this,eg,pi(this,_s,"f").own(new pe(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return pi(this,_s,"f").own(e)}ownAll(...e){pi(this,_s,"f").ownAll(...e)}onSelected(){bs(this,Xd,!0,"f")}onDeselected(){bs(this,Xd,!1,"f")}isSelected(){return pi(this,Xd,"f")}get box(){return pi(this,As,"f")}get attributes(){return pi(this,Xm,"f")}get uuid(){return pi(this,As,"f").address.uuid}get address(){return pi(this,As,"f").address}get parameters(){return pi(this,eg,"f")}get modular(){return pi(this,Ym,"f").boxAdapters.adapterFor(pi(this,As,"f").attributes.collection.targetVertex.unwrap().box,ea)}terminate(){pi(this,_s,"f").terminate()}};Ym=new WeakMap,As=new WeakMap,_s=new WeakMap,Xm=new WeakMap,eg=new WeakMap,Xd=new WeakMap;var tg=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},uo=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},rg,ta,ep,ig,Gt;(function(r){r.Input="input",r.Output="output"})(Gt||(Gt={}));var qt=class r{static create(e,t,i,n){return new r(e,t,i,n??t.fieldName)}constructor(e,t,i,n){rg.set(this,void 0),ta.set(this,void 0),ep.set(this,void 0),ig.set(this,void 0),tg(this,rg,e,"f"),tg(this,ta,t,"f"),tg(this,ep,i,"f"),tg(this,ig,n,"f")}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(t=>e.field.pointerRules.accepts.some(i=>i===t))}get connections(){return uo(this,ta,"f").pointerHub.isEmpty()?O.empty():uo(this,ta,"f").pointerHub.filter(l.VoltageConnection).map(({box:e})=>uo(this,rg,"f").adapterFor(e,Xo))}get field(){return uo(this,ta,"f")}get address(){return uo(this,ta,"f").address}get direction(){return uo(this,ep,"f")}get name(){return uo(this,ig,"f")}toString(){return`{ModuleConnectorAdapter address: ${uo(this,ta,"f").address.toString()}, direction: ${uo(this,ep,"f")}}`}};rg=new WeakMap,ta=new WeakMap,ep=new WeakMap,ig=new WeakMap;var ew=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},tp=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ng,rp,ip,uu=class extends hi{constructor(e,t){super(e,t),ng.set(this,void 0),rp.set(this,void 0),ip.set(this,void 0),ew(this,ng,this.parameters.createParameter(t.time,E.exponential(1,1e4),P.numeric({unit:"ms"}),"Time"),"f"),ew(this,rp,qt.create(e.boxAdapters,t.voltageInput,Gt.Input,"Input"),"f"),ew(this,ip,qt.create(e.boxAdapters,t.voltageOutput,Gt.Output,"Output"),"f")}get parameterTime(){return tp(this,ng,"f")}get voltageInput(){return tp(this,rp,"f")}get voltageOutput(){return tp(this,ip,"f")}get inputs(){return[tp(this,rp,"f")]}get outputs(){return[tp(this,ip,"f")]}};ng=new WeakMap,rp=new WeakMap,ip=new WeakMap;var vB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},HP=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},np,cu=class extends hi{constructor(e,t){super(e,t),np.set(this,void 0),vB(this,np,qt.create(e.boxAdapters,t.input,Gt.Input,"Input"),"f")}get voltageInput(){return HP(this,np,"f")}get inputs(){return[HP(this,np,"f")]}get outputs(){return O.empty()}};np=new WeakMap;var tw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},op=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},og,ap,sp,du=class extends hi{constructor(e,t){super(e,t),og.set(this,void 0),ap.set(this,void 0),sp.set(this,void 0),tw(this,og,this.parameters.createParameter(t.gain,E.DefaultDecibel,P.numeric({unit:"db"}),"Gain"),"f"),tw(this,ap,qt.create(e.boxAdapters,t.voltageInput,Gt.Input,"Input"),"f"),tw(this,sp,qt.create(e.boxAdapters,t.voltageOutput,Gt.Output,"Output"),"f")}get parameterGain(){return op(this,og,"f")}get voltageInput(){return op(this,ap,"f")}get voltageOutput(){return op(this,sp,"f")}get inputs(){return[op(this,ap,"f")]}get outputs(){return[op(this,sp,"f")]}};og=new WeakMap,ap=new WeakMap,sp=new WeakMap;var rw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},iw=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ag,sg,lg,pu=class extends hi{constructor(e,t){super(e,t),ag.set(this,void 0),sg.set(this,void 0),lg.set(this,void 0),rw(this,ag,qt.create(e.boxAdapters,t.voltageInputX,Gt.Input,"X"),"f"),rw(this,sg,qt.create(e.boxAdapters,t.voltageInputY,Gt.Input,"Y"),"f"),rw(this,lg,qt.create(e.boxAdapters,t.voltageOutput,Gt.Output,"Result"),"f")}get inputs(){return[iw(this,ag,"f"),iw(this,sg,"f")]}get outputs(){return[iw(this,lg,"f")]}};ag=new WeakMap,sg=new WeakMap,lg=new WeakMap;var yB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},JP=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},lp,hu=class extends hi{constructor(e,t){super(e,t),lp.set(this,void 0),yB(this,lp,qt.create(e.boxAdapters,t.output,Gt.Output,"Output"),"f")}get voltageOutput(){return JP(this,lp,"f")}get inputs(){return O.empty()}get outputs(){return[JP(this,lp,"f")]}};lp=new WeakMap;var fu;(function(r){r.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,r.adapterFor=(e,t)=>Y(t.accept({visitModuleGainBox:i=>e.adapterFor(i,du),visitModuleDelayBox:i=>e.adapterFor(i,uu),visitModuleMultiplierBox:i=>e.adapterFor(i,pu),visitModularAudioInputBox:i=>e.adapterFor(i,hu),visitModularAudioOutputBox:i=>e.adapterFor(i,cu)}),`Could not find ModuleAdapter for ${t.name}`)})(fu||(fu={}));var QP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ps=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ug,cg,Es,nw,mu=class{constructor(e,t){ug.add(this),cg.set(this,void 0),Es.set(this,void 0),QP(this,cg,e,"f"),QP(this,Es,t,"f")}get box(){return Ps(this,Es,"f")}get uuid(){return Ps(this,Es,"f").address.uuid}get address(){return Ps(this,Es,"f").address}get moduleAdapter(){return fu.adapterFor(Ps(this,cg,"f").boxAdapters,Ps(this,ug,"a",nw).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(Ps(this,ug,"a",nw).address)}terminate(){}};cg=new WeakMap,Es=new WeakMap,ug=new WeakSet,nw=function(){return Ps(this,Es,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var YP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},br=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},gu,Ar,ra=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",gu.set(this,void 0),Ar.set(this,void 0),YP(this,gu,e,"f"),YP(this,Ar,t,"f")}get box(){return br(this,Ar,"f")}get uuid(){return br(this,Ar,"f").address.uuid}get address(){return br(this,Ar,"f").address}get indexField(){return br(this,Ar,"f").index}get labelField(){return br(this,Ar,"f").label}get enabledField(){return br(this,Ar,"f").enabled}get minimizedField(){return br(this,Ar,"f").minimized}get host(){return br(this,Ar,"f").host}parameterAt(e){return F("Not yet implemented")}deviceHost(){return br(this,gu,"f").boxAdapters.adapterFor(br(this,Ar,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return br(this,gu,"f").boxAdapters.adapterFor(br(this,Ar,"f").modularSetup.targetVertex.unwrap("No Modular found").box,ea)}elements(){return br(this,Ar,"f").userInterface.elements.pointerHub.filter(l.DeviceUserInterface).map(e=>br(this,gu,"f").boxAdapters.adapterFor(e.box,mu))}terminate(){}};gu=new WeakMap,Ar=new WeakMap;var up=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ze=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},vu,ia,yu,jr,Ss,Bs,ea=class{constructor(e,t){vu.set(this,new z),ia.set(this,void 0),yu.set(this,void 0),jr.set(this,void 0),Ss.set(this,void 0),Bs.set(this,void 0),up(this,yu,e,"f"),up(this,jr,t,"f"),up(this,ia,ze(this,vu,"f").own(new Ft),"f"),up(this,Ss,A.newSet(s=>s.uuid),"f"),up(this,Bs,A.newSet(s=>s.uuid),"f");let i=s=>{let u=fu.adapterFor(ze(this,yu,"f").boxAdapters,s.box);ze(this,Ss,"f").add(u)&&ze(this,ia,"f").proxy.onModuleAdded(u)},n=s=>ze(this,ia,"f").proxy.onModuleRemoved(ze(this,Ss,"f").removeByKey(s.address.uuid)),o=s=>{let u=ze(this,yu,"f").boxAdapters.adapterFor(s.box,Xo);ze(this,Bs,"f").add(u)&&ze(this,ia,"f").proxy.onConnectionAdded(u)},a=s=>ze(this,ia,"f").proxy.onConnectionRemoved(ze(this,Bs,"f").removeByKey(s.address.uuid));ze(this,jr,"f").modules.pointerHub.filter(l.ModuleCollection).forEach(i),ze(this,jr,"f").connections.pointerHub.filter(l.ConnectionCollection).forEach(o),ze(this,vu,"f").own(ze(this,jr,"f").modules.pointerHub.subscribe({onAdded:i,onRemoved:n},l.ModuleCollection)),ze(this,vu,"f").own(ze(this,jr,"f").connections.pointerHub.subscribe({onAdded:o,onRemoved:a},l.ConnectionCollection))}catchupAndSubscribe(e){return yx(e.onModuleAdded,t=>ze(this,Ss,"f").forEach(i=>t(i))),yx(e.onConnectionAdded,t=>ze(this,Bs,"f").forEach(i=>t(i))),ze(this,ia,"f").subscribe(e)}get box(){return ze(this,jr,"f")}get address(){return ze(this,jr,"f").address}get uuid(){return ze(this,jr,"f").address.uuid}get editingField(){return ze(this,jr,"f").editing}get labelField(){return ze(this,jr,"f").label}get modules(){return ze(this,Ss,"f").values()}get connections(){return ze(this,Bs,"f").values()}get device(){return ze(this,yu,"f").boxAdapters.adapterFor(Y(ze(this,jr,"f").device.pointerHub.incoming().at(0),"No device found").box,ra)}terminate(){console.debug(`terminate ${this}`),ze(this,vu,"f").terminate()}};vu=new WeakMap,ia=new WeakMap,yu=new WeakMap,jr=new WeakMap,Ss=new WeakMap,Bs=new WeakMap;var cp=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},dr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ow,wu,dp,dg,xu,hp,pg,pp,hg,XP,Sn=class{constructor(e,t){ow.add(this),this.type="groove-adapter",dp.set(this,new z),dg.set(this,void 0),xu.set(this,void 0),hp.set(this,void 0),pg.set(this,new qh({duration:()=>dr(this,hg,"f"),fx:i=>Ax(i,dr(this,pp,"f")),fy:i=>Ax(i,1-dr(this,pp,"f"))})),pp.set(this,0),hg.set(this,Q.SemiQuaver*2),cp(this,dg,e,"f"),cp(this,xu,t,"f"),cp(this,hp,dr(this,dp,"f").own(new pe(dr(this,dg,"f"))),"f"),this.namedParameter=dr(this,ow,"m",XP).call(this,t),dr(this,dp,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(i=>cp(this,hg,i.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(i=>cp(this,pp,lP(i.getValue(),.01),"f")))}unwarp(e){return dr(this,pg,"f").unwarp(e)}warp(e){return dr(this,pg,"f").warp(e)}get box(){return dr(this,xu,"f")}get uuid(){return dr(this,xu,"f").address.uuid}get address(){return dr(this,xu,"f").address}terminate(){dr(this,dp,"f").terminate()}};wu=Sn,dp=new WeakMap,dg=new WeakMap,xu=new WeakMap,hp=new WeakMap,pg=new WeakMap,pp=new WeakMap,hg=new WeakMap,ow=new WeakSet,XP=function(e){return{duration:dr(this,hp,"f").createParameter(e.duration,E.values(wu.DurationPPQNs),P.values("",wu.DurationPPQNs,wu.DurationStrings),"duration"),amount:dr(this,hp,"f").createParameter(e.amount,E.unipolar(),P.percent({fractionDigits:0}),"amount")}};Sn.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];Sn.DurationPPQNs=wu.Durations.map(([r,e])=>Q.fromSignature(r,e));Sn.DurationStrings=wu.Durations.map(([r,e])=>`${r}/${e}`);var bu=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ct=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Bn,na,Au,fg,mg,fp,mp,aw,oa=class{constructor(e,t,i,n,o){Bn.set(this,void 0),na.set(this,void 0),Au.set(this,void 0),fg.set(this,void 0),mg.set(this,void 0),fp.set(this,new z),mp.set(this,void 0),aw.set(this,g.None),bu(this,Bn,e,"f"),bu(this,na,t,"f"),bu(this,Au,i,"f"),bu(this,fg,n,"f"),bu(this,mg,o??0,"f"),bu(this,mp,ct(this,fp,"f").own(new ee),"f"),ct(this,fp,"f").own(ct(this,Bn,"f").subscribe(()=>ct(this,mp,"f").notify(this))),e.getValue()!==t.clamp(e.getValue())&&console.warn(`${n} (${e.getValue()}) is out of bounds`,t)}get field(){return ct(this,Bn,"f")}get valueMapping(){return ct(this,na,"f")}get stringMapping(){return ct(this,Au,"f")}get name(){return ct(this,fg,"f")}get anchor(){return ct(this,mg,"f")}get type(){return ct(this,Bn,"f").type}get address(){return ct(this,Bn,"f").address}get track(){return ct(this,aw,"f")}subscribe(e){return ct(this,mp,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return ct(this,Bn,"f").getValue()}setValue(e){ct(this,Bn,"f").setValue(ct(this,na,"f").clamp(e))}setUnitValue(e){this.setValue(ct(this,na,"f").y(e))}getUnitValue(){return ct(this,na,"f").x(this.getValue())}getPrintValue(){return ct(this,Au,"f").x(this.getValue())}setPrintValue(e){let t=ct(this,Au,"f").y(e);t.type==="unitValue"?this.setUnitValue(ce(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(ct(this,na,"f").clamp(ct(this,Bn,"f").initValue))}terminate(){ct(this,fp,"f").terminate()}};Bn=new WeakMap,na=new WeakMap,Au=new WeakMap,fg=new WeakMap,mg=new WeakMap,fp=new WeakMap,mp=new WeakMap,aw=new WeakMap;var _u=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},fi=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Fn,gg,vg,yg,xg,wg,bg=class{constructor(e){Fn.set(this,void 0),gg.set(this,void 0),vg.set(this,void 0),yg.set(this,void 0),xg.set(this,void 0),wg.set(this,void 0),_u(this,Fn,e,"f"),_u(this,gg,new oa(fi(this,Fn,"f").keyboard,E.values([88,76,61,49]),P.numeric({fractionDigits:1}),"Keyboard Type"),"f"),_u(this,vg,new oa(fi(this,Fn,"f").timeRangeInQuarters,E.exponential(1,64),P.numeric({fractionDigits:1}),"Time-Range"),"f"),_u(this,yg,new oa(fi(this,Fn,"f").noteScale,E.exponential(.5,2),P.numeric({fractionDigits:1}),"Note Scale"),"f"),_u(this,xg,new oa(fi(this,Fn,"f").noteLabels,E.bool,P.bool,"Note Labels"),"f"),_u(this,wg,new oa(fi(this,Fn,"f").transpose,E.linearInteger(-48,48),P.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return fi(this,Fn,"f").box.subscribe(Fe.Children,()=>e(this))}get object(){return fi(this,Fn,"f")}get keyboard(){return fi(this,gg,"f")}get timeRangeInQuarters(){return fi(this,vg,"f")}get noteScale(){return fi(this,yg,"f")}get noteLabels(){return fi(this,xg,"f")}get transpose(){return fi(this,wg,"f")}};Fn=new WeakMap,gg=new WeakMap,vg=new WeakMap,yg=new WeakMap,xg=new WeakMap,wg=new WeakMap;var gp=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Mt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Fs,Lr,Pu,Ag,_g,Eu=class{constructor(e,t){Fs.set(this,void 0),Lr.set(this,void 0),Pu.set(this,void 0),Ag.set(this,void 0),_g.set(this,void 0),gp(this,Fs,e,"f"),gp(this,Lr,t,"f"),gp(this,Pu,Vt.create(Mt(this,Lr,"f").audioUnits,i=>Mt(this,Fs,"f").boxAdapters.adapterFor(i,si),l.AudioUnits),"f"),gp(this,Ag,new Wm(Mt(this,Lr,"f").audioBusses.pointerHub,i=>Mt(this,Fs,"f").boxAdapters.adapterFor(i,ur),l.AudioBusses),"f"),gp(this,_g,new bg(Mt(this,Lr,"f").pianoMode),"f")}get uuid(){return Mt(this,Lr,"f").address.uuid}get address(){return Mt(this,Lr,"f").address}get box(){return Mt(this,Lr,"f")}get audioBusses(){return Mt(this,Ag,"f")}get audioUnits(){return Mt(this,Pu,"f")}get clips(){return Mt(this,Pu,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return Mt(this,Fs,"f").boxAdapters.adapterFor(Mt(this,Lr,"f").groove.targetVertex.unwrap("no groove").box,Sn)}get timeline(){return Mt(this,Fs,"f").boxAdapters.adapterFor(Mt(this,Lr,"f").timeline.targetVertex.unwrap("no timeline").box,En)}get pianoMode(){return Mt(this,_g,"f")}get created(){return new Date(Mt(this,Lr,"f").created.getValue())}get midiOutputDevices(){return Mt(this,Lr,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>Be(e,Ci))}terminate(){Mt(this,Pu,"f").terminate()}};Fs=new WeakMap,Lr=new WeakMap,Pu=new WeakMap,Ag=new WeakMap,_g=new WeakMap;var sw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ht=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},lw,vp,Wi,aa,e1,Su=class{constructor(e,t){lw.add(this),this.type="instrument",this.accepts="audio",vp.set(this,void 0),Wi.set(this,void 0),aa.set(this,void 0),sw(this,vp,e,"f"),sw(this,Wi,t,"f"),sw(this,aa,new pe(Ht(this,vp,"f")),"f"),this.namedParameter=Ht(this,lw,"m",e1).call(this,t)}get box(){return Ht(this,Wi,"f")}get uuid(){return Ht(this,Wi,"f").address.uuid}get address(){return Ht(this,Wi,"f").address}get labelField(){return Ht(this,Wi,"f").label}get iconField(){return Ht(this,Wi,"f").icon}get defaultTrackType(){return te.Audio}get enabledField(){return Ht(this,Wi,"f").enabled}get minimizedField(){return Ht(this,Wi,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return Ht(this,vp,"f").boxAdapters.adapterFor(Ht(this,Wi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Ht(this,aa,"f").terminate()}};vp=new WeakMap,Wi=new WeakMap,aa=new WeakMap,lw=new WeakSet,e1=function(e){return{flutter:Ht(this,aa,"f").createParameter(e.flutter,E.unipolar(),P.percent(),"flutter"),wow:Ht(this,aa,"f").createParameter(e.wow,E.unipolar(),P.percent(),"wow"),noise:Ht(this,aa,"f").createParameter(e.noise,E.unipolar(),P.percent(),"noise"),saturation:Ht(this,aa,"f").createParameter(e.saturation,E.unipolar(),P.percent(),"saturation")}};var Nn=(()=>{let t=[1,2,3,4],i=["12","24","36","48"],n=[Ue.sine,Ue.triangle,Ue.saw,Ue.square],o=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:E.exponential(20,2e4),CUTOFF_STRING_MAPPING:P.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:t,FILTER_ORDER_STRINGS:i,FILTER_ORDER_VALUE_MAPPING:E.values(t),FILTER_ORDER_STRING_MAPPING:P.values("db",t,i),LFO_WAVEFORM_VALUES:n,LFO_WAVEFORM_STRINGS:o,LFO_WAVEFORM_VALUE_MAPPING:E.values(n),LFO_WAVEFORM_STRING_MAPPING:P.values("",n,o)}})();var uw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ee=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},cw,yp,Zi,Re,t1,Bu=class{constructor(e,t){cw.add(this),this.type="instrument",this.accepts="midi",yp.set(this,void 0),Zi.set(this,void 0),Re.set(this,void 0),uw(this,yp,e,"f"),uw(this,Zi,t,"f"),uw(this,Re,new pe(Ee(this,yp,"f")),"f"),this.namedParameter=Ee(this,cw,"m",t1).call(this,t)}get box(){return Ee(this,Zi,"f")}get uuid(){return Ee(this,Zi,"f").address.uuid}get address(){return Ee(this,Zi,"f").address}get labelField(){return Ee(this,Zi,"f").label}get iconField(){return Ee(this,Zi,"f").icon}get defaultTrackType(){return te.Notes}get enabledField(){return Ee(this,Zi,"f").enabled}get minimizedField(){return Ee(this,Zi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ee(this,yp,"f").boxAdapters.adapterFor(Ee(this,Zi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Ee(this,Re,"f").terminate()}};yp=new WeakMap,Zi=new WeakMap,Re=new WeakMap,cw=new WeakSet,t1=function(e){let t=[ln.Monophonic,ln.Polyphonic];return{oscillators:e.oscillators.fields().map(i=>({waveform:Ee(this,Re,"f").createParameter(i.waveform,E.linearInteger(0,3),P.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:Ee(this,Re,"f").createParameter(i.volume,E.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:Ee(this,Re,"f").createParameter(i.octave,E.linearInteger(-3,3),P.numeric({unit:"oct"}),"Octave",.5),tune:Ee(this,Re,"f").createParameter(i.tune,E.linear(-1200,1200),P.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:Ee(this,Re,"f").createParameter(e.noise.volume,E.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:Ee(this,Re,"f").createParameter(e.noise.attack,E.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:Ee(this,Re,"f").createParameter(e.noise.hold,E.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Hold"),release:Ee(this,Re,"f").createParameter(e.noise.release,E.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:Ee(this,Re,"f").createParameter(e.filterOrder,Nn.FILTER_ORDER_VALUE_MAPPING,Nn.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:Ee(this,Re,"f").createParameter(e.cutoff,Nn.CUTOFF_VALUE_MAPPING,Nn.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:Ee(this,Re,"f").createParameter(e.resonance,E.exponential(.01,10),P.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:Ee(this,Re,"f").createParameter(e.attack,E.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:Ee(this,Re,"f").createParameter(e.decay,E.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:Ee(this,Re,"f").createParameter(e.sustain,E.unipolar(),P.percent({fractionDigits:1}),"Sustain"),release:Ee(this,Re,"f").createParameter(e.release,E.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:Ee(this,Re,"f").createParameter(e.filterEnvelope,E.bipolar(),P.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:Ee(this,Re,"f").createParameter(e.filterKeyboard,E.bipolar(),P.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:Ee(this,Re,"f").createParameter(e.voicingMode,E.values(t),P.values("",t,["mono","poly"]),"Play Mode",.5),glideTime:Ee(this,Re,"f").createParameter(e.glideTime,E.unipolar(),P.percent({fractionDigits:1}),"Glide time",0),unisonCount:Ee(this,Re,"f").createParameter(e.unisonCount,E.values([1,3,5]),P.values("#",[1,3,5],[1,3,5].map(i=>String(i))),"Unisono",0),unisonDetune:Ee(this,Re,"f").createParameter(e.unisonDetune,E.exponential(1,1200),P.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:Ee(this,Re,"f").createParameter(e.unisonStereo,E.unipolar(),P.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:Ee(this,Re,"f").createParameter(e.lfo.waveform,Nn.LFO_WAVEFORM_VALUE_MAPPING,Nn.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:Ee(this,Re,"f").createParameter(e.lfo.rate,E.exponential(1e-4,30),P.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:Ee(this,Re,"f").createParameter(e.lfo.targetTune,E.bipolar(),P.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:Ee(this,Re,"f").createParameter(e.lfo.targetVolume,E.bipolar(),P.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:Ee(this,Re,"f").createParameter(e.lfo.targetCutoff,E.bipolar(),P.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};var dw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Dt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},pw,Pg,xp,mi,kn,r1,Gi=class{constructor(e,t){pw.add(this),this.type="midi-effect",this.accepts="midi",xp.set(this,void 0),mi.set(this,void 0),kn.set(this,void 0),dw(this,xp,e,"f"),dw(this,mi,t,"f"),dw(this,kn,new pe(Dt(this,xp,"f")),"f"),this.namedParameter=Dt(this,pw,"m",r1).call(this,t)}get box(){return Dt(this,mi,"f")}get uuid(){return Dt(this,mi,"f").address.uuid}get address(){return Dt(this,mi,"f").address}get indexField(){return Dt(this,mi,"f").index}get labelField(){return Dt(this,mi,"f").label}get enabledField(){return Dt(this,mi,"f").enabled}get minimizedField(){return Dt(this,mi,"f").minimized}get host(){return Dt(this,mi,"f").host}deviceHost(){return Dt(this,xp,"f").boxAdapters.adapterFor(Dt(this,mi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Dt(this,kn,"f").terminate()}};Pg=Gi,xp=new WeakMap,mi=new WeakMap,kn=new WeakMap,pw=new WeakSet,r1=function(e){return{modeIndex:Dt(this,kn,"f").createParameter(e.modeIndex,E.linearInteger(0,2),P.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:Dt(this,kn,"f").createParameter(e.numOctaves,E.linearInteger(1,5),P.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:Dt(this,kn,"f").createParameter(e.rateIndex,E.linearInteger(0,Pg.RateFractions.length-1),Pg.RateStringMapping,"Rate"),gate:Dt(this,kn,"f").createParameter(e.gate,E.linear(0,2),P.percent({fractionDigits:0}),"Gate"),repeat:Dt(this,kn,"f").createParameter(e.repeat,E.linearInteger(1,16),P.numeric({fractionDigits:0}),"Repeat"),velocity:Dt(this,kn,"f").createParameter(e.velocity,E.bipolar(),P.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};Gi.RateFractions=rr.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();Gi.RateStringMapping=P.indices("",Pg.RateFractions.map(([r,e])=>`${r}/${e}`));var hw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Jt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},fw,wp,gi,Ns,i1,Fu=class{constructor(e,t){fw.add(this),this.type="midi-effect",this.accepts="midi",wp.set(this,void 0),gi.set(this,void 0),Ns.set(this,void 0),hw(this,wp,e,"f"),hw(this,gi,t,"f"),hw(this,Ns,new pe(Jt(this,wp,"f")),"f"),this.namedParameter=Jt(this,fw,"m",i1).call(this,t)}get box(){return Jt(this,gi,"f")}get uuid(){return Jt(this,gi,"f").address.uuid}get address(){return Jt(this,gi,"f").address}get indexField(){return Jt(this,gi,"f").index}get labelField(){return Jt(this,gi,"f").label}get enabledField(){return Jt(this,gi,"f").enabled}get minimizedField(){return Jt(this,gi,"f").minimized}get host(){return Jt(this,gi,"f").host}deviceHost(){return Jt(this,wp,"f").boxAdapters.adapterFor(Jt(this,gi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Jt(this,Ns,"f").terminate()}};wp=new WeakMap,gi=new WeakMap,Ns=new WeakMap,fw=new WeakSet,i1=function(e){return{octaves:Jt(this,Ns,"f").createParameter(e.octaves,E.linearInteger(-7,7),P.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:Jt(this,Ns,"f").createParameter(e.semiTones,E.linearInteger(-36,36),P.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:Jt(this,Ns,"f").createParameter(e.cents,E.linear(-50,50),P.numeric({unit:"cents",fractionDigits:1}),"cents")}};var mw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},_r=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},gw,bp,qi,Nu,n1,ku=class{constructor(e,t){gw.add(this),this.type="instrument",this.accepts="midi",bp.set(this,void 0),qi.set(this,void 0),Nu.set(this,void 0),mw(this,bp,e,"f"),mw(this,qi,t,"f"),mw(this,Nu,new pe(_r(this,bp,"f")),"f"),this.namedParameter=_r(this,gw,"m",n1).call(this,t)}get box(){return _r(this,qi,"f")}get uuid(){return _r(this,qi,"f").address.uuid}get address(){return _r(this,qi,"f").address}get labelField(){return _r(this,qi,"f").label}get iconField(){return _r(this,qi,"f").icon}get defaultTrackType(){return te.Notes}get enabledField(){return _r(this,qi,"f").enabled}get minimizedField(){return _r(this,qi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return _r(this,bp,"f").boxAdapters.adapterFor(_r(this,qi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){_r(this,Nu,"f").terminate()}};bp=new WeakMap,qi=new WeakMap,Nu=new WeakMap,gw=new WeakSet,n1=function(e){return{volume:_r(this,Nu,"f").createParameter(e.volume,E.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"volume"),release:_r(this,Nu,"f").createParameter(e.release,E.exponential(.001,8),P.numeric({unit:"s",fractionDigits:3}),"release")}};var $u=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},q=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},vw,ks,sa,ye,Eg,Sg,Kr,Mu,o1,Du=class{constructor(e,t){vw.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",ks.set(this,new z),sa.set(this,void 0),ye.set(this,void 0),Eg.set(this,void 0),Sg.set(this,void 0),Kr.set(this,void 0),Mu.set(this,g.None),$u(this,sa,e,"f"),$u(this,ye,t,"f"),$u(this,Eg,q(this,ks,"f").own(Vt.create(q(this,ye,"f").midiEffects,i=>q(this,sa,"f").boxAdapters.adapterFor(i,re.isMidiEffect),l.MidiEffectHost)),"f"),$u(this,Sg,q(this,ks,"f").own(Vt.create(q(this,ye,"f").audioEffects,i=>q(this,sa,"f").boxAdapters.adapterFor(i,re.isAudioEffect),l.AudioEffectHost)),"f"),$u(this,Kr,q(this,ks,"f").own(new pe(q(this,sa,"f"))),"f"),this.namedParameter=q(this,vw,"m",o1).call(this,t),q(this,ks,"f").own(q(this,ye,"f").file.catchupAndSubscribe(i=>{$u(this,Mu,i.targetVertex.map(({box:n})=>q(this,sa,"f").boxAdapters.adapterFor(n,Ri)),"f"),q(this,Mu,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return q(this,ye,"f")}get uuid(){return q(this,ye,"f").address.uuid}get address(){return q(this,ye,"f").address}get peakAddress(){return q(this,ye,"f").address.append(1001)}get indexField(){return q(this,ye,"f").index}get gate(){return q(this,ye,"f").gate.getValue()}get exclude(){return q(this,ye,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${q(this,Mu,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return q(this,ye,"f").icon}get defaultTrackType(){return te.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return q(this,ye,"f").midiEffects}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return q(this,ye,"f").audioEffects}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}file(){return q(this,Mu,"f")}fileUUID(){return q(this,ye,"f").file.targetAddress.unwrap().uuid}resetParameters(){q(this,ye,"f").mute.reset(),q(this,ye,"f").solo.reset(),q(this,ye,"f").exclude.reset(),q(this,ye,"f").polyphone.reset(),q(this,ye,"f").pitch.reset(),q(this,ye,"f").attack.reset(),q(this,ye,"f").release.reset(),q(this,ye,"f").sampleStart.reset(),q(this,ye,"f").sampleEnd.reset(),q(this,ye,"f").gate.reset()}copyToIndex(e){$o.create(q(this,ye,"f").graph,A.generate(),t=>{t.file.refer(q(this,ye,"f").file.targetVertex.unwrap()),t.device.refer(q(this,ye,"f").device.targetVertex.unwrap()),t.index.setValue(e),t.mute.setValue(q(this,ye,"f").mute.getValue()),t.solo.setValue(q(this,ye,"f").solo.getValue()),t.sampleStart.setValue(q(this,ye,"f").sampleStart.getValue()),t.sampleEnd.setValue(q(this,ye,"f").sampleEnd.getValue()),t.attack.setValue(q(this,ye,"f").attack.getValue()),t.release.setValue(q(this,ye,"f").release.getValue()),t.pitch.setValue(q(this,ye,"f").pitch.getValue()),t.exclude.setValue(q(this,ye,"f").exclude.getValue()),t.gate.setValue(q(this,ye,"f").gate.getValue())})}get midiEffects(){return q(this,Eg,"f")}get inputAdapter(){return g.wrap(this)}get audioEffects(){return q(this,Sg,"f")}get labelField(){return q(this,ye,"f").label}get enabledField(){return q(this,ye,"f").enabled}get minimizedField(){return q(this,ye,"f").minimized}device(){return q(this,sa,"f").boxAdapters.adapterFor(q(this,ye,"f").device.targetVertex.unwrap().box,la)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){q(this,ks,"f").terminate()}};ks=new WeakMap,sa=new WeakMap,ye=new WeakMap,Eg=new WeakMap,Sg=new WeakMap,Kr=new WeakMap,Mu=new WeakMap,vw=new WeakSet,o1=function(e){return{gate:q(this,Kr,"f").createParameter(e.gate,E.linearInteger(0,2),P.indices("",["Off","On","Loop"]),"Gate"),mute:q(this,Kr,"f").createParameter(e.mute,E.bool,P.bool,"Mute"),solo:q(this,Kr,"f").createParameter(e.solo,E.bool,P.bool,"Solo"),polyphone:q(this,Kr,"f").createParameter(e.polyphone,E.bool,P.bool,"Polyphone"),exclude:q(this,Kr,"f").createParameter(e.exclude,E.bool,P.bool,"Exclude"),pitch:q(this,Kr,"f").createParameter(e.pitch,E.linear(-1200,1200),P.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:q(this,Kr,"f").createParameter(e.sampleStart,E.unipolar(),P.percent(),"Start",0),sampleEnd:q(this,Kr,"f").createParameter(e.sampleEnd,E.unipolar(),P.percent(),"End",1),attack:q(this,Kr,"f").createParameter(e.attack,E.exponential(.001,5),P.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:q(this,Kr,"f").createParameter(e.release,E.exponential(.001,5),P.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release")}};var Bg=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Pr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Iu,Hi,Ap,Fg,la=class{constructor(e,t){this.type="instrument",this.accepts="midi",Iu.set(this,void 0),Hi.set(this,void 0),Ap.set(this,void 0),Fg.set(this,void 0),Bg(this,Iu,e,"f"),Bg(this,Hi,t,"f"),Bg(this,Ap,Vt.create(t.samples,i=>e.boxAdapters.adapterFor(i,Du),l.Sample),"f"),Bg(this,Fg,new pe(Pr(this,Iu,"f")),"f")}reset(){Pr(this,Ap,"f").adapters().forEach(e=>e.box.delete())}get box(){return Pr(this,Hi,"f")}get uuid(){return Pr(this,Hi,"f").address.uuid}get address(){return Pr(this,Hi,"f").address}get labelField(){return Pr(this,Hi,"f").label}get iconField(){return Pr(this,Hi,"f").icon}get defaultTrackType(){return te.Notes}get enabledField(){return Pr(this,Hi,"f").enabled}get minimizedField(){return Pr(this,Hi,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return Pr(this,Ap,"f")}get context(){return Pr(this,Iu,"f")}deviceHost(){return Pr(this,Iu,"f").boxAdapters.adapterFor(Pr(this,Hi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Pr(this,Fg,"f").terminate()}};Iu=new WeakMap,Hi=new WeakMap,Ap=new WeakMap,Fg=new WeakMap;var yw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},It=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},xw,_p,vi,$n,a1,Cu=class{constructor(e,t){xw.add(this),this.type="audio-effect",this.accepts="audio",_p.set(this,void 0),vi.set(this,void 0),$n.set(this,void 0),yw(this,_p,e,"f"),yw(this,vi,t,"f"),yw(this,$n,new pe(It(this,_p,"f")),"f"),this.namedParameter=It(this,xw,"m",a1).call(this,t)}get box(){return It(this,vi,"f")}get uuid(){return It(this,vi,"f").address.uuid}get address(){return It(this,vi,"f").address}get indexField(){return It(this,vi,"f").index}get labelField(){return It(this,vi,"f").label}get enabledField(){return It(this,vi,"f").enabled}get minimizedField(){return It(this,vi,"f").minimized}get host(){return It(this,vi,"f").host}deviceHost(){return It(this,_p,"f").boxAdapters.adapterFor(It(this,vi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){It(this,$n,"f").terminate()}};_p=new WeakMap,vi=new WeakMap,$n=new WeakMap,xw=new WeakSet,a1=function(e){return{volume:It(this,$n,"f").createParameter(e.volume,E.decibel(-72,0,12),P.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:It(this,$n,"f").createParameter(e.panning,E.bipolar(),P.panning,"Panning",.5),stereo:It(this,$n,"f").createParameter(e.stereo,E.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:It(this,$n,"f").createParameter(e.invertL,E.bool,P.bool,"Invert Left"),invertR:It(this,$n,"f").createParameter(e.invertR,E.bool,P.bool,"Invert Right"),swap:It(this,$n,"f").createParameter(e.swap,E.bool,P.bool,"Swap")}};var $s;(function(r){r.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})($s||($s={}));var s1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Er=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Tu,Sr,Ru=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",Tu.set(this,void 0),Sr.set(this,void 0),s1(this,Tu,e,"f"),s1(this,Sr,t,"f"),this.groove()}get box(){return Er(this,Sr,"f")}get uuid(){return Er(this,Sr,"f").address.uuid}get address(){return Er(this,Sr,"f").address}get indexField(){return Er(this,Sr,"f").index}get labelField(){return Er(this,Sr,"f").label}get enabledField(){return Er(this,Sr,"f").enabled}get minimizedField(){return Er(this,Sr,"f").minimized}get host(){return Er(this,Sr,"f").host}deviceHost(){return Er(this,Tu,"f").boxAdapters.adapterFor(Er(this,Sr,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}groove(){return Er(this,Tu,"f").boxAdapters.adapterFor(Er(this,Sr,"f").groove.targetVertex.unwrap("no groove").box,$s.checkType)}catchupAndSubscribeGroove(e){return Er(this,Sr,"f").groove.catchupAndSubscribe(t=>e(Er(this,Tu,"f").boxAdapters.adapterFor(t.targetVertex.unwrap("No groove found").box,$s.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Tu=new WeakMap,Sr=new WeakMap;var l1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ji=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ng,Wr,Ou=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",Ng.set(this,void 0),Wr.set(this,void 0),l1(this,Ng,e,"f"),l1(this,Wr,t,"f")}get box(){return Ji(this,Wr,"f")}get uuid(){return Ji(this,Wr,"f").address.uuid}get address(){return Ji(this,Wr,"f").address}get indexField(){return Ji(this,Wr,"f").index}get labelField(){return Ji(this,Wr,"f").label}get enabledField(){return Ji(this,Wr,"f").enabled}get minimizedField(){return Ji(this,Wr,"f").minimized}get host(){return Ji(this,Wr,"f").host}get commentField(){return Ji(this,Wr,"f").comment}deviceHost(){return Ji(this,Ng,"f").boxAdapters.adapterFor(Ji(this,Wr,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Ng=new WeakMap,Wr=new WeakMap;var u1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Qi=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},kg,Zr,Vu=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",kg.set(this,void 0),Zr.set(this,void 0),u1(this,kg,e,"f"),u1(this,Zr,t,"f")}get box(){return Qi(this,Zr,"f")}get uuid(){return Qi(this,Zr,"f").address.uuid}get address(){return Qi(this,Zr,"f").address}get indexField(){return Qi(this,Zr,"f").index}get labelField(){return Qi(this,Zr,"f").label}get enabledField(){return Qi(this,Zr,"f").enabled}get minimizedField(){return Qi(this,Zr,"f").minimized}get host(){return Qi(this,Zr,"f").host}get commentField(){return Qi(this,Zr,"f").comment}deviceHost(){return Qi(this,kg,"f").boxAdapters.adapterFor(Qi(this,Zr,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};kg=new WeakMap,Zr=new WeakMap;var ua=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Se=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ww,bw,Pp,Br,$g,zu,Yi,yi,Uu,c1,Aw,ju=class{constructor(e,t){ww.add(this),this.type="instrument",this.accepts="midi",bw.set(this,new z),Pp.set(this,void 0),Br.set(this,void 0),$g.set(this,void 0),zu.set(this,void 0),Yi.set(this,void 0),yi.set(this,void 0),Uu.set(this,K.Empty),Aw.set(this,i=>i.match({none:()=>{Se(this,yi,"f").clear(),Se(this,Yi,"f").clear()},some:n=>n.soundfont.match({none:()=>{Se(this,yi,"f").clear(),Se(this,Yi,"f").clear(),Se(this,Uu,"f").terminate(),ua(this,Uu,n.subscribe(o=>{if(o.type==="loaded"){let a=n.soundfont.unwrap();Se(this,yi,"f").wrap(a.presets[this.presetIndex]??a.presets[0]),Se(this,Yi,"f").wrap(a)}else o.type==="error"?(Se(this,yi,"f").clear(),Se(this,Yi,"f").clear()):o.type==="idle"&&(Se(this,yi,"f").clear(),Se(this,Yi,"f").clear())}),"f")},some:o=>{Se(this,Yi,"f").wrap(o),Se(this,yi,"f").wrap(o.presets[this.presetIndex]??o.presets[0])}})})),ua(this,Pp,e,"f"),ua(this,Br,t,"f"),ua(this,$g,new pe(Se(this,Pp,"f")),"f"),this.namedParameter=Se(this,ww,"m",c1).call(this,t),ua(this,zu,new Yr,"f"),ua(this,Yi,new Yr,"f"),ua(this,yi,new Yr,"f"),Se(this,bw,"f").ownAll(Se(this,zu,"f").subscribe(Se(this,Aw,"f")),Se(this,Br,"f").file.catchupAndSubscribe(({targetVertex:i})=>Se(this,zu,"f").wrapOption(i.map(({box:n})=>e.soundfontManager.getOrCreate(n.address.uuid)))),Se(this,Br,"f").presetIndex.catchupAndSubscribe(i=>Se(this,Yi,"f").match({none:()=>Se(this,yi,"f").clear(),some:n=>Se(this,yi,"f").wrap(n.presets[i.getValue()]??n.presets[0])})))}get loader(){return Se(this,zu,"f")}get soundfont(){return Se(this,Yi,"f")}get preset(){return Se(this,yi,"f")}get presetIndex(){return Se(this,Br,"f").presetIndex.getValue()}get box(){return Se(this,Br,"f")}get uuid(){return Se(this,Br,"f").address.uuid}get address(){return Se(this,Br,"f").address}get labelField(){return Se(this,Br,"f").label}get iconField(){return Se(this,Br,"f").icon}get defaultTrackType(){return te.Notes}get enabledField(){return Se(this,Br,"f").enabled}get minimizedField(){return Se(this,Br,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Se(this,Pp,"f").boxAdapters.adapterFor(Se(this,Br,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Se(this,Uu,"f").terminate(),ua(this,Uu,K.Empty,"f"),Se(this,$g,"f").terminate()}};bw=new WeakMap,Pp=new WeakMap,Br=new WeakMap,$g=new WeakMap,zu=new WeakMap,Yi=new WeakMap,yi=new WeakMap,Uu=new WeakMap,Aw=new WeakMap,ww=new WeakSet,c1=function(e){return{}};var d1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ep=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Mg,Ms,Dg=class{constructor(e,t){Mg.set(this,void 0),Ms.set(this,void 0),d1(this,Mg,e,"f"),d1(this,Ms,t,"f")}get box(){return Ep(this,Ms,"f")}get uuid(){return Ep(this,Ms,"f").address.uuid}get address(){return Ep(this,Ms,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return Ep(this,Mg,"f").soundfontManager.getOrCreate(Ep(this,Ms,"f").address.uuid)}terminate(){}};Mg=new WeakMap,Ms=new WeakMap;var _w=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},tt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Pw,Sp,xi,Qt,p1,Lu=class{constructor(e,t){Pw.add(this),this.type="audio-effect",this.accepts="audio",Sp.set(this,void 0),xi.set(this,void 0),Qt.set(this,void 0),_w(this,Sp,e,"f"),_w(this,xi,t,"f"),_w(this,Qt,new pe(tt(this,Sp,"f")),"f"),this.namedParameter=tt(this,Pw,"m",p1).call(this,t)}get box(){return tt(this,xi,"f")}get uuid(){return tt(this,xi,"f").address.uuid}get address(){return tt(this,xi,"f").address}get indexField(){return tt(this,xi,"f").index}get labelField(){return tt(this,xi,"f").label}get enabledField(){return tt(this,xi,"f").enabled}get minimizedField(){return tt(this,xi,"f").minimized}get host(){return tt(this,xi,"f").host}deviceHost(){return tt(this,Sp,"f").boxAdapters.adapterFor(tt(this,xi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){tt(this,Qt,"f").terminate()}};Sp=new WeakMap,xi=new WeakMap,Qt=new WeakMap,Pw=new WeakSet,p1=function(e){return{lookahead:tt(this,Qt,"f").createParameter(e.lookahead,E.bool,P.bool,"Lookahead"),automakeup:tt(this,Qt,"f").createParameter(e.automakeup,E.bool,P.bool,"Auto Makeup"),autoattack:tt(this,Qt,"f").createParameter(e.autoattack,E.bool,P.bool,"Auto Attack"),autorelease:tt(this,Qt,"f").createParameter(e.autorelease,E.bool,P.bool,"Auto Release"),inputgain:tt(this,Qt,"f").createParameter(e.inputgain,E.linear(-30,30),P.decible,"Input Gain"),threshold:tt(this,Qt,"f").createParameter(e.threshold,E.linear(-60,0),P.decible,"Threshold"),ratio:tt(this,Qt,"f").createParameter(e.ratio,E.exponential(1,24),P.numeric({fractionDigits:1}),"Ratio"),knee:tt(this,Qt,"f").createParameter(e.knee,E.linear(0,24),P.decible,"Knee"),attack:tt(this,Qt,"f").createParameter(e.attack,E.linear(0,100),P.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:tt(this,Qt,"f").createParameter(e.release,E.linear(5,1500),P.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:tt(this,Qt,"f").createParameter(e.makeup,E.linear(-40,40),P.decible,"Makeup Gain"),mix:tt(this,Qt,"f").createParameter(e.mix,E.unipolar(),P.percent(),"Dry/Wet")}};var Ew=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Kt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Sw,Bp,wi,ca,h1,Ku=class{constructor(e,t){Sw.add(this),this.type="audio-effect",this.accepts="audio",Bp.set(this,void 0),wi.set(this,void 0),ca.set(this,void 0),Ew(this,Bp,e,"f"),Ew(this,wi,t,"f"),Ew(this,ca,new pe(Kt(this,Bp,"f")),"f"),this.namedParameter=Kt(this,Sw,"m",h1).call(this,t)}get box(){return Kt(this,wi,"f")}get uuid(){return Kt(this,wi,"f").address.uuid}get address(){return Kt(this,wi,"f").address}get indexField(){return Kt(this,wi,"f").index}get labelField(){return Kt(this,wi,"f").label}get enabledField(){return Kt(this,wi,"f").enabled}get minimizedField(){return Kt(this,wi,"f").minimized}get host(){return Kt(this,wi,"f").host}deviceHost(){return Kt(this,Bp,"f").boxAdapters.adapterFor(Kt(this,wi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Kt(this,ca,"f").terminate()}};Bp=new WeakMap,wi=new WeakMap,ca=new WeakMap,Sw=new WeakSet,h1=function(e){return{crush:Kt(this,ca,"f").createParameter(e.crush,E.unipolar(),P.percent(),"Crush"),bits:Kt(this,ca,"f").createParameter(e.bits,E.linearInteger(1,16),P.numeric(),"Bits"),boost:Kt(this,ca,"f").createParameter(e.boost,E.linear(0,24),P.decible,"Boost"),mix:Kt(this,ca,"f").createParameter(e.mix,E.exponential(.001,1),P.percent(),"Mix")}};var Bw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},pr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Fw,Fp,bi,Wu,f1,Zu=class{constructor(e,t){Fw.add(this),this.type="audio-effect",this.accepts="audio",Fp.set(this,void 0),bi.set(this,void 0),Wu.set(this,void 0),Bw(this,Fp,e,"f"),Bw(this,bi,t,"f"),Bw(this,Wu,new pe(pr(this,Fp,"f")),"f"),this.namedParameter=pr(this,Fw,"m",f1).call(this,t)}get box(){return pr(this,bi,"f")}get uuid(){return pr(this,bi,"f").address.uuid}get address(){return pr(this,bi,"f").address}get indexField(){return pr(this,bi,"f").index}get labelField(){return pr(this,bi,"f").label}get enabledField(){return pr(this,bi,"f").enabled}get minimizedField(){return pr(this,bi,"f").minimized}get host(){return pr(this,bi,"f").host}deviceHost(){return pr(this,Fp,"f").boxAdapters.adapterFor(pr(this,bi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){pr(this,Wu,"f").terminate()}};Fp=new WeakMap,bi=new WeakMap,Wu=new WeakMap,Fw=new WeakSet,f1=function(e){return{drive:pr(this,Wu,"f").createParameter(e.drive,E.linear(0,30),P.decible,"Drive"),volume:pr(this,Wu,"f").createParameter(e.volume,E.linear(-18,0),P.decible,"Volume")}};var Ig=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Pt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Np,kp,Ai,Gu,qu,Hu=class{constructor(e,t){Np.set(this,new z),this.type="instrument",this.accepts="midi",kp.set(this,void 0),Ai.set(this,void 0),Gu.set(this,void 0),qu.set(this,void 0),Ig(this,kp,e,"f"),Ig(this,Ai,t,"f"),Ig(this,Gu,new Yr,"f"),Ig(this,qu,Pt(this,Np,"f").own(new pe(Pt(this,kp,"f"))),"f"),Pt(this,Np,"f").ownAll(t.parameters.pointerHub.catchupAndSubscribe({onAdded:(({box:i})=>Pt(this,qu,"f").createParameter(Be(i,Ti).value,E.unipolar(),P.percent({fractionDigits:1}),"",0)),onRemoved:(({box:i})=>Pt(this,qu,"f").removeParameter(Be(i,Ti).value.address))}),Pt(this,Ai,"f").device.catchupAndSubscribe(({targetVertex:i})=>i.match({none:()=>Pt(this,Gu,"f").clear(),some:({box:n})=>Pt(this,Gu,"f").wrap(Be(n,Ci))})))}get box(){return Pt(this,Ai,"f")}get uuid(){return Pt(this,Ai,"f").address.uuid}get address(){return Pt(this,Ai,"f").address}get labelField(){return Pt(this,Ai,"f").label}get iconField(){return Pt(this,Ai,"f").icon}get defaultTrackType(){return te.Notes}get enabledField(){return Pt(this,Ai,"f").enabled}get minimizedField(){return Pt(this,Ai,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return Pt(this,qu,"f")}get midiDevice(){return Pt(this,Gu,"f")}deviceHost(){return Pt(this,kp,"f").boxAdapters.adapterFor(Pt(this,Ai,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Pt(this,Np,"f").terminate()}};Np=new WeakMap,kp=new WeakMap,Ai=new WeakMap,Gu=new WeakMap,qu=new WeakMap;var Cg=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},vt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Nw,$p,_i,Mn,Mp,m1,Ju=class{constructor(e,t){Nw.add(this),this.type="midi-effect",this.accepts="midi",$p.set(this,void 0),_i.set(this,void 0),Mn.set(this,void 0),Mp.set(this,void 0),Cg(this,$p,e,"f"),Cg(this,_i,t,"f"),Cg(this,Mn,new pe(vt(this,$p,"f")),"f"),Cg(this,Mp,Hs.create(),"f"),this.namedParameter=vt(this,Nw,"m",m1).call(this,t)}computeVelocity(e,t){let{magnetPosition:i,magnetStrength:n,randomSeed:o,randomAmount:a,offset:s,mix:u}=this.namedParameter;vt(this,Mp,"f").setSeed(o.valueAt(e)+e);let c=t+(i.valueAt(e)-t)*n.valueAt(e),p=(vt(this,Mp,"f").uniform()*2-1)*a.valueAt(e),d=s.valueAt(e),f=u.valueAt(e);return t*(1-f)+Jr(c+p+d)*f}get box(){return vt(this,_i,"f")}get uuid(){return vt(this,_i,"f").address.uuid}get address(){return vt(this,_i,"f").address}get indexField(){return vt(this,_i,"f").index}get labelField(){return vt(this,_i,"f").label}get enabledField(){return vt(this,_i,"f").enabled}get minimizedField(){return vt(this,_i,"f").minimized}get host(){return vt(this,_i,"f").host}deviceHost(){return vt(this,$p,"f").boxAdapters.adapterFor(vt(this,_i,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){vt(this,Mn,"f").terminate()}};$p=new WeakMap,_i=new WeakMap,Mn=new WeakMap,Mp=new WeakMap,Nw=new WeakSet,m1=function(e){return{magnetPosition:vt(this,Mn,"f").createParameter(e.magnetPosition,E.unipolar(),P.percent(),"Position"),magnetStrength:vt(this,Mn,"f").createParameter(e.magnetStrength,E.unipolar(),P.percent(),"Strength"),randomSeed:vt(this,Mn,"f").createParameter(e.randomSeed,E.linearInteger(0,65535),P.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:vt(this,Mn,"f").createParameter(e.randomAmount,E.unipolar(),P.percent(),"Amount"),offset:vt(this,Mn,"f").createParameter(e.offset,E.bipolar(),P.percent(),"Offset"),mix:vt(this,Mn,"f").createParameter(e.mix,E.unipolar(),P.percent(),"Mix")}};var kw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ct=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},$w,Mw,Dp,Pi,Dn,g1,Xi=class{constructor(e,t){$w.add(this),this.type="audio-effect",this.accepts="audio",Dp.set(this,void 0),Pi.set(this,void 0),Dn.set(this,void 0),kw(this,Dp,e,"f"),kw(this,Pi,t,"f"),kw(this,Dn,new pe(Ct(this,Dp,"f")),"f"),this.namedParameter=Ct(this,$w,"m",g1).call(this,t)}get box(){return Ct(this,Pi,"f")}get uuid(){return Ct(this,Pi,"f").address.uuid}get address(){return Ct(this,Pi,"f").address}get indexField(){return Ct(this,Pi,"f").index}get labelField(){return Ct(this,Pi,"f").label}get enabledField(){return Ct(this,Pi,"f").enabled}get minimizedField(){return Ct(this,Pi,"f").minimized}get host(){return Ct(this,Pi,"f").host}deviceHost(){return Ct(this,Dp,"f").boxAdapters.adapterFor(Ct(this,Pi,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Ct(this,Dn,"f").terminate()}};Mw=Xi,Dp=new WeakMap,Pi=new WeakMap,Dn=new WeakMap,$w=new WeakSet,g1=function(e){let{RateFractions:t,RateStringMapping:i}=Mw;return{slope:Ct(this,Dn,"f").createParameter(e.slope,E.bipolar(),P.percent({fractionDigits:1}),"Slope",.5),symmetry:Ct(this,Dn,"f").createParameter(e.symmetry,E.unipolar(),P.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:Ct(this,Dn,"f").createParameter(e.rate,E.values(t.map((n,o)=>o)),i,"Rate",0),depth:Ct(this,Dn,"f").createParameter(e.depth,E.unipolar(),P.percent({fractionDigits:1}),"Depth",0),offset:Ct(this,Dn,"f").createParameter(e.offset,E.linear(-180,180),P.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:Ct(this,Dn,"f").createParameter(e.channelOffset,E.linear(-180,180),P.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};Xi.RateFractions=rr.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();Xi.RateStringMapping=P.indices("",Mw.RateFractions.map(([r,e])=>`${r}/${e}`));var Dw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},rt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Iw,Ip,Ei,Yt,v1,Qu=class{constructor(e,t){Iw.add(this),this.type="audio-effect",this.accepts="audio",Ip.set(this,void 0),Ei.set(this,void 0),Yt.set(this,void 0),Dw(this,Ip,e,"f"),Dw(this,Ei,t,"f"),Dw(this,Yt,new pe(rt(this,Ip,"f")),"f"),this.namedParameter=rt(this,Iw,"m",v1).call(this,t)}get box(){return rt(this,Ei,"f")}get uuid(){return rt(this,Ei,"f").address.uuid}get address(){return rt(this,Ei,"f").address}get indexField(){return rt(this,Ei,"f").index}get labelField(){return rt(this,Ei,"f").label}get enabledField(){return rt(this,Ei,"f").enabled}get minimizedField(){return rt(this,Ei,"f").minimized}get host(){return rt(this,Ei,"f").host}deviceHost(){return rt(this,Ip,"f").boxAdapters.adapterFor(rt(this,Ei,"f").host.targetVertex.unwrap("no device-host").box,re.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){rt(this,Yt,"f").terminate()}};Ip=new WeakMap,Ei=new WeakMap,Yt=new WeakMap,Iw=new WeakSet,v1=function(e){return{preDelay:rt(this,Yt,"f").createParameter(e.preDelay,E.linear(0,1e3),P.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:rt(this,Yt,"f").createParameter(e.bandwidth,E.unipolar(),P.percent(),"Bandwidth"),inputDiffusion1:rt(this,Yt,"f").createParameter(e.inputDiffusion1,E.unipolar(),P.percent(),"Tank 1"),inputDiffusion2:rt(this,Yt,"f").createParameter(e.inputDiffusion2,E.unipolar(),P.percent(),"Tank 2"),decay:rt(this,Yt,"f").createParameter(e.decay,E.unipolar(),P.percent(),"Decay"),decayDiffusion1:rt(this,Yt,"f").createParameter(e.decayDiffusion1,E.unipolar(),P.percent(),"Tank 1"),decayDiffusion2:rt(this,Yt,"f").createParameter(e.decayDiffusion2,E.unipolar(),P.percent(),"Tank 2"),damping:rt(this,Yt,"f").createParameter(e.damping,E.unipolar(),P.percent(),"Damping"),excursionRate:rt(this,Yt,"f").createParameter(e.excursionRate,E.unipolar(),P.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:rt(this,Yt,"f").createParameter(e.excursionDepth,E.unipolar(),P.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:rt(this,Yt,"f").createParameter(e.wet,E.DefaultDecibel,P.decible,"Wet"),dry:rt(this,Yt,"f").createParameter(e.dry,E.DefaultDecibel,P.decible,"Dry")}};var Tg=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},H=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Cw,X,co,Cp,Rg,y1,Og=class{constructor(e){Cw.add(this),X.set(this,void 0),co.set(this,void 0),Cp.set(this,void 0),Rg.set(this,void 0),Tg(this,X,e,"f"),Tg(this,co,A.newSet(t=>t.uuid),"f"),Tg(this,Cp,new Set,"f"),Tg(this,Rg,H(this,X,"f").boxGraph.subscribeToAllUpdates({onUpdate:t=>{if(t.type==="delete"){let i=H(this,co,"f").getOrNull(t.uuid);Z(i)&&(H(this,Cp,"f").add(i.box),H(this,co,"f").removeByValue(i).terminate())}}}),"f")}terminate(){H(this,co,"f").values().forEach(e=>e.terminate()),H(this,co,"f").clear(),H(this,Rg,"f").terminate()}adapterFor(e,t){if(H(this,Cp,"f").has(e))return F(`Cannot resolve adapter for already deleted box: ${e}`);let i=H(this,co,"f").getOrNull(e.address.uuid);if(i===null){i=H(this,Cw,"m",y1).call(this,e);let n=H(this,co,"f").add(i);D(n,`Could not add adapter for ${e}`)}return typeof t=="function"?Object.hasOwn(t,"prototype")?i instanceof t?i:F(`${i} is not instance of ${t}`):t(i)?i:F(`${i} did not pass custom type guard`):F("Unknown checkType method")}};X=new WeakMap,co=new WeakMap,Cp=new WeakMap,Rg=new WeakMap,Cw=new WeakSet,y1=function(e){return Y(e.accept({visitArpeggioDeviceBox:t=>new Gi(H(this,X,"f"),t),visitAudioBusBox:t=>new ur(H(this,X,"f"),t),visitAudioClipBox:t=>new Yn(H(this,X,"f"),t),visitAudioFileBox:t=>new Ri(H(this,X,"f"),t),visitAudioPitchBox:t=>new hn(H(this,X,"f"),t),visitAudioTimeStretchBox:t=>new fn(H(this,X,"f"),t),visitTransientMarkerBox:t=>new Pl(t),visitWarpMarkerBox:t=>new Oo(H(this,X,"f"),t),visitAudioRegionBox:t=>new Lo(H(this,X,"f"),t),visitAudioUnitBox:t=>new si(H(this,X,"f"),t),visitAuxSendBox:t=>new eu(H(this,X,"f"),t),visitCompressorDeviceBox:t=>new Lu(H(this,X,"f"),t),visitCrusherDeviceBox:t=>new Ku(H(this,X,"f"),t),visitDattorroReverbDeviceBox:t=>new Qu(H(this,X,"f"),t),visitDelayDeviceBox:t=>new ui(H(this,X,"f"),t),visitDeviceInterfaceKnobBox:t=>new mu(H(this,X,"f"),t),visitTidalDeviceBox:t=>new Xi(H(this,X,"f"),t),visitFoldDeviceBox:t=>new Zu(H(this,X,"f"),t),visitGrooveShuffleBox:t=>new Sn(H(this,X,"f"),t),visitMarkerBox:t=>new Qo(H(this,X,"f"),t),visitMIDIOutputDeviceBox:t=>new Hu(H(this,X,"f"),t),visitModularAudioInputBox:t=>new hu(H(this,X,"f"),t),visitModularAudioOutputBox:t=>new cu(H(this,X,"f"),t),visitModularBox:t=>new ea(H(this,X,"f"),t),visitModularDeviceBox:t=>new ra(H(this,X,"f"),t),visitModuleConnectionBox:t=>new Xo(H(this,X,"f"),t),visitModuleDelayBox:t=>new uu(H(this,X,"f"),t),visitModuleGainBox:t=>new du(H(this,X,"f"),t),visitModuleMultiplierBox:t=>new pu(H(this,X,"f"),t),visitNanoDeviceBox:t=>new ku(H(this,X,"f"),t),visitNoteClipBox:t=>new Rl(H(this,X,"f"),t),visitNoteEventBox:t=>new Ya(H(this,X,"f"),t),visitNoteEventCollectionBox:t=>new ri(H(this,X,"f"),t),visitNoteRegionBox:t=>new Ko(H(this,X,"f"),t),visitPitchDeviceBox:t=>new Fu(H(this,X,"f"),t),visitPlayfieldDeviceBox:t=>new la(H(this,X,"f"),t),visitPlayfieldSampleBox:t=>new Du(H(this,X,"f"),t),visitRevampDeviceBox:t=>new su(H(this,X,"f"),t),visitReverbDeviceBox:t=>new au(H(this,X,"f"),t),visitRootBox:t=>new Eu(H(this,X,"f"),t),visitSoundfontDeviceBox:t=>new ju(H(this,X,"f"),t),visitSoundfontFileBox:t=>new Dg(H(this,X,"f"),t),visitStereoToolDeviceBox:t=>new Cu(H(this,X,"f"),t),visitTapeDeviceBox:t=>new Su(H(this,X,"f"),t),visitTimelineBox:t=>new En(H(this,X,"f"),t),visitTrackBox:t=>new pt(H(this,X,"f"),t),visitUnknownAudioEffectDeviceBox:t=>new Ou(H(this,X,"f"),t),visitUnknownMidiEffectDeviceBox:t=>new Vu(H(this,X,"f"),t),visitValueClipBox:t=>new Ro(H(this,X,"f"),t),visitValueEventBox:t=>new Hn(H(this,X,"f"),t),visitValueEventCollectionBox:t=>new ar(H(this,X,"f"),t),visitValueRegionBox:t=>new io(H(this,X,"f"),t),visitVaporisateurDeviceBox:t=>new Bu(H(this,X,"f"),t),visitVelocityDeviceBox:t=>new Ju(H(this,X,"f"),t),visitZeitgeistDeviceBox:t=>new Ru(H(this,X,"f"),t)}),`Could not find factory for ${e}`)};var Yu;(function(r){r.PEAKS=we.compose(A.Lowest).append(0),r.SPECTRUM=we.compose(A.Lowest).append(1),r.WAVEFORM=we.compose(A.Lowest).append(2)})(Yu||(Yu={}));var x1;(function(r){r.countStems=e=>e.match({none:()=>1,some:t=>Object.keys(t).length}),r.sanitizeFileName=e=>e.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").trim(),r.sanitizeExportNamesInPlace=e=>{let t=new Map,i=n=>{let o=t.get(n)??0,a=n;for(;t.has(a);)o++,a=`${n} ${o}`;return t.set(n,o),t.set(a,1),a};Object.keys(e).forEach(n=>{let o=e[n];o.fileName=i(r.sanitizeFileName(o.fileName))})}})(x1||(x1={}));var w1=vr.createBuilder({position:vr.float,playbackTimestamp:vr.float,countInBeatsRemaining:vr.float,isPlaying:vr.bool,isCountingIn:vr.bool,isRecording:vr.bool});var b1;(function(r){r.store=(e,t,i)=>{if(i==="")return F("MetaData.store: origin must be unique to your app.");let n=e.pointerHub.filter(l.MetaData).map(({box:a})=>a).find(a=>a instanceof Zn&&a.origin.getValue()===i),o=a=>{a.target.refer(e),a.origin.setValue(i),a.value.setValue(JSON.stringify(t))};Ea(n)?o(n):Zn.create(e.graph,A.generate(),o)},r.read=(e,t)=>{if(t==="")return F("MetaData.read: origin must be unique to your app.");let i=e.pointerHub.filter(l.MetaData).map(({box:n})=>n).find(n=>n instanceof Zn&&n.origin.getValue()===t);if(Ea(i)){let{status:n,value:o,error:a}=On(()=>JSON.parse(i.value.getValue()));return n==="success"?Mr.ok(o):Mr.err(a)}else return Mr.err("No meta-data found")},r.clear=(e,t)=>{if(t==="")return F("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(l.MetaData).map(({box:i})=>i).filter(i=>i instanceof Zn&&i.origin.getValue()===t).forEach(i=>i.delete())}})(b1||(b1={}));var Tw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},da=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Vg,zg,Ug,Ds,Si=class{constructor(e,t){Vg.set(this,new z),zg.set(this,void 0),Ug.set(this,void 0),Ds.set(this,void 0),Tw(this,zg,e,"f"),Tw(this,Ug,t,"f"),Tw(this,Ds,new nt(128),"f"),da(this,Vg,"f").own(da(this,zg,"f").broadcastIntegers(da(this,Ug,"f"),new Int32Array(da(this,Ds,"f").buffer),ki))}noteOn(e){e>=0&&e<128&&da(this,Ds,"f").setBit(e,!0)}noteOff(e){e>=0&&e<128&&da(this,Ds,"f").setBit(e,!1)}reset(){}clear(){da(this,Ds,"f").clear()}terminate(){da(this,Vg,"f").terminate()}toString(){return`{${this.constructor.name}}`}};Vg=new WeakMap,zg=new WeakMap,Ug=new WeakMap,Ds=new WeakMap;var it;(function(r){let e;(function(t){t[t.NoteOn=144]="NoteOn",t[t.NoteOff=128]="NoteOff",t[t.PitchBend=224]="PitchBend",t[t.Controller=176]="Controller",t[t.Start=250]="Start",t[t.Continue=251]="Continue",t[t.Stop=252]="Stop",t[t.Clock=248]="Clock",t[t.Position=242]="Position"})(e=r.Command||(r.Command={})),r.readCommand=t=>t[0]&240,r.readChannel=t=>t[0]&15,r.readParam1=t=>t.length>1?t[1]&255:0,r.readParam2=t=>t.length>2?t[2]&255:0,r.readPitch=t=>t[1],r.readVelocity=t=>t[2]/127,r.isNoteOn=t=>r.readCommand(t)===e.NoteOn&&r.readVelocity(t)>0,r.isNoteOff=t=>r.readCommand(t)===e.NoteOff||r.readCommand(t)===e.NoteOn&&r.readVelocity(t)===0,r.isPitchWheel=t=>r.readCommand(t)===e.PitchBend,r.isController=t=>r.readCommand(t)===e.Controller,r.isClock=t=>t[0]===e.Clock,r.isStart=t=>t[0]===e.Start,r.isContinue=t=>t[0]===e.Continue,r.isStop=t=>t[0]===e.Stop,r.isPosition=t=>t[0]===e.Position,r.asPitchBend=t=>{let i=r.readParam1(t)&127,n=r.readParam2(t)&127,o=i|n<<7;return 8192>=o?o/8192-1:(o-8191)/8192},r.asValue=t=>{let i=r.readParam2(t);return i>64?.5+(i-63)/128:i<64?i/128:.5},r.Clock=new Uint8Array([e.Clock]),r.Start=new Uint8Array([e.Start]),r.Continue=new Uint8Array([e.Continue]),r.Stop=new Uint8Array([e.Stop]),r.noteOn=(t,i,n)=>new Uint8Array([e.NoteOn|t,i,n]),r.noteOff=(t,i)=>new Uint8Array([e.NoteOff|t,i,0]),r.control=(t,i,n)=>new Uint8Array([e.Controller|t,i&127,n&127]),r.position=(t,i)=>new Uint8Array([e.Position,t&127,i&127]),r.positionInPPQN=t=>{let i=Math.floor(t/96),n=i&127,o=i>>7&127;return new Uint8Array([e.Position,n,o])},r.accept=(t,i)=>{Rn(t)||(r.isNoteOn(t)?_(i.noteOn,r.readPitch(t),r.readVelocity(t)):r.isNoteOff(t)?_(i.noteOff,r.readPitch(t)):r.isPitchWheel(t)?_(i.pitchBend,r.asPitchBend(t)):r.isController(t)?_(i.controller,r.readParam1(t),r.readParam2(t)/127):r.isClock(t)?_(i.clock):r.isStart(t)?_(i.start):r.isContinue(t)?_(i.continue):r.isStop(t)?_(i.stop):r.isPosition(t)&&_(i.songPos,r.readParam1(t)|r.readParam2(t)<<7))},r.debug=t=>t===null?"null":r.isNoteOn(t)?`NoteOn #${r.readChannel(t)} ${r.readPitch(t)} : ${r.readVelocity(t).toFixed(2)}`:r.isNoteOff(t)?`NoteOff #${r.readChannel(t)} ${r.readPitch(t)}`:r.isPitchWheel(t)?`PitchWheel #${r.readChannel(t)} ${r.asPitchBend(t)}`:r.isController(t)?`Control #${r.readChannel(t)} ${r.asValue(t)}`:r.isClock(t)?"Clock":r.isStart(t)?"Start":r.isContinue(t)?"Continue":r.isStop(t)?"Stop":r.isPosition(t)?`SongPosition ${r.readParam1(t)|r.readParam2(t)<<7}`:"Unknown"})(it||(it={}));var pa;(function(r){r.on=(e,t,i)=>({type:"note-on",uuid:e,pitch:t,velocity:i}),r.off=(e,t)=>({type:"note-off",uuid:e,pitch:t}),r.isOn=e=>e.type==="note-on",r.isOff=e=>e.type==="note-off",r.fromEvent=(e,t)=>{let i=e.data;if(it.isNoteOn(i)){let n=it.readPitch(i),o=it.readVelocity(i);return{type:"note-on",uuid:t,pitch:n,velocity:o}}else if(it.isNoteOff(i)){let n=it.readPitch(i);return{type:"note-off",uuid:t,pitch:n}}return F("Unknown MIDI event")}})(pa||(pa={}));var A1;(function(r){r.start=(e,t,i,n=1)=>{let o=!0;return e(pa.on(t,i,n)),{terminate:()=>{o&&(e(pa.off(t,i)),o=!1)}}}})(A1||(A1={}));var xB,wB,bB,AB,_B;xB=new WeakMap,wB=new WeakMap,bB=new WeakMap,AB=new WeakMap,_B=new WeakMap;var PB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},jg=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Is,Lg=class{constructor(){Is.set(this,void 0),PB(this,Is,we.newSet(e=>e.field.address),"f")}register(e){return jg(this,Is,"f").add(e),{terminate:()=>jg(this,Is,"f").removeByValue(e)}}get(e){return jg(this,Is,"f").get(e)}opt(e){return jg(this,Is,"f").opt(e)}};Is=new WeakMap;var ha={isClipBox:r=>r.accept({visitNoteClipBox:e=>!0,visitAudioClipBox:e=>!0,visitValueClipBox:e=>!0})??!1,isRegionBox:r=>r.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1,asRegionBox:r=>r.accept({visitNoteRegionBox:e=>e,visitAudioRegionBox:e=>e,visitValueRegionBox:e=>e})??F("Could not cast to AnyRegionBox"),isLoopableRegionBox:r=>r.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var Kg;(function(r){r.isTimeSignatureValid=(e,t)=>!Number.isInteger(e)||e<1||e>31?Mr.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(t)||t<1||t>32||(t&t-1)!==0?Mr.err("Denominator must be a power of two between 1 and 32"):Mr.ok([e,t]),r.MIN_BPM=30,r.MAX_BPM=1e3,r.clampBpm=e=>Number.isFinite(e)?ce(e,r.MIN_BPM,r.MAX_BPM):120,r.hasOverlappingRegions=e=>e.boxes().some(t=>t.accept({visitTrackBox:i=>{for(let[n,o]of O.iterateAdjacent(i.regions.pointerHub.incoming().map(({box:a})=>ha.asRegionBox(a)).sort(({position:a},{position:s})=>a.getValue()-s.getValue()))){if(n instanceof Fo&&n.timeBase.getValue()===nr.Seconds)return!1;if(n.position.getValue()+n.duration.getValue()>o.position.getValue())return!0}return!1}})??!1)})(Kg||(Kg={}));var _1;(function(r){r.parseTimeSignature=e=>{let[t,i]=e.split("/"),n=parseInt(t,10),o=parseInt(i,10);return Kg.isTimeSignatureValid(n,o)}})(_1||(_1={}));var Wg;(function(r){r.reader=({sab:e,numChunks:t,numberOfChannels:i,bufferSize:n},o)=>{let a=!0,s=new Int32Array(e,0,2),u=new Float32Array(e,8),c=new Float32Array(i*n),p=typeof document>"u",d=()=>{if(!a)return;let f=Atomics.load(s,1),v=Atomics.load(s,0);if(f===v){if(p)Atomics.wait(s,0,v);else{setTimeout(d,1);return}v=Atomics.load(s,0)}for(;f!==v;){let m=f*i*n;c.set(u.subarray(m,m+i*n));let y=[];for(let x=0;x<i;x++){let $=x*n,I=$+n;y.push(c.slice($,I))}if(f=(f+1)%t,Atomics.store(s,1,f),!a)return;o(y)}d()};return d(),{stop:()=>a=!1}},r.writer=({sab:e,numChunks:t,numberOfChannels:i,bufferSize:n})=>{let o=new Int32Array(e,0,2),a=new Float32Array(e,8);return Object.freeze({write:s=>{if(s.length!==i)return;for(let p of s)if(p.length!==n)return F("Each channel buffer must contain 'bufferSize' samples");let u=Atomics.load(o,0),c=u*i*n;s.forEach((p,d)=>a.set(p,c+d*n)),Atomics.store(o,0,(u+1)%t),Atomics.notify(o,0)}})}})(Wg||(Wg={}));var Rw={isRegion:r=>ha.isRegionBox(r.box),isLoopableRegion:r=>ha.isLoopableRegionBox(r.box)};var In;(function(r){r[r.Off=0]="Off",r[r.On=1]="On",r[r.Loop=2]="Loop"})(In||(In={}));var EB,SB,BB,FB;EB=new WeakMap,SB=new WeakMap,BB=new WeakMap,FB=new WeakMap;var NB,kB,$B,MB;NB=new WeakMap,kB=new WeakMap,$B=new WeakMap,MB=new WeakMap;var Xu={[bt.Instrument]:0,[bt.Aux]:1,[bt.Bus]:2,[bt.Output]:3};var Zg;(function(r){r.create=({boxGraph:e,mandatoryBoxes:{rootBox:t,primaryAudioBus:i}},n,o,a)=>{let s=a??r.orderAndGetIndex(t,n);return console.debug(`createAudioUnit type: ${n}, insertIndex: ${s}`),Xe.create(e,A.generate(),u=>{u.collection.refer(t.audioUnits),u.output.refer(i.input),u.index.setValue(s),u.type.setValue(n),o.ifSome(c=>u.capture.refer(c))})},r.orderAndGetIndex=(e,t)=>{let i=ol.collectIndexedBoxes(e.audioUnits,Xe),n=Xu[t],o=0;for(;o<i.length&&!(Xu[i[o].type.getValue()]>n);o++);let a=o;for(;o<i.length;)i[o].index.setValue(++o);return a},r.trackTypeToCapture=(e,t)=>{switch(t){case te.Audio:return g.wrap(No.create(e,A.generate()));case te.Notes:return g.wrap(ko.create(e,A.generate()));default:return g.None}}})(Zg||(Zg={}));var P1;(function(r){r.create=(e,t,i,n,o)=>{console.debug(`createAudioBus '${t}', type: ${n}, color: ${o}`);let{boxGraph:a,mandatoryBoxes:{rootBox:s}}=e;D(s.isAttached(),"rootBox not attached");let u=A.generate(),c=Ii.create(a,u,d=>{d.collection.refer(s.audioBusses),d.label.setValue(t),d.icon.setValue(ke.toName(i)),d.color.setValue(o.toString())}),p=Zg.create(e,n,g.None);return or.create(a,A.generate(),d=>{d.tracks.refer(p.tracks),d.target.refer(p),d.index.setValue(0),d.type.setValue(te.Undefined)}),c.output.refer(p.input),c}})(P1||(P1={}));var E1;(function(r){r.forAudioType=e=>{switch(e){case bt.Output:return al.blue;case bt.Aux:return al.purple;case bt.Bus:return al.orange;case bt.Instrument:return al.green;default:return al.dark}},r.forTrackType=e=>{switch(e){case te.Audio:return 200;case te.Notes:return 45;case te.Value:return 156;default:return 0}}})(E1||(E1={}));var S1;(function(r){r.Tape={defaultName:"Tape",defaultIcon:ke.Tape,description:"Plays audio regions & clips",trackType:te.Audio,create:(i,n,o,a,s)=>xl.create(i,A.generate(),u=>{u.label.setValue(o),u.icon.setValue(ke.toName(a)),u.flutter.setValue(.2),u.wow.setValue(.05),u.noise.setValue(.02),u.saturation.setValue(.5),u.host.refer(n)})},r.Nano={defaultName:"Nano",defaultIcon:ke.NanoWave,description:"Simple sampler",trackType:te.Notes,create:(i,n,o,a,s)=>{let u;if(Z(s))u=s;else{let c=A.parse("c1678daa-4a47-4cba-b88f-4f4e384663c3"),p=5.34;u=i.findBox(c).unwrapOrElse(()=>Cr.create(i,c,d=>{d.fileName.setValue("Rhode"),d.endInSeconds.setValue(p)}))}return vl.create(i,A.generate(),c=>{c.label.setValue(o),c.icon.setValue(ke.toName(a)),c.file.refer(u),c.host.refer(n)})}},r.Playfield={defaultName:"Playfield",defaultIcon:ke.Playfield,description:"Drum computer",trackType:te.Notes,create:(i,n,o,a,s)=>{let u=yl.create(i,A.generate(),c=>{c.label.setValue(o),c.icon.setValue(ke.toName(a)),c.host.refer(n)});return Z(s)&&s.filter(({note:c,uuid:p,name:d,durationInSeconds:f,exclude:v})=>{let m=e(i,p,d,f);$o.create(i,A.generate(),y=>{y.device.refer(u.samples),y.file.refer(m),y.index.setValue(c),y.exclude.setValue(v)})}),u}},r.Vaporisateur={defaultName:"Vaporisateur",defaultIcon:ke.Piano,description:"Classic subtractive synthesizer",trackType:te.Notes,create:(i,n,o,a,s)=>fl.create(i,A.generate(),u=>{u.label.setValue(o),u.icon.setValue(ke.toName(a)),u.tune.setInitValue(0),u.cutoff.setInitValue(8e3),u.resonance.setInitValue(.1),u.attack.setInitValue(.005),u.decay.setInitValue(.1),u.sustain.setInitValue(.5),u.release.setInitValue(.5),u.voicingMode.setInitValue(ln.Polyphonic),u.lfo.rate.setInitValue(1),u.oscillators.fields()[0].waveform.setInitValue(Ue.saw),u.oscillators.fields()[0].volume.setInitValue(-6),u.oscillators.fields()[1].volume.setInitValue(Number.NEGATIVE_INFINITY),u.oscillators.fields()[1].waveform.setInitValue(Ue.square),u.host.refer(n),u.version.setValue(2)})},r.MIDIOutput={defaultName:"MIDIOutput",defaultIcon:ke.Midi,description:"MIDI Output",trackType:te.Notes,create:(i,n,o,a,s)=>ml.create(i,A.generate(),u=>{u.label.setValue(o),u.icon.setValue(ke.toName(a)),u.host.refer(n)})},r.Soundfont={defaultName:"Soundfont",defaultIcon:ke.SoundFont,description:"Soundfont Player",trackType:te.Notes,create:(i,n,o,a,s)=>{s??(s={uuid:"d9f51577-2096-4671-9067-27ca2e12b329",name:"Upright Piano KW"});let u=s.uuid,c=A.parse(u),p=t(i,c,s.name);return gl.create(i,A.generate(),d=>{d.label.setValue(o),d.icon.setValue(ke.toName(a)),d.host.refer(n),d.file.refer(p)})}},r.Named={Vaporisateur:r.Vaporisateur,Playfield:r.Playfield,Nano:r.Nano,Tape:r.Tape,Soundfont:r.Soundfont,MIDIOutput:r.MIDIOutput};let e=(i,n,o,a)=>i.findBox(n).unwrapOrElse(()=>Cr.create(i,n,s=>{s.fileName.setValue(o),s.endInSeconds.setValue(a)})),t=(i,n,o)=>i.findBox(n).unwrapOrElse(()=>Xr.create(i,n,a=>a.fileName.setValue(o)))})(S1||(S1={}));var fa;(function(r){r.empty=i=>{let n=new Da(g.wrap(Ia.create)),o=new Date().toISOString();console.debug(`New Project created on ${o}`),n.beginTransaction();let a=pl.create(n,A.generate(),f=>{f.label.setValue("Groove Shuffle")}),s=sl.create(n,A.generate(),f=>{f.groove.refer(a),f.created.setValue(o)}),u=Ii.create(n,A.generate(),f=>{f.collection.refer(s.audioBusses),f.label.setValue("Output"),f.icon.setValue(ke.toName(ke.SpeakerHeadphone)),f.color.setValue("hsl(189, 100%, 65%)")}),c=Xe.create(n,A.generate(),f=>{f.type.setValue(bt.Output),f.collection.refer(s.audioUnits),f.output.refer(s.outputDevice),f.index.setValue(0)});i.createOutputCompressor&&hl.create(n,A.generate(),f=>{f.label.setValue("Compressor"),f.index.setValue(0),f.host.refer(c.audioEffects),f.threshold.setValue(0),f.ratio.setValue(24)});let p=Ta.create(n,A.generate());s.timeline.refer(p.root),u.output.refer(c.input);let d=[];if(i.createDefaultUser){let f=Ca.create(n,A.generate());f.root.refer(s.users),d.push(f)}return n.endTransaction(),{boxGraph:n,mandatoryBoxes:{rootBox:s,primaryAudioBus:u,primaryAudioOutputUnit:c,timelineBox:p,userInterfaceBoxes:d}}},r.encode=i=>{let n=Bt.create();n.writeInt(1330660686),n.writeInt(2);let o=i.toArrayBuffer();return n.writeInt(o.byteLength),n.writeBytes(new Int8Array(o)),n.toArrayBuffer()},r.decode=i=>{let n=new ot(i);D(n.readInt()===1330660686,"Corrupt header. Probably not an openDAW project file."),D(n.readInt()===2,"Deprecated Format");let o=n.readInt(),a=new Int8Array(o);n.readBytes(a);let s=new Da(g.wrap(Ia.create));return s.fromArrayBuffer(a.buffer),{boxGraph:s,mandatoryBoxes:r.findMandatoryBoxes(s)}},r.findMandatoryBoxes=i=>{let n=i.boxes().find(o=>o.accept({visitRootBox:()=>!0}));if(Z(n)){let o=Be(n.outputDevice.pointerHub.incoming().at(0)?.box,Xe),a=Be(o.input.pointerHub.incoming().at(0)?.box,Ii),s=Be(n.timeline.targetVertex.unwrap("TimelineBox not found").box,Ta),u=n.users.pointerHub.incoming().map(({box:c})=>Be(c,Ca));return{rootBox:n,primaryAudioBus:a,primaryAudioOutputUnit:o,timelineBox:s,userInterfaceBoxes:u}}return F("Could not find mandatory boxes")}})(fa||(fa={}));var ec;(function(r){let e=({graph:s},{graph:u})=>s===u,t=(s,u)=>s.index.getValue()-u.index.getValue(),i=s=>s.accept({visitTrackBox:u=>!0})===!0;r.extractAudioUnits=(s,{boxGraph:u,mandatoryBoxes:{primaryAudioBus:c,rootBox:p}},d={})=>{D(O.satisfy(s,e),"AudioUnits must share the same BoxGraph"),D(!d.includeAux&&!d.includeBus,"Options are not yet implemented");let f=d?.excludeTimeline===!0?i:vo.alwaysFalse,v=s.flatMap(y=>Array.from(y.graph.dependenciesOf(y,{alwaysFollowMandatory:!0,excludeBox:f}).boxes)).filter(y=>y.name!==un.ClassName&&y.name!==Va.ClassName),m=n(s,v,p.audioUnits.address.uuid,c.address.uuid);return o(m,u,s,v),a(m,s,p),console.debug("inTransaction",u.inTransaction()),s.map(y=>Be(p.graph.findBox(m.get(y.address.uuid).target).unwrap("Target Track has not been copied"),Xe))},r.extractRegions=(s,{boxGraph:u,mandatoryBoxes:{primaryAudioBus:c,rootBox:p}},d=0)=>{D(O.satisfy(s,e),"Region smust be from the same BoxGraph");let f=new Set(s),v=new Set,m=new qs;s.forEach(L=>{let ae=Be(L.regions.targetVertex.unwrap().box,or);v.add(ae);let xe=Be(ae.tracks.targetVertex.unwrap().box,Xe);m.add(xe,ae)}),console.debug(`Found ${m.keyCount()} audioUnits`),console.debug(`Found ${v.size} tracks`);let y=[...m.keys()],x=L=>Me(L,or)&&!v.has(L)||ha.isRegionBox(L)&&!f.has(L),$=y.flatMap(L=>Array.from(L.graph.dependenciesOf(L,{excludeBox:x,alwaysFollowMandatory:!0}).boxes)).filter(L=>L.name!==un.ClassName&&L.name!==Va.ClassName),I=n(y,$,p.audioUnits.address.uuid,c.address.uuid);o(I,u,y,$),a(I,y,p),m.forEach((L,ae)=>[...ae].sort(t).forEach((xe,J)=>{let oe=u.findBox(I.get(xe.address.uuid).target).unwrap("Target Track has not been copied");Be(oe,or).index.setValue(J)}));let T=s.reduce((L,ae)=>Math.min(L,ae.position.getValue()),Number.MAX_VALUE),R=d-T;s.forEach(L=>{let ae=u.findBox(I.get(L.address.uuid).target).unwrap("Target Track has not been copied"),xe=ha.asRegionBox(ae).position;xe.setValue(xe.getValue()+R)})};let n=(s,u,c,p)=>{let d=A.newSet(({source:f})=>f);return d.addMany([...s.filter(({output:{targetAddress:f}})=>f.nonEmpty()).map(f=>({source:f.output.targetAddress.unwrap().uuid,target:p})),...s.map(f=>({source:f.collection.targetAddress.unwrap("AudioUnitBox was not connected to a RootBox").uuid,target:c})),...s.map(f=>({source:f.address.uuid,target:A.generate()})),...u.map(({address:{uuid:f},name:v})=>({source:f,target:v===Cr.ClassName||v===Xr.ClassName?f:A.generate()}))]),d},o=(s,u,c,p)=>{B.decodeWith({map:(d,f)=>f.map(v=>s.opt(v.uuid).match({none:()=>v,some:({target:m})=>v.moveTo(m)}))},()=>{c.forEach(d=>{let f=new ot(d.toArrayBuffer()),v=d.name,m=s.get(d.address.uuid).target;u.createBox(v,m,y=>y.read(f))}),p.forEach(d=>{let f=new ot(d.toArrayBuffer()),v=d.name,m=s.get(d.address.uuid).target;if((d instanceof Cr||d instanceof Xr)&&u.findBox(d.address.uuid).nonEmpty()){d.read(f);return}u.createBox(v,m,y=>y.read(f))})})},a=(s,u,c)=>u.toSorted(t).map(p=>Be(c.graph.findBox(s.get(p.address.uuid).target).unwrap("Target Track has not been copied"),Xe)).forEach(p=>ol.collectIndexedBoxes(c.audioUnits,Xe).toSorted((d,f)=>{let v=Xu[d.type.getValue()],m=Xu[f.type.getValue()],y=v-m;return y===0?f===p?-1:1:y}).forEach((d,f)=>d.index.setValue(f)))})(ec||(ec={}));var ma;(function(r){r.MAGIC_HEADER_OPEN=1330664005,r.FORMAT_VERSION=1})(ma||(ma={}));var B1;(function(r){r.decode=(e,t)=>{let i=new ot(e.slice(0,8));if(i.readInt()!==ma.MAGIC_HEADER_OPEN){Qs.info({headline:"Could Not Import Preset",message:"Invalid preset file"}).then();return}if(i.readInt()!==ma.FORMAT_VERSION){Qs.info({headline:"Could Not Import Preset",message:"Invalid preset version"}).then();return}let n=new Da(g.wrap(Ia.create));try{n.fromArrayBuffer(e.slice(8))}catch(a){Qs.info({headline:"Could Not Import Preset",message:String(a)}).then();return}let o=n.boxes().filter(a=>Me(a,Xe)).filter(a=>a.type.getValue()!==bt.Output);ec.extractAudioUnits(o,t,{excludeTimeline:!0}).filter(a=>a.type.getValue()!==bt.Output).forEach(a=>{let s=a.input.pointerHub.incoming().at(0)?.box;Z(s)&&a.capture.targetVertex.ifSome(({box:u})=>{u instanceof ko?or.create(t.boxGraph,A.generate(),c=>{c.index.setValue(0),c.type.setValue(te.Notes),c.target.refer(a),c.tracks.refer(a.tracks)}):u instanceof No&&or.create(t.boxGraph,A.generate(),c=>{c.index.setValue(0),c.type.setValue(te.Audio),c.target.refer(a),c.tracks.refer(a.tracks)})})})},r.replaceAudioUnit=(e,t,i)=>{console.debug("ReplaceAudioUnit with preset...");let n=fa.empty({createDefaultUser:!1,createOutputCompressor:!1}),o=n.boxGraph,a=t.graph;o.beginTransaction(),r.decode(e,n),o.endTransaction();let s=Y(n.mandatoryBoxes.rootBox.audioUnits.pointerHub.incoming().map(({box:y})=>Be(y,Xe)).find(y=>y.type.getValue()!==bt.Output),"Source has no audioUnitBox"),u=s.capture.targetVertex.mapOr(({box:y})=>y.name,""),c=t.capture.targetVertex.mapOr(({box:y})=>y.name,"");if(u!==c)return Mr.err("Cannot replace incompatible instruments");let p=i?.keepMIDIEffects!==!0,d=i?.keepAudioEffects!==!0;console.debug("replaceMIDIEffects",p),console.debug("replaceAudioEffects",d),Y(t.input.pointerHub.incoming().at(0)?.box,"Target has no input").delete(),p?t.midiEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()):(o.beginTransaction(),s.midiEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()),o.endTransaction()),d?t.audioEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()):(o.beginTransaction(),s.audioEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()),o.endTransaction());let f=y=>y.accept({visitTrackBox:x=>!0,visitCaptureMidiBox:x=>!0,visitCaptureAudioBox:x=>!0})===!0,v=A.newSet(({source:y})=>y),m=Array.from(o.dependenciesOf(s,{excludeBox:f,alwaysFollowMandatory:!1}).boxes);return v.addMany([{source:s.address.uuid,target:t.address.uuid},...m.map(({address:{uuid:y},name:x})=>({source:y,target:x===Cr.ClassName||x===Xr.ClassName?y:A.generate()}))]),B.decodeWith({map:(y,x)=>x.map($=>v.opt($.uuid).match({none:()=>$,some:({target:I})=>$.moveTo(I)}))},()=>{m.forEach(y=>{let x=new ot(y.toArrayBuffer()),$=y.name,I=v.get(y.address.uuid).target;if((y instanceof Cr||y instanceof Xr)&&a.findBox(y.address.uuid).nonEmpty()){y.read(x);return}a.createBox($,I,T=>T.read(x))})}),Mr.Ok}})(B1||(B1={}));var F1;(function(r){r.encode=e=>{let t=Bt.create();t.writeInt(ma.MAGIC_HEADER_OPEN),t.writeInt(ma.FORMAT_VERSION);let i=fa.empty({createOutputCompressor:!1,createDefaultUser:!1});return i.boxGraph.beginTransaction(),ec.extractAudioUnits([e],i,{excludeTimeline:!0}),i.boxGraph.endTransaction(),console.debug("SAVING..."),i.boxGraph.debugBoxes(),O.concatArrayBuffers(t.toArrayBuffer(),i.boxGraph.toArrayBuffer())}})(F1||(F1={}));var N1;(function(r){r.existingInstrumentNames=e=>e.audioUnits.pointerHub.incoming().map(({box:t})=>{let i=Y(Be(t,Xe).input.pointerHub.incoming().at(0)).box;return"label"in i&&i.label instanceof C?i.label.getValue():"N/A"})})(N1||(N1={}));var Et={};Pa(Et,{$brand:()=>Gg,$input:()=>iA,$output:()=>rA,NEVER:()=>Ow,TimePrecision:()=>sA,ZodAny:()=>sS,ZodArray:()=>dS,ZodBase64:()=>S_,ZodBase64URL:()=>B_,ZodBigInt:()=>bh,ZodBigIntFormat:()=>k_,ZodBoolean:()=>wh,ZodCIDRv4:()=>P_,ZodCIDRv6:()=>E_,ZodCUID:()=>v_,ZodCUID2:()=>y_,ZodCatch:()=>kS,ZodCodec:()=>z_,ZodCustom:()=>ty,ZodCustomStringFormat:()=>yh,ZodDate:()=>Yv,ZodDefault:()=>PS,ZodDiscriminatedUnion:()=>pS,ZodE164:()=>F_,ZodEmail:()=>f_,ZodEmoji:()=>m_,ZodEnum:()=>gh,ZodError:()=>uk,ZodFile:()=>bS,ZodFirstPartyTypeKind:()=>U_,ZodFunction:()=>VS,ZodGUID:()=>Gv,ZodIPv4:()=>A_,ZodIPv6:()=>__,ZodISODate:()=>Lv,ZodISODateTime:()=>jv,ZodISODuration:()=>Wv,ZodISOTime:()=>Kv,ZodIntersection:()=>hS,ZodIssueCode:()=>_$,ZodJWT:()=>N_,ZodKSUID:()=>b_,ZodLazy:()=>TS,ZodLiteral:()=>wS,ZodMAC:()=>eS,ZodMap:()=>yS,ZodNaN:()=>MS,ZodNanoID:()=>g_,ZodNever:()=>uS,ZodNonOptional:()=>O_,ZodNull:()=>oS,ZodNullable:()=>_S,ZodNumber:()=>xh,ZodNumberFormat:()=>mc,ZodObject:()=>ey,ZodOptional:()=>R_,ZodPipe:()=>V_,ZodPrefault:()=>SS,ZodPromise:()=>OS,ZodReadonly:()=>DS,ZodRealError:()=>kr,ZodRecord:()=>I_,ZodSet:()=>xS,ZodString:()=>vh,ZodStringFormat:()=>Ze,ZodSuccess:()=>NS,ZodSymbol:()=>iS,ZodTemplateLiteral:()=>CS,ZodTransform:()=>AS,ZodTuple:()=>mS,ZodType:()=>Ae,ZodULID:()=>x_,ZodURL:()=>Qv,ZodUUID:()=>mo,ZodUndefined:()=>nS,ZodUnion:()=>M_,ZodUnknown:()=>lS,ZodVoid:()=>cS,ZodXID:()=>w_,_ZodString:()=>h_,_default:()=>ES,_function:()=>f$,any:()=>qk,array:()=>Xv,base64:()=>$k,base64url:()=>Mk,bigint:()=>Lk,boolean:()=>rS,catch:()=>$S,check:()=>m$,cidrv4:()=>Nk,cidrv6:()=>kk,clone:()=>hr,codec:()=>d$,coerce:()=>j_,config:()=>yt,core:()=>fo,cuid:()=>bk,cuid2:()=>Ak,custom:()=>g$,date:()=>Jk,decode:()=>n_,decodeAsync:()=>a_,describe:()=>v$,discriminatedUnion:()=>t$,e164:()=>Dk,email:()=>dk,emoji:()=>xk,encode:()=>i_,encodeAsync:()=>o_,endsWith:()=>lh,enum:()=>C_,file:()=>s$,flattenError:()=>Kp,float32:()=>Vk,float64:()=>zk,formatError:()=>Wp,function:()=>f$,getErrorMap:()=>E$,globalRegistry:()=>fr,gt:()=>ho,gte:()=>Nr,guid:()=>pk,hash:()=>Ok,hex:()=>Rk,hostname:()=>Tk,httpUrl:()=>yk,includes:()=>ah,instanceof:()=>x$,int:()=>p_,int32:()=>Uk,int64:()=>Kk,intersection:()=>fS,ipv4:()=>Sk,ipv6:()=>Fk,iso:()=>Zv,json:()=>b$,jwt:()=>Ik,keyof:()=>Qk,ksuid:()=>Ek,lazy:()=>RS,length:()=>pc,literal:()=>a$,locales:()=>Xp,looseObject:()=>e$,lowercase:()=>nh,lt:()=>po,lte:()=>Ni,mac:()=>Bk,map:()=>i$,maxLength:()=>dc,maxSize:()=>cc,meta:()=>y$,mime:()=>uh,minLength:()=>Aa,minSize:()=>Vs,multipleOf:()=>Os,nan:()=>c$,nanoid:()=>wk,nativeEnum:()=>o$,negative:()=>TA,never:()=>$_,nonnegative:()=>OA,nonoptional:()=>FS,nonpositive:()=>RA,normalize:()=>ch,null:()=>aS,nullable:()=>Hv,nullish:()=>l$,number:()=>tS,object:()=>Yk,optional:()=>qv,overwrite:()=>Cn,parse:()=>XA,parseAsync:()=>e_,partialRecord:()=>r$,pipe:()=>Jv,positive:()=>CA,prefault:()=>BS,preprocess:()=>A$,prettifyError:()=>Jw,promise:()=>h$,property:()=>VA,readonly:()=>IS,record:()=>vS,refine:()=>zS,regex:()=>ih,regexes:()=>Fi,registry:()=>bv,safeDecode:()=>l_,safeDecodeAsync:()=>c_,safeEncode:()=>s_,safeEncodeAsync:()=>u_,safeParse:()=>t_,safeParseAsync:()=>r_,set:()=>n$,setErrorMap:()=>P$,size:()=>rh,slugify:()=>fh,startsWith:()=>sh,strictObject:()=>Xk,string:()=>d_,stringFormat:()=>Ck,stringbool:()=>w$,success:()=>u$,superRefine:()=>US,symbol:()=>Zk,templateLiteral:()=>p$,toJSONSchema:()=>qA,toLowerCase:()=>ph,toUpperCase:()=>hh,transform:()=>T_,treeifyError:()=>Hw,trim:()=>dh,tuple:()=>gS,uint32:()=>jk,uint64:()=>Wk,ulid:()=>_k,undefined:()=>Gk,union:()=>D_,unknown:()=>fc,uppercase:()=>oh,url:()=>vk,util:()=>j,uuid:()=>hk,uuidv4:()=>fk,uuidv6:()=>mk,uuidv7:()=>gk,void:()=>Hk,xid:()=>Pk});var fo={};Pa(fo,{$ZodAny:()=>E0,$ZodArray:()=>k0,$ZodAsyncError:()=>en,$ZodBase64:()=>m0,$ZodBase64URL:()=>g0,$ZodBigInt:()=>mv,$ZodBigIntFormat:()=>b0,$ZodBoolean:()=>Hp,$ZodCIDRv4:()=>p0,$ZodCIDRv6:()=>h0,$ZodCUID:()=>e0,$ZodCUID2:()=>t0,$ZodCatch:()=>G0,$ZodCheck:()=>We,$ZodCheckBigIntFormat:()=>kb,$ZodCheckEndsWith:()=>jb,$ZodCheckGreaterThan:()=>lv,$ZodCheckIncludes:()=>zb,$ZodCheckLengthEquals:()=>Tb,$ZodCheckLessThan:()=>sv,$ZodCheckLowerCase:()=>Ob,$ZodCheckMaxLength:()=>Ib,$ZodCheckMaxSize:()=>$b,$ZodCheckMimeType:()=>Kb,$ZodCheckMinLength:()=>Cb,$ZodCheckMinSize:()=>Mb,$ZodCheckMultipleOf:()=>Fb,$ZodCheckNumberFormat:()=>Nb,$ZodCheckOverwrite:()=>Wb,$ZodCheckProperty:()=>Lb,$ZodCheckRegex:()=>Rb,$ZodCheckSizeEquals:()=>Db,$ZodCheckStartsWith:()=>Ub,$ZodCheckStringFormat:()=>lc,$ZodCheckUpperCase:()=>Vb,$ZodCodec:()=>Jp,$ZodCustom:()=>tA,$ZodCustomStringFormat:()=>x0,$ZodDate:()=>N0,$ZodDefault:()=>L0,$ZodDiscriminatedUnion:()=>M0,$ZodE164:()=>v0,$ZodEmail:()=>Jb,$ZodEmoji:()=>Yb,$ZodEncodeError:()=>ga,$ZodEnum:()=>R0,$ZodError:()=>Lp,$ZodFile:()=>V0,$ZodFunction:()=>Y0,$ZodGUID:()=>qb,$ZodIPv4:()=>u0,$ZodIPv6:()=>c0,$ZodISODate:()=>a0,$ZodISODateTime:()=>o0,$ZodISODuration:()=>l0,$ZodISOTime:()=>s0,$ZodIntersection:()=>D0,$ZodJWT:()=>y0,$ZodKSUID:()=>n0,$ZodLazy:()=>eA,$ZodLiteral:()=>O0,$ZodMAC:()=>d0,$ZodMap:()=>C0,$ZodNaN:()=>q0,$ZodNanoID:()=>Xb,$ZodNever:()=>B0,$ZodNonOptional:()=>W0,$ZodNull:()=>P0,$ZodNullable:()=>j0,$ZodNumber:()=>fv,$ZodNumberFormat:()=>w0,$ZodObject:()=>tE,$ZodObjectJIT:()=>$0,$ZodOptional:()=>U0,$ZodPipe:()=>H0,$ZodPrefault:()=>K0,$ZodPromise:()=>X0,$ZodReadonly:()=>J0,$ZodRealError:()=>Fr,$ZodRecord:()=>I0,$ZodRegistry:()=>uc,$ZodSet:()=>T0,$ZodString:()=>Rs,$ZodStringFormat:()=>je,$ZodSuccess:()=>Z0,$ZodSymbol:()=>A0,$ZodTemplateLiteral:()=>Q0,$ZodTransform:()=>z0,$ZodTuple:()=>vv,$ZodType:()=>he,$ZodULID:()=>r0,$ZodURL:()=>Qb,$ZodUUID:()=>Hb,$ZodUndefined:()=>_0,$ZodUnion:()=>gv,$ZodUnknown:()=>S0,$ZodVoid:()=>F0,$ZodXID:()=>i0,$brand:()=>Gg,$constructor:()=>b,$input:()=>iA,$output:()=>rA,Doc:()=>qp,JSONSchema:()=>QE,JSONSchemaGenerator:()=>mh,NEVER:()=>Ow,TimePrecision:()=>sA,_any:()=>FA,_array:()=>zA,_base64:()=>Ov,_base64url:()=>Vv,_bigint:()=>bA,_boolean:()=>xA,_catch:()=>rk,_check:()=>JE,_cidrv4:()=>Tv,_cidrv6:()=>Rv,_coercedBigint:()=>AA,_coercedBoolean:()=>wA,_coercedDate:()=>DA,_coercedNumber:()=>hA,_coercedString:()=>oA,_cuid:()=>Nv,_cuid2:()=>kv,_custom:()=>jA,_date:()=>MA,_decode:()=>Xg,_decodeAsync:()=>tv,_default:()=>XN,_discriminatedUnion:()=>UN,_e164:()=>zv,_email:()=>Av,_emoji:()=>Bv,_encode:()=>Yg,_encodeAsync:()=>ev,_endsWith:()=>lh,_enum:()=>GN,_file:()=>UA,_float32:()=>mA,_float64:()=>gA,_gt:()=>ho,_gte:()=>Nr,_guid:()=>eh,_includes:()=>ah,_int:()=>fA,_int32:()=>vA,_int64:()=>_A,_intersection:()=>jN,_ipv4:()=>Iv,_ipv6:()=>Cv,_isoDate:()=>uA,_isoDateTime:()=>lA,_isoDuration:()=>dA,_isoTime:()=>cA,_jwt:()=>Uv,_ksuid:()=>Dv,_lazy:()=>ak,_length:()=>pc,_literal:()=>HN,_lowercase:()=>nh,_lt:()=>po,_lte:()=>Ni,_mac:()=>aA,_map:()=>WN,_max:()=>Ni,_maxLength:()=>dc,_maxSize:()=>cc,_mime:()=>uh,_min:()=>Nr,_minLength:()=>Aa,_minSize:()=>Vs,_multipleOf:()=>Os,_nan:()=>IA,_nanoid:()=>Fv,_nativeEnum:()=>qN,_negative:()=>TA,_never:()=>kA,_nonnegative:()=>OA,_nonoptional:()=>ek,_nonpositive:()=>RA,_normalize:()=>ch,_null:()=>BA,_nullable:()=>YN,_number:()=>pA,_optional:()=>QN,_overwrite:()=>Cn,_parse:()=>nc,_parseAsync:()=>oc,_pipe:()=>ik,_positive:()=>CA,_promise:()=>sk,_property:()=>VA,_readonly:()=>nk,_record:()=>KN,_refine:()=>LA,_regex:()=>ih,_safeDecode:()=>iv,_safeDecodeAsync:()=>ov,_safeEncode:()=>rv,_safeEncodeAsync:()=>nv,_safeParse:()=>ac,_safeParseAsync:()=>sc,_set:()=>ZN,_size:()=>rh,_slugify:()=>fh,_startsWith:()=>sh,_string:()=>nA,_stringFormat:()=>hc,_stringbool:()=>GA,_success:()=>tk,_superRefine:()=>KA,_symbol:()=>EA,_templateLiteral:()=>ok,_toLowerCase:()=>ph,_toUpperCase:()=>hh,_transform:()=>JN,_trim:()=>dh,_tuple:()=>LN,_uint32:()=>yA,_uint64:()=>PA,_ulid:()=>$v,_undefined:()=>SA,_union:()=>zN,_unknown:()=>NA,_uppercase:()=>oh,_url:()=>th,_uuid:()=>_v,_uuidv4:()=>Pv,_uuidv6:()=>Ev,_uuidv7:()=>Sv,_void:()=>$A,_xid:()=>Mv,clone:()=>hr,config:()=>yt,decode:()=>aF,decodeAsync:()=>lF,describe:()=>WA,encode:()=>oF,encodeAsync:()=>sF,flattenError:()=>Kp,formatError:()=>Wp,globalConfig:()=>Tp,globalRegistry:()=>fr,isValidBase64:()=>f0,isValidBase64URL:()=>Q1,isValidJWT:()=>Y1,locales:()=>Xp,meta:()=>ZA,parse:()=>Jg,parseAsync:()=>Qg,prettifyError:()=>Jw,regexes:()=>Fi,registry:()=>bv,safeDecode:()=>cF,safeDecodeAsync:()=>pF,safeEncode:()=>uF,safeEncodeAsync:()=>dF,safeParse:()=>Qw,safeParseAsync:()=>Yw,toDotPath:()=>I1,toJSONSchema:()=>qA,treeifyError:()=>Hw,util:()=>j,version:()=>Zb});var Ow=Object.freeze({status:"aborted"});function b(r,e,t){function i(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(r))return;s._zod.traits.add(r),e(s,u);let c=a.prototype,p=Object.keys(c);for(let d=0;d<p.length;d++){let f=p[d];f in s||(s[f]=c[f].bind(s))}}let n=t?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:r});function a(s){var u;let c=t?.Parent?new o:this;i(c,s),(u=c._zod).deferred??(u.deferred=[]);for(let p of c._zod.deferred)p();return c}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>t?.Parent&&s instanceof t.Parent?!0:s?._zod?.traits?.has(r)}),Object.defineProperty(a,"name",{value:r}),a}var Gg=Symbol("zod_brand"),en=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ga=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Tp={};function yt(r){return r&&Object.assign(Tp,r),Tp}var j={};Pa(j,{BIGINT_FORMAT_RANGES:()=>qw,Class:()=>zw,NUMBER_FORMAT_RANGES:()=>Gw,aborted:()=>ba,allowsEval:()=>Lw,assert:()=>RB,assertEqual:()=>DB,assertIs:()=>CB,assertNever:()=>TB,assertNotEqual:()=>IB,assignProp:()=>ya,base64ToUint8Array:()=>$1,base64urlToUint8Array:()=>eF,cached:()=>rc,captureStackTrace:()=>Hg,cleanEnum:()=>XB,cleanRegex:()=>Vp,clone:()=>hr,cloneDef:()=>VB,createTransparentProxy:()=>WB,defineLazy:()=>Ne,esc:()=>qg,escapeRegex:()=>Bi,extend:()=>qB,finalizeIssue:()=>qr,floatSafeRemainder:()=>Uw,getElementAtPath:()=>zB,getEnumValues:()=>Op,getLengthableOrigin:()=>jp,getParsedType:()=>KB,getSizableOrigin:()=>Up,hexToUint8Array:()=>rF,isObject:()=>Cs,isPlainObject:()=>wa,issue:()=>ic,joinValues:()=>k,jsonStringifyReplacer:()=>tc,merge:()=>JB,mergeDefs:()=>xa,normalizeParams:()=>U,nullish:()=>va,numKeys:()=>LB,objectClone:()=>OB,omit:()=>GB,optionalKeys:()=>Zw,partial:()=>QB,pick:()=>ZB,prefixIssues:()=>Gr,primitiveTypes:()=>Ww,promiseAllObject:()=>UB,propertyKeyTypes:()=>zp,randomString:()=>jB,required:()=>YB,safeExtend:()=>HB,shallowClone:()=>Kw,slugify:()=>jw,stringifyPrimitive:()=>V,uint8ArrayToBase64:()=>M1,uint8ArrayToBase64url:()=>tF,uint8ArrayToHex:()=>iF,unwrapMessage:()=>Rp});function DB(r){return r}function IB(r){return r}function CB(r){}function TB(r){throw new Error}function RB(r){}function Op(r){let e=Object.values(r).filter(i=>typeof i=="number");return Object.entries(r).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function k(r,e="|"){return r.map(t=>V(t)).join(e)}function tc(r,e){return typeof e=="bigint"?e.toString():e}function rc(r){return{get value(){{let t=r();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}function va(r){return r==null}function Vp(r){let e=r.startsWith("^")?1:0,t=r.endsWith("$")?r.length-1:r.length;return r.slice(e,t)}function Uw(r,e){let t=(r.toString().split(".")[1]||"").length,i=e.toString(),n=(i.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(i)){let u=i.match(/\d?e-(\d?)/);u?.[1]&&(n=Number.parseInt(u[1]))}let o=t>n?t:n,a=Number.parseInt(r.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return a%s/10**o}var k1=Symbol("evaluating");function Ne(r,e,t){let i;Object.defineProperty(r,e,{get(){if(i!==k1)return i===void 0&&(i=k1,i=t()),i},set(n){Object.defineProperty(r,e,{value:n})},configurable:!0})}function OB(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function ya(r,e,t){Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function xa(...r){let e={};for(let t of r){let i=Object.getOwnPropertyDescriptors(t);Object.assign(e,i)}return Object.defineProperties({},e)}function VB(r){return xa(r._zod.def)}function zB(r,e){return e?e.reduce((t,i)=>t?.[i],r):r}function UB(r){let e=Object.keys(r),t=e.map(i=>r[i]);return Promise.all(t).then(i=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function jB(r=10){let e="abcdefghijklmnopqrstuvwxyz",t="";for(let i=0;i<r;i++)t+=e[Math.floor(Math.random()*e.length)];return t}function qg(r){return JSON.stringify(r)}function jw(r){return r.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Hg="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function Cs(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var Lw=rc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let r=Function;return new r(""),!0}catch{return!1}});function wa(r){if(Cs(r)===!1)return!1;let e=r.constructor;if(e===void 0||typeof e!="function")return!0;let t=e.prototype;return!(Cs(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function Kw(r){return wa(r)?{...r}:Array.isArray(r)?[...r]:r}function LB(r){let e=0;for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&e++;return e}var KB=r=>{let e=typeof r;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(r)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(r)?"array":r===null?"null":r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?"promise":typeof Map<"u"&&r instanceof Map?"map":typeof Set<"u"&&r instanceof Set?"set":typeof Date<"u"&&r instanceof Date?"date":typeof File<"u"&&r instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},zp=new Set(["string","number","symbol"]),Ww=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Bi(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hr(r,e,t){let i=new r._zod.constr(e??r._zod.def);return(!e||t?.parent)&&(i._zod.parent=r),i}function U(r){let e=r;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function WB(r){let e;return new Proxy({},{get(t,i,n){return e??(e=r()),Reflect.get(e,i,n)},set(t,i,n,o){return e??(e=r()),Reflect.set(e,i,n,o)},has(t,i){return e??(e=r()),Reflect.has(e,i)},deleteProperty(t,i){return e??(e=r()),Reflect.deleteProperty(e,i)},ownKeys(t){return e??(e=r()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(t,i){return e??(e=r()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(t,i,n){return e??(e=r()),Reflect.defineProperty(e,i,n)}})}function V(r){return typeof r=="bigint"?r.toString()+"n":typeof r=="string"?`"${r}"`:`${r}`}function Zw(r){return Object.keys(r).filter(e=>r[e]._zod.optin==="optional"&&r[e]._zod.optout==="optional")}var Gw={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},qw={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ZB(r,e){let t=r._zod.def,i=xa(r._zod.def,{get shape(){let n={};for(let o in e){if(!(o in t.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(n[o]=t.shape[o])}return ya(this,"shape",n),n},checks:[]});return hr(r,i)}function GB(r,e){let t=r._zod.def,i=xa(r._zod.def,{get shape(){let n={...r._zod.def.shape};for(let o in e){if(!(o in t.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete n[o]}return ya(this,"shape",n),n},checks:[]});return hr(r,i)}function qB(r,e){if(!wa(e))throw new Error("Invalid input to extend: expected a plain object");let t=r._zod.def.checks;if(t&&t.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let n=xa(r._zod.def,{get shape(){let o={...r._zod.def.shape,...e};return ya(this,"shape",o),o},checks:[]});return hr(r,n)}function HB(r,e){if(!wa(e))throw new Error("Invalid input to safeExtend: expected a plain object");let t={...r._zod.def,get shape(){let i={...r._zod.def.shape,...e};return ya(this,"shape",i),i},checks:r._zod.def.checks};return hr(r,t)}function JB(r,e){let t=xa(r._zod.def,{get shape(){let i={...r._zod.def.shape,...e._zod.def.shape};return ya(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return hr(r,t)}function QB(r,e,t){let i=xa(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(t)for(let a in t){if(!(a in n))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=r?new r({type:"optional",innerType:n[a]}):n[a])}else for(let a in n)o[a]=r?new r({type:"optional",innerType:n[a]}):n[a];return ya(this,"shape",o),o},checks:[]});return hr(e,i)}function YB(r,e,t){let i=xa(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(t)for(let a in t){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=new r({type:"nonoptional",innerType:n[a]}))}else for(let a in n)o[a]=new r({type:"nonoptional",innerType:n[a]});return ya(this,"shape",o),o},checks:[]});return hr(e,i)}function ba(r,e=0){if(r.aborted===!0)return!0;for(let t=e;t<r.issues.length;t++)if(r.issues[t]?.continue!==!0)return!0;return!1}function Gr(r,e){return e.map(t=>{var i;return(i=t).path??(i.path=[]),t.path.unshift(r),t})}function Rp(r){return typeof r=="string"?r:r?.message}function qr(r,e,t){let i={...r,path:r.path??[]};if(!r.message){let n=Rp(r.inst?._zod.def?.error?.(r))??Rp(e?.error?.(r))??Rp(t.customError?.(r))??Rp(t.localeError?.(r))??"Invalid input";i.message=n}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function Up(r){return r instanceof Set?"set":r instanceof Map?"map":r instanceof File?"file":"unknown"}function jp(r){return Array.isArray(r)?"array":typeof r=="string"?"string":"unknown"}function ic(...r){let[e,t,i]=r;return typeof e=="string"?{message:e,code:"custom",input:t,inst:i}:{...e}}function XB(r){return Object.entries(r).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function $1(r){let e=atob(r),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}function M1(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e)}function eF(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t="=".repeat((4-e.length%4)%4);return $1(e+t)}function tF(r){return M1(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function rF(r){let e=r.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let t=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)t[i/2]=Number.parseInt(e.slice(i,i+2),16);return t}function iF(r){return Array.from(r).map(e=>e.toString(16).padStart(2,"0")).join("")}var zw=class{constructor(...e){}};var D1=(r,e)=>{r.name="$ZodError",Object.defineProperty(r,"_zod",{value:r._zod,enumerable:!1}),Object.defineProperty(r,"issues",{value:e,enumerable:!1}),r.message=JSON.stringify(e,tc,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},Lp=b("$ZodError",D1),Fr=b("$ZodError",D1,{Parent:Error});function Kp(r,e=t=>t.message){let t={},i=[];for(let n of r.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:t}}function Wp(r,e=t=>t.message){let t={_errors:[]},i=n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)t._errors.push(e(o));else{let a=t,s=0;for(;s<o.path.length;){let u=o.path[s];s===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(e(o))):a[u]=a[u]||{_errors:[]},a=a[u],s++}}};return i(r),t}function Hw(r,e=t=>t.message){let t={errors:[]},i=(n,o=[])=>{var a,s;for(let u of n.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(c=>i({issues:c},u.path));else if(u.code==="invalid_key")i({issues:u.issues},u.path);else if(u.code==="invalid_element")i({issues:u.issues},u.path);else{let c=[...o,...u.path];if(c.length===0){t.errors.push(e(u));continue}let p=t,d=0;for(;d<c.length;){let f=c[d],v=d===c.length-1;typeof f=="string"?(p.properties??(p.properties={}),(a=p.properties)[f]??(a[f]={errors:[]}),p=p.properties[f]):(p.items??(p.items=[]),(s=p.items)[f]??(s[f]={errors:[]}),p=p.items[f]),v&&p.errors.push(e(u)),d++}}};return i(r),t}function I1(r){let e=[],t=r.map(i=>typeof i=="object"?i.key:i);for(let i of t)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function Jw(r){let e=[],t=[...r.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of t)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${I1(i.path)}`);return e.join(`
4
- `)}var nc=r=>(e,t,i,n)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise)throw new en;if(a.issues.length){let s=new(n?.Err??r)(a.issues.map(u=>qr(u,o,yt())));throw Hg(s,n?.callee),s}return a.value},Jg=nc(Fr),oc=r=>async(e,t,i,n)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??r)(a.issues.map(u=>qr(u,o,yt())));throw Hg(s,n?.callee),s}return a.value},Qg=oc(Fr),ac=r=>(e,t,i)=>{let n=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:t,issues:[]},n);if(o instanceof Promise)throw new en;return o.issues.length?{success:!1,error:new(r??Lp)(o.issues.map(a=>qr(a,n,yt())))}:{success:!0,data:o.value}},Qw=ac(Fr),sc=r=>async(e,t,i)=>{let n=i?Object.assign(i,{async:!0}):{async:!0},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new r(o.issues.map(a=>qr(a,n,yt())))}:{success:!0,data:o.value}},Yw=sc(Fr),Yg=r=>(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nc(r)(e,t,n)},oF=Yg(Fr),Xg=r=>(e,t,i)=>nc(r)(e,t,i),aF=Xg(Fr),ev=r=>async(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return oc(r)(e,t,n)},sF=ev(Fr),tv=r=>async(e,t,i)=>oc(r)(e,t,i),lF=tv(Fr),rv=r=>(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ac(r)(e,t,n)},uF=rv(Fr),iv=r=>(e,t,i)=>ac(r)(e,t,i),cF=iv(Fr),nv=r=>async(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return sc(r)(e,t,n)},dF=nv(Fr),ov=r=>async(e,t,i)=>sc(r)(e,t,i),pF=ov(Fr);var Fi={};Pa(Fi,{base64:()=>fb,base64url:()=>av,bigint:()=>wb,boolean:()=>_b,browserEmail:()=>wF,cidrv4:()=>pb,cidrv6:()=>hb,cuid:()=>Xw,cuid2:()=>eb,date:()=>gb,datetime:()=>yb,domain:()=>_F,duration:()=>ob,e164:()=>mb,email:()=>sb,emoji:()=>lb,extendedDuration:()=>hF,guid:()=>ab,hex:()=>PF,hostname:()=>AF,html5Email:()=>vF,idnEmail:()=>xF,integer:()=>bb,ipv4:()=>ub,ipv6:()=>cb,ksuid:()=>ib,lowercase:()=>Sb,mac:()=>db,md5_base64:()=>SF,md5_base64url:()=>BF,md5_hex:()=>EF,nanoid:()=>nb,null:()=>Pb,number:()=>Ab,rfc5322Email:()=>yF,sha1_base64:()=>NF,sha1_base64url:()=>kF,sha1_hex:()=>FF,sha256_base64:()=>MF,sha256_base64url:()=>DF,sha256_hex:()=>$F,sha384_base64:()=>CF,sha384_base64url:()=>TF,sha384_hex:()=>IF,sha512_base64:()=>OF,sha512_base64url:()=>VF,sha512_hex:()=>RF,string:()=>xb,time:()=>vb,ulid:()=>tb,undefined:()=>Eb,unicodeEmail:()=>C1,uppercase:()=>Bb,uuid:()=>Ts,uuid4:()=>fF,uuid6:()=>mF,uuid7:()=>gF,xid:()=>rb});var Xw=/^[cC][^\s-]{8,}$/,eb=/^[0-9a-z]+$/,tb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rb=/^[0-9a-vA-V]{20}$/,ib=/^[A-Za-z0-9]{27}$/,nb=/^[a-zA-Z0-9_-]{21}$/,ob=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,hF=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ab=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ts=r=>r?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${r}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,fF=Ts(4),mF=Ts(6),gF=Ts(7),sb=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,vF=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,yF=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,C1=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,xF=C1,wF=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,bF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function lb(){return new RegExp(bF,"u")}var ub=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,db=r=>{let e=Bi(r??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},pb=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,hb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,av=/^[A-Za-z0-9_-]*$/,AF=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,_F=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,mb=/^\+(?:[0-9]){6,14}[0-9]$/,T1="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",gb=new RegExp(`^${T1}$`);function R1(r){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof r.precision=="number"?r.precision===-1?`${e}`:r.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${r.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function vb(r){return new RegExp(`^${R1(r)}$`)}function yb(r){let e=R1({precision:r.precision}),t=["Z"];r.local&&t.push(""),r.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${t.join("|")})`;return new RegExp(`^${T1}T(?:${i})$`)}var xb=r=>{let e=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},wb=/^-?\d+n?$/,bb=/^-?\d+$/,Ab=/^-?\d+(?:\.\d+)?/,_b=/^(?:true|false)$/i,Pb=/^null$/i;var Eb=/^undefined$/i;var Sb=/^[^A-Z]*$/,Bb=/^[^a-z]*$/,PF=/^[0-9a-fA-F]*$/;function Zp(r,e){return new RegExp(`^[A-Za-z0-9+/]{${r}}${e}$`)}function Gp(r){return new RegExp(`^[A-Za-z0-9_-]{${r}}$`)}var EF=/^[0-9a-fA-F]{32}$/,SF=Zp(22,"=="),BF=Gp(22),FF=/^[0-9a-fA-F]{40}$/,NF=Zp(27,"="),kF=Gp(27),$F=/^[0-9a-fA-F]{64}$/,MF=Zp(43,"="),DF=Gp(43),IF=/^[0-9a-fA-F]{96}$/,CF=Zp(64,""),TF=Gp(64),RF=/^[0-9a-fA-F]{128}$/,OF=Zp(86,"=="),VF=Gp(86);var We=b("$ZodCheck",(r,e)=>{var t;r._zod??(r._zod={}),r._zod.def=e,(t=r._zod).onattach??(t.onattach=[])}),V1={number:"number",bigint:"bigint",object:"date"},sv=b("$ZodCheckLessThan",(r,e)=>{We.init(r,e);let t=V1[typeof e.value];r._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),r._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:t,code:"too_big",maximum:e.value,input:i.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),lv=b("$ZodCheckGreaterThan",(r,e)=>{We.init(r,e);let t=V1[typeof e.value];r._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),r._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:t,code:"too_small",minimum:e.value,input:i.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),Fb=b("$ZodCheckMultipleOf",(r,e)=>{We.init(r,e),r._zod.onattach.push(t=>{var i;(i=t._zod.bag).multipleOf??(i.multipleOf=e.value)}),r._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):Uw(t.value,e.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:e.value,input:t.value,inst:r,continue:!e.abort})}}),Nb=b("$ZodCheckNumberFormat",(r,e)=>{We.init(r,e),e.format=e.format||"float64";let t=e.format?.includes("int"),i=t?"int":"number",[n,o]=Gw[e.format];r._zod.onattach.push(a=>{let s=a._zod.bag;s.format=e.format,s.minimum=n,s.maximum=o,t&&(s.pattern=bb)}),r._zod.check=a=>{let s=a.value;if(t){if(!Number.isInteger(s)){a.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:s,inst:r});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:i,continue:!e.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:i,continue:!e.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:r,continue:!e.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inst:r})}}),kb=b("$ZodCheckBigIntFormat",(r,e)=>{We.init(r,e);let[t,i]=qw[e.format];r._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,o.minimum=t,o.maximum=i}),r._zod.check=n=>{let o=n.value;o<t&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:t,inclusive:!0,inst:r,continue:!e.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inst:r})}}),$b=b("$ZodCheckMaxSize",(r,e)=>{var t;We.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!va(n)&&n.size!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),r._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:Up(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),Mb=b("$ZodCheckMinSize",(r,e)=>{var t;We.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!va(n)&&n.size!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),r._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:Up(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),Db=b("$ZodCheckSizeEquals",(r,e)=>{var t;We.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!va(n)&&n.size!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),r._zod.check=i=>{let n=i.value,o=n.size;if(o===e.size)return;let a=o>e.size;i.issues.push({origin:Up(n),...a?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:r,continue:!e.abort})}}),Ib=b("$ZodCheckMaxLength",(r,e)=>{var t;We.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!va(n)&&n.length!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),r._zod.check=i=>{let n=i.value;if(n.length<=e.maximum)return;let a=jp(n);i.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),Cb=b("$ZodCheckMinLength",(r,e)=>{var t;We.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!va(n)&&n.length!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),r._zod.check=i=>{let n=i.value;if(n.length>=e.minimum)return;let a=jp(n);i.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),Tb=b("$ZodCheckLengthEquals",(r,e)=>{var t;We.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!va(n)&&n.length!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),r._zod.check=i=>{let n=i.value,o=n.length;if(o===e.length)return;let a=jp(n),s=o>e.length;i.issues.push({origin:a,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:r,continue:!e.abort})}}),lc=b("$ZodCheckStringFormat",(r,e)=>{var t,i;We.init(r,e),r._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(t=r._zod).check??(t.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:r,continue:!e.abort})}):(i=r._zod).check??(i.check=()=>{})}),Rb=b("$ZodCheckRegex",(r,e)=>{lc.init(r,e),r._zod.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:e.pattern.toString(),inst:r,continue:!e.abort})}}),Ob=b("$ZodCheckLowerCase",(r,e)=>{e.pattern??(e.pattern=Sb),lc.init(r,e)}),Vb=b("$ZodCheckUpperCase",(r,e)=>{e.pattern??(e.pattern=Bb),lc.init(r,e)}),zb=b("$ZodCheckIncludes",(r,e)=>{We.init(r,e);let t=Bi(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=i,r._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),r._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:r,continue:!e.abort})}}),Ub=b("$ZodCheckStartsWith",(r,e)=>{We.init(r,e);let t=new RegExp(`^${Bi(e.prefix)}.*`);e.pattern??(e.pattern=t),r._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),r._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:r,continue:!e.abort})}}),jb=b("$ZodCheckEndsWith",(r,e)=>{We.init(r,e);let t=new RegExp(`.*${Bi(e.suffix)}$`);e.pattern??(e.pattern=t),r._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),r._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:r,continue:!e.abort})}});function O1(r,e,t){r.issues.length&&e.issues.push(...Gr(t,r.issues))}var Lb=b("$ZodCheckProperty",(r,e)=>{We.init(r,e),r._zod.check=t=>{let i=e.schema._zod.run({value:t.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>O1(n,t,e.property));O1(i,t,e.property)}}),Kb=b("$ZodCheckMimeType",(r,e)=>{We.init(r,e);let t=new Set(e.mime);r._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),r._zod.check=i=>{t.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:r,continue:!e.abort})}}),Wb=b("$ZodCheckOverwrite",(r,e)=>{We.init(r,e),r._zod.check=t=>{t.value=e.tx(t.value)}});var qp=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
3
+ `),this));for(let i of t)i.defer();for(let i of e)i.unstage();this.unstage()}unstage(){this.graph.unstageBox(this)}isValid(){if(this.#i.mandatory&&this.pointerHub.incoming().length===0)return!1;let e=t=>t.every(i=>i.accept({visitPointerField:n=>!n.mandatory||n.nonEmpty(),visitArrayField:n=>e(n.fields()),visitObjectField:n=>e(n.fields()),visitPrimitiveField:n=>!0,visitField:n=>!0})??!0);return e(this.fields())}toString(){return`${this.constructor.name} ${this.address.toString()}`}};vB([Qs,_P("design:type",ln),_P("design:paramtypes",[])],N.prototype,"pointerHub",null);var Lc;(function(r){r.clampInt32=(e,t)=>t,r.clampFloat32=(e,t)=>t})(Lc||(Lc={}));var ke;(function(r){r[r.This=0]="This",r[r.Parent=1]="Parent",r[r.Children=2]="Children"})(ke||(ke={}));var cf;(function(r){r.create=()=>new Rx})(cf||(cf={}));var Rx=class{#e=new Kc(Ta.equals);#t=new Kc(Ta.startsWith);#r=new Kc(Ta.endsWith);#i=[];#n=0;#o=!1;subscribe(e,t,i){let n=new Ox(t,e,this.#n++,i);if(this.#o){let o=new Vx(n,e);return this.#i.push(o),o}else return this.subscribeMonitor(n,e)}dispatch(e){this.#o=!0,[...this.#e.filter(e),...this.#t.filter(e),...this.#r.filter(e)].sort(({order:i},{order:n})=>i-n).forEach(i=>i.procedure(e)),this.#o=!1,this.#i.forEach(i=>i.subscribe(this)),this.#i.length=0}subscribeMonitor(e,t){switch(t){case ke.This:return this.#e.subscribe(e);case ke.Parent:return this.#t.subscribe(e);case ke.Children:return this.#r.subscribe(e);default:return zh(t)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},Ox=class{address;propagation;order;procedure;constructor(e,t,i,n){this.address=e,this.propagation=t,this.order=i,this.procedure=n}toString(){return`{ Monitor address: ${this.address}, propagation: ${ke[this.propagation]}, order: ${this.order} }`}},Kc=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 t=this.#e.length;for(;--t>=0;)this.#e[t]===e&&this.#e.splice(t,1)}}}stations(){return this.#t||(this.#e.sort(Ta.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},Vx=class{monitor;propagation;#e=new U;#t=!1;constructor(e,t){this.monitor=e,this.propagation=t}subscribe(e){this.#t||(this.#e.terminate(),this.#e.own(e.subscribeMonitor(this.monitor,this.propagation)))}terminate(){this.#t=!0,this.#e.terminate()}};var mt;(function(r){r.Boolean="boolean",r.Float32="float32",r.Int32="int32",r.String="string",r.Bytes="bytes"})(mt||(mt={}));var Oa={[mt.Boolean]:{type:mt.Boolean,encode:(r,e)=>r.writeBoolean(e),decode:r=>r.readBoolean()},[mt.Float32]:{type:mt.Float32,encode:(r,e)=>r.writeFloat(e),decode:r=>r.readFloat()},[mt.Int32]:{type:mt.Int32,encode:(r,e)=>r.writeInt(e),decode:r=>r.readInt()},[mt.String]:{type:mt.String,encode:(r,e)=>r.writeString(e),decode:r=>r.readString()},[mt.Bytes]:{type:mt.Bytes,encode:(r,e)=>{r.writeInt(e.length),r.writeBytes(e)},decode:r=>{let e=new Int8Array(r.readInt());return r.readBytes(e),e}}},Ra=class extends W{#e;#t;#r;constructor(e,t,i){super(e),this.#e=t,this.#t=i,this.#r=this.#t}accept(e){return _(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(ke.This,this.address,()=>e(this))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}get type(){return this.#e}get initValue(){return this.#t}setInitValue(e){I(this.graph.constructingBox(),"Cannot change initial value at runtime"),this.setValue(this.#t=this.clamp(e))}getValue(){return this.#r}setValue(e){let t=this.#r,i=this.clamp(e);this.equals(i)||(this.#r=i,this.graph.onPrimitiveValueUpdate(this,t,i))}writeValue(e,t){I(!this.deprecated,"PrimitiveField.write: deprecated field"),this.serialization().encode(e,t)}readValue(e){return this.serialization().decode(e)}toJSON(){if(this.deprecated)return;let e=this.getValue();return ArrayBuffer.isView(e)?F("not implemented"):e}fromJSON(e){return F("Type mismatch")}reset(){this.setValue(this.#t)}},$=class r extends Ra{static create(e,t=!1){return new r(e,t)}constructor(e,t){super(e,mt.Boolean,t)}toggle(){this.setValue(!this.getValue())}serialization(){return Oa[mt.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){I(!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()))}},w=class r extends Ra{static create(e,t,i,n=0){return new r(e,t,i,n)}#e;#t;constructor(e,t,i,n){super(e,mt.Float32,n),this.#e=t,this.#t=i}serialization(){return Oa[mt.Float32]}equals(e){return this.getValue()===e}clamp(e){return Lc.clampFloat32(this.#e,Ln.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){I(!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()))}},E=class r extends Ra{static create(e,t,i,n=0){return new r(e,t,i,n)}#e;#t;constructor(e,t,i,n){super(e,mt.Int32,n),this.#e=t,this.#t=i}serialization(){return Oa[mt.Int32]}equals(e){return this.getValue()===e}clamp(e){return Lc.clampInt32(this.#e,rr.toInt(e))}read(e){this.setValue(e.readInt())}write(e){I(!this.deprecated,"Int32Field.write: deprecated field"),e.writeInt(this.getValue())}get unit(){return this.#t}get constraints(){return this.#e}fromJSON(e){this.deprecated||(typeof e=="number"&&e===Math.floor(e)&&e>=rr.MIN_VALUE&&e<=rr.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},C=class r extends Ra{static create(e,t=""){return new r(e,t)}constructor(e,t){super(e,mt.String,t)}serialization(){return Oa[mt.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){I(!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()))}},PP=class r extends Ra{static create(e,t=this.#e){return new r(e,t)}static#e=Object.freeze(new Int8Array(0));constructor(e,t){super(e,mt.Bytes,t)}serialization(){return Oa[mt.Bytes]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){let t=new Int8Array(e.readInt());e.readBytes(t),this.setValue(t)}write(e){I(!this.deprecated,"ByteArrayField.write: deprecated field");let t=this.getValue();e.writeInt(t.length),e.writeBytes(t)}toJSON(){if(!this.deprecated)return Array.from(this.getValue().values())}fromJSON(e){this.deprecated||(Array.isArray(e)&&e.every(t=>typeof t=="number")?this.setValue(new Int8Array(e)):console.warn("ByteArrayField Type mismatch",e,this.address.toString()))}};var SP;(function(r){r.decode=e=>{let t=e.readInt();return R.create(()=>{switch(e.readString()){case"new":{let n=A.fromDataInput(e),o=e.readString(),a=new Int8Array(e.readInt());return e.readBytes(a),new Wc(n,o,a.buffer)}case"pointer":{let n=Ae.read(e),o=e.readBoolean()?g.wrap(Ae.read(e)):g.None,a=e.readBoolean()?g.wrap(Ae.read(e)):g.None;return new Gc(n,o,a)}case"primitive":{let n=Ae.read(e),o=e.readString(),a=Oa[o],s=a.decode(e),l=a.decode(e);return new Zc(n,a,s,l)}case"delete":{let n=A.fromDataInput(e),o=e.readString(),a=new Int8Array(e.readInt());return e.readBytes(a),new qc(n,o,a.buffer)}}},t)}})(SP||(SP={}));var Wc=class{type="new";#e;#t;#r;constructor(e,t,i){this.#e=e,this.#t=t,this.#r=i}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.createBox(this.#t,this.#e,t=>t.read(new ut(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),A.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${A.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},Zc=class{type="primitive";#e;#t;#r;#i;constructor(e,t,i,n){this.#e=e,this.#t=t,this.#r=i,this.#i=n}get address(){return this.#e}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}`}},Gc=class{type="pointer";#e;#t;#r;constructor(e,t,i){this.#e=e,this.#t=t,this.#r=i}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:t=>{e.writeBoolean(!0),t.write(e)}}),this.#r.match({none:()=>e.writeBoolean(!1),some:t=>{e.writeBoolean(!0),t.write(e)}})}toString(){return`{PointerUpdate oldValue: ${this.#t.unwrapOrNull()}, newValue: ${this.#r.unwrapOrNull()}`}},qc=class{type="delete";#e;#t;#r;constructor(e,t,i){this.#e=e,this.#t=t,this.#r=i}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,t=>t.read(new ut(this.#r)))}write(e){e.writeString(this.type),A.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${A.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var GC=Symbol("Unreferenceable"),B=class r extends W{static create(e,t,i){return new r(e,t,i)}static encodeWith(e,t){I(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=g.wrap(e);let i=zn(t);if(this.#e=g.None,i.status==="failure")throw i.error;return i.value}static decodeWith(e,t){I(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=g.wrap(e);let i=zn(t);if(this.#t=g.None,i.status==="failure")throw i.error;return i.value}static#e=g.None;static#t=g.None;#r;#i;#n=g.None;#o=g.None;constructor(e,t,i){super(e),this.#r=t,this.#i=i,i&&this.graph.edges().watchVertex(this)}get pointerHub(){return F(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return _(e.visitPointerField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(ke.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}refer(e){this.targetVertex=g.wrap(e)}defer(){this.targetVertex=g.None}get targetVertex(){return this.graph.inTransaction()?this.#o.flatMap(e=>this.graph.findVertex(e)):this.#n}set targetVertex(e){if(e.nonEmpty()){let t=ln.validate(this,e.unwrap());t.nonEmpty()&&F(t.unwrap())}this.targetAddress=e.map(t=>t.address)}get targetAddress(){return this.#o}set targetAddress(e){let t=this.#o;t.isEmpty()&&e.isEmpty()||(e.nonEmpty()&&t.unwrapOrNull()?.equals(e.unwrap()))===!0||(this.#o=e,this.graph.onPointerAddressUpdated(this,t,e))}isEmpty(){return this.targetAddress.isEmpty()}nonEmpty(){return this.targetAddress.nonEmpty()}ifVertex(e){this.targetVertex.nonEmpty()&&e(this.targetVertex.unwrap())}resolvedTo(e){this.#n=e}read(e){let t=e.readBoolean()?g.wrap(Ae.read(e)):g.None;this.targetAddress=r.#t.match({none:()=>t,some:i=>i.map(this,t)})}write(e){I(!this.deprecated,"PointerField.write: deprecated field"),r.#e.match({none:()=>this.#o,some:t=>t.map(this)}).match({none:()=>e.writeBoolean(!1),some:t=>{e.writeBoolean(!0),t.write(e)}})}toJSON(){if(!this.deprecated)return r.#e.match({none:()=>this.#o,some:e=>e.map(this)}).match({none:()=>null,some:e=>e.toString()})}fromJSON(e){if(!this.deprecated)if($a(e)||typeof e=="string"){let t=g.wrap($a(e)?null:Ae.decode(e));this.targetAddress=r.#t.match({none:()=>t,some:i=>i.map(this,t)})}else return F(`Pointer: Type mismatch. value (${typeof e}) must be a string.`)}};var df=class{#e;#t;#r;#i;constructor(){this.#e=Ae.newSet(e=>e.address),this.#t=Ae.newSet(e=>e.address),this.#r=Ae.newSet(([e])=>e),this.#i=Ae.newSet(([e])=>e.address)}watchVertex(e){if(Te(e,B)){if(!e.mandatory)return F("watchVertex called but has no edge requirement");this.#e.add(e)}else{if(!e.pointerRules.mandatory)return F("watchVertex called but has no edge requirement");this.#t.add(e)}}unwatchVerticesOf(...e){let t=({box:{address:{uuid:i}}})=>i;for(let{address:{uuid:i}}of e)this.#o(this.#e,i,t),this.#o(this.#t,i,t);for(let i of e){let n=this.outgoingEdgesOf(i);if(n.length>0)return F(`${i} has outgoing edges: ${n.map(([a,s])=>`[${a.toString()}, ${s.toString()}]`)}`);let o=this.incomingEdgesOf(i);if(o.length>0)return F(`${i} has incoming edges from: ${o.map(a=>a.toString())}`)}}connect(e,t){this.#i.add([e,t]),this.#r.opt(t).match({none:()=>this.#r.add([t,[e]]),some:([,i])=>i.push(e)})}disconnect(e){let[,t]=this.#i.removeByKey(e.address),[,i]=this.#r.get(t);R.remove(i,e),i.length===0&&this.#r.removeByKey(t)}isConnected(e,t){return this.#i.opt(e.address).mapOr(([,i])=>i.equals(t),!1)}outgoingEdgesOf(e){return this.#n(this.#i,e.address.uuid,([{box:{address:{uuid:t}}}])=>t)}incomingEdgesOf(e){return e.isBox()?this.#n(this.#r,e.address.uuid,([{uuid:t}])=>t).flatMap(([t,i])=>i):this.#r.opt(e.address).mapOr(([t,i])=>i,R.empty())}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?F(`Pointer ${e.toString()} requires an edge.`):F(`Illegal state: ${e} has no edge requirements.`)}),this.#t.forEach(e=>{if(e.pointerHub.isEmpty())return e.pointerRules.mandatory?F(`Target ${e.toString()} requires an edge.`):F(`Illegal state: ${e} has no edge requirements.`)})}#n(e,t,i){let n=Ae.boxRange(e,t,i);return Z(n)?e.values().slice(n[0],n[1]):R.empty()}#o(e,t,i){let n=Ae.boxRange(e,t,i);Z(n)&&e.removeRange(n[0],n[1])}};var Va=class{#e;#t;#r;#i;#n;#o;#a;#u;#s;#l;#c=!1;#d=!1;constructor(e=g.None){this.#e=e,this.#t=A.newSet(t=>t.address.uuid),this.#r=[],this.#a=cf.create(),this.#i=new $t,this.#n=new $t,this.#o=new $t,this.#u=new df,this.#s=Ae.newSet(({pointer:t})=>t.address),this.#l=[]}beginTransaction(){I(!this.#c,"Transaction already in progress"),this.#c=!0,this.#o.proxy.onBeginTransaction()}endTransaction(){for(I(this.#c,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:t})=>this.#p(e,t)),this.#r.length=0),this.#s.values().toSorted((e,t)=>e.index-t.index).forEach(({pointer:e,initial:t,final:i})=>{t.equals(i)||(t.ifSome(n=>this.findVertex(n).unwrapOrUndefined()?.pointerHub.onRemoved(e)),i.ifSome(n=>this.findVertex(n).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#s.clear(),this.#c=!1;this.#l.length>0;)this.#l.splice(0).forEach(e=>e()),this.#l.length>0&&console.debug(`${this.#l.length} new observers while notifying`);this.#o.proxy.onEndTransaction()}inTransaction(){return this.#c}constructingBox(){return this.#d}createBox(e,t,i){return this.#e.unwrap("No box-factory installed")(e,this,t,i)}stageBox(e,t){this.#h(),I(!this.#d,"Cannot construct box while other box is constructing"),Z(t)&&(this.#d=!0,t(e),this.#d=!1);let i=this.#t.add(e);I(i,`${e} already staged`);let n=new Wc(e.address.uuid,e.name,e.toArrayBuffer());return this.#i.proxy.onUpdate(n),this.#n.proxy.onUpdate(n),e}subscribeTransaction(e){return this.#o.subscribe(e)}subscribeToAllUpdates(e){return this.#i.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#n.subscribe(e)}subscribeVertexUpdates(e,t,i){return this.#a.subscribe(e,t,i)}subscribeEndTransaction(e){this.#l.push(e)}unstageBox(e){this.#h();let t=this.#t.removeByKey(e.address.uuid);I(t===e,`${e} could not be found to unstage`),this.#u.unwatchVerticesOf(e);let i=new qc(e.address.uuid,e.name,e.toArrayBuffer());this.#i.proxy.onUpdate(i),this.#n.proxy.onUpdate(i)}findBox(e){return this.#t.opt(e)}findVertex(e){return this.#t.opt(e.uuid).flatMap(t=>t.searchVertex(e.fieldKeys))}boxes(){return this.#t.values()}edges(){return this.#u}checksum(){let e=new Kh;return this.boxes().forEach(t=>t.write(e)),e.result()}onPrimitiveValueUpdate(e,t,i){if(this.#h(),e.isAttached()&&!this.#d){let n=new Zc(e.address,e.serialization(),t,i);this.#a.dispatch(n),this.#i.proxy.onUpdate(n),this.#n.proxy.onUpdate(n)}}onPointerAddressUpdated(e,t,i){this.#h(),t.nonEmpty()&&this.#u.disconnect(e),i.nonEmpty()&&this.#u.connect(e,i.unwrap());let n=new Gc(e.address,t,i);this.#d?this.#r.push({pointerField:e,update:n}):(this.#p(e,n),this.#n.proxy.onUpdate(n))}#p(e,t){let{oldAddress:i,newAddress:n}=t;e.resolvedTo(n.flatMap(a=>this.findVertex(a))),this.#s.opt(e.address).match({none:()=>this.#s.add({pointer:e,initial:i,final:n,index:this.#s.size()}),some:a=>a.final=n}),this.#a.dispatch(t),this.#i.proxy.onUpdate(t)}dependenciesOf(e,t={}){let i=Z(t.excludeBox)?t.excludeBox:bo.alwaysFalse,n=Z(t.alwaysFollowMandatory)?t.alwaysFollowMandatory:!1,o=new Set,a=new Set,s=l=>{o.has(l)||i(l)||(o.add(l),l.outgoingEdges().filter(([c])=>!a.has(c)).forEach(([c,p])=>{let d=this.findVertex(p).unwrap(`Could not find target of ${c.toString()}`);if(a.add(c),d.pointerRules.mandatory&&(n||d.pointerHub.incoming().every(f=>a.has(f))))return s(d.box)}),l.incomingEdges().forEach(c=>{a.add(c),c.mandatory&&s(c.box)}))};return s(e),o.delete(e),{boxes:o,pointers:Array.from(a).reverse()}}verifyPointers(){this.#u.validateRequirements();let e=0,t=i=>{for(let n of i.fields())n.accept({visitPointerField:o=>{if(o.targetAddress.nonEmpty()){let a=o.targetVertex.nonEmpty(),s=this.findVertex(o.targetAddress.unwrap()).nonEmpty();I(a,`pointer ${o.address} is broken`),I(s,`Cannot find target for pointer ${o.address}`),e++}},visitObjectField:o=>t(o)})};return this.#t.forEach(i=>t(i)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#t.values().reduce((e,t)=>(e[A.toString(t.address.uuid)]={class:t.name,"incoming links":t.incomingEdges().length,"outgoing links":t.outgoingEdges().length,"est. memory (bytes)":t.estimateMemory()},e),{}))}debugDependencies(){console.debug("Dependencies:"),this.boxes().forEach(e=>{console.debug(` ${e}`);for(let t of this.dependenciesOf(e).boxes)console.debug(` ${t}`)})}addressToDebugPath(e){return e.flatMap(t=>t.isBox()?this.findBox(t.uuid).map(i=>i.name):this.findBox(t.uuid).flatMap(i=>i.searchVertex(t.fieldKeys).map(n=>n.isField()?n.debugPath:F("Unknown address"))))}toArrayBuffer(){let e=kt.create(),t=this.#t.values();return e.writeInt(t.length),t.forEach(i=>{let n=i.serialize();e.writeInt(n.byteLength),e.writeBytes(new Int8Array(n))}),e.toArrayBuffer()}fromArrayBuffer(e){I(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let t=new ut(e),i=t.readInt();this.beginTransaction();let n=[];for(let o=0;o<i;o++){let a=t.readInt(),s=new Int8Array(a);t.readBytes(s);let l=new ut(s.buffer),c=l.readInt(),p=l.readString(),d=A.fromDataInput(l);n.push({creationIndex:c,name:p,uuid:d,boxStream:l})}n.sort((o,a)=>o.creationIndex-a.creationIndex).forEach(({name:o,uuid:a,boxStream:s})=>this.createBox(o,a,l=>l.read(s))),this.endTransaction()}toJSON(){return this.#t.values().map(e=>({name:e.name,uuid:e.address.toString(),fields:ee(e.toJSON())}))}#h(){I(this.#c,()=>"Modification only prohibited in transaction mode.")}};var ul;(function(r){r.insertOrder=(e,t=Number.MAX_SAFE_INTEGER)=>{let i=r.collectIndexedBoxes(e),n=le(t,0,i.length);if(n<i.length)for(let o=n;o<i.length;o++)i[o].index.setValue(o+1);return n},r.removeOrder=(e,t)=>{let i=r.collectIndexedBoxes(e);if(t<i.length)for(let n=t+1;n<i.length;n++)i[n].index.setValue(n-1)},r.moveIndex=(e,t,i)=>{let n=r.collectIndexedBoxes(e),o=n[t];if(i<0){let a=le(t+i,0,n.length-1);for(let s=a;s<t;s++)n[s].index.setValue(s+1);o.index.setValue(a)}else if(i>1){let a=le(t+(i-1),0,n.length-1);for(let s=t;s<a;s++)n[s+1].index.setValue(s);o.index.setValue(a)}else console.warn(`moveIndex had no effect: startIndex: ${t}, delta: ${i}`)},r.isIndexedBox=e=>"index"in e&&e.index instanceof E,r.collectIndexedBoxes=(e,t)=>e.pointerHub.incoming().map(({box:i})=>r.isIndexedBox(i)&&(t===void 0||i instanceof t)?i:F(`${i} has no index field`)).sort((i,n)=>i.index.getValue()-n.index.getValue())})(ul||(ul={}));var je=class extends W{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return _(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return ee(this.#e[e])}optField(e){return g.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(ke.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){Eo.readFields(e,this.#e)}write(e){Eo.writeFields(e,this.#e)}toJSON(){if(!this.deprecated)return Object.entries(this.#e).reduce((e,[t,i])=>(e[t]=i.toJSON(),e),{})}fromJSON(e){if(!this.deprecated)if(Vh(e))Object.entries(e).forEach(([t,i])=>{let n=this.#e[parseInt(t)];Z(i)&&n.fromJSON(i)});else return F("Type mismatch")}};var Zn;(function(r){r.sender=(n,o)=>o(new t(n)),r.executor=(n,o)=>new i(n,o);let e=n=>{let o=[];for(let a of n)a instanceof MessagePort&&o.push(a),typeof ImageBitmap<"u"&&a instanceof ImageBitmap&&o.push(a),typeof OffscreenCanvas<"u"&&a instanceof OffscreenCanvas&&o.push(a);return o};class t{#e;#t=new Map;#r;#i=0;constructor(o){this.#e=o,this.#r=o.subscribe(this.#n)}terminate(){this.#r.terminate()}dispatchAndForget=(o,...a)=>{let s=e(a);this.#e.send({type:"send",returnId:!1,func:o.name,args:Array.from(Xe.map(a,l=>({value:l})))},s)};dispatchAndReturn=(o,...a)=>new Promise((s,l)=>{let c=Xe.reduce(a,(d,f,v)=>(typeof f=="function"&&d.push([v,f]),d),[]);this.#t.set(this.#i,{executorTuple:{resolve:s,reject:l},callbacks:new Map(c)});let p=e(a);this.#e.send({type:"send",returnId:this.#i,func:o.name,args:Array.from(Xe.map(a,(d,f)=>typeof d=="function"?{callback:f}:{value:d}))},p),this.#i++});#n=o=>{let a=this.#t.get(o.returnId);Z(a)?o.type==="resolve"?(a.executorTuple.resolve(o.resolve),this.#t.delete(o.returnId)):o.type==="reject"?(a.executorTuple.reject(o.reject),this.#t.delete(o.returnId)):o.type==="callback"&&a.callbacks?.get(o.funcAt).apply(this,o.args):F(`Promise has already been resolved. ${JSON.stringify(o)}`)}}class i{#e;#t;#r;constructor(o,a){this.#e=o,this.#t=a,this.#r=o.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=o=>{I(o.type==="send",()=>"Message type must be 'send'");let a=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),s=ee(a[o.func],`${o.func.toString()} does not exists on ${this.#t}`),l=o.returnId;if(l===!1)s.apply(this.#t,o.args.map(c=>"value"in c?c.value:F(`${o.func.toString()} has no promise.`)));else try{s.apply(this.#t,o.args.map(p=>"callback"in p?(...d)=>this.#a(l,p.callback,d):p.value)).then(p=>{try{this.#n(l,p)}catch(d){this.#o(l,d)}},p=>this.#o(l,p))}catch(c){this.#o(l,c)}};#n=(o,a)=>this.#e.send({type:"resolve",returnId:o,resolve:a});#o=(o,a)=>this.#e.send({type:"reject",returnId:o,reject:a});#a=(o,a,s)=>this.#e.send({type:"callback",returnId:o,funcAt:a,args:s})}r.Executor=i})(Zn||(Zn={}));var EP={for:r=>new zx(r)},yB=[],zx=class{#e;#t=new te;constructor(e){if(this.#e=e,Z(e.onmessage)||Z(e.onmessageerror))throw console.error(e),new Error(`${e} is already wrapped.`);e.onmessage=t=>this.#t.notify(t.data),e.onmessageerror=t=>{throw new Error(t.type)}}send(e,t){this.#e.postMessage(e,t??yB)}channel(e){return new Ux(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},Ux=class r{#e;#t;#r=new te;#i;constructor(e,t){this.#e=e,this.#t=t,this.#i=e.subscribe(i=>{"__id__"in i&&i.__id__==="42"&&"message"in i&&"channel"in i&&i.channel===t&&this.#r.notify(i.message)})}send(e,t){this.#e.send({__id__:"42",channel:this.#t,message:e},t)}channel(e){return new r(this,e)}subscribe(e){return this.#r.subscribe(e)}terminate(){this.#i.terminate(),this.#r.terminate()}};var pf;(function(r){r.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),r.frames=e=>new Promise(t=>{let i=e,n=()=>{--i<=0?t():requestAnimationFrame(n)};requestAnimationFrame(n)}),r.timeSpan=(e,...t)=>new Promise(i=>setTimeout(i,e.millis(),...t)),r.event=(e,t)=>new Promise(i=>e.addEventListener(t,i,{once:!0})),r.observable=e=>new Promise(t=>{let i=e.subscribe(()=>{i.terminate(),t()})}),r.complete=e=>new Promise((t,i)=>{let n=setInterval(()=>{let{status:o,value:a,error:s}=zn(()=>e.next());if(o==="success"){let{done:l,value:c}=a;l&&(clearInterval(n),t(c))}else clearInterval(n),i(s)},0)})})(pf||(pf={}));var jx=class{maxRetry;timeSpan;#e=0;constructor(e,t){this.maxRetry=e,this.timeSpan=t}retry(e,t){return++this.#e===this.maxRetry?!1:(console.debug(`${e} > will retry in ${this.timeSpan.toString()}`),setTimeout(t,this.timeSpan.millis()),!0)}},hf;(function(r){class e{value;status="resolved";constructor(s){this.value=s}error=Da("Cannot access error when promise is resolved")}r.ResolveResult=e;class t{error;status="rejected";constructor(s){this.error=s}value=Da("Cannot access value when promise is rejected")}r.RejectedResult=t,r.makeAbortable=async(a,s)=>{let l=!0;return a.own(K.create(()=>l=!1)),new Promise((c,p)=>s.then(d=>{l&&c(d)},d=>{l&&p(d)}))},r.tryCatch=a=>a.then(s=>new e(s),s=>new t(s));let i=new jx(3,Tc.seconds(3));r.retry=(a,s=i)=>a().catch(l=>new Promise((c,p)=>{let d=f=>{s.retry(f,()=>a().then(v=>c(v),d))||p(f)};d(l)})),r.guardedRetry=(a,s)=>{let l=async(c=0)=>{try{return await a()}catch(p){if(s(p,++c))return console.debug("retrying after failure:",p),await pf.timeSpan(Tc.seconds(1)),l(c);throw new Error(`Failed after ${c} retries: ${p}`)}};return l()},r.approvedRetry=(a,s)=>{let l=async()=>{try{return await a()}catch(c){if(await tl.approve(s(c)))return l();throw c}};return l()},r.fail=(a,s)=>{let l=()=>new Promise((c,p)=>setTimeout(()=>p("fails first"),a.millis()));return()=>{let c=l();return l=s,c}},r.timeout=(a,s,l)=>new Promise((c,p)=>{let d=!0,f=setTimeout(()=>{d=!1,p(new Error(l??"timeout"))},s.millis());a.then(v=>{d&&c(v)},v=>{d&&p(v)}).finally(()=>clearTimeout(f))}),r.sequentialAll=a=>a.reduce((s,l)=>s.then(async c=>[...c,await l()]),Promise.resolve([])),r.sequentialize=a=>{let s=Promise.resolve();return l=>{let c=()=>a(l),p=s.then(c,c);return s=p.catch(()=>{}),p}},r.memoizeAsync=(a,s)=>{let l=null,c=Date.now();return()=>{let p=Date.now();return($a(l)||Z(s)&&p-c>s.millis())&&(c=p,l=a(),l.catch(d=>(l=null,d))),l}},r.allWithLimit=async(a,s=1)=>{let l=new Array(a.length),c=0,p=!1,d=async()=>{for(;c<a.length&&!p;){let f=c++;try{let v=await a[f]();p||(l[f]=v)}catch(v){throw p=!0,v}}};return await Promise.all(Array.from({length:Math.min(s,a.length)},d)),l},r.allSettledWithLimit=async(a,s=1)=>{let l=new Array(a.length),c=0,p=async()=>{for(;c<a.length;){let d=c++;try{let f=await a[d]();l[d]={status:"fulfilled",value:f}}catch(f){l[d]={status:"rejected",reason:f}}}};return await Promise.all(Array.from({length:Math.min(s,a.length)},p)),l};class n{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 l=Promise.withResolvers();return this.#e.push([s,l]),l.promise.finally(()=>this.#r())}}#r(){if(I(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[s,{resolve:l,reject:c}]=this.#e.shift();this.#t++,s().then(l,c)}}}r.Limit=n;class o{#e;#t;#r;#i=g.None;constructor(s,l,c){this.#e=s,this.#t=l,this.#r=c}update(s){this.#i=g.wrap(s),s.then(l=>{this.#i.contains(s)&&this.#e(l)}).catch(l=>{this.#i.contains(s)&&this.#t(l)}).finally(()=>{this.#i.contains(s)&&(this.terminate(),_(this.#r))})}terminate(){this.#i=g.None}}r.Latest=o})(hf||(hf={}));var BP=(r,e)=>Zn.executor(e,new class{sendUpdates(t){r.beginTransaction(),t.forEach(i=>{let n=i.type;n==="new"?r.createBox(i.name,i.uuid,o=>o.read(new ut(i.buffer))):n==="update-primitive"?r.findVertex(Ae.reconstruct(i.address)).unwrap(()=>`Could not find primitive field ${i.address}`).setValue(i.value):n==="update-pointer"?r.findVertex(Ae.reconstruct(i.address)).unwrap(()=>`Could not find pointer field ${i.address}`).targetAddress=Z(i.target)?g.wrap(Ae.reconstruct(i.target)):g.None:i.type==="delete"&&r.unstageBox(r.findBox(i.uuid).unwrap(()=>`Could not find box ${A.toString(i.uuid)}`))}),r.endTransaction()}checksum(t){return R.equals(r.checksum(),t)?Promise.resolve():Promise.reject("Checksum mismatch")}});var ff=class{#e=0;#t=!1;#r=!1;isRecording=!1;isCountingIn=!1;metronomeEnabled=!1;getLeapStateAndReset(){let e=this.#r;return this.#r=!1,e}get position(){return this.#e}set position(e){this.#e=e,this.#r=!0}get transporting(){return this.#t}set transporting(e){this.#t!==e&&(this.#t=e)}pause(){this.#t=!1,this.isRecording=!1,this.isCountingIn=!1}advanceTo(e){this.#e=e}};var FP;(function(r){r.NoSync="nosync",r.Pitch="pitch",r.Timestretch="timestretch",r.AudioFit="audiofit"})(FP||(FP={}));var NP;(function(r){r[r.Pre=0]="Pre",r[r.Post=1]="Post"})(NP||(NP={}));var St;(function(r){r.Instrument="instrument",r.Bus="bus",r.Aux="aux",r.Output="output"})(St||(St={}));var cl={white:new _t(0,0,100),blue:new _t(189,100,65),green:new _t(150,77,69),yellow:new _t(60,100,84),cream:new _t(65,20,83),orange:new _t(31,100,73),red:new _t(354,100,65),purple:new _t(314,100,78),bright:new _t(197,0,100),gray:new _t(197,31,85),dark:new _t(197,15,62),shadow:new _t(197,10,42),black:new _t(197,10,14),background:new _t(197,6,5),panelBackground:new _t(197,14,7),panelBackgroundBright:new _t(197,14,10),panelBackgroundDark:new _t(197,14,6)};var Me;(function(r){r[r.Add=0]="Add",r[r.Adsr=1]="Adsr",r[r.ArrayDown=2]="ArrayDown",r[r.AudioBus=3]="AudioBus",r[r.AudioDevice=4]="AudioDevice",r[r.AudioFile=5]="AudioFile",r[r.AutoGain=6]="AutoGain",r[r.Automation=7]="Automation",r[r.BassGuitar=8]="BassGuitar",r[r.Book=9]="Book",r[r.Box=10]="Box",r[r.Bug=11]="Bug",r[r.Fold=12]="Fold",r[r.Checkbox=13]="Checkbox",r[r.Clips=14]="Clips",r[r.Close=15]="Close",r[r.CloudFolder=16]="CloudFolder",r[r.CollapseDown=17]="CollapseDown",r[r.Compressor=18]="Compressor",r[r.Connected=19]="Connected",r[r.Cube=20]="Cube",r[r.Cursor=21]="Cursor",r[r.Curve=22]="Curve",r[r.Dattorro=23]="Dattorro",r[r.Delete=24]="Delete",r[r.Dial=25]="Dial",r[r.DinSlot=26]="DinSlot",r[r.Disconnected=27]="Disconnected",r[r.Divide=28]="Divide",r[r.DragConnections=29]="DragConnections",r[r.Dropdown=30]="Dropdown",r[r.Dropbox=31]="Dropbox",r[r.DrumSet=32]="DrumSet",r[r.Tidal=33]="Tidal",r[r.Duration=34]="Duration",r[r.EditBox=35]="EditBox",r[r.Effects=36]="Effects",r[r.Embed=37]="Embed",r[r.EQ=38]="EQ",r[r.Eraser=39]="Eraser",r[r.Exclude=40]="Exclude",r[r.Exit=41]="Exit",r[r.ExpandWidth=42]="ExpandWidth",r[r.FileList=43]="FileList",r[r.Flask=44]="Flask",r[r.Focus=45]="Focus",r[r.Generator=46]="Generator",r[r.GoogleDrive=47]="GoogleDrive",r[r.Groove=48]="Groove",r[r.Guitar=49]="Guitar",r[r.GuitarTab=50]="GuitarTab",r[r.Headphone=51]="Headphone",r[r.Heart=52]="Heart",r[r.Help=53]="Help",r[r.HighPass=54]="HighPass",r[r.HighShelf=55]="HighShelf",r[r.Insert=56]="Insert",r[r.Invert=57]="Invert",r[r.Loop=58]="Loop",r[r.LowPass=59]="LowPass",r[r.LowShelf=60]="LowShelf",r[r.Magnet=61]="Magnet",r[r.MainMenu=62]="MainMenu",r[r.Maximized=63]="Maximized",r[r.Menu=64]="Menu",r[r.Merge=65]="Merge",r[r.Metronome=66]="Metronome",r[r.Microphone=67]="Microphone",r[r.Midi=68]="Midi",r[r.Minimized=69]="Minimized",r[r.Mix=70]="Mix",r[r.Mixing=71]="Mixing",r[r.Mute=72]="Mute",r[r.NanoWave=73]="NanoWave",r[r.New=74]="New",r[r.NoAudio=75]="NoAudio",r[r.Note=76]="Note",r[r.NotePad=77]="NotePad",r[r.OpenDAW=78]="OpenDAW",r[r.Panel=79]="Panel",r[r.Peak=80]="Peak",r[r.Pencil=81]="Pencil",r[r.Piano=82]="Piano",r[r.Play=83]="Play",r[r.Playfield=84]="Playfield",r[r.PlayOnce=85]="PlayOnce",r[r.PlayRepeat=86]="PlayRepeat",r[r.PlayAlternate=87]="PlayAlternate",r[r.Pointer=88]="Pointer",r[r.Popout=89]="Popout",r[r.Primary=90]="Primary",r[r.Random=91]="Random",r[r.Record=92]="Record",r[r.Rectangle=93]="Rectangle",r[r.Region=94]="Region",r[r.Robot=95]="Robot",r[r.RoundDown=96]="RoundDown",r[r.RoundUp=97]="RoundUp",r[r.Run=98]="Run",r[r.Sawtooth=99]="Sawtooth",r[r.Saxophone=100]="Saxophone",r[r.Scissors=101]="Scissors",r[r.Search=102]="Search",r[r.Shadertoy=103]="Shadertoy",r[r.Sine=104]="Sine",r[r.Solo=105]="Solo",r[r.SoundFont=106]="SoundFont",r[r.SpeakerHeadphone=107]="SpeakerHeadphone",r[r.Square=108]="Square",r[r.Stack=109]="Stack",r[r.Start=110]="Start",r[r.Stereo=111]="Stereo",r[r.Stop=112]="Stop",r[r.Subtract=113]="Subtract",r[r.Sun=114]="Sun",r[r.Swap=115]="Swap",r[r.System=116]="System",r[r.Table=117]="Table",r[r.Tape=118]="Tape",r[r.TapeReel=119]="TapeReel",r[r.Time=120]="Time",r[r.Timeline=121]="Timeline",r[r.Tool=122]="Tool",r[r.Triangle=123]="Triangle",r[r.Unknown=124]="Unknown",r[r.UserFolder=125]="UserFolder",r[r.Velocity=126]="Velocity",r[r.Vinyl=127]="Vinyl",r[r.VUMeter=128]="VUMeter",r[r.Waveform=129]="Waveform",r[r.Zeitgeist=130]="Zeitgeist"})(Me||(Me={}));(function(r){r.toName=e=>r[e],r.fromName=e=>r[e]??r.Rectangle})(Me||(Me={}));var u;(function(r){r[r.Deprecated=NaN]="Deprecated",r[r.MetaData=0]="MetaData",r[r.AudioBusses=1]="AudioBusses",r[r.AudioConnection=2]="AudioConnection",r[r.AudioEffectHost=3]="AudioEffectHost",r[r.AudioFile=4]="AudioFile",r[r.AudioOutput=5]="AudioOutput",r[r.AudioPlayMode=6]="AudioPlayMode",r[r.AudioUnit=7]="AudioUnit",r[r.AudioUnits=8]="AudioUnits",r[r.Automation=9]="Automation",r[r.AuxSend=10]="AuxSend",r[r.Capture=11]="Capture",r[r.ClipCollection=12]="ClipCollection",r[r.ConnectionCollection=13]="ConnectionCollection",r[r.Device=14]="Device",r[r.DeviceUserInterface=15]="DeviceUserInterface",r[r.Editing=16]="Editing",r[r.FileUploadState=17]="FileUploadState",r[r.Groove=18]="Groove",r[r.InstrumentHost=19]="InstrumentHost",r[r.MarkerEvents=20]="MarkerEvents",r[r.MarkerTrack=21]="MarkerTrack",r[r.MidiControl=22]="MidiControl",r[r.MIDIDevice=23]="MIDIDevice",r[r.MidiEffectHost=24]="MidiEffectHost",r[r.ModularSetup=25]="ModularSetup",r[r.Modulation=26]="Modulation",r[r.ModuleCollection=27]="ModuleCollection",r[r.NoteEventCollection=28]="NoteEventCollection",r[r.NoteEventFeature=29]="NoteEventFeature",r[r.NoteEvents=30]="NoteEvents",r[r.NotesConnection=31]="NotesConnection",r[r.Parameter=32]="Parameter",r[r.ParameterController=33]="ParameterController",r[r.PianoMode=34]="PianoMode",r[r.RegionCollection=35]="RegionCollection",r[r.Sample=36]="Sample",r[r.Selection=37]="Selection",r[r.Shadertoy=38]="Shadertoy",r[r.SoundfontFile=39]="SoundfontFile",r[r.StepAutomation=40]="StepAutomation",r[r.Timeline=41]="Timeline",r[r.TrackCollection=42]="TrackCollection",r[r.TransientMarkers=43]="TransientMarkers",r[r.User=44]="User",r[r.ValueEventCollection=45]="ValueEventCollection",r[r.ValueEvents=46]="ValueEvents",r[r.ValueInterpolation=47]="ValueInterpolation",r[r.VoltageConnection=48]="VoltageConnection",r[r.WarpMarkers=49]="WarpMarkers"})(u||(u={}));var Bo;(function(r){r[r.Once=0]="Once",r[r.Repeat=1]="Repeat",r[r.Pingpong=2]="Pingpong"})(Bo||(Bo={}));var un;(function(r){r[r.Monophonic=0]="Monophonic",r[r.Polyphonic=1]="Polyphonic"})(un||(un={}));var kP=(r,e)=>{if(r===e)return 0;let t=r-e;return t===0?F(`Indices cannot be equal (${r}, ${e})`):t};var Gn=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ut=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},mf,Di,Fo,gf,qn,jt=class r{static create(e,t,i){return new r(e,t,i)}constructor(e,t,i){mf.set(this,void 0),Di.set(this,void 0),Fo.set(this,void 0),gf.set(this,void 0),qn.set(this,null),Gn(this,mf,e,"f"),Gn(this,Di,A.newSet(n=>n.adapter.uuid),"f"),Gn(this,Fo,new $t,"f"),Gn(this,gf,e.pointerHub.catchupAndSubscribe({onAdded:n=>{Gn(this,qn,null,"f");let o=t(n.box),a=o.indexField.subscribe(()=>{Gn(this,qn,null,"f"),Ut(this,Fo,"f").proxy.onReorder(o)}),s=Ut(this,Di,"f").add({adapter:o,subscription:a});I(s,`Could not add ${o}`),Ut(this,Fo,"f").proxy.onAdd(o)},onRemoved:n=>{Gn(this,qn,null,"f");let o=n.box.address.uuid,{adapter:a,subscription:s}=Ut(this,Di,"f").removeByKey(o);s.terminate(),Ut(this,Fo,"f").proxy.onRemove(a)}},i),"f")}field(){return Ut(this,mf,"f")}subscribe(e){return Ut(this,Fo,"f").subscribe(e)}catchupAndSubscribe(e){return Ut(this,Di,"f").forEach(({adapter:t})=>e.onAdd(t)),this.subscribe(e)}getAdapterByIndex(e){let t=Ye.exactMapped(this.adapters(),e,kP,i=>i.indexField.getValue());return t===-1?g.None:g.wrap(this.adapters()[t])}getAdapterById(e){return Ut(this,Di,"f").opt(e).map(({adapter:t})=>t)}getMinFreeIndex(){let e=this.adapters();for(let t=0;t<e.length;t++)if(e[t].indexField.getValue()>t)return t;return e.length}adapters(){return Ut(this,qn,"f")===null&&Gn(this,qn,Ut(this,Di,"f").values().map(({adapter:e})=>e).sort((e,t)=>e.indexField.getValue()-t.indexField.getValue()),"f"),Ut(this,qn,"f")}move(e,t){this.moveIndex(e.indexField.getValue(),t)}moveIndex(e,t){let i=this.adapters(),n=i[e];if(t<0){let o=le(e+t,0,i.length-1);for(let a=o;a<e;a++)i[a].indexField.setValue(a+1);n.indexField.setValue(o)}else if(t>1){let o=le(e+(t-1),0,i.length-1);for(let a=e;a<o;a++)i[a+1].indexField.setValue(a);n.indexField.setValue(o)}else console.warn(`moveIndex had no effect: startIndex: ${e}, delta: ${t}`)}size(){return Ut(this,Di,"f").size()}isEmpty(){return this.size()===0}terminate(){Gn(this,qn,null,"f"),Ut(this,Di,"f").forEach(({subscription:e})=>e.terminate()),Ut(this,Di,"f").clear(),Ut(this,Fo,"f").terminate(),Ut(this,gf,"f").terminate()}};mf=new WeakMap,Di=new WeakMap,Fo=new WeakMap,gf=new WeakMap,qn=new WeakMap;var za;(function(r){r.create=(e,t,i,n)=>{switch(e){case"MetaDataBox":return Hn.create(t,i,n);case"RootBox":return dl.create(t,i,n);case"SelectionBox":return cn.create(t,i,n);case"UserInterfaceBox":return Ua.create(t,i,n);case"UploadFileBox":return vf.create(t,i,n);case"ShadertoyBox":return yf.create(t,i,n);case"TimelineBox":return ja.create(t,i,n);case"TrackBox":return ar.create(t,i,n);case"NoteEventBox":return No.create(t,i,n);case"NoteEventRepeatBox":return xf.create(t,i,n);case"NoteEventCollectionBox":return Jn.create(t,i,n);case"NoteRegionBox":return La.create(t,i,n);case"NoteClipBox":return pl.create(t,i,n);case"ValueEventBox":return ko.create(t,i,n);case"ValueEventCollectionBox":return Qn.create(t,i,n);case"ValueEventCurveBox":return $o.create(t,i,n);case"ValueRegionBox":return Ka.create(t,i,n);case"ValueClipBox":return hl.create(t,i,n);case"AudioRegionBox":return Mo.create(t,i,n);case"AudioClipBox":return fl.create(t,i,n);case"AudioPitchStretchBox":return wf.create(t,i,n);case"AudioTimeStretchBox":return bf.create(t,i,n);case"TransientMarkerBox":return Af.create(t,i,n);case"WarpMarkerBox":return _f.create(t,i,n);case"MarkerBox":return ml.create(t,i,n);case"AudioFileBox":return Cr.create(t,i,n);case"SoundfontFileBox":return Xr.create(t,i,n);case"AudioUnitBox":return it.create(t,i,n);case"CaptureAudioBox":return Do.create(t,i,n);case"CaptureMidiBox":return Io.create(t,i,n);case"AudioBusBox":return Ii.create(t,i,n);case"AuxSendBox":return Wa.create(t,i,n);case"GrooveShuffleBox":return gl.create(t,i,n);case"UnknownAudioEffectDeviceBox":return Pf.create(t,i,n);case"UnknownMidiEffectDeviceBox":return Sf.create(t,i,n);case"DeviceInterfaceKnobBox":return Ef.create(t,i,n);case"ModularDeviceBox":return Bf.create(t,i,n);case"StereoToolDeviceBox":return Ff.create(t,i,n);case"CompressorDeviceBox":return vl.create(t,i,n);case"DelayDeviceBox":return Nf.create(t,i,n);case"CrusherDeviceBox":return kf.create(t,i,n);case"DattorroReverbDeviceBox":return $f.create(t,i,n);case"VelocityDeviceBox":return Mf.create(t,i,n);case"FoldDeviceBox":return Df.create(t,i,n);case"TidalDeviceBox":return If.create(t,i,n);case"RevampDeviceBox":return Cf.create(t,i,n);case"ReverbDeviceBox":return Tf.create(t,i,n);case"VaporisateurDeviceBox":return yl.create(t,i,n);case"MIDIOutputDeviceBox":return xl.create(t,i,n);case"MIDIOutputBox":return Ci.create(t,i,n);case"MIDIOutputParameterBox":return Ti.create(t,i,n);case"SoundfontDeviceBox":return wl.create(t,i,n);case"NanoDeviceBox":return bl.create(t,i,n);case"PlayfieldDeviceBox":return Al.create(t,i,n);case"PlayfieldSampleBox":return Co.create(t,i,n);case"TapeDeviceBox":return _l.create(t,i,n);case"ArpeggioDeviceBox":return Rf.create(t,i,n);case"PitchDeviceBox":return Of.create(t,i,n);case"ZeitgeistDeviceBox":return Vf.create(t,i,n);case"ModularBox":return zf.create(t,i,n);case"ModuleConnectionBox":return Uf.create(t,i,n);case"ModularAudioInputBox":return jf.create(t,i,n);case"ModularAudioOutputBox":return Lf.create(t,i,n);case"ModuleDelayBox":return Kf.create(t,i,n);case"ModuleMultiplierBox":return Wf.create(t,i,n);case"ModuleGainBox":return Zf.create(t,i,n);default:return F(`Unknown box class '${e}'`)}},r.deserialize=(e,t)=>{let i=new ut(t),n=i.readString(),o=A.fromDataInput(i),a=r.create(n,e,o);return a.read(i),a}})(za||(za={}));var Hn=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MetaDataBox",pointerRules:h}),i)}static ClassName="MetaDataBox";constructor(e){super(e)}accept(e){return _(e.visitMetaDataBox,this)}get target(){return this.getField(1)}get origin(){return this.getField(2)}get value(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"target",deprecated:!1,pointerRules:h},u.MetaData,!0),2:C.create({parent:this,fieldKey:2,fieldName:"origin",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"value",deprecated:!1,pointerRules:h})}}};var Gf=class r extends je{static create(e){return new r(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:E.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:h},{length:4},"",0),2:w.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:h},{min:1,max:64,scaling:"linear"},"",8),3:w.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:h},{min:.5,max:2,scaling:"linear"},"",1),4:$.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:h},!1),5:E.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:h},{min:-48,max:48},"st",0)}}};var dl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"RootBox",pointerRules:h}),i)}static ClassName="RootBox";constructor(e){super(e)}accept(e){return _(e.visitRootBox,this)}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 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 editingChannel(){return this.getField(111)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:h},u.Timeline,!0),2:W.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[u.User],mandatory:!0}}),3:C.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:h}),4:B.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:h},u.Groove,!0),10:W.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[u.ModularSetup],mandatory:!1}}),20:W.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[u.AudioUnits],mandatory:!1}}),21:W.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[u.AudioBusses],mandatory:!1}}),30:W.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[u.AudioOutput],mandatory:!0}}),35:W.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[u.MIDIDevice],mandatory:!1}}),40:Gf.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:h}),100:B.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:h},u.Shadertoy,!1),111:B.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:h},u.Editing,!1)}}};var cn=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"SelectionBox",pointerRules:h}),i)}static ClassName="SelectionBox";constructor(e){super(e)}accept(e){return _(e.visitSelectionBox,this)}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:h},u.Selection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:h},u.Selection,!0)}}};var Ua=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UserInterfaceBox",pointerRules:{accepts:[u.MetaData],mandatory:!1}}),i)}static ClassName="UserInterfaceBox";constructor(e){super(e)}accept(e){return _(e.visitUserInterfaceBox,this)}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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:h},u.User,!0),10:W.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[u.Selection],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[u.FileUploadState],mandatory:!1}}),21:B.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:h},u.Editing,!1),22:B.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:h},u.Editing,!1),23:B.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:h},u.Editing,!1)}}};var vf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UploadFileBox",pointerRules:h}),i)}static ClassName="UploadFileBox";constructor(e){super(e)}accept(e){return _(e.visitUploadFileBox,this)}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:h},u.FileUploadState,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:h},u.FileUploadState,!0)}}};var yf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ShadertoyBox",pointerRules:{accepts:[u.Shadertoy],mandatory:!0}}),i)}static ClassName="ShadertoyBox";constructor(e){super(e)}accept(e){return _(e.visitShadertoyBox,this)}get shaderCode(){return this.getField(1)}get highres(){return this.getField(2)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"shaderCode",deprecated:!1,pointerRules:h}),2:$.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:h},!0)}}};var qf=class r extends je{static create(e){return new r(e)}constructor(e){super(e)}get nominator(){return this.getField(1)}get denominator(){return this.getField(2)}initializeFields(){return{1:E.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:h},{min:1,max:32},"",4),2:E.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:h},{min:1,max:32},"",4)}}};var Hf=class r extends je{static create(e){return new r(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:$.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),2:E.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:h},"any","ppqn",0),3:E.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:h},"any","ppqn",15360)}}};var Jf=class r extends je{static create(e){return new r(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:W.hook({parent:this,fieldKey:1,fieldName:"markers",deprecated:!1,pointerRules:{accepts:[u.MarkerTrack],mandatory:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),20:$.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:h},!0)}}};var ja=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TimelineBox",pointerRules:h}),i)}static ClassName="TimelineBox";constructor(e){super(e)}accept(e){return _(e.visitTimelineBox,this)}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 durationInPulses(){return this.getField(30)}get bpm(){return this.getField(31)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[u.Timeline],mandatory:!0}}),10:qf.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:h}),11:Hf.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:h}),20:W.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!1,pointerRules:{accepts:[u.MarkerTrack],mandatory:!1}}),21:Jf.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:h}),30:E.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:h},"positive","ppqn",491520),31:w.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:h},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var ar=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TrackBox",pointerRules:{accepts:[u.Selection,u.PianoMode,u.MetaData],mandatory:!1}}),i)}static ClassName="TrackBox";constructor(e){super(e)}accept(e){return _(e.visitTrackBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:h},u.TrackCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:h},u.Automation,!0),3:W.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[u.RegionCollection],mandatory:!1}}),4:W.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[u.ClipCollection],mandatory:!1}}),10:E.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),11:E.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:h},{values:[0,1,2,3]},""),20:$.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),30:$.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:h},!1)}}};var No=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventBox",pointerRules:{accepts:[u.Selection,u.NoteEventFeature],mandatory:!1}}),i)}static ClassName="NoteEventBox";constructor(e){super(e)}accept(e){return _(e.visitNoteEventBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:h},u.NoteEvents,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn",240),20:E.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:h},{min:0,max:127},"",60),21:w.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:h},"unipolar","%",.7874015748031497),22:E.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:h},{min:1,max:128},"",1),23:w.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:h},"bipolar","%",0),24:w.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:h},{min:-50,max:50,scaling:"linear"},"ct",0),25:E.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:h},{min:0,max:100},"",100)}}};var xf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventRepeatBox",pointerRules:h}),i)}static ClassName="NoteEventRepeatBox";constructor(e){super(e)}accept(e){return _(e.visitNoteEventRepeatBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:h},u.NoteEventFeature,!0),2:E.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:h},{min:1,max:128},"",1),3:w.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:h},"bipolar","%",0),4:w.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:h},"unipolar","%",1)}}};var Jn=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="NoteEventCollectionBox";constructor(e){super(e)}accept(e){return _(e.visitNoteEventCollectionBox,this)}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[u.NoteEvents],mandatory:!1}}),2:W.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[u.NoteEventCollection],mandatory:!0}})}}};var La=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),i)}static ClassName="NoteRegionBox";constructor(e){super(e)}accept(e){return _(e.visitNoteRegionBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:h},u.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},u.NoteEventCollection,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),12:E.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:h},"any","ppqn"),13:E.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:h},"positive","ppqn"),14:E.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:h},"any","ppqn"),15:$.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:h}),16:C.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:h}),17:E.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var To=class r extends je{static create(e){return new r(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:$.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:h},!0),2:$.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:h}),3:$.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:h}),4:E.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:h},"non-negative",""),5:E.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:h},"non-negative",""),6:E.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:h},"non-negative","")}}};var pl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NoteClipBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),i)}static ClassName="NoteClipBox";constructor(e){super(e)}accept(e){return _(e.visitNoteClipBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:h},u.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},u.NoteEventCollection,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:To.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:h}),10:E.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),11:$.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:h}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:h}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var ko=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="ValueEventBox";constructor(e){super(e)}accept(e){return _(e.visitValueEventBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:h},u.ValueEvents,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),12:E.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[u.ValueInterpolation],mandatory:!1}},{values:[0,1]},"",1),13:w.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:h},"unipolar","%"),14:w.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:h},"any","",NaN)}}};var Qn=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="ValueEventCollectionBox";constructor(e){super(e)}accept(e){return _(e.visitValueEventCollectionBox,this)}get events(){return this.getField(1)}get owners(){return this.getField(2)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[u.ValueEvents],mandatory:!1}}),2:W.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[u.ValueEventCollection],mandatory:!0}})}}};var $o=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCurveBox",pointerRules:h}),i)}static ClassName="ValueEventCurveBox";constructor(e){super(e)}accept(e){return _(e.visitValueEventCurveBox,this)}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:h},u.ValueInterpolation,!0),2:w.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:h},"unipolar","%",.5)}}};var Ka=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),i)}static ClassName="ValueRegionBox";constructor(e){super(e)}accept(e){return _(e.visitValueRegionBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:h},u.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},u.ValueEventCollection,!0),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),12:E.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:h},"any","ppqn"),13:E.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:h},"positive","ppqn"),14:$.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:h}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:h}),16:E.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var hl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ValueClipBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),i)}static ClassName="ValueClipBox";constructor(e){super(e)}accept(e){return _(e.visitValueClipBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:h},u.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:h},u.ValueEventCollection,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:To.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:h}),10:E.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:h},"positive","ppqn"),11:$.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:h}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:h}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var Mo=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),i)}static ClassName="AudioRegionBox";constructor(e){super(e)}accept(e){return _(e.visitAudioRegionBox,this)}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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:h},u.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:h},u.AudioFile,!0),3:C.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:h}),4:C.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:h},"musical"),5:B.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:h},u.ValueEventCollection,!0),6:B.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:h},u.Deprecated,!1),7:w.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:h},"any","seconds"),8:B.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:h},u.AudioPlayMode,!1),10:E.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),11:w.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:h},"any","mixed"),12:w.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:h},"any","mixed"),13:w.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:h},"any","mixed"),14:$.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:h}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:h}),16:E.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0"),17:w.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:h},"decibel","db")}}};var fl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioClipBox",pointerRules:{accepts:[u.Selection,u.Editing,u.MetaData],mandatory:!1}}),i)}static ClassName="AudioClipBox";constructor(e){super(e)}accept(e){return _(e.visitAudioClipBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:h},u.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:h},u.AudioFile,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:To.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:h}),5:B.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:h},u.ValueEventCollection,!0),6:B.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:h},u.Deprecated,!1),7:w.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:h},"any","seconds"),8:B.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:h},u.AudioPlayMode,!1),10:E.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:h},"any","ppqn"),11:$.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:h}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:h}),13:E.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0"),14:w.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:h},"decibel","db"),20:C.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!0,pointerRules:h}),21:C.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:h},"musical")}}};var wf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioPitchStretchBox",pointerRules:{accepts:[u.AudioPlayMode],mandatory:!0}}),i)}static ClassName="AudioPitchStretchBox";constructor(e){super(e)}accept(e){return _(e.visitAudioPitchStretchBox,this)}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[u.WarpMarkers],mandatory:!0}})}}};var bf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioTimeStretchBox",pointerRules:{accepts:[u.AudioPlayMode],mandatory:!0}}),i)}static ClassName="AudioTimeStretchBox";constructor(e){super(e)}accept(e){return _(e.visitAudioTimeStretchBox,this)}get warpMarkers(){return this.getField(1)}get transientPlayMode(){return this.getField(2)}get playbackRate(){return this.getField(3)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[u.WarpMarkers],mandatory:!0}}),2:E.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:h},"positive","enum",2),3:w.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:h},"positive","ratio",1)}}};var Af=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TransientMarkerBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="TransientMarkerBox";constructor(e){super(e)}accept(e){return _(e.visitTransientMarkerBox,this)}get owner(){return this.getField(1)}get position(){return this.getField(2)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:h},u.TransientMarkers,!0),2:w.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:h},"non-negative","seconds")}}};var _f=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"WarpMarkerBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="WarpMarkerBox";constructor(e){super(e)}accept(e){return _(e.visitWarpMarkerBox,this)}get owner(){return this.getField(1)}get position(){return this.getField(2)}get seconds(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:h},u.WarpMarkers,!0),2:E.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),3:w.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:h},"non-negative","seconds")}}};var ml=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MarkerBox",pointerRules:{accepts:[u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="MarkerBox";constructor(e){super(e)}accept(e){return _(e.visitMarkerBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:h},u.MarkerTrack,!0),2:E.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:h},"any","ppqn"),3:E.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:h},"non-negative","",1),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:h}),5:E.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:h},{min:0,max:360},"\xB0")}}};var Cr=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioFileBox",pointerRules:{accepts:[u.AudioFile,u.FileUploadState,u.MetaData],mandatory:!0}}),i)}static ClassName="AudioFileBox";constructor(e){super(e)}accept(e){return _(e.visitAudioFileBox,this)}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:w.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:h},"non-negative","s"),2:w.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:h},"non-negative","s"),3:C.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[u.TransientMarkers],mandatory:!1}})}}};var Xr=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[u.SoundfontFile],mandatory:!0}}),i)}static ClassName="SoundfontFileBox";constructor(e){super(e)}accept(e){return _(e.visitSoundfontFileBox,this)}get fileName(){return this.getField(1)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:h})}}};var it=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[u.Selection,u.Automation],mandatory:!1}}),i)}static ClassName="AudioUnitBox";constructor(e){super(e)}accept(e){return _(e.visitAudioUnitBox,this)}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)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"type",deprecated:!1,pointerRules:h},"instrument"),2:B.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:h},u.AudioUnits,!0),3:W.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[u.Editing],mandatory:!1}}),11:E.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),12:w.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-96,mid:-9,max:6,scaling:"decibel"},"dB"),13:w.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%"),14:$.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),15:$.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),20:W.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[u.TrackCollection],mandatory:!1}}),21:W.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[u.MidiEffectHost],mandatory:!1}}),22:W.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[u.InstrumentHost,u.AudioOutput],mandatory:!1}}),23:W.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[u.AudioEffectHost],mandatory:!1}}),24:W.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[u.AuxSend],mandatory:!1}}),25:B.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:h},u.AudioOutput,!1),26:B.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:h},u.Capture,!1)}}};var Do=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[u.Capture],mandatory:!0}}),i)}static ClassName="CaptureAudioBox";constructor(e){super(e)}accept(e){return _(e.visitCaptureAudioBox,this)}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get requestChannels(){return this.getField(10)}get gainDb(){return this.getField(11)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:h}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:h},"normal"),10:E.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:h},"any","",1),11:w.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:h},"decibel","dB",0)}}};var Io=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[u.Capture],mandatory:!0}}),i)}static ClassName="CaptureMidiBox";constructor(e){super(e)}accept(e){return _(e.visitCaptureMidiBox,this)}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get channel(){return this.getField(10)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:h}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:h},"normal"),10:E.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:h},"any","",-1)}}};var Ii=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AudioBusBox",pointerRules:h}),i)}static ClassName="AudioBusBox";constructor(e){super(e)}accept(e){return _(e.visitAudioBusBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},u.AudioBusses,!0),2:B.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:h},u.AudioOutput,!0),3:W.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[u.AudioOutput],mandatory:!1}}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:C.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:h}),6:C.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:h}),7:C.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:h},"red"),8:$.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:h})}}};var Wa=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"AuxSendBox",pointerRules:h}),i)}static ClassName="AuxSendBox";constructor(e){super(e)}accept(e){return _(e.visitAuxSendBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:h},u.AuxSend,!0),2:B.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:h},u.AudioOutput,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),4:E.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:h},{values:[0,1]},"",1),5:w.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB"),6:w.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","")}}};var gl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[u.Groove],mandatory:!0}}),i)}static ClassName="GrooveShuffleBox";constructor(e){super(e)}accept(e){return _(e.visitGrooveShuffleBox,this)}get label(){return this.getField(1)}get amount(){return this.getField(10)}get duration(){return this.getField(11)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:h}),10:w.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.6),11:E.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"non-negative","ppqn",480)}}};var Pf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="UnknownAudioEffectDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitUnknownAudioEffectDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:h})}}};var Sf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="UnknownMidiEffectDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitUnknownMidiEffectDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.MidiEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:h})}}};var Ef=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:h}),i)}static ClassName="DeviceInterfaceKnobBox";constructor(e){super(e)}accept(e){return _(e.visitDeviceInterfaceKnobBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:h},u.DeviceUserInterface,!0),2:B.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:h},u.ParameterController,!0),3:E.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),10:w.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:h},"unipolar","%"),11:C.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:h})}}};var Qf=class r extends je{static create(e){return new r(e)}constructor(e){super(e)}get elements(){return this.getField(1)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"elements",deprecated:!1,pointerRules:{accepts:[u.DeviceUserInterface],mandatory:!1}})}}};var Bf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="ModularDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitModularDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:B.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:h},u.ModularSetup,!0),11:Qf.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:h})}}};var Ff=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="StereoToolDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitStereoToolDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-72,mid:0,max:12,scaling:"decibel"},"dB",0),11:w.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%",0),12:w.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%",0),13:$.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),14:$.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),15:$.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),20:E.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:h},{values:[0,1]},"",1)}}};var vl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="CompressorDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitCompressorDeviceBox,this)}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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:$.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},!1),11:$.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},!0),12:$.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},!1),13:$.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},!1),14:w.create({parent:this,fieldKey:14,fieldName:"inputgain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-30,max:30,scaling:"linear"},"dB",0),15:w.create({parent:this,fieldKey:15,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-60,max:0,scaling:"linear"},"dB",-10),16:w.create({parent:this,fieldKey:16,fieldName:"ratio",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:1,max:24,scaling:"exponential"},"",2),17:w.create({parent:this,fieldKey:17,fieldName:"knee",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:0,max:24,scaling:"linear"},"dB",0),18:w.create({parent:this,fieldKey:18,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:0,max:100,scaling:"linear"},"ms",0),19:w.create({parent:this,fieldKey:19,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:5,max:1500,scaling:"linear"},"ms",5),20:w.create({parent:this,fieldKey:20,fieldName:"makeup",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-40,max:40,scaling:"linear"},"dB",0),21:w.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",1)}}};var Nf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="DelayDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitDelayDeviceBox,this)}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 delay(){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)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"delay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"any","",4),11:w.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),12:w.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%",0),13:w.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%",0),14:w.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",-6),15:w.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",0)}}};var kf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="CrusherDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitCrusherDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",0),11:E.create({parent:this,fieldKey:11,fieldName:"bits",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:1,max:16},"bits",16),12:w.create({parent:this,fieldKey:12,fieldName:"boost",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:0,max:24,scaling:"linear"},"dB",0),13:w.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",1)}}};var $f=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"DattorroReverbDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="DattorroReverbDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitDattorroReverbDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),11:w.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.9999),12:w.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.75),13:w.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.625),14:w.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),15:w.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.7),16:w.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),17:w.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.005),18:w.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),19:w.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.7),20:w.create({parent:this,fieldKey:20,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",-6),21:w.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",0)}}};var Mf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"VelocityDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="VelocityDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitVelocityDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.MidiEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),11:w.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%"),12:E.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:h},"any","",2048),13:w.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%"),14:w.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%",0),15:w.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",1)}}};var Df=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="FoldDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitFoldDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"drive",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:0,max:30,scaling:"linear"},"dB",0),11:E.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:h},{length:3},"",0),12:w.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-18,max:0,scaling:"linear"},"dB",0)}}};var If=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TidalDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="TidalDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitTidalDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%",-.25),11:w.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),20:w.create({parent:this,fieldKey:20,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",3),21:w.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","",1),22:w.create({parent:this,fieldKey:22,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0),23:w.create({parent:this,fieldKey:23,fieldName:"channelOffset",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0)}}};var Hc=class r extends je{static create(e){return new r(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:$.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),10:w.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:E.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{length:4},""),12:w.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Jc=class r extends je{static create(e){return new r(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:$.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),10:w.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:w.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-24,max:24,scaling:"linear"},"dB")}}};var Pl=class r extends je{static create(e){return new r(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:$.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}}),10:w.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:w.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-24,max:24,scaling:"linear"},"dB"),12:w.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Cf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="RevampDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitRevampDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:Hc.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:h}),11:Jc.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:h}),12:Pl.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:h}),13:Pl.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:h}),14:Pl.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:h}),15:Jc.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:h}),16:Hc.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:h}),17:w.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-18,max:18,scaling:"linear"},"db")}}};var Tf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="ReverbDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitReverbDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.AudioEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),11:w.create({parent:this,fieldKey:11,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:.5,scaling:"exponential"},"s",0),12:w.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",.5),13:w.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%",0),14:w.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",-3),15:w.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",0)}}};var Yf=class r extends je{static create(e){return new r(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:E.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{values:[0,1,2,3]},""),2:w.create({parent:this,fieldKey:2,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","db",-1/0),3:E.create({parent:this,fieldKey:3,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-3,max:3},"oct",0),4:w.create({parent:this,fieldKey:4,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-1200,max:1200,scaling:"linear"},"ct")}}};var Xf=class r extends je{static create(e){return new r(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:E.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{values:[0,1,2,3]},""),2:w.create({parent:this,fieldKey:2,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:1e-4,max:30,scaling:"exponential"},"Hz",1e-4),3:$.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},!1),10:w.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%"),11:w.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%"),12:w.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%")}}};var em=class r extends je{static create(e){return new r(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:w.create({parent:this,fieldKey:1,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),2:w.create({parent:this,fieldKey:2,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),3:w.create({parent:this,fieldKey:3,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),4:w.create({parent:this,fieldKey:4,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","db",.001)}}};var yl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="VaporisateurDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitVaporisateurDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",-6),11:E.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"any","oct"),12:w.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"any","ct"),13:E.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"any",""),14:w.create({parent:this,fieldKey:14,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),15:w.create({parent:this,fieldKey:15,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"q"),16:w.create({parent:this,fieldKey:16,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s"),17:w.create({parent:this,fieldKey:17,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s"),18:w.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%"),19:w.create({parent:this,fieldKey:19,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),20:w.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",1),21:w.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",0),22:E.create({parent:this,fieldKey:22,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{values:[0,1]},"",1),23:E.create({parent:this,fieldKey:23,fieldName:"unisonCount",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{values:[1,3,5]},"",1),24:w.create({parent:this,fieldKey:24,fieldName:"unisonDetune",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:1,max:1200,scaling:"exponential"},"ct",30),25:w.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",1),26:E.create({parent:this,fieldKey:26,fieldName:"filterOrder",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{values:[1,2,3,4]},"",1),27:w.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","%"),30:Xf.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:h}),40:uf.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:h},e=>Yf.create(e),2),50:em.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:h}),99:E.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:h},"any","")}}};var tm=class r extends je{static create(e){return new r(e)}constructor(e){super(e)}get id(){return this.getField(1)}get label(){return this.getField(2)}initializeFields(){return{1:C.create({parent:this,fieldKey:1,fieldName:"id",deprecated:!1,pointerRules:h}),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h})}}};var xl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="MIDIOutputDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIOutputDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:tm.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:h}),11:E.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:h},{min:0,max:15},"ch"),12:E.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:h},"any","ms",10),13:W.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[u.Parameter],mandatory:!1}}),14:B.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:h},u.MIDIDevice,!1)}}};var Ci=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputBox",pointerRules:h}),i)}static ClassName="MIDIOutputBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIOutputBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:h},u.MIDIDevice,!0),2:W.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[u.MIDIDevice],mandatory:!0}}),3:C.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:h}),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:h}),5:E.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:h},{min:0,max:500},"ms",10),6:$.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:h},!0)}}};var Ti=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputParameterBox",pointerRules:h}),i)}static ClassName="MIDIOutputParameterBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIOutputParameterBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:h},u.Parameter,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h},""),3:E.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:h},{min:0,max:127},"#",64),4:w.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!0}},"unipolar","%")}}};var wl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="SoundfontDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitSoundfontDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:B.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:h},u.SoundfontFile,!1),11:E.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:h},{min:0,max:65535},"")}}};var bl=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="NanoDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitNanoDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"decibel","dB",-3),15:B.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:h},u.AudioFile,!1),20:w.create({parent:this,fieldKey:20,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:8,scaling:"exponential"},"s",.1)}}};var Al=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="PlayfieldDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitPlayfieldDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:W.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[u.Sample],mandatory:!1}})}}};var Co=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[u.Editing],mandatory:!1}}),i)}static ClassName="PlayfieldSampleBox";constructor(e){super(e)}accept(e){return _(e.visitPlayfieldSampleBox,this)}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)}initializeFields(){return{10:B.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:h},u.Sample,!0),11:B.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:h},u.AudioFile,!0),12:W.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[u.MidiEffectHost],mandatory:!1}}),13:W.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[u.AudioEffectHost],mandatory:!1}}),15:E.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:h},{min:0,max:127},"",60),20:C.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!1,pointerRules:h}),21:C.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:h}),22:$.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),23:$.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),40:$.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:h}),41:$.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:h}),42:$.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:h}),43:$.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:h}),44:E.create({parent:this,fieldKey:44,fieldName:"gate",deprecated:!1,pointerRules:h},{length:3},"",0),45:w.create({parent:this,fieldKey:45,fieldName:"pitch",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-1200,max:1200,scaling:"linear"},"ct"),46:w.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",0),47:w.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%",1),48:w.create({parent:this,fieldKey:48,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),49:w.create({parent:this,fieldKey:49,fieldName:"release",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.02)}}};var _l=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData,u.Automation],mandatory:!1}}),i)}static ClassName="TapeDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitTapeDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:w.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%"),11:w.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%"),12:w.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%"),13:w.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"unipolar","%")}}};var Rf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="ArpeggioDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitArpeggioDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.MidiEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:E.create({parent:this,fieldKey:10,fieldName:"modeIndex",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{length:3},"",0),11:E.create({parent:this,fieldKey:11,fieldName:"numOctaves",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:1,max:5},"oct",1),12:E.create({parent:this,fieldKey:12,fieldName:"rateIndex",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{length:17},"",9),13:w.create({parent:this,fieldKey:13,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:0,max:2,scaling:"linear"},"",1),14:E.create({parent:this,fieldKey:14,fieldName:"repeat",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:1,max:16},"",1),15:w.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},"bipolar","",0)}}};var Of=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="PitchDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitPitchDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.MidiEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:E.create({parent:this,fieldKey:10,fieldName:"semiTones",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-36,max:36},"st",0),11:w.create({parent:this,fieldKey:11,fieldName:"cents",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-50,max:50,scaling:"linear"},"ct",0),12:E.create({parent:this,fieldKey:12,fieldName:"octaves",deprecated:!1,pointerRules:{accepts:[u.Modulation,u.Automation,u.MidiControl],mandatory:!1}},{min:-7,max:7},"oct",0)}}};var Vf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[u.Device,u.Selection,u.MetaData],mandatory:!1}}),i)}static ClassName="ZeitgeistDeviceBox";constructor(e){super(e)}accept(e){return _(e.visitZeitgeistDeviceBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:h},u.MidiEffectHost,!0),2:E.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:h},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:h}),4:$.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:h},!0),5:$.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:h},!1),10:B.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:h},u.Groove,!0)}}};var zf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularBox",pointerRules:h}),i)}static ClassName="ModularBox";constructor(e){super(e)}accept(e){return _(e.visitModularBox,this)}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:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},u.ModularSetup,!0),2:W.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[u.ModularSetup],mandatory:!0}}),3:W.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[u.Editing],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[u.ModuleCollection],mandatory:!1}}),12:W.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[u.ConnectionCollection],mandatory:!1}}),13:C.create({parent:this,fieldKey:13,fieldName:"label",deprecated:!1,pointerRules:h})}}};var Uf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleConnectionBox",pointerRules:h}),i)}static ClassName="ModuleConnectionBox";constructor(e){super(e)}accept(e){return _(e.visitModuleConnectionBox,this)}get collection(){return this.getField(1)}get source(){return this.getField(2)}get target(){return this.getField(3)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},u.ConnectionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:h},u.VoltageConnection,!0),3:B.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:h},u.VoltageConnection,!0)}}};var ei=class r extends je{static create(e){return new r(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:B.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:h},u.ModuleCollection,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:h}),3:E.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:h},"any","x"),4:E.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:h},"any","y"),5:$.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:h},!1),6:$.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:h},!0)}}};var jf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="ModularAudioInputBox";constructor(e){super(e)}accept(e){return _(e.visitModularAudioInputBox,this)}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:ei.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}})}}};var Lf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="ModularAudioOutputBox";constructor(e){super(e)}accept(e){return _(e.visitModularAudioOutputBox,this)}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:ei.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}})}}};var Kf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="ModuleDelayBox";constructor(e){super(e)}accept(e){return _(e.visitModuleDelayBox,this)}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:ei.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),20:w.create({parent:this,fieldKey:20,fieldName:"time",deprecated:!1,pointerRules:{accepts:[u.ParameterController],mandatory:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",500)}}};var Wf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="ModuleMultiplierBox";constructor(e){super(e)}accept(e){return _(e.visitModuleMultiplierBox,this)}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:ei.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),12:W.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),20:w.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:h},"unipolar","%")}}};var Zf=class r extends N{static create(e,t,i){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[u.Selection],mandatory:!1}}),i)}static ClassName="ModuleGainBox";constructor(e){super(e)}accept(e){return _(e.visitModuleGainBox,this)}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:ei.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:h}),10:W.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),12:W.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[u.VoltageConnection],mandatory:!1}}),20:w.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[u.ParameterController],mandatory:!1}},"decibel","dB")}}};var dn;(function(r){r.write=(e,t)=>{if(t.type==="none")e.disconnect(),e.setValue(0);else if(t.type==="linear")e.disconnect(),e.setValue(1);else if(t.type==="curve"){e.setValue(0);let i=e.pointerHub.filter(u.ValueInterpolation).at(0)?.box;Z(i)?(xx(i,$o),i.slope.setValue(t.slope)):$o.create(e.box.graph,A.generate(),n=>{n.slope.setValue(t.slope),n.event.refer(e)})}},r.read=e=>{let t=e.pointerHub.incoming().at(0)?.box;return Z(t)?(xx(t,$o),{type:"curve",slope:t.slope.getValue()}):e.getValue()===0?So.None:e.getValue()===1?So.Linear:F("Unknown Interpolation value")}})(dn||(dn={}));var Ro=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Re=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Qc,Sl,pt,Yc,Oo,Xc,Yn=class r{constructor(e,t){this.type="value-event",Qc.set(this,new U),Sl.set(this,void 0),pt.set(this,void 0),Yc.set(this,void 0),Oo.set(this,void 0),Xc.set(this,!1),Ro(this,Sl,e,"f"),Ro(this,pt,t,"f"),Ro(this,Yc,Re(this,Qc,"f").own(new Uh(()=>dn.read(Re(this,pt,"f").interpolation))),"f");let i=()=>{Re(this,Yc,"f").invalidate(),this.collection.ifSome(n=>n.onEventPropertyChanged())};Re(this,Qc,"f").ownAll(Re(this,pt,"f").subscribe(ke.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let o=this.collection.unwrap(),a=n.address.fieldKeys,s=R.equals(Re(this,pt,"f").index.address.fieldKeys,a),l=R.equals(Re(this,pt,"f").position.address.fieldKeys,a);s||l?o.requestSorting():o.onEventPropertyChanged()}}),Re(this,pt,"f").interpolation.subscribe(i),Re(this,pt,"f").interpolation.pointerHub.subscribe({onAdded:({box:n})=>{Re(this,Oo,"f").terminate(),Ro(this,Oo,n.subscribe(ke.Children,i),"f"),i()},onRemoved:()=>{Re(this,Oo,"f").terminate(),Ro(this,Oo,K.Empty,"f"),i()}})),Ro(this,Oo,Re(this,pt,"f").interpolation.pointerHub.filter(u.ValueInterpolation).at(0)?.box.subscribe(ke.Children,i)??K.Empty,"f")}onSelected(){Ro(this,Xc,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Ro(this,Xc,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Re(this,Oo,"f").terminate(),Re(this,Qc,"f").terminate()}get box(){return Re(this,pt,"f")}get uuid(){return Re(this,pt,"f").address.uuid}get address(){return Re(this,pt,"f").address}get position(){return Re(this,pt,"f").position.getValue()}get index(){return Re(this,pt,"f").index.getValue()}set interpolation(e){dn.write(Re(this,pt,"f").interpolation,e)}get interpolation(){return Re(this,Yc,"f").get()}get value(){return Re(this,pt,"f").value.getValue()}get isSelected(){return Re(this,Xc,"f")}get collection(){return Re(this,pt,"f").events.targetVertex.map(e=>Re(this,Sl,"f").boxAdapters.adapterFor(e.box,sr))}copyTo(e){let t=ko.create(Re(this,Sl,"f").boxGraph,A.generate(),i=>{i.position.setValue(e?.position??this.position),i.index.setValue(e?.index??this.index),i.events.refer(e?.events??this.collection.unwrap().box.events),i.value.setValue(e?.value??this.value)});return dn.write(t.interpolation,e?.interpolation??this.interpolation),Re(this,Sl,"f").boxAdapters.adapterFor(t,r)}copyFrom(e){return Re(this,pt,"f").position.setValue(e?.position??this.position),Re(this,pt,"f").index.setValue(e?.index??this.index),Re(this,pt,"f").events.refer(e?.events??this.collection.unwrap().box.events),Re(this,pt,"f").value.setValue(e?.value??this.value),dn.write(Re(this,pt,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};Qc=new WeakMap,Sl=new WeakMap,pt=new WeakMap,Yc=new WeakMap,Oo=new WeakMap,Xc=new WeakMap;Yn.Comparator=(r,e)=>{let t=r.position-e.position;if(t!==0)return t;let i=r.index-e.index;if(i!==0)return i;throw new Error(`${r} and ${e} are identical in terms of comparison`)};var ed=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Oe=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},td,rd,Vo,ti,Za,id,Xn,rm,sr=class r{constructor(e,t){td.add(this),rd.set(this,new U),Vo.set(this,void 0),ti.set(this,void 0),Za.set(this,void 0),id.set(this,void 0),Xn.set(this,void 0),ed(this,Vo,e,"f"),ed(this,ti,t,"f"),ed(this,Za,new te,"f"),ed(this,id,A.newSet(n=>n.uuid),"f"),ed(this,Xn,xr.create(Yn.Comparator),"f");let i=n=>{let o=ee(n.accept({visitValueEventBox:a=>Oe(this,Vo,"f").boxAdapters.adapterFor(a,Yn)}),`Could not find adapter for ${n}`);Oe(this,id,"f").add(o)&&(Oe(this,Xn,"f").add(o),Oe(this,td,"m",rm).call(this))};Oe(this,ti,"f").events.pointerHub.incoming().forEach(({box:n})=>i(n)),Oe(this,rd,"f").own(Oe(this,ti,"f").events.pointerHub.subscribe({onAdded:({box:n})=>i(n),onRemoved:({box:{address:{uuid:n}}})=>{Oe(this,Xn,"f").remove(Oe(this,id,"f").removeByKey(n)),Oe(this,td,"m",rm).call(this)}})),Oe(this,rd,"f").own(Oe(this,ti,"f").owners.pointerHub.subscribe({onAdded:()=>Oe(this,Za,"f").notify(this),onRemoved:()=>Oe(this,Za,"f").notify(this)}))}valueAt(e,t){return sf.valueAt(Oe(this,Xn,"f"),e,t)}copy(){let e=Oe(this,Vo,"f").boxGraph,t=Qn.create(e,A.generate());return Oe(this,Xn,"f").asArray().forEach(i=>i.copyTo({events:t.events})),Oe(this,Vo,"f").boxAdapters.adapterFor(t,r)}cut(e){let t=this.events.lowerEqual(e),i=this.events.greaterEqual(e);if(i===null)return t===null?g.None:g.wrap(this.createEvent({position:e,value:t.value,index:t.index,interpolation:t.interpolation}));if(t===null)return g.wrap(this.createEvent({position:e,value:i.value,index:i.index,interpolation:i.interpolation}));if(t.position===e)return g.wrap(t);if(t.interpolation.type==="none")return g.wrap(this.createEvent({position:e,value:t.value,index:t.index,interpolation:t.interpolation}));if(t.interpolation.type==="linear"){let{position:n,value:o}=t,{position:a,value:s}=i;return g.wrap(this.createEvent({position:e,value:jh(o,s,(e-n)/(a-n)),index:0,interpolation:t.interpolation}))}if(t.interpolation.type==="curve"){let{position:n,value:o}=t,{position:a,value:s}=i,l=a-n,c=e-n,p=Qr.byHalf(l,o,Qr.valueAt({slope:t.interpolation.slope,steps:l,y0:o,y1:s},l*.5),s),d=Qr.valueAt(p,c),f=Qr.slopeByHalf(o,Qr.valueAt(p,c*.5),d);return dn.write(t.box.interpolation,So.Curve(f)),g.wrap(this.createEvent({position:e,value:d,index:0,interpolation:So.Curve(Qr.slopeByHalf(d,Qr.valueAt(p,(c+l)*.5),s))}))}return F("Unknown interpolation type")}subscribeChange(e){return Oe(this,Za,"f").subscribe(e)}createEvent({position:e,index:t,value:i,interpolation:n}){let o=ko.create(Oe(this,Vo,"f").boxGraph,A.generate(),a=>{a.position.setValue(e),a.index.setValue(t),a.value.setValue(i),a.events.refer(Oe(this,ti,"f").events)});return dn.write(o.interpolation,n),Oe(this,Vo,"f").boxAdapters.adapterFor(o,Yn)}requestSorting(){Oe(this,Xn,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Oe(this,td,"m",rm).call(this)}terminate(){Oe(this,rd,"f").terminate()}get box(){return Oe(this,ti,"f")}get uuid(){return Oe(this,ti,"f").address.uuid}get address(){return Oe(this,ti,"f").address}get numOwners(){return Oe(this,ti,"f").owners.pointerHub.filter(u.ValueEventCollection).length}get events(){return Oe(this,Xn,"f")}toString(){return`{ValueEventCollectionBox ${A.toString(Oe(this,ti,"f").address.uuid)}}`}};rd=new WeakMap,Vo=new WeakMap,ti=new WeakMap,Za=new WeakMap,id=new WeakMap,Xn=new WeakMap,td=new WeakSet,rm=function(){Oe(this,Za,"f").notify(this)};var Ga=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},_e=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},qa,zo,Ha,Et,Ja,ad,nd,od,El,Uo=class{constructor(e,t){qa.add(this),this.type="value-clip",zo.set(this,new U),Ha.set(this,void 0),Et.set(this,void 0),Ja.set(this,void 0),ad.set(this,void 0),nd.set(this,void 0),od.set(this,K.Empty),Ga(this,Ha,e,"f"),Ga(this,Et,t,"f"),Ga(this,nd,!0,"f"),Ga(this,Ja,_e(this,zo,"f").own(new Ir(!1)),"f"),Ga(this,ad,_e(this,zo,"f").own(new te),"f"),_e(this,zo,"f").own(_e(this,Et,"f").pointerHub.subscribe({onAdded:()=>_e(this,qa,"m",El).call(this),onRemoved:()=>_e(this,qa,"m",El).call(this)})),_e(this,zo,"f").own(_e(this,Et,"f").subscribe(ke.Children,i=>_e(this,qa,"m",El).call(this))),_e(this,zo,"f").own(_e(this,Et,"f").events.catchupAndSubscribe(({targetVertex:i})=>{_e(this,od,"f").terminate(),Ga(this,od,i.match({none:()=>K.Empty,some:({box:n})=>_e(this,Ha,"f").boxAdapters.adapterFor(n,sr).subscribeChange(()=>_e(this,qa,"m",El).call(this))}),"f"),_e(this,qa,"m",El).call(this)})),Ga(this,nd,!1,"f")}valueAt(e,t){let i=this.optCollection;return i.isEmpty()?t:i.unwrap().valueAt(e%this.duration,t)}catchupAndSubscribeSelected(e){return _e(this,Ja,"f").catchupAndSubscribe(e)}subscribeChange(e){return _e(this,ad,"f").subscribe(e)}accept(e){return _(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&_e(this,Et,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:_e(this,Et,"f").events.targetVertex.unwrap();hl.create(_e(this,Ha,"f").boxGraph,A.generate(),i=>{i.index.setValue(this.indexField.getValue()),i.label.setValue(this.label),i.hue.setValue(this.hue),i.duration.setValue(this.duration),i.mute.setValue(this.mute),i.clips.refer(_e(this,Et,"f").clips.targetVertex.unwrap()),i.events.refer(t)})}onSelected(){_e(this,Ja,"f").setValue(!0)}onDeselected(){_e(this,Ja,"f").setValue(!1)}get isSelected(){return _e(this,Ja,"f").getValue()}terminate(){_e(this,od,"f").terminate(),_e(this,zo,"f").terminate()}get box(){return _e(this,Et,"f")}get uuid(){return _e(this,Et,"f").address.uuid}get address(){return _e(this,Et,"f").address}get indexField(){return _e(this,Et,"f").index}get duration(){return _e(this,Et,"f").duration.getValue()}get mute(){return _e(this,Et,"f").mute.getValue()}get hue(){return _e(this,Et,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return _e(this,Et,"f").events.targetVertex.map(e=>_e(this,Ha,"f").boxAdapters.adapterFor(e.box,sr))}get label(){return _e(this,Et,"f").label.getValue()}get trackBoxAdapter(){return _e(this,nd,"f")?g.None:_e(this,Et,"f").clips.targetVertex.map(e=>_e(this,Ha,"f").boxAdapters.adapterFor(e.box,gt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${A.toString(_e(this,Et,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};zo=new WeakMap,Ha=new WeakMap,Et=new WeakMap,Ja=new WeakMap,ad=new WeakMap,nd=new WeakMap,od=new WeakMap,qa=new WeakSet,El=function(){_e(this,ad,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var $P=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Bl=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Lx,Qa,im,Fl=class{constructor(e){this.type="transient-marker",Lx.set(this,new U),Qa.set(this,void 0),im.set(this,void 0),$P(this,Qa,e,"f"),$P(this,im,new te,"f")}get box(){return Bl(this,Qa,"f")}get uuid(){return Bl(this,Qa,"f").address.uuid}get address(){return Bl(this,Qa,"f").address}get position(){return Bl(this,Qa,"f").position.getValue()}subscribe(e){return Bl(this,im,"f").subscribe(e)}terminate(){Bl(this,Lx,"f").terminate()}};Lx=new WeakMap,Qa=new WeakMap,im=new WeakMap;var sd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Lt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},nm,ld,pn,ud,Nl,om,Ri=class r{constructor(e,t){nm.set(this,new U),ld.set(this,void 0),pn.set(this,void 0),ud.set(this,void 0),Nl.set(this,void 0),om.set(this,void 0),sd(this,ld,e,"f"),sd(this,pn,t,"f"),sd(this,ud,A.newSet(({uuid:i})=>i),"f"),sd(this,Nl,xr.create(r.Comparator),"f"),sd(this,om,hf.memoizeAsync(async()=>{if(this.data.nonEmpty())return this.data.unwrap();let{promise:i,resolve:n,reject:o}=Promise.withResolvers(),a=this.getOrCreateLoader(),s=a.subscribe(l=>{l.type==="loaded"?(s.terminate(),n(a.data.unwrap("State mismatch"))):l.type==="error"&&(s.terminate(),o(l.reason))});return i}),"f"),Lt(this,nm,"f").own(t.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:i=>{let n=Lt(this,ld,"f").boxAdapters.adapterFor(i.box,Fl);Lt(this,ud,"f").add(n)&&Lt(this,Nl,"f").add(n)},onRemoved:({box:{address:{uuid:i}}})=>{Lt(this,Nl,"f").remove(Lt(this,ud,"f").removeByKey(i))}}))}get box(){return Lt(this,pn,"f")}get uuid(){return Lt(this,pn,"f").address.uuid}get address(){return Lt(this,pn,"f").address}get startInSeconds(){return Lt(this,pn,"f").startInSeconds.getValue()}get endInSeconds(){return Lt(this,pn,"f").endInSeconds.getValue()}get transients(){return Lt(this,Nl,"f")}get fileName(){return Lt(this,pn,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return Lt(this,om,"f").call(this)}getOrCreateLoader(){return Lt(this,ld,"f").sampleManager.getOrCreate(Lt(this,pn,"f").address.uuid)}terminate(){Lt(this,nm,"f").terminate()}};nm=new WeakMap,ld=new WeakMap,pn=new WeakMap,ud=new WeakMap,Nl=new WeakMap,om=new WeakMap;Ri.Comparator=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),F("Events at the same position: "+r.position+", "+e.position)):t};var cd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},lr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},dd,am,sm,eo,hd,pd,lm,jo=class{constructor(e,t){dd.add(this),this.type="warp-marker",am.set(this,new U),sm.set(this,void 0),eo.set(this,void 0),hd.set(this,void 0),pd.set(this,!1),cd(this,sm,e,"f"),cd(this,eo,t,"f"),cd(this,hd,new te,"f"),lr(this,am,"f").own(t.subscribe(ke.Children,()=>lr(this,dd,"m",lm).call(this)))}onSelected(){cd(this,pd,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),lr(this,dd,"m",lm).call(this)}onDeselected(){cd(this,pd,!1,"f"),lr(this,dd,"m",lm).call(this)}get box(){return lr(this,eo,"f")}get uuid(){return lr(this,eo,"f").address.uuid}get address(){return lr(this,eo,"f").address}get position(){return lr(this,eo,"f").position.getValue()}get seconds(){return lr(this,eo,"f").seconds.getValue()}get isSelected(){return lr(this,pd,"f")}get optWarping(){return lr(this,eo,"f").owner.targetVertex.map(e=>lr(this,sm,"f").boxAdapters.adapterFor(e.box,hn.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return lr(this,hd,"f").subscribe(e)}terminate(){lr(this,am,"f").terminate()}};am=new WeakMap,sm=new WeakMap,eo=new WeakMap,hd=new WeakMap,pd=new WeakMap,dd=new WeakSet,lm=function(){lr(this,hd,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var um=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),F("Events at the same position: "+r.position+", "+e.position)):t};var fd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ur=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},cm,dm,kl,Ya,md,$l,fn=class{constructor(e,t){cm.set(this,new U),dm.set(this,void 0),kl.set(this,void 0),Ya.set(this,void 0),md.set(this,void 0),$l.set(this,void 0),fd(this,dm,e,"f"),fd(this,kl,t,"f"),fd(this,Ya,new te,"f"),fd(this,md,A.newSet(({uuid:i})=>i),"f"),fd(this,$l,xr.create(um),"f"),ur(this,cm,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:i=>{let n=ur(this,dm,"f").boxAdapters.adapterFor(i.box,jo);ur(this,md,"f").add(n)&&(ur(this,$l,"f").add(n),ur(this,Ya,"f").notify())},onRemoved:({box:{address:{uuid:i}}})=>{ur(this,$l,"f").remove(ur(this,md,"f").removeByKey(i)),ur(this,Ya,"f").notify()}}))}get box(){return ur(this,kl,"f")}get uuid(){return ur(this,kl,"f").address.uuid}get address(){return ur(this,kl,"f").address}get warpMarkers(){return ur(this,$l,"f")}subscribe(e){return ur(this,Ya,"f").subscribe(e)}onChanged(){ur(this,Ya,"f").notify()}terminate(){ur(this,cm,"f").terminate()}};cm=new WeakMap,dm=new WeakMap,kl=new WeakMap,Ya=new WeakMap,md=new WeakMap,$l=new WeakMap;var gd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Mt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},pm,hm,mn,Xa,vd,Ml,gn=class{constructor(e,t){pm.set(this,new U),hm.set(this,void 0),mn.set(this,void 0),Xa.set(this,void 0),vd.set(this,void 0),Ml.set(this,void 0),gd(this,hm,e,"f"),gd(this,mn,t,"f"),gd(this,Xa,new te,"f"),gd(this,vd,A.newSet(({uuid:i})=>i),"f"),gd(this,Ml,xr.create(um),"f"),Mt(this,pm,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:i=>{let n=Mt(this,hm,"f").boxAdapters.adapterFor(i.box,jo);Mt(this,vd,"f").add(n)&&(Mt(this,Ml,"f").add(n),Mt(this,Xa,"f").notify())},onRemoved:({box:{address:{uuid:i}}})=>{Mt(this,Ml,"f").remove(Mt(this,vd,"f").removeByKey(i)),Mt(this,Xa,"f").notify()}}))}get box(){return Mt(this,mn,"f")}get uuid(){return Mt(this,mn,"f").address.uuid}get address(){return Mt(this,mn,"f").address}get warpMarkers(){return Mt(this,Ml,"f")}get playbackRate(){return Mt(this,mn,"f").playbackRate.getValue()}get cents(){return Math.log2(Mt(this,mn,"f").playbackRate.getValue())*1200}set cents(e){Mt(this,mn,"f").playbackRate.setValue(le(2**(e/1200),.5,2))}get transientPlayMode(){return Hr(Mt(this,mn,"f").transientPlayMode.getValue(),Bo)}subscribe(e){return Mt(this,Xa,"f").subscribe(e)}onChanged(){Mt(this,Xa,"f").notify()}terminate(){Mt(this,pm,"f").terminate()}};pm=new WeakMap,hm=new WeakMap,mn=new WeakMap,Xa=new WeakMap,vd=new WeakMap,Ml=new WeakMap;var hn;(function(r){r.isAudioPlayMode=e=>e instanceof fn||e instanceof gn})(hn||(hn={}));var Tr=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ae=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},es,Dl,ts,ct,Il,rs,yd,wd,xd,is,Cl,Tl,Rl,to=class r{constructor(e,t){es.add(this),this.type="audio-clip",Dl.set(this,new U),ts.set(this,void 0),ct.set(this,void 0),Il.set(this,void 0),rs.set(this,void 0),yd.set(this,void 0),wd.set(this,void 0),xd.set(this,void 0),is.set(this,g.None),Cl.set(this,g.None),Tl.set(this,K.Empty),Tr(this,ts,e,"f"),Tr(this,ct,t,"f"),Tr(this,xd,!0,"f"),Tr(this,Il,new Yr,"f"),Tr(this,rs,ae(this,Dl,"f").own(new Ir(!1)),"f"),Tr(this,yd,Po.aware(e.tempoMap,t.timeBase,r.STATIC_POSITION,t.duration),"f"),Tr(this,wd,ae(this,Dl,"f").own(new te),"f"),ae(this,Dl,"f").ownAll(ae(this,ct,"f").pointerHub.subscribe({onAdded:()=>ae(this,es,"m",Rl).call(this),onRemoved:()=>ae(this,es,"m",Rl).call(this)}),ae(this,ct,"f").playMode.catchupAndSubscribe(({targetVertex:i})=>{ae(this,Tl,"f").terminate(),i.match({none:()=>ae(this,Il,"f").clear(),some:({box:n})=>{let o=ae(this,ts,"f").boxAdapters.adapterFor(n,hn.isAudioPlayMode);Tr(this,Tl,o.subscribe(()=>ae(this,es,"m",Rl).call(this)),"f"),ae(this,Il,"f").wrap(o)}})}),ae(this,ct,"f").file.catchupAndSubscribe(i=>{Tr(this,is,i.targetVertex.map(n=>ae(this,ts,"f").boxAdapters.adapterFor(n.box,Ri)),"f"),ae(this,Cl,"f").ifSome(n=>n.terminate()),Tr(this,Cl,ae(this,is,"f").map(n=>n.getOrCreateLoader().subscribe(()=>ae(this,es,"m",Rl).call(this))),"f")}),ae(this,ct,"f").subscribe(ke.Children,i=>ae(this,es,"m",Rl).call(this))),Tr(this,xd,!1,"f")}catchupAndSubscribeSelected(e){return ae(this,rs,"f").catchupAndSubscribe(e)}subscribeChange(e){return ae(this,wd,"f").subscribe(e)}accept(e){return _(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){fl.create(ae(this,ts,"f").boxGraph,A.generate(),t=>{t.index.setValue(this.indexField.getValue()),t.gain.setValue(this.gain.getValue()),t.timeBase.setValue(this.timeBase),t.label.setValue(this.label),t.hue.setValue(this.hue),t.duration.setValue(this.duration),t.mute.setValue(this.mute),t.clips.refer(ae(this,ct,"f").clips.targetVertex.unwrap()),t.file.refer(ae(this,ct,"f").file.targetVertex.unwrap()),t.events.refer(ae(this,ct,"f").events.targetVertex.unwrap()),ae(this,ct,"f").playMode.ifVertex(i=>t.playMode.refer(i.box))})}onSelected(){ae(this,rs,"f").setValue(!0)}onDeselected(){ae(this,rs,"f").setValue(!1)}get isSelected(){return ae(this,rs,"f").getValue()}get box(){return ae(this,ct,"f")}get uuid(){return ae(this,ct,"f").address.uuid}get address(){return ae(this,ct,"f").address}get indexField(){return ae(this,ct,"f").index}get duration(){return ae(this,yd,"f").toPPQN()}set duration(e){ae(this,yd,"f").fromPPQN(e)}get mute(){return ae(this,ct,"f").mute.getValue()}get hue(){return ae(this,ct,"f").hue.getValue()}get gain(){return ae(this,ct,"f").gain}get file(){return ae(this,is,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return ae(this,Il,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return g.None}get timeBase(){return Hr(ae(this,ct,"f").timeBase.getValue(),or)}get waveformOffset(){return ae(this,ct,"f").waveformOffset}get isPlayModeNoStretch(){return ae(this,ct,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>Te(e,fn)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Te(e,gn)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>hn.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(ae(this,is,"f").isEmpty())return"No Audio File";let e=ae(this,is,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):ae(this,ct,"f").label.getValue()}get trackBoxAdapter(){return ae(this,xd,"f")?g.None:ae(this,ct,"f").clips.targetVertex.map(e=>ae(this,ts,"f").boxAdapters.adapterFor(e.box,gt))}get isMirrowed(){return!1}get canMirror(){return!1}terminate(){ae(this,Cl,"f").ifSome(e=>e.terminate()),Tr(this,Cl,g.None,"f"),ae(this,Tl,"f").terminate(),Tr(this,Tl,K.Empty,"f"),ae(this,Dl,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${A.toString(ae(this,ct,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};Dl=new WeakMap,ts=new WeakMap,ct=new WeakMap,Il=new WeakMap,rs=new WeakMap,yd=new WeakMap,wd=new WeakMap,xd=new WeakMap,is=new WeakMap,Cl=new WeakMap,Tl=new WeakMap,es=new WeakSet,Rl=function(){ae(this,wd,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};to.STATIC_POSITION={getValue:()=>0};var bd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},xt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ol,Dt,fm,Ad,ns=class r{constructor(e,t){this.type="note-event",Ol.set(this,void 0),Dt.set(this,void 0),fm.set(this,void 0),Ad.set(this,!1),bd(this,Ol,e,"f"),bd(this,Dt,t,"f"),bd(this,fm,xt(this,Dt,"f").subscribe(ke.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.collection.unwrap(),o=i.address.fieldKeys,a=R.equals(xt(this,Dt,"f").pitch.address.fieldKeys,o),s=R.equals(xt(this,Dt,"f").position.address.fieldKeys,o);a||s?n.requestSorting():n.onEventPropertyChanged()}}),"f")}onSelected(){bd(this,Ad,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){bd(this,Ad,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){xt(this,fm,"f").terminate()}get box(){return xt(this,Dt,"f")}get uuid(){return xt(this,Dt,"f").address.uuid}get address(){return xt(this,Dt,"f").address}get position(){return xt(this,Dt,"f").position.getValue()}get duration(){return xt(this,Dt,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return xt(this,Dt,"f").velocity.getValue()}get pitch(){return xt(this,Dt,"f").pitch.getValue()}get cent(){return xt(this,Dt,"f").cent.getValue()}get chance(){return xt(this,Dt,"f").chance.getValue()}get playCount(){return xt(this,Dt,"f").playCount.getValue()}get playCurve(){return xt(this,Dt,"f").playCurve.getValue()}get isSelected(){return xt(this,Ad,"f")}get collection(){return xt(this,Dt,"f").events.targetVertex.map(e=>xt(this,Ol,"f").boxAdapters.adapterFor(e.box,ri))}normalizedPitch(){if(this.collection.isEmpty())return .5;let{minPitch:e,maxPitch:t}=this.collection.unwrap();return e===t?.5:1-(this.pitch-e)/(t-e)}copyAsNoteEvent(){return{type:"note-event",position:this.position,duration:this.duration,pitch:this.pitch,cent:this.cent,velocity:this.velocity}}copyTo(e){return xt(this,Ol,"f").boxAdapters.adapterFor(No.create(xt(this,Ol,"f").boxGraph,A.generate(),t=>{t.position.setValue(e?.position??this.position),t.duration.setValue(e?.duration??this.duration),t.pitch.setValue(e?.pitch??this.pitch),t.playCount.setValue(e?.playCount??this.playCount),t.events.refer(e?.events??this.collection.unwrap().box.events),t.velocity.setValue(this.velocity),t.cent.setValue(this.cent),t.chance.setValue(this.chance)}),r)}computeCurveValue(e){return nr.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,t=this.collection.unwrap().box.events,i=R.create(n=>{let o=Math.floor(this.computeCurveValue(n/e)*this.duration),a=Math.floor(this.computeCurveValue((n+1)/e)*this.duration);return this.copyTo({position:Math.floor(this.position+o),duration:Math.max(1,a-o),playCount:1,events:t})},e);return xt(this,Dt,"f").delete(),i}};Ol=new WeakMap,Dt=new WeakMap,fm=new WeakMap,Ad=new WeakMap;var vn=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ge=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ro,_d,Lo,Oi,os,Pd,ii,gm,vm,ym,Ko,mm,Sd,ri=class r{constructor(e,t){ro.add(this),_d.set(this,new U),Lo.set(this,void 0),Oi.set(this,void 0),os.set(this,void 0),Pd.set(this,void 0),ii.set(this,void 0),gm.set(this,60),vm.set(this,60),ym.set(this,0),Ko.set(this,!1),vn(this,Lo,e,"f"),vn(this,Oi,t,"f"),vn(this,os,new te,"f"),vn(this,Pd,A.newSet(i=>i.uuid),"f"),vn(this,ii,xr.create(nr.Comparator),"f"),ge(this,_d,"f").own(ge(this,Oi,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:i})=>{let n=ge(this,Lo,"f").boxAdapters.adapterFor(i,ns);ge(this,Pd,"f").add(n)&&(ge(this,ii,"f").add(n),ge(this,ro,"m",mm).call(this))},onRemoved:({box:{address:{uuid:i}}})=>{ge(this,ii,"f").remove(ge(this,Pd,"f").removeByKey(i)),ge(this,ro,"m",mm).call(this)}})),ge(this,_d,"f").own(ge(this,Oi,"f").owners.pointerHub.subscribe({onAdded:()=>ge(this,os,"f").notify(this),onRemoved:()=>ge(this,os,"f").notify(this)}))}copy(){let e=ge(this,Lo,"f").boxGraph,t=Jn.create(e,A.generate());return ge(this,ii,"f").asArray().forEach(i=>i.copyTo({events:t.events})),ge(this,Lo,"f").boxAdapters.adapterFor(t,r)}createEvent({position:e,duration:t,velocity:i,pitch:n,chance:o,playCount:a,cent:s}){return ge(this,Lo,"f").boxAdapters.adapterFor(No.create(ge(this,Lo,"f").boxGraph,A.generate(),l=>{l.position.setValue(e),l.duration.setValue(t),l.velocity.setValue(i),l.pitch.setValue(n),l.chance.setValue(o),l.playCount.setValue(a),l.cent.setValue(s),l.events.refer(ge(this,Oi,"f").events)}),ns)}subscribeChange(e){return ge(this,os,"f").subscribe(e)}selectable(){return ge(this,ii,"f").asArray()}selectableAt(e){for(let t of ge(this,ii,"f").asArray())if(t.position<=e.u&&e.u<t.complete&&t.pitch===e.v)return Xe.one(t);return Xe.empty()}selectablesBetween(e,t){let i=[];for(let n of ge(this,ii,"f").asArray())Ic.intersect1D(n.position,n.complete,e.u,t.u)&&Ic.intersect1D(n.pitch,n.pitch,e.v,t.v)&&i.push(n);return i}requestSorting(){ge(this,ii,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){ge(this,ro,"m",mm).call(this)}terminate(){ge(this,_d,"f").terminate()}get box(){return ge(this,Oi,"f")}get uuid(){return ge(this,Oi,"f").address.uuid}get address(){return ge(this,Oi,"f").address}get numOwners(){return ge(this,Oi,"f").owners.pointerHub.filter(u.NoteEventCollection).length}get events(){return ge(this,Ko,"f")||ge(this,ro,"m",Sd).call(this),ge(this,ii,"f")}get minPitch(){return ge(this,Ko,"f")||ge(this,ro,"m",Sd).call(this),ge(this,gm,"f")}get maxPitch(){return ge(this,Ko,"f")||ge(this,ro,"m",Sd).call(this),ge(this,vm,"f")}get maxDuration(){return ge(this,Ko,"f")||ge(this,ro,"m",Sd).call(this),ge(this,ym,"f")}toString(){return`{NoteEventCollectionBox ${A.toString(ge(this,Oi,"f").address.uuid)}}`}};_d=new WeakMap,Lo=new WeakMap,Oi=new WeakMap,os=new WeakMap,Pd=new WeakMap,ii=new WeakMap,gm=new WeakMap,vm=new WeakMap,ym=new WeakMap,Ko=new WeakMap,ro=new WeakSet,mm=function(){vn(this,Ko,!1,"f"),ge(this,os,"f").notify(this)},Sd=function(){let e=127,t=0,i=0;ge(this,ii,"f").asArray().forEach(({pitch:n,duration:o})=>{e=Math.min(e,n),t=Math.max(t,n),i=Math.max(i,o)}),vn(this,gm,e,"f"),vn(this,vm,t,"f"),vn(this,ym,i,"f"),vn(this,Ko,!0,"f")};var as=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ee=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ss,Vl,ls,Bt,us,Fd,Ed,Bd,zl,Ul=class{constructor(e,t){ss.add(this),this.type="note-clip",Vl.set(this,new U),ls.set(this,void 0),Bt.set(this,void 0),us.set(this,void 0),Fd.set(this,void 0),Ed.set(this,void 0),Bd.set(this,K.Empty),as(this,ls,e,"f"),as(this,Bt,t,"f"),as(this,Ed,!0,"f"),as(this,us,Ee(this,Vl,"f").own(new Ir(!1)),"f"),as(this,Fd,Ee(this,Vl,"f").own(new te),"f"),Ee(this,Vl,"f").ownAll(Ee(this,Bt,"f").pointerHub.subscribe({onAdded:()=>Ee(this,ss,"m",zl).call(this),onRemoved:()=>Ee(this,ss,"m",zl).call(this)}),Ee(this,Bt,"f").subscribe(ke.Children,i=>Ee(this,ss,"m",zl).call(this)),Ee(this,Bt,"f").events.catchupAndSubscribe(({targetVertex:i})=>{Ee(this,Bd,"f").terminate(),as(this,Bd,i.match({none:()=>K.Empty,some:({box:n})=>Ee(this,ls,"f").boxAdapters.adapterFor(n,ri).subscribeChange(()=>Ee(this,ss,"m",zl).call(this))}),"f"),Ee(this,ss,"m",zl).call(this)})),as(this,Ed,!1,"f")}catchupAndSubscribeSelected(e){return Ee(this,us,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ee(this,Fd,"f").subscribe(e)}accept(e){return _(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ee(this,Bt,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:Ee(this,Bt,"f").events.targetVertex.unwrap();pl.create(Ee(this,ls,"f").boxGraph,A.generate(),i=>{i.index.setValue(this.indexField.getValue()),i.label.setValue(this.label),i.hue.setValue(this.hue),i.duration.setValue(this.duration),i.mute.setValue(this.mute),i.clips.refer(Ee(this,Bt,"f").clips.targetVertex.unwrap()),i.events.refer(t)})}onSelected(){Ee(this,us,"f").setValue(!0)}onDeselected(){Ee(this,us,"f").setValue(!1)}get isSelected(){return Ee(this,us,"f").getValue()}terminate(){Ee(this,Bd,"f").terminate(),Ee(this,Vl,"f").terminate()}get box(){return Ee(this,Bt,"f")}get uuid(){return Ee(this,Bt,"f").address.uuid}get address(){return Ee(this,Bt,"f").address}get indexField(){return Ee(this,Bt,"f").index}get duration(){return Ee(this,Bt,"f").duration.getValue()}get mute(){return Ee(this,Bt,"f").mute.getValue()}get hue(){return Ee(this,Bt,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return Ee(this,Bt,"f").events.targetVertex.map(e=>Ee(this,ls,"f").boxAdapters.adapterFor(e.box,ri))}get label(){return Ee(this,Bt,"f").label.getValue()}get trackBoxAdapter(){return Ee(this,Ed,"f")?g.None:Ee(this,Bt,"f").clips.targetVertex.map(e=>Ee(this,ls,"f").boxAdapters.adapterFor(e.box,gt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${A.toString(Ee(this,Bt,"f").address.uuid)} d: ${Q.toString(this.duration)}}`}};Vl=new WeakMap,ls=new WeakMap,Bt=new WeakMap,us=new WeakMap,Fd=new WeakMap,Ed=new WeakMap,Bd=new WeakMap,ss=new WeakSet,zl=function(){Ee(this,Fd,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var xm={for:(r,e)=>ee(e.accept({visitNoteClipBox:t=>r.adapterFor(t,Ul),visitValueClipBox:t=>r.adapterFor(t,Uo),visitAudioClipBox:t=>r.adapterFor(t,to)}),"")};var wm=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Wo=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},bm,jl,Nd,kd,Am=class{constructor(e,t){bm.set(this,void 0),jl.set(this,void 0),Nd.set(this,void 0),kd.set(this,void 0),wm(this,bm,e,"f"),wm(this,jl,new U,"f"),wm(this,Nd,Wo(this,jl,"f").own(new te),"f"),wm(this,kd,Wo(this,jl,"f").own(jt.create(e.box.clips,i=>xm.for(t,i),u.ClipCollection)),"f"),Wo(this,kd,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return Wo(this,bm,"f")}get collection(){return Wo(this,kd,"f")}dispatchChange(){Wo(this,Nd,"f").notify()}subscribeChanges(e){return Wo(this,Nd,"f").subscribe(e)}terminate(){Wo(this,jl,"f").terminate()}};bm=new WeakMap,jl=new WeakMap,Nd=new WeakMap,kd=new WeakMap;var vt=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},q=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Rr,$d,yn,Le,Md,Dd,Id,Ll,Cd,Td,cs,Kl,Wl,Zl,Gl,ql,ni,Zo=class r{constructor(e,t){Rr.add(this),this.type="audio-region",$d.set(this,void 0),yn.set(this,void 0),Le.set(this,void 0),Md.set(this,void 0),Dd.set(this,void 0),Id.set(this,void 0),Ll.set(this,void 0),Cd.set(this,void 0),Td.set(this,void 0),cs.set(this,g.None),Kl.set(this,K.Empty),Wl.set(this,K.Empty),Zl.set(this,K.Empty),Gl.set(this,K.Empty),ql.set(this,void 0),vt(this,yn,e,"f"),vt(this,Le,t,"f"),vt(this,$d,new U,"f");let{timeBase:i,position:n,duration:o,loopOffset:a,loopDuration:s}=t;vt(this,Md,Po.aware(e.tempoMap,i,n,o),"f"),vt(this,Dd,Po.aware(e.tempoMap,i,n,a),"f"),vt(this,Id,Po.aware(e.tempoMap,i,n,s),"f"),vt(this,Ll,new Yr,"f"),vt(this,Cd,new te,"f"),vt(this,ql,!1,"f"),vt(this,Td,!0,"f"),q(this,$d,"f").ownAll(q(this,Le,"f").pointerHub.subscribe({onAdded:()=>q(this,Rr,"m",ni).call(this),onRemoved:()=>q(this,Rr,"m",ni).call(this)}),q(this,Le,"f").file.catchupAndSubscribe(l=>{vt(this,cs,l.targetVertex.map(c=>q(this,yn,"f").boxAdapters.adapterFor(c.box,Ri)),"f"),q(this,Kl,"f").terminate(),vt(this,Kl,q(this,cs,"f").mapOr(c=>c.getOrCreateLoader().subscribe(()=>q(this,Rr,"m",ni).call(this)),K.Empty),"f")}),q(this,Le,"f").playMode.catchupAndSubscribe(({targetVertex:l})=>{q(this,Wl,"f").terminate(),l.match({none:()=>q(this,Ll,"f").clear(),some:({box:c})=>{let p=q(this,yn,"f").boxAdapters.adapterFor(c,hn.isAudioPlayMode);vt(this,Wl,p.subscribe(()=>q(this,Rr,"m",ni).call(this)),"f"),q(this,Ll,"f").wrap(p)}})}),q(this,Le,"f").timeBase.catchupAndSubscribe(l=>{q(this,Zl,"f").terminate(),Hr(l.getValue(),or)===or.Seconds&&vt(this,Zl,e.tempoMap.subscribe(()=>q(this,Rr,"m",ni).call(this)),"f")}),q(this,Le,"f").subscribe(ke.Children,l=>{if(!this.trackBoxAdapter.isEmpty()&&(l.type==="primitive"||l.type==="pointer")){let c=this.trackBoxAdapter.unwrap();q(this,Le,"f").position.address.equals(l.address)?(c.regions.onIndexingChanged(),q(this,Rr,"m",ni).call(this)):q(this,Rr,"m",ni).call(this)}}),q(this,Le,"f").events.catchupAndSubscribe(({targetVertex:l})=>{q(this,Gl,"f").terminate(),vt(this,Gl,l.match({none:()=>K.Empty,some:({box:c})=>q(this,yn,"f").boxAdapters.adapterFor(c,sr).subscribeChange(()=>q(this,Rr,"m",ni).call(this))}),"f"),q(this,Rr,"m",ni).call(this)})),vt(this,Td,!1,"f")}subscribeChange(e){return q(this,Cd,"f").subscribe(e)}accept(e){return _(e.visitAudioRegionBoxAdapter,this)}onSelected(){vt(this,ql,!0,"f"),q(this,Rr,"m",ni).call(this)}onDeselected(){vt(this,ql,!1,"f"),q(this,Rr,"m",ni).call(this)}get isSelected(){return q(this,ql,"f")}get box(){return q(this,Le,"f")}get uuid(){return q(this,Le,"f").address.uuid}get address(){return q(this,Le,"f").address}get position(){return q(this,Le,"f").position.getValue()}get duration(){return q(this,Md,"f").toPPQN()}get complete(){return this.position+this.duration}get loopOffset(){return q(this,Dd,"f").toPPQN()}get loopDuration(){return q(this,Id,"f").toPPQN()}get offset(){return this.position-this.loopOffset}get mute(){return q(this,Le,"f").mute.getValue()}get hue(){return q(this,Le,"f").hue.getValue()}get gain(){return q(this,Le,"f").gain}get file(){return q(this,cs,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return q(this,Ll,"f")}get timeBase(){return Hr(q(this,Le,"f").timeBase.getValue(),or)}get waveformOffset(){return q(this,Le,"f").waveformOffset}get isPlayModeNoStretch(){return q(this,Le,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>Te(e,fn)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Te(e,gn)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>hn.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(q(this,cs,"f").isEmpty())return"No Audio File";let e=q(this,cs,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):q(this,Le,"f").label.getValue()}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get trackBoxAdapter(){return q(this,Le,"f").regions.targetVertex.map(e=>q(this,yn,"f").boxAdapters.adapterFor(e.box,gt))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return q(this,Le,"f").events.targetVertex.map(e=>q(this,yn,"f").boxAdapters.adapterFor(e.box,sr))}set position(e){q(this,Le,"f").position.setValue(e)}set duration(e){q(this,Md,"f").fromPPQN(e)}set loopOffset(e){q(this,Dd,"f").fromPPQN(e)}set loopDuration(e){q(this,Id,"f").fromPPQN(e)}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),i=e?.consolidate===!0?t.copy().box.owners:t.box.owners,n=q(this,yn,"f").boxAdapters.adapterFor(Mo.create(q(this,yn,"f").boxGraph,A.generate(),o=>{o.timeBase.setValue(q(this,Le,"f").timeBase.getValue()),o.position.setValue(e?.position??q(this,Le,"f").position.getValue()),o.regions.refer(e?.track??q(this,Le,"f").regions.targetVertex.unwrap()),o.file.refer(q(this,Le,"f").file.targetVertex.unwrap()),o.events.refer(i),o.mute.setValue(this.mute),o.hue.setValue(this.hue),o.label.setValue(this.label),o.gain.setValue(this.gain.getValue()),q(this,Le,"f").playMode.ifVertex(a=>o.playMode.refer(a.box))}),r);return n.duration=e?.duration??this.duration,n.loopOffset=e?.loopOffset??this.loopOffset,n.loopDuration=e?.loopDuration??this.loopDuration,n}consolidate(){}canFlatten(e){return!1}flatten(e){return g.None}terminate(){q(this,Kl,"f").terminate(),vt(this,Kl,K.Empty,"f"),q(this,Zl,"f").terminate(),vt(this,Zl,K.Empty,"f"),q(this,Wl,"f").terminate(),vt(this,Wl,K.Empty,"f"),q(this,Gl,"f").terminate(),vt(this,Gl,K.Empty,"f"),q(this,$d,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${A.toString(q(this,Le,"f").address.uuid)}}`}};$d=new WeakMap,yn=new WeakMap,Le=new WeakMap,Md=new WeakMap,Dd=new WeakMap,Id=new WeakMap,Ll=new WeakMap,Cd=new WeakMap,Td=new WeakMap,cs=new WeakMap,Kl=new WeakMap,Wl=new WeakMap,Zl=new WeakMap,Gl=new WeakMap,ql=new WeakMap,Rr=new WeakSet,ni=function(){q(this,Td,"f")||(q(this,Cd,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var io=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},pe=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},xn,_m,wn,et,Vd,Rd,Hl,Od,no,Go=class r{constructor(e,t){xn.add(this),this.type="note-region",_m.set(this,new U),wn.set(this,void 0),et.set(this,void 0),Vd.set(this,void 0),Rd.set(this,void 0),Hl.set(this,void 0),Od.set(this,K.Empty),io(this,wn,e,"f"),io(this,et,t,"f"),io(this,Vd,new te,"f"),io(this,Hl,!1,"f"),io(this,Rd,!0,"f"),pe(this,_m,"f").ownAll(pe(this,et,"f").pointerHub.subscribe({onAdded:()=>pe(this,xn,"m",no).call(this),onRemoved:()=>pe(this,xn,"m",no).call(this)}),pe(this,et,"f").subscribe(ke.Children,i=>{if(!this.trackBoxAdapter.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.trackBoxAdapter.unwrap();pe(this,et,"f").position.address.equals(i.address)?(n.regions.onIndexingChanged(),pe(this,xn,"m",no).call(this)):pe(this,xn,"m",no).call(this)}}),pe(this,et,"f").events.catchupAndSubscribe(({targetVertex:i})=>{pe(this,Od,"f").terminate(),io(this,Od,i.match({none:()=>K.Empty,some:({box:n})=>pe(this,wn,"f").boxAdapters.adapterFor(n,ri).subscribeChange(()=>pe(this,xn,"m",no).call(this))}),"f"),pe(this,xn,"m",no).call(this)})),io(this,Rd,!1,"f")}set position(e){pe(this,et,"f").position.setValue(e)}set duration(e){pe(this,et,"f").duration.setValue(e)}set loopOffset(e){pe(this,et,"f").loopOffset.setValue(e)}set loopDuration(e){pe(this,et,"f").loopDuration.setValue(e)}subscribeChange(e){return pe(this,Vd,"f").subscribe(e)}accept(e){return _(e.visitNoteRegionBoxAdapter,this)}onSelected(){io(this,Hl,!0,"f"),pe(this,xn,"m",no).call(this)}onDeselected(){io(this,Hl,!1,"f"),pe(this,xn,"m",no).call(this)}get isSelected(){return pe(this,Hl,"f")}*iterateActiveNotesAt(e){let t=this.optCollection;if(t.isEmpty())return;let i=t.unwrap(),n=Gt.globalToLocal(this,e);for(let o of i.events.iterateFrom(n-i.maxDuration)){if(n<o.position)return;n<o.complete&&(yield o.copyAsNoteEvent())}}terminate(){pe(this,Od,"f").terminate(),pe(this,_m,"f").terminate()}get box(){return pe(this,et,"f")}get uuid(){return pe(this,et,"f").address.uuid}get address(){return pe(this,et,"f").address}get position(){return pe(this,et,"f").position.getValue()}get duration(){return pe(this,et,"f").duration.getValue()}get loopOffset(){return pe(this,et,"f").loopOffset.getValue()}get loopDuration(){return pe(this,et,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return pe(this,et,"f").mute.getValue()}get hue(){return pe(this,et,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return pe(this,et,"f").events.targetVertex.map(e=>pe(this,wn,"f").boxAdapters.adapterFor(e.box,ri))}get label(){return pe(this,et,"f").label.getValue()}get trackBoxAdapter(){return pe(this,Rd,"f")?g.None:pe(this,et,"f").regions.targetVertex.map(e=>pe(this,wn,"f").boxAdapters.adapterFor(e.box,gt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),i=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return pe(this,wn,"f").boxAdapters.adapterFor(La.create(pe(this,wn,"f").boxGraph,A.generate(),n=>{n.position.setValue(e?.position??this.position),n.duration.setValue(e?.duration??this.duration),n.loopOffset.setValue(e?.loopOffset??this.loopOffset),n.loopDuration.setValue(e?.loopDuration??this.loopDuration),n.hue.setValue(this.hue),n.label.setValue(this.label),n.mute.setValue(this.mute),n.events.refer(i),n.regions.refer(e?.track??pe(this,et,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let t=pe(this,wn,"f").boxGraph,i=Jn.create(t,A.generate());e.events.asArray().forEach(n=>n.copyTo({events:i.events})),pe(this,et,"f").events.refer(i.owners)})}canFlatten(e){return e.length>0&&R.satisfy(e,(t,i)=>t.trackBoxAdapter.contains(i.trackBoxAdapter.unwrap()))&&e.every(t=>t.isSelected&&t instanceof r)}flatten(e){if(!this.canFlatten(e))return g.None;let t=pe(this,wn,"f").boxGraph,i=e.toSorted(_o.Comparator),n=R.getFirst(i,"Internal error (no first)"),o=R.getLast(i,"Internal error (no last)"),a=n.position,s=o.position+o.duration,l=n.trackBoxAdapter.unwrap(),c=Jn.create(t,A.generate()),p=Array.from(l.regions.collection.iterateRange(a,s));return p.filter(d=>d.isSelected).forEach(d=>{let f=d;for(let{resultStart:v,resultEnd:m,rawStart:y}of Gt.locateLoops(f,f.position,f.complete)){let x=Math.floor(v-y),M=Math.floor(m-y);for(let D of f.optCollection.unwrap().events.iterateRange(x,M))D.copyTo({position:D.position+y-n.position,events:c.events})}}),p.forEach(({box:d})=>d.delete()),g.wrap(La.create(t,A.generate(),d=>{d.position.setValue(a),d.duration.setValue(s-a),d.loopDuration.setValue(s-a),d.loopOffset.setValue(0),d.hue.setValue(this.hue),d.mute.setValue(this.mute),d.label.setValue(this.label),d.events.refer(c.owners),d.regions.refer(l.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${A.toString(pe(this,et,"f").address.uuid)} p: ${Q.toString(this.position)}, c: ${Q.toString(this.complete)}}`}};_m=new WeakMap,wn=new WeakMap,et=new WeakMap,Vd=new WeakMap,Rd=new WeakMap,Hl=new WeakMap,Od=new WeakMap,xn=new WeakSet,no=function(){pe(this,Vd,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var oo=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ue=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Vi,Jl,bn,tt,jd,Ql,zd,Ud,An,ao=class r{constructor(e,t){Vi.add(this),this.type="value-region",Jl.set(this,new U),bn.set(this,void 0),tt.set(this,void 0),jd.set(this,void 0),Ql.set(this,void 0),zd.set(this,void 0),Ud.set(this,K.Empty),oo(this,bn,e,"f"),oo(this,tt,t,"f"),oo(this,zd,!0,"f"),oo(this,jd,new te,"f"),oo(this,Ql,!1,"f"),ue(this,Jl,"f").own(ue(this,tt,"f").pointerHub.subscribe({onAdded:()=>ue(this,Vi,"m",An).call(this),onRemoved:()=>ue(this,Vi,"m",An).call(this)})),ue(this,Jl,"f").own(ue(this,tt,"f").subscribe(ke.Children,i=>{if(!this.trackBoxAdapter.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.trackBoxAdapter.unwrap();ue(this,tt,"f").position.address.equals(i.address)?(n.regions.onIndexingChanged(),ue(this,Vi,"m",An).call(this)):ue(this,Vi,"m",An).call(this)}})),ue(this,Jl,"f").own(ue(this,tt,"f").events.catchupAndSubscribe(({targetVertex:i})=>{ue(this,Ud,"f").terminate(),oo(this,Ud,i.match({none:()=>K.Empty,some:({box:n})=>ue(this,bn,"f").boxAdapters.adapterFor(n,sr).subscribeChange(()=>ue(this,Vi,"m",An).call(this))}),"f"),ue(this,Vi,"m",An).call(this)})),oo(this,zd,!1,"f")}valueAt(e,t){let i=this.optCollection;return i.isEmpty()?t:i.unwrap().valueAt(Gt.globalToLocal(this,e),t)}incomingValue(e){return this.valueAt(this.position,e)}outgoingValue(e){let t=this.optCollection;if(t.isEmpty())return e;let i=t.unwrap();return(this.complete-this.offset)%this.loopDuration===0?i.valueAt(this.loopDuration,e):i.valueAt(Gt.globalToLocal(this,this.complete),e)}subscribeChange(e){return ue(this,jd,"f").subscribe(e)}accept(e){return _(e.visitValueRegionBoxAdapter,this)}onSelected(){oo(this,Ql,!0,"f"),ue(this,Vi,"m",An).call(this)}onDeselected(){oo(this,Ql,!1,"f"),ue(this,Vi,"m",An).call(this)}get isSelected(){return ue(this,Ql,"f")}onValuesPropertyChanged(){ue(this,Vi,"m",An).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){ue(this,Ud,"f").terminate(),ue(this,Jl,"f").terminate()}get box(){return ue(this,tt,"f")}get uuid(){return ue(this,tt,"f").address.uuid}get address(){return ue(this,tt,"f").address}get position(){return ue(this,tt,"f").position.getValue()}get duration(){return ue(this,tt,"f").duration.getValue()}get loopOffset(){return ue(this,tt,"f").loopOffset.getValue()}get loopDuration(){return ue(this,tt,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}get mute(){return ue(this,tt,"f").mute.getValue()}get hue(){return ue(this,tt,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return ue(this,tt,"f").events.targetVertex.map(e=>ue(this,bn,"f").boxAdapters.adapterFor(e.box,sr))}get label(){return ue(this,tt,"f").label.getValue()}get trackBoxAdapter(){return ue(this,zd,"f")?g.None:ue(this,tt,"f").regions.targetVertex.map(e=>ue(this,bn,"f").boxAdapters.adapterFor(e.box,gt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}set position(e){ue(this,tt,"f").position.setValue(e)}set duration(e){ue(this,tt,"f").duration.setValue(e)}set loopOffset(e){ue(this,tt,"f").loopOffset.setValue(e)}set loopDuration(e){ue(this,tt,"f").loopDuration.setValue(e)}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),i=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return ue(this,bn,"f").boxAdapters.adapterFor(Ka.create(ue(this,bn,"f").boxGraph,A.generate(),n=>{n.position.setValue(e?.position??this.position),n.duration.setValue(e?.duration??this.duration),n.loopOffset.setValue(e?.loopOffset??this.loopOffset),n.loopDuration.setValue(e?.loopDuration??this.loopDuration),n.hue.setValue(this.hue),n.label.setValue(this.label),n.mute.setValue(this.mute),n.events.refer(i),n.regions.refer(e?.track??ue(this,tt,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let t=ue(this,bn,"f").boxGraph,i=Qn.create(t,A.generate());e.asArray().forEach(n=>n.copyTo({events:i.events})),ue(this,tt,"f").events.refer(i.owners)})}canFlatten(e){return!1}flatten(e){if(!this.canFlatten(e))return g.None;let t=ue(this,bn,"f").boxGraph,i=e.toSorted(_o.Comparator),n=R.getFirst(i,"Internal error (no first)"),o=R.getLast(i,"Internal error (no last)"),a=n.position,s=o.position+o.duration,l=n.trackBoxAdapter.unwrap(),c=Qn.create(t,A.generate()),p=Array.from(l.regions.collection.iterateRange(a,s));return p.filter(d=>d.isSelected).forEach(d=>{let f=d;for(let{resultStart:v,resultEnd:m,rawStart:y}of Gt.locateLoops(f,f.position,f.complete)){let x=Math.floor(v-y),M=Math.floor(m-y);for(let D of f.events.unwrap().iterateRange(x,M));}}),p.forEach(({box:d})=>d.delete()),g.wrap(Ka.create(t,A.generate(),d=>{d.position.setValue(a),d.duration.setValue(s-a),d.loopDuration.setValue(s-a),d.loopOffset.setValue(0),d.hue.setValue(this.hue),d.mute.setValue(this.mute),d.label.setValue(this.label),d.events.refer(c.owners),d.regions.refer(l.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${A.toString(ue(this,tt,"f").address.uuid)} p: ${Q.toString(this.position)}, c: ${Q.toString(this.complete)}}`}};Jl=new WeakMap,bn=new WeakMap,tt=new WeakMap,jd=new WeakMap,Ql=new WeakMap,zd=new WeakMap,Ud=new WeakMap,Vi=new WeakSet,An=function(){ue(this,jd,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var MP=(r,e)=>r.position-e.position,DP={for:(r,e)=>ee(e.accept({visitNoteRegionBox:t=>r.adapterFor(t,Go),visitAudioRegionBox:t=>r.adapterFor(t,Zo),visitValueRegionBox:t=>r.adapterFor(t,ao)}),"")};var Yl=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},zt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ld,ds,Kd,Xl,ps,eu,Pm=class{constructor(e,t){Ld.set(this,void 0),ds.set(this,void 0),Kd.set(this,void 0),Xl.set(this,void 0),ps.set(this,void 0),eu.set(this,void 0),Yl(this,Ld,e,"f"),Yl(this,ds,new U,"f"),Yl(this,Kd,zt(this,ds,"f").own(new te),"f"),Yl(this,Xl,zt(this,ds,"f").own(new $t),"f"),Yl(this,ps,_o.create(MP),"f"),Yl(this,eu,A.newSet(i=>i.uuid),"f"),zt(this,ds,"f").ownAll(zt(this,Ld,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:i})=>{let n=DP.for(t,i),o=zt(this,eu,"f").add(n);I(o,`Cannot add ${i}`),zt(this,ps,"f").add(n),zt(this,Xl,"f").forEach(a=>a.onAdded(n)),this.dispatchChange()},onRemoved:({box:{address:{uuid:i}}})=>{let n=zt(this,eu,"f").removeByKey(i);zt(this,ps,"f").remove(n),zt(this,Xl,"f").forEach(o=>o.onRemoved(n)),this.dispatchChange()}},u.RegionCollection))}get trackBoxAdapter(){return zt(this,Ld,"f")}get collection(){return zt(this,ps,"f")}get adapters(){return zt(this,eu,"f")}onIndexingChanged(){zt(this,ps,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),zt(this,Xl,"f").subscribe(e)}subscribeChanges(e){return zt(this,Kd,"f").subscribe(e)}dispatchChange(){zt(this,Kd,"f").notify()}terminate(){zt(this,ds,"f").terminate()}};Ld=new WeakMap,ds=new WeakMap,Kd=new WeakMap,Xl=new WeakMap,ps=new WeakMap,eu=new WeakMap;var re;(function(r){r[r.Undefined=0]="Undefined",r[r.Notes=1]="Notes",r[r.Audio=2]="Audio",r[r.Value=3]="Value"})(re||(re={}));(function(r){r.toLabelString=e=>{switch(e){case r.Audio:return"Audio";case r.Notes:return"Notes";case r.Value:return"Automation";case r.Undefined:default:return"N/A"}},r.toIconSymbol=e=>{switch(e){case r.Audio:return Me.Waveform;case r.Notes:return Me.Piano;case r.Value:return Me.Automation;case r.Undefined:return Me.AudioBus;default:return Me.Unknown}}})(re||(re={}));var Sm;(function(r){r.isDeviceBox=e=>"host"in e&&Te(e.host,B)&&"label"in e&&Te(e.label,C)&&"enabled"in e&&Te(e.enabled,$)&&"minimized"in e&&Te(e.minimized,$),r.isInstrumentDeviceBox=e=>r.isDeviceBox(e)&&e.host.pointerType===u.InstrumentHost,r.isEffectDeviceBox=e=>r.isDeviceBox(e)&&"index"in e&&Te(e.index,E)&&(e.host.pointerType===u.MidiEffectHost||e.host.pointerType===u.AudioEffectHost),r.lookupHostField=e=>Z(e)&&"host"in e&&Te(e.host,B)?e.host:F(`Could not find 'host' field in '${e?.name}'`),r.lookupLabelField=e=>Z(e)&&"label"in e&&Te(e.label,C)?e.label:F(`Could not find 'label' field in '${e?.name}'`),r.lookupEnabledField=e=>Z(e)&&"enabled"in e&&Te(e.enabled,$)?e.enabled:F(`Could not find 'enabled' field in '${e?.name}'`),r.lookupMinimizedField=e=>Z(e)&&"minimized"in e&&Te(e.minimized,$)?e.minimized:F(`Could not find 'minimized' field in '${e?.name}'`),r.lookupIndexField=e=>Z(e)&&"index"in e&&Te(e.index,E)?e.index:F(`Could not find 'index' field in '${e?.name}'`)})(Sm||(Sm={}));var IP;(function(r){r.toTrackType=e=>{switch(e){case"midi":return re.Notes;case"audio":return re.Audio;default:return F()}}})(IP||(IP={}));var ie;(function(r){r.isAny=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="bus"||e.type==="instrument"||e.type==="audio-effect"),r.isEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&(e.type==="midi-effect"||e.type==="audio-effect"),r.isInstrument=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="instrument",r.isMidiEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="midi-effect",r.isAudioEffect=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="audio-effect",r.isHost=e=>e!==null&&typeof e=="object"&&"class"in e&&e.class==="device-host",r.deleteEffectDevices=e=>{if(e.length===0)return;I(R.satisfy(e,(n,o)=>n.deviceHost().address.equals(o.deviceHost().address)),"Devices are not connected to the same host");let t=e[0];(t.accepts==="audio"?t.deviceHost().audioEffects.field().pointerHub.filter(u.AudioEffectHost):t.accepts==="midi"?t.deviceHost().midiEffects.field().pointerHub.filter(u.MidiEffectHost):F("unknown type")).map(({box:n})=>Sm.lookupIndexField(n)).filter(n=>e.some(o=>A.Comparator(o.uuid,n.address.uuid)!==0)).sort((n,o)=>n.getValue()-o.getValue()).forEach((n,o)=>n.setValue(o)),e.forEach(n=>n.box.delete())}})(ie||(ie={}));var Em=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Kt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Wd,Bm,zi,hs,Fm,Nm=class{constructor(e,t){Wd.set(this,void 0),Bm.set(this,new te),zi.set(this,void 0),hs.set(this,void 0),Fm.set(this,void 0),Em(this,Wd,e,"f"),Em(this,zi,jt.create(e.box.tracks,i=>t.adapterFor(i,gt),u.TrackCollection),"f"),Em(this,hs,A.newSet(({uuid:i})=>i),"f"),Em(this,Fm,Kt(this,zi,"f").catchupAndSubscribe({onAdd:i=>Kt(this,hs,"f").add({uuid:i.uuid,subscription:i.regions.subscribeChanges(()=>Kt(this,Bm,"f").notify())}),onRemove:({uuid:i})=>Kt(this,hs,"f").removeByKey(i).subscription.terminate(),onReorder:i=>{}}),"f")}create(e,t,i){let n=Kt(this,Wd,"f").box.graph,o=Kt(this,Wd,"f").box.tracks;ar.create(n,A.generate(),a=>{a.index.setValue(i??Kt(this,zi,"f").getMinFreeIndex()),a.type.setValue(e),a.tracks.refer(o),a.target.refer(t)})}controls(e){return g.wrap(Kt(this,zi,"f").adapters().find(t=>t.target.targetVertex.contains(e),!1))}delete(e){let t=Kt(this,zi,"f").adapters(),i=t.indexOf(e);if(i===-1)return F(`Cannot delete ${e}. Does not exist.`);for(let n=i+1;n<t.length;n++)t[n].indexField.setValue(n-1);e.box.delete()}get collection(){return Kt(this,zi,"f")}values(){return Kt(this,zi,"f").adapters()}catchupAndSubscribe(e){return Kt(this,zi,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return Kt(this,Bm,"f").subscribe(e)}terminate(){Kt(this,zi,"f").terminate(),Kt(this,Fm,"f").terminate(),Kt(this,hs,"f").forEach(({subscription:e})=>e.terminate()),Kt(this,hs,"f").clear()}};Wd=new WeakMap,Bm=new WeakMap,zi=new WeakMap,hs=new WeakMap,Fm=new WeakMap;var CP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ui=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},km,Or,cr=class{constructor(e,t){this.type="bus",this.accepts="audio",km.set(this,void 0),Or.set(this,void 0),CP(this,km,e,"f"),CP(this,Or,t,"f")}catchupAndSubscribe(e){return e(this),Ui(this,Or,"f").subscribe(ke.Children,()=>e(this))}get uuid(){return Ui(this,Or,"f").address.uuid}get address(){return Ui(this,Or,"f").address}get box(){return Ui(this,Or,"f")}get enabledField(){return Ui(this,Or,"f").enabled}get minimizedField(){return Ui(this,Or,"f").minimized}get iconField(){return Ui(this,Or,"f").icon}get labelField(){return Ui(this,Or,"f").label}get colorField(){return Ui(this,Or,"f").color}get iconSymbol(){return Me.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return Ui(this,km,"f").boxAdapters.adapterFor(Ui(this,Or,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}toString(){return`{${this.constructor.name}}`}};km=new WeakMap,Or=new WeakMap;var Zd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ht=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},so,tu,ru,oi,Gd,$m=class{constructor(e,t){so.set(this,void 0),tu.set(this,void 0),ru.set(this,void 0),oi.set(this,void 0),Gd.set(this,K.Empty),Zd(this,so,new U,"f"),Zd(this,tu,ht(this,so,"f").own(new te),"f"),Zd(this,ru,ht(this,so,"f").own(new Ir(Me.Unknown)),"f"),Zd(this,oi,ht(this,so,"f").own(new Ir(g.None)),"f"),ht(this,so,"f").own(ht(this,oi,"f").subscribe(i=>{ht(this,Gd,"f").terminate(),Zd(this,Gd,i.getValue().match({none:()=>(ht(this,tu,"f").notify(g.None),K.Empty),some:({labelField:n,iconField:o})=>K.many(o.catchupAndSubscribe(a=>ht(this,ru,"f").setValue(Me.fromName(a.getValue()))),n.catchupAndSubscribe(a=>ht(this,tu,"f").notify(g.wrap(a.getValue()))))}),"f")})),ht(this,so,"f").own(e.catchupAndSubscribe({onAdded:({box:i})=>{I(ht(this,oi,"f").getValue().isEmpty(),"Already set");let n=i instanceof Ii?t.adapterFor(i,cr):t.adapterFor(i,ie.isInstrument);ht(this,oi,"f").getValue().unwrapOrNull()!==n&&ht(this,oi,"f").setValue(g.wrap(n))},onRemoved:({box:i})=>{I(ht(this,oi,"f").getValue().unwrap("Cannot remove").box.address.equals(i.address),"Unexpected value to remove"),ht(this,oi,"f").setValue(g.None)}},u.InstrumentHost,u.AudioOutput))}getValue(){return ht(this,oi,"f").getValue()}subscribe(e){return ht(this,oi,"f").subscribe(e)}catchupAndSubscribe(e){return e(ht(this,oi,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),ht(this,tu,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return ht(this,ru,"f").catchupAndSubscribe(e)}set label(e){this.getValue().ifSome(t=>t.labelField.setValue(e))}get label(){return this.getValue().map(e=>e.labelField.getValue())}set icon(e){this.getValue().ifSome(t=>t.iconField.setValue(Me.toName(e)))}get icon(){return this.getValue().match({none:()=>Me.Unknown,some:e=>Me.fromName(e.iconField.getValue())})}get iconValue(){return ht(this,ru,"f")}terminate(){ht(this,so,"f").terminate(),ht(this,Gd,"f").terminate()}};so=new WeakMap,tu=new WeakMap,ru=new WeakMap,oi=new WeakMap,Gd=new WeakMap;var TP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},fs=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Mm,lo,he=class{constructor(e){Mm.set(this,void 0),lo.set(this,void 0),TP(this,Mm,e,"f"),TP(this,lo,Ae.newSet(t=>t.address),"f")}terminate(){fs(this,lo,"f").forEach(e=>e.terminate()),fs(this,lo,"f").clear()}parameters(){return fs(this,lo,"f").values()}parameterAt(e){return fs(this,lo,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,t,i,n,o){let a=new ms(fs(this,Mm,"f"),e,t,i,n,o),s=fs(this,lo,"f").add(a);return I(s,`Could not add adapter for ${e}`),a}removeParameter(e){return fs(this,lo,"f").removeByKey(e)}};Mm=new WeakMap,lo=new WeakMap;var gs=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},nt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},vs,ai,qo,iu,Dm,Im,qd,nu=class{constructor(e,t){vs.set(this,void 0),ai.set(this,void 0),qo.set(this,void 0),iu.set(this,void 0),Dm.set(this,void 0),Im.set(this,void 0),qd.set(this,K.Empty),gs(this,vs,e,"f"),gs(this,ai,t,"f"),gs(this,qo,new U,"f"),gs(this,iu,nt(this,qo,"f").own(new te),"f"),nt(this,qo,"f").own(t.targetBus.catchupAndSubscribe(()=>{nt(this,qd,"f").terminate(),gs(this,qd,this.optTargetBus.match({none:()=>(nt(this,iu,"f").notify(g.None),K.Empty),some:i=>i.catchupAndSubscribe(n=>nt(this,iu,"f").notify(g.wrap(n)))}),"f")})),gs(this,Dm,nt(this,qo,"f").own(new ms(nt(this,vs,"f"),nt(this,ai,"f").sendPan,S.bipolar(),P.percent({unit:"%",fractionDigits:0}),"panning")),"f"),gs(this,Im,nt(this,qo,"f").own(new ms(nt(this,vs,"f"),nt(this,ai,"f").sendGain,S.DefaultDecibel,P.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),nt(this,iu,"f").subscribe(e)}get uuid(){return nt(this,ai,"f").address.uuid}get address(){return nt(this,ai,"f").address}get box(){return nt(this,ai,"f")}get indexField(){return nt(this,ai,"f").index}get sendPan(){return nt(this,Dm,"f")}get sendGain(){return nt(this,Im,"f")}get targetBus(){return nt(this,vs,"f").boxAdapters.adapterFor(nt(this,ai,"f").targetBus.targetVertex.unwrap("no audioUnit").box,cr)}get optTargetBus(){return nt(this,ai,"f").targetBus.targetVertex.flatMap(e=>g.wrap(e.box.accept({visitAudioBusBox:t=>nt(this,vs,"f").boxAdapters.adapterFor(t,cr)})))}delete(){nt(this,ai,"f").delete()}terminate(){nt(this,qo,"f").terminate(),nt(this,qd,"f").terminate()}};vs=new WeakMap,ai=new WeakMap,qo=new WeakMap,iu=new WeakMap,Dm=new WeakMap,Im=new WeakMap,qd=new WeakMap;var Hd=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},_n=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Cm,Tm,ou,au,Jd,Rm=class{constructor(e,t){Cm.set(this,void 0),Tm.set(this,void 0),ou.set(this,void 0),au.set(this,void 0),Jd.set(this,K.Empty),Hd(this,Cm,e,"f"),Hd(this,Tm,t,"f"),Hd(this,ou,new U,"f"),Hd(this,au,_n(this,ou,"f").own(new te),"f"),_n(this,ou,"f").own(e.catchupAndSubscribe(()=>{_n(this,Jd,"f").terminate(),Hd(this,Jd,this.adapter.match({none:()=>(_n(this,au,"f").notify(g.None),K.Empty),some:i=>i.catchupAndSubscribe(n=>_n(this,au,"f").notify(g.wrap(n)))}),"f")}))}subscribe(e){return _n(this,au,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return _n(this,Cm,"f").targetVertex.flatMap(e=>g.wrap(e.box.accept({visitAudioBusBox:t=>_n(this,Tm,"f").adapterFor(t,cr)})))}terminate(){_n(this,ou,"f").terminate(),_n(this,Jd,"f").terminate()}};Cm=new WeakMap,Tm=new WeakMap,ou=new WeakMap,au=new WeakMap,Jd=new WeakMap;var uo=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},se=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Om,RP,Pn,Vr,yt,xs,su,ys,Vm,zm,Um,jm,OP,VP,si=class{constructor(e,t){Om.add(this),this.class="device-host",Pn.set(this,new U),Vr.set(this,void 0),yt.set(this,void 0),xs.set(this,void 0),su.set(this,void 0),ys.set(this,void 0),Vm.set(this,void 0),zm.set(this,void 0),Um.set(this,void 0),jm.set(this,void 0),uo(this,Vr,e,"f"),uo(this,yt,t,"f"),uo(this,xs,se(this,Pn,"f").own(new he(se(this,Vr,"f"))),"f"),uo(this,su,se(this,Pn,"f").own(new Nm(this,se(this,Vr,"f").boxAdapters)),"f"),uo(this,ys,se(this,Pn,"f").own(new $m(se(this,yt,"f").input.pointerHub,se(this,Vr,"f").boxAdapters)),"f"),uo(this,Vm,se(this,Pn,"f").own(jt.create(se(this,yt,"f").midiEffects,i=>se(this,Vr,"f").boxAdapters.adapterFor(i,ie.isMidiEffect),u.MidiEffectHost)),"f"),uo(this,zm,se(this,Pn,"f").own(jt.create(se(this,yt,"f").audioEffects,i=>se(this,Vr,"f").boxAdapters.adapterFor(i,ie.isAudioEffect),u.AudioEffectHost)),"f"),uo(this,Um,se(this,Pn,"f").own(jt.create(se(this,yt,"f").auxSends,i=>se(this,Vr,"f").boxAdapters.adapterFor(i,nu),u.AuxSend)),"f"),uo(this,jm,se(this,Pn,"f").own(new Rm(se(this,yt,"f").output,se(this,Vr,"f").boxAdapters)),"f"),this.namedParameter=se(this,Om,"m",OP).call(this,t),se(this,Om,"m",VP).call(this)}get box(){return se(this,yt,"f")}get uuid(){return se(this,yt,"f").address.uuid}get address(){return se(this,yt,"f").address}get indexField(){return se(this,yt,"f").index}get type(){return se(this,yt,"f").type.getValue()}get captureBox(){return se(this,yt,"f").capture.targetVertex}get tracks(){return se(this,su,"f")}get input(){return se(this,ys,"f")}get midiEffects(){return se(this,Vm,"f")}get audioEffects(){return se(this,zm,"f")}get inputAdapter(){return se(this,ys,"f").getValue()}get auxSends(){return se(this,Um,"f")}get output(){return se(this,jm,"f")}get isBus(){return this.input.getValue().mapOr(e=>e.type==="bus",!1)}get isInstrument(){return this.input.getValue().mapOr(e=>e.type==="instrument",!1)}get isOutput(){return se(this,yt,"f").output.targetVertex.mapOr(e=>e.box.address.equals(se(this,Vr,"f").rootBoxAdapter.address),!1)}get midiEffectsField(){return se(this,yt,"f").midiEffects}get inputField(){return se(this,yt,"f").input}get audioEffectsField(){return se(this,yt,"f").audioEffects}get tracksField(){return se(this,yt,"f").tracks}get minimizedField(){return se(this,ys,"f").getValue().unwrap().minimizedField}get isAudioUnit(){return!0}get label(){return se(this,ys,"f").getValue().mapOr(e=>e.labelField.getValue(),"")}audioUnitBoxAdapter(){return this}indicesLimit(){let e=se(this,Vr,"f").rootBoxAdapter.audioUnits.adapters(),t=this.indexField.getValue(),i=this.type,n=t,o=t;for(;n>0&&e[n-1].type===i;)n--;for(;o<e.length-1&&e[o+1].type===i;)o++;return[n,o+1]}move(e){se(this,Vr,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,t){se(this,su,"f").collection.move(e,t)}deleteTrack(e){se(this,su,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){se(this,Pn,"f").terminate()}};RP=si,Pn=new WeakMap,Vr=new WeakMap,yt=new WeakMap,xs=new WeakMap,su=new WeakMap,ys=new WeakMap,Vm=new WeakMap,zm=new WeakMap,Um=new WeakMap,jm=new WeakMap,Om=new WeakSet,OP=function(e){return{volume:se(this,xs,"f").createParameter(e.volume,RP.VolumeMapper,P.decible,"volume"),panning:se(this,xs,"f").createParameter(e.panning,S.bipolar(),P.panning,"panning",.5),mute:se(this,xs,"f").createParameter(e.mute,S.bool,P.bool,"mute"),solo:se(this,xs,"f").createParameter(e.solo,S.bool,P.bool,"solo")}},VP=function(){let e=this.address.toString(),t=se(this,yt,"f").capture.targetAddress.unwrapOrUndefined(),i=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${se(this,yt,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${t}`;I(this.type!==St.Instrument||se(this,yt,"f").capture.targetAddress.nonEmpty(),i)};si.VolumeMapper=S.decibel(-96,-9,6);var lu=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},He=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Lm,Ho,dr,ws,Km,Wm,Qd,zP,UP,gt=class{constructor(e,t){Lm.add(this),Ho.set(this,void 0),dr.set(this,void 0),ws.set(this,void 0),Km.set(this,void 0),Wm.set(this,void 0),Qd.set(this,void 0),lu(this,Ho,e,"f"),lu(this,dr,t,"f"),lu(this,ws,new U,"f"),lu(this,Km,He(this,ws,"f").own(new Am(this,e.boxAdapters)),"f"),lu(this,Wm,He(this,ws,"f").own(new Pm(this,e.boxAdapters)),"f"),lu(this,Qd,He(this,ws,"f").own(new Ir(-1)),"f")}catchupAndSubscribePath(e){let t=[g.None,g.None],i=()=>{t.every(n=>n.nonEmpty())?e(g.wrap(t.map(n=>n.unwrap()))):e(g.None)};return K.many(He(this,Lm,"m",zP).call(this,n=>{t[0].equals(n)||(t[0]=n,i())}),He(this,Lm,"m",UP).call(this,n=>{t[1].equals(n)||(t[1]=n,i())}))}set targetDeviceName(e){He(this,dr,"f").target.targetVertex.ifSome(t=>{let i=t.box;if(i instanceof it)return He(this,Ho,"f").boxAdapters.adapterFor(i,si).input.getValue().ifSome(({labelField:o})=>o.setValue(e));if("label"in i&&i.label instanceof C)return i.label.setValue(e)})}get targetDeviceName(){return He(this,dr,"f").target.targetVertex.flatMap(e=>{let t=e.box;return t instanceof it?He(this,Ho,"f").boxAdapters.adapterFor(t,si).input.label:"label"in t&&t.label instanceof C?g.wrap(t.label.getValue()):g.wrap(t.name)})}terminate(){He(this,ws,"f").terminate()}get audioUnit(){return Ne(He(this,dr,"f").tracks.targetVertex.unwrap().box,it)}get target(){return He(this,dr,"f").target}get clips(){return He(this,Km,"f")}get regions(){return He(this,Wm,"f")}get enabled(){return He(this,dr,"f").enabled}get indexField(){return He(this,dr,"f").index}get type(){return He(this,dr,"f").type.getValue()}get box(){return He(this,dr,"f")}get uuid(){return He(this,dr,"f").address.uuid}get address(){return He(this,dr,"f").address}get listIndex(){return He(this,Qd,"f").getValue()}set listIndex(e){He(this,Qd,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===re.Audio;case"note-clip":return this.type===re.Notes;case"value-clip":return this.type===re.Value;case"audio-region":return this.type===re.Audio;case"note-region":return this.type===re.Notes;case"value-region":return this.type===re.Value}}valueAt(e,t){if(!this.enabled.getValue())return t;let i=t,n=He(this,Ho,"f").clipSequencing.iterate(this.uuid,e,e+af);for(let{optClip:o,sectionFrom:a}of n)i=o.match({none:()=>{let s=this.regions.collection.lowerEqual(e,l=>!l.mute);if(s===null){let l=this.regions.collection.optAt(0);return Te(l,ao)?l.incomingValue(t):t}else if(Te(s,ao))return e<s.complete?s.valueAt(e,t):s.outgoingValue(t);return t},some:s=>a===e&&Te(s,Uo)?s.valueAt(e,t):t});return i}};Ho=new WeakMap,dr=new WeakMap,ws=new WeakMap,Km=new WeakMap,Wm=new WeakMap,Qd=new WeakMap,Lm=new WeakSet,zP=function(e){let t=He(this,dr,"f").target.targetVertex;if(t.nonEmpty()){let i=t.unwrap().box;return i instanceof it?He(this,Ho,"f").boxAdapters.adapterFor(i,si).input.catchupAndSubscribeLabelChange(o=>e(o)):"label"in i&&i.label instanceof C?i.label.catchupAndSubscribe(n=>e(g.wrap(n.getValue()))):(e(g.wrap(i.name)),K.Empty)}return e(g.None),K.Empty},UP=function(e){let t=this.type;switch(t){case re.Audio:case re.Notes:return e(g.wrap(re[t])),K.Empty;case re.Value:{let i=He(this,dr,"f").target.targetVertex.unwrap();if(i.isField())e(He(this,Ho,"f").parameterFieldAdapters.opt(i.address).map(n=>n.name));else if(i.isBox())e(g.wrap(i.name));else return F("Illegal State. Vertex is not a field nor box.");return K.Empty}case re.Undefined:return e(g.wrap("")),K.Empty;default:return e(g.None),K.Empty}};var Wt=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ce=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Jo,zr,Qo,bs,Zm,Gm,As,_s,Yo,Xo,Ps,uu,Yd,jP=[u.Automation,u.Modulation,u.MidiControl,u.ParameterController],ms=class{constructor(e,t,i,n,o,a){Jo.set(this,void 0),zr.set(this,void 0),Qo.set(this,void 0),bs.set(this,void 0),Zm.set(this,void 0),Gm.set(this,void 0),As.set(this,new U),_s.set(this,void 0),Yo.set(this,void 0),Xo.set(this,g.None),Ps.set(this,g.None),uu.set(this,null),Yd.set(this,!1),Wt(this,Jo,e,"f"),Wt(this,zr,t,"f"),Wt(this,Qo,i,"f"),Wt(this,bs,n,"f"),Wt(this,Zm,o,"f"),Wt(this,Gm,a??0,"f"),ce(this,As,"f").own(ce(this,Jo,"f").parameterFieldAdapters.register(this)),Wt(this,_s,ce(this,As,"f").own(new te),"f"),Wt(this,Yo,new $t,"f"),ce(this,As,"f").own(ce(this,zr,"f").subscribe(()=>ce(this,_s,"f").notify(this))),ce(this,As,"f").own(ce(this,zr,"f").pointerHub.catchupAndSubscribe({onAdded:s=>{ce(this,Yo,"f").proxy.onControlSourceAdd(Kx(s.pointerType)),s.box.accept({visitTrackBox:l=>{I(ce(this,Xo,"f").isEmpty(),"Already assigned");let c=ce(this,Jo,"f").boxAdapters.adapterFor(l,gt);Wt(this,Xo,g.wrap(c),"f"),ce(this,Jo,"f").isMainThread&&Wt(this,Ps,g.wrap(ce(this,Jo,"f").liveStreamReceiver.subscribeFloat(ce(this,zr,"f").address,p=>{ce(this,uu,"f")!==p&&(Wt(this,uu,p,"f"),ce(this,_s,"f").notify(this))})),"f")}})},onRemoved:s=>{ce(this,Yo,"f").proxy.onControlSourceRemove(Kx(s.pointerType)),s.box.accept({visitTrackBox:l=>{I(ce(this,Xo,"f").unwrapOrNull()?.address?.equals(l.address)===!0,`Unknown ${l}`),Wt(this,Xo,g.None,"f"),ce(this,Jo,"f").isMainThread&&(ce(this,Ps,"f").ifSome(c=>c.terminate()),Wt(this,Ps,g.None,"f"),Wt(this,uu,null,"f"),ce(this,_s,"f").notify(this))}})}},...jP)),t.getValue()!==i.clamp(t.getValue())&&console.warn(`${o} (${t.getValue()}) is out of bounds`,"constraints"in t?t.constraints:"no constraints",i,t.address.fieldKeys.join(", "),t.box.name)}registerMidiControl(){return ce(this,Yo,"f").proxy.onControlSourceAdd("midi"),Wt(this,Yd,!0,"f"),{terminate:()=>{Wt(this,Yd,!1,"f"),ce(this,Yo,"f").proxy.onControlSourceRemove("midi")}}}get field(){return ce(this,zr,"f")}get valueMapping(){return ce(this,Qo,"f")}get stringMapping(){return ce(this,bs,"f")}get name(){return ce(this,Zm,"f")}get anchor(){return ce(this,Gm,"f")}get type(){return ce(this,zr,"f").type}get address(){return ce(this,zr,"f").address}get track(){return ce(this,Xo,"f")}valueAt(e){let t=ce(this,Xo,"f");if(t.nonEmpty()){let i=t.unwrap();if(i.enabled)return this.valueMapping.y(i.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return ce(this,_s,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return ce(this,Yd,"f")&&e.onControlSourceAdd("midi"),ce(this,zr,"f").pointerHub.filter(...jP).forEach(t=>e.onControlSourceAdd(Kx(t.pointerType))),ce(this,Yo,"f").subscribe(e)}getValue(){return ce(this,zr,"f").getValue()}setValue(e){ce(this,zr,"f").setValue(e)}setUnitValue(e){this.setValue(ce(this,Qo,"f").y(e))}getUnitValue(){return ce(this,Qo,"f").x(this.getValue())}getControlledValue(){return ce(this,Qo,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return ce(this,uu,"f")??this.getUnitValue()}getControlledPrintValue(){return ce(this,bs,"f").x(this.getControlledValue())}getPrintValue(){return ce(this,bs,"f").x(this.getValue())}setPrintValue(e){let t=ce(this,bs,"f").y(e);t.type==="unitValue"?this.setUnitValue(le(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(ce(this,Qo,"f").clamp(ce(this,zr,"f").initValue))}terminate(){ce(this,Ps,"f").ifSome(e=>e.terminate()),Wt(this,Ps,g.None,"f"),ce(this,As,"f").terminate()}};Jo=new WeakMap,zr=new WeakMap,Qo=new WeakMap,bs=new WeakMap,Zm=new WeakMap,Gm=new WeakMap,As=new WeakMap,_s=new WeakMap,Yo=new WeakMap,Xo=new WeakMap,Ps=new WeakMap,uu=new WeakMap,Yd=new WeakMap;var Kx=r=>{switch(r){case u.Automation:return"automated";case u.Modulation:return"modulated";case u.MidiControl:return"midi";case u.ParameterController:return"external";default:return F(`${r.toString()} is an unknown pointer type`)}};var Wx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ji=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},co,Ss,qm,Hm=class{constructor(e,t,i){co.set(this,void 0),Ss.set(this,void 0),qm.set(this,void 0),Wx(this,co,A.newSet(n=>n.uuid),"f"),Wx(this,Ss,new $t,"f"),Wx(this,qm,e.catchupAndSubscribe({onAdded:n=>{let o=t(n.box),a=ji(this,co,"f").add(o);I(a,`Could not add ${o}`),ji(this,Ss,"f").proxy.onAdd(o)},onRemoved:n=>{let o=n.box.address.uuid;ji(this,Ss,"f").proxy.onRemove(ji(this,co,"f").removeByKey(o))}},i),"f")}subscribe(e){return ji(this,Ss,"f").subscribe(e)}catchupAndSubscribe(e){return ji(this,co,"f").forEach(t=>e.onAdd(t)),this.subscribe(e)}adapters(){return ji(this,co,"f").values()}size(){return ji(this,co,"f").size()}isEmpty(){return this.size()===0}terminate(){ji(this,co,"f").clear(),ji(this,Ss,"f").terminate(),ji(this,qm,"f").terminate()}};co=new WeakMap,Ss=new WeakMap,qm=new WeakMap;var Zx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},It=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Gx,Jm,Xd,li,Sn,LP,ui=class{constructor(e,t){Gx.add(this),this.type="audio-effect",this.accepts="audio",Xd.set(this,void 0),li.set(this,void 0),Sn.set(this,void 0),Zx(this,Xd,e,"f"),Zx(this,li,t,"f"),Zx(this,Sn,new he(It(this,Xd,"f")),"f"),this.namedParameter=It(this,Gx,"m",LP).call(this,t)}get box(){return It(this,li,"f")}get uuid(){return It(this,li,"f").address.uuid}get address(){return It(this,li,"f").address}get indexField(){return It(this,li,"f").index}get labelField(){return It(this,li,"f").label}get enabledField(){return It(this,li,"f").enabled}get minimizedField(){return It(this,li,"f").minimized}get host(){return It(this,li,"f").host}deviceHost(){return It(this,Xd,"f").boxAdapters.adapterFor(It(this,li,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){It(this,Sn,"f").terminate()}};Jm=ui,Xd=new WeakMap,li=new WeakMap,Sn=new WeakMap,Gx=new WeakSet,LP=function(e){return{delay:It(this,Sn,"f").createParameter(e.delay,S.linearInteger(0,Jm.OffsetFractions.length-1),Jm.OffsetStringMapping,"delay"),feedback:It(this,Sn,"f").createParameter(e.feedback,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:It(this,Sn,"f").createParameter(e.cross,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"cross"),filter:It(this,Sn,"f").createParameter(e.filter,S.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:It(this,Sn,"f").createParameter(e.dry,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"dry"),wet:It(this,Sn,"f").createParameter(e.wet,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"wet")}};ui.OffsetFractions=ir.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();ui.OffsetStringMapping=P.indices("",Jm.OffsetFractions.map(([r,e])=>`${r}/${e}`));var qx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ct=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Hx,ep,ci,En,KP,cu=class{constructor(e,t){Hx.add(this),this.type="audio-effect",this.accepts="audio",ep.set(this,void 0),ci.set(this,void 0),En.set(this,void 0),qx(this,ep,e,"f"),qx(this,ci,t,"f"),qx(this,En,new he(Ct(this,ep,"f")),"f"),this.namedParameter=Ct(this,Hx,"m",KP).call(this,t)}get box(){return Ct(this,ci,"f")}get uuid(){return Ct(this,ci,"f").address.uuid}get address(){return Ct(this,ci,"f").address}get indexField(){return Ct(this,ci,"f").index}get labelField(){return Ct(this,ci,"f").label}get enabledField(){return Ct(this,ci,"f").enabled}get minimizedField(){return Ct(this,ci,"f").minimized}get host(){return Ct(this,ci,"f").host}deviceHost(){return Ct(this,ep,"f").boxAdapters.adapterFor(Ct(this,ci,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Ct(this,En,"f").terminate()}};ep=new WeakMap,ci=new WeakMap,En=new WeakMap,Hx=new WeakSet,KP=function(e){return{decay:Ct(this,En,"f").createParameter(e.decay,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:Ct(this,En,"f").createParameter(e.preDelay,S.exponential(.001,.5),P.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:Ct(this,En,"f").createParameter(e.damp,S.unipolar(),P.numeric({unit:"%",fractionDigits:0}),"damping"),filter:Ct(this,En,"f").createParameter(e.filter,S.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"filter"),dry:Ct(this,En,"f").createParameter(e.dry,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"dry"),wet:Ct(this,En,"f").createParameter(e.wet,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"wet")}};var Jx=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},wt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Yx,tp,Ur,Li,GP,du=class{constructor(e,t){Yx.add(this),this.type="audio-effect",this.accepts="audio",tp.set(this,void 0),Ur.set(this,void 0),Li.set(this,void 0),Jx(this,tp,e,"f"),Jx(this,Ur,t,"f"),Jx(this,Li,new he(wt(this,tp,"f")),"f"),this.namedParameter=wt(this,Yx,"m",GP).call(this,t)}get box(){return wt(this,Ur,"f")}get uuid(){return wt(this,Ur,"f").address.uuid}get address(){return wt(this,Ur,"f").address}get indexField(){return wt(this,Ur,"f").index}get labelField(){return wt(this,Ur,"f").label}get enabledField(){return wt(this,Ur,"f").enabled}get minimizedField(){return wt(this,Ur,"f").minimized}get host(){return wt(this,Ur,"f").host}get spectrum(){return wt(this,Ur,"f").address.append(4095)}deviceHost(){return wt(this,tp,"f").boxAdapters.adapterFor(wt(this,Ur,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){wt(this,Li,"f").terminate()}};tp=new WeakMap,Ur=new WeakMap,Li=new WeakMap,Yx=new WeakSet,GP=function(e){return{highPass:WP(wt(this,Li,"f"),e.highPass,"High-Pass"),lowShelf:ZP(wt(this,Li,"f"),e.lowShelf,"Low-Shelf"),lowBell:Qx(wt(this,Li,"f"),e.lowBell,"Low-Bell"),midBell:Qx(wt(this,Li,"f"),e.midBell,"Mid-Bell"),highBell:Qx(wt(this,Li,"f"),e.highBell,"High-Bell"),highShelf:ZP(wt(this,Li,"f"),e.highShelf,"High-Shelf"),lowPass:WP(wt(this,Li,"f"),e.lowPass,"Low-Pass")}};var Xx=S.exponential(20,2e4),qP=S.linear(-24,24),HP=S.exponential(.01,10),WP=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,P.bool,"enabled"),frequency:r.createParameter(e.frequency,Xx,P.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),order:r.createParameter(e.order,S.linearInteger(0,3),P.indices("db",["12","24","36","48"]),`${t} Order`),q:r.createParameter(e.q,HP,P.numeric({fractionDigits:3}),`${t} Q`)}),ZP=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,P.bool,"enabled"),frequency:r.createParameter(e.frequency,Xx,P.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,qP,P.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5)}),Qx=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,P.bool,"enabled"),frequency:r.createParameter(e.frequency,Xx,P.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,qP,P.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5),q:r.createParameter(e.q,HP,P.numeric({fractionDigits:3}),`${t} Q`)});var JP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},wr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Qm,Ym,br,ea=class{constructor(e,t){this.type="marker-event",Qm.set(this,new U),Ym.set(this,void 0),br.set(this,void 0),JP(this,Ym,e,"f"),JP(this,br,t,"f"),wr(this,Qm,"f").own(wr(this,br,"f").subscribe(ke.Children,i=>{if(!this.trackAdapter.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.trackAdapter.unwrap();wr(this,br,"f").position.address.equals(i.address)?n.onSortingChanged():n.dispatchChange()}}))}get box(){return wr(this,br,"f")}get uuid(){return wr(this,br,"f").address.uuid}get address(){return wr(this,br,"f").address}get position(){return wr(this,br,"f").position.getValue()}get plays(){return wr(this,br,"f").plays.getValue()}get hue(){return wr(this,br,"f").hue.getValue()}get label(){return wr(this,br,"f").label.getValue()}get trackAdapter(){return wr(this,br,"f").track.targetVertex.map(e=>wr(this,Ym,"f").boxAdapters.adapterFor(e.box,Bn).markerTrack)}terminate(){wr(this,Qm,"f").terminate()}toString(){return`{MarkerBoxAdapter ${A.toString(wr(this,br,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};Qm=new WeakMap,Ym=new WeakMap,br=new WeakMap;ea.Comparator=(r,e)=>r.position-e.position;var rp=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},di=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ip,pu,np,Es,Xm,eg=class{constructor(e,t){ip.set(this,void 0),pu.set(this,void 0),np.set(this,void 0),Es.set(this,void 0),Xm.set(this,void 0),rp(this,ip,e,"f"),rp(this,pu,t,"f"),this.changeNotifier=new te,rp(this,np,A.newSet(i=>i.uuid),"f"),rp(this,Es,xr.create(ea.Comparator),"f"),rp(this,Xm,di(this,pu,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:i})=>{if(i instanceof ml){let n=di(this,ip,"f").boxAdapters.adapterFor(i,ea),o=di(this,np,"f").add(n);I(o,"Could not add adapter"),di(this,Es,"f").add(n),this.dispatchChange()}},onRemoved:({box:{address:{uuid:i}}})=>{di(this,Es,"f").remove(di(this,np,"f").removeByKey(i)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return di(this,ip,"f")}get enabled(){return di(this,pu,"f").enabled.getValue()}get events(){return di(this,Es,"f")}get object(){return di(this,pu,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){di(this,Es,"f").onIndexingChanged(),this.dispatchChange()}terminate(){di(this,Xm,"f").terminate()}};ip=new WeakMap,pu=new WeakMap,np=new WeakMap,Es=new WeakMap,Xm=new WeakMap;var QP=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},po=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ki,tg,Bn=class{constructor(e,t){Ki.set(this,void 0),tg.set(this,void 0),QP(this,Ki,t,"f"),QP(this,tg,new eg(e,po(this,Ki,"f").markerTrack),"f")}terminate(){}get box(){return po(this,Ki,"f")}get uuid(){return po(this,Ki,"f").address.uuid}get address(){return po(this,Ki,"f").address}get markerTrack(){return po(this,tg,"f")}get signature(){return[po(this,Ki,"f").signature.nominator.getValue(),po(this,Ki,"f").signature.denominator.getValue()]}get signatureDuration(){let{nominator:e,denominator:t}=po(this,Ki,"f").signature;return Q.fromSignature(e.getValue(),t.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),po(this,Ki,"f").signature.subscribe(()=>e(this.signature))}};Ki=new WeakMap,tg=new WeakMap;var xB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},op=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ta,ra=class{constructor(e,t){ta.set(this,void 0),xB(this,ta,t,"f")}get box(){return op(this,ta,"f")}get uuid(){return op(this,ta,"f").address.uuid}get address(){return op(this,ta,"f").address}get source(){return op(this,ta,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return op(this,ta,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};ta=new WeakMap;var Bs=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},pi=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},rg,Fs,Ns,ig,ng,ap,hi=class{constructor(e,t){rg.set(this,void 0),Fs.set(this,void 0),Ns.set(this,void 0),ig.set(this,void 0),ng.set(this,void 0),ap.set(this,!1),Bs(this,rg,e,"f"),Bs(this,Fs,t,"f"),Bs(this,Ns,new U,"f"),Bs(this,ig,t.attributes,"f"),Bs(this,ng,pi(this,Ns,"f").own(new he(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return pi(this,Ns,"f").own(e)}ownAll(...e){pi(this,Ns,"f").ownAll(...e)}onSelected(){Bs(this,ap,!0,"f")}onDeselected(){Bs(this,ap,!1,"f")}isSelected(){return pi(this,ap,"f")}get box(){return pi(this,Fs,"f")}get attributes(){return pi(this,ig,"f")}get uuid(){return pi(this,Fs,"f").address.uuid}get address(){return pi(this,Fs,"f").address}get parameters(){return pi(this,ng,"f")}get modular(){return pi(this,rg,"f").boxAdapters.adapterFor(pi(this,Fs,"f").attributes.collection.targetVertex.unwrap().box,ia)}terminate(){pi(this,Ns,"f").terminate()}};rg=new WeakMap,Fs=new WeakMap,Ns=new WeakMap,ig=new WeakMap,ng=new WeakMap,ap=new WeakMap;var og=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ho=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ag,na,sp,sg,Ht;(function(r){r.Input="input",r.Output="output"})(Ht||(Ht={}));var Jt=class r{static create(e,t,i,n){return new r(e,t,i,n??t.fieldName)}constructor(e,t,i,n){ag.set(this,void 0),na.set(this,void 0),sp.set(this,void 0),sg.set(this,void 0),og(this,ag,e,"f"),og(this,na,t,"f"),og(this,sp,i,"f"),og(this,sg,n,"f")}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(t=>e.field.pointerRules.accepts.some(i=>i===t))}get connections(){return ho(this,na,"f").pointerHub.isEmpty()?R.empty():ho(this,na,"f").pointerHub.filter(u.VoltageConnection).map(({box:e})=>ho(this,ag,"f").adapterFor(e,ra))}get field(){return ho(this,na,"f")}get address(){return ho(this,na,"f").address}get direction(){return ho(this,sp,"f")}get name(){return ho(this,sg,"f")}toString(){return`{ModuleConnectorAdapter address: ${ho(this,na,"f").address.toString()}, direction: ${ho(this,sp,"f")}}`}};ag=new WeakMap,na=new WeakMap,sp=new WeakMap,sg=new WeakMap;var ew=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},lp=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},lg,up,cp,hu=class extends hi{constructor(e,t){super(e,t),lg.set(this,void 0),up.set(this,void 0),cp.set(this,void 0),ew(this,lg,this.parameters.createParameter(t.time,S.exponential(1,1e4),P.numeric({unit:"ms"}),"Time"),"f"),ew(this,up,Jt.create(e.boxAdapters,t.voltageInput,Ht.Input,"Input"),"f"),ew(this,cp,Jt.create(e.boxAdapters,t.voltageOutput,Ht.Output,"Output"),"f")}get parameterTime(){return lp(this,lg,"f")}get voltageInput(){return lp(this,up,"f")}get voltageOutput(){return lp(this,cp,"f")}get inputs(){return[lp(this,up,"f")]}get outputs(){return[lp(this,cp,"f")]}};lg=new WeakMap,up=new WeakMap,cp=new WeakMap;var wB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},YP=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},dp,fu=class extends hi{constructor(e,t){super(e,t),dp.set(this,void 0),wB(this,dp,Jt.create(e.boxAdapters,t.input,Ht.Input,"Input"),"f")}get voltageInput(){return YP(this,dp,"f")}get inputs(){return[YP(this,dp,"f")]}get outputs(){return R.empty()}};dp=new WeakMap;var tw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},pp=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ug,hp,fp,mu=class extends hi{constructor(e,t){super(e,t),ug.set(this,void 0),hp.set(this,void 0),fp.set(this,void 0),tw(this,ug,this.parameters.createParameter(t.gain,S.DefaultDecibel,P.numeric({unit:"db"}),"Gain"),"f"),tw(this,hp,Jt.create(e.boxAdapters,t.voltageInput,Ht.Input,"Input"),"f"),tw(this,fp,Jt.create(e.boxAdapters,t.voltageOutput,Ht.Output,"Output"),"f")}get parameterGain(){return pp(this,ug,"f")}get voltageInput(){return pp(this,hp,"f")}get voltageOutput(){return pp(this,fp,"f")}get inputs(){return[pp(this,hp,"f")]}get outputs(){return[pp(this,fp,"f")]}};ug=new WeakMap,hp=new WeakMap,fp=new WeakMap;var rw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},iw=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},cg,dg,pg,gu=class extends hi{constructor(e,t){super(e,t),cg.set(this,void 0),dg.set(this,void 0),pg.set(this,void 0),rw(this,cg,Jt.create(e.boxAdapters,t.voltageInputX,Ht.Input,"X"),"f"),rw(this,dg,Jt.create(e.boxAdapters,t.voltageInputY,Ht.Input,"Y"),"f"),rw(this,pg,Jt.create(e.boxAdapters,t.voltageOutput,Ht.Output,"Result"),"f")}get inputs(){return[iw(this,cg,"f"),iw(this,dg,"f")]}get outputs(){return[iw(this,pg,"f")]}};cg=new WeakMap,dg=new WeakMap,pg=new WeakMap;var bB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},XP=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},mp,vu=class extends hi{constructor(e,t){super(e,t),mp.set(this,void 0),bB(this,mp,Jt.create(e.boxAdapters,t.output,Ht.Output,"Output"),"f")}get voltageOutput(){return XP(this,mp,"f")}get inputs(){return R.empty()}get outputs(){return[XP(this,mp,"f")]}};mp=new WeakMap;var yu;(function(r){r.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,r.adapterFor=(e,t)=>ee(t.accept({visitModuleGainBox:i=>e.adapterFor(i,mu),visitModuleDelayBox:i=>e.adapterFor(i,hu),visitModuleMultiplierBox:i=>e.adapterFor(i,gu),visitModularAudioInputBox:i=>e.adapterFor(i,vu),visitModularAudioOutputBox:i=>e.adapterFor(i,fu)}),`Could not find ModuleAdapter for ${t.name}`)})(yu||(yu={}));var e1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ks=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},hg,fg,$s,nw,xu=class{constructor(e,t){hg.add(this),fg.set(this,void 0),$s.set(this,void 0),e1(this,fg,e,"f"),e1(this,$s,t,"f")}get box(){return ks(this,$s,"f")}get uuid(){return ks(this,$s,"f").address.uuid}get address(){return ks(this,$s,"f").address}get moduleAdapter(){return yu.adapterFor(ks(this,fg,"f").boxAdapters,ks(this,hg,"a",nw).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(ks(this,hg,"a",nw).address)}terminate(){}};fg=new WeakMap,$s=new WeakMap,hg=new WeakSet,nw=function(){return ks(this,$s,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var t1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ar=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},wu,_r,oa=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",wu.set(this,void 0),_r.set(this,void 0),t1(this,wu,e,"f"),t1(this,_r,t,"f")}get box(){return Ar(this,_r,"f")}get uuid(){return Ar(this,_r,"f").address.uuid}get address(){return Ar(this,_r,"f").address}get indexField(){return Ar(this,_r,"f").index}get labelField(){return Ar(this,_r,"f").label}get enabledField(){return Ar(this,_r,"f").enabled}get minimizedField(){return Ar(this,_r,"f").minimized}get host(){return Ar(this,_r,"f").host}parameterAt(e){return F("Not yet implemented")}deviceHost(){return Ar(this,wu,"f").boxAdapters.adapterFor(Ar(this,_r,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return Ar(this,wu,"f").boxAdapters.adapterFor(Ar(this,_r,"f").modularSetup.targetVertex.unwrap("No Modular found").box,ia)}elements(){return Ar(this,_r,"f").userInterface.elements.pointerHub.filter(u.DeviceUserInterface).map(e=>Ar(this,wu,"f").boxAdapters.adapterFor(e.box,xu))}terminate(){}};wu=new WeakMap,_r=new WeakMap;var gp=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ke=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},bu,aa,Au,jr,Ms,Ds,ia=class{constructor(e,t){bu.set(this,new U),aa.set(this,void 0),Au.set(this,void 0),jr.set(this,void 0),Ms.set(this,void 0),Ds.set(this,void 0),gp(this,Au,e,"f"),gp(this,jr,t,"f"),gp(this,aa,Ke(this,bu,"f").own(new $t),"f"),gp(this,Ms,A.newSet(s=>s.uuid),"f"),gp(this,Ds,A.newSet(s=>s.uuid),"f");let i=s=>{let l=yu.adapterFor(Ke(this,Au,"f").boxAdapters,s.box);Ke(this,Ms,"f").add(l)&&Ke(this,aa,"f").proxy.onModuleAdded(l)},n=s=>Ke(this,aa,"f").proxy.onModuleRemoved(Ke(this,Ms,"f").removeByKey(s.address.uuid)),o=s=>{let l=Ke(this,Au,"f").boxAdapters.adapterFor(s.box,ra);Ke(this,Ds,"f").add(l)&&Ke(this,aa,"f").proxy.onConnectionAdded(l)},a=s=>Ke(this,aa,"f").proxy.onConnectionRemoved(Ke(this,Ds,"f").removeByKey(s.address.uuid));Ke(this,jr,"f").modules.pointerHub.filter(u.ModuleCollection).forEach(i),Ke(this,jr,"f").connections.pointerHub.filter(u.ConnectionCollection).forEach(o),Ke(this,bu,"f").own(Ke(this,jr,"f").modules.pointerHub.subscribe({onAdded:i,onRemoved:n},u.ModuleCollection)),Ke(this,bu,"f").own(Ke(this,jr,"f").connections.pointerHub.subscribe({onAdded:o,onRemoved:a},u.ConnectionCollection))}catchupAndSubscribe(e){return yx(e.onModuleAdded,t=>Ke(this,Ms,"f").forEach(i=>t(i))),yx(e.onConnectionAdded,t=>Ke(this,Ds,"f").forEach(i=>t(i))),Ke(this,aa,"f").subscribe(e)}get box(){return Ke(this,jr,"f")}get address(){return Ke(this,jr,"f").address}get uuid(){return Ke(this,jr,"f").address.uuid}get editingField(){return Ke(this,jr,"f").editing}get labelField(){return Ke(this,jr,"f").label}get modules(){return Ke(this,Ms,"f").values()}get connections(){return Ke(this,Ds,"f").values()}get device(){return Ke(this,Au,"f").boxAdapters.adapterFor(ee(Ke(this,jr,"f").device.pointerHub.incoming().at(0),"No device found").box,oa)}terminate(){console.debug(`terminate ${this}`),Ke(this,bu,"f").terminate()}};bu=new WeakMap,aa=new WeakMap,Au=new WeakMap,jr=new WeakMap,Ms=new WeakMap,Ds=new WeakMap;var vp=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},pr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ow,Pu,yp,mg,_u,wp,gg,xp,vg,r1,Fn=class{constructor(e,t){ow.add(this),this.type="groove-adapter",yp.set(this,new U),mg.set(this,void 0),_u.set(this,void 0),wp.set(this,void 0),gg.set(this,new Yh({duration:()=>pr(this,vg,"f"),fx:i=>Ax(i,pr(this,xp,"f")),fy:i=>Ax(i,1-pr(this,xp,"f"))})),xp.set(this,0),vg.set(this,Q.SemiQuaver*2),vp(this,mg,e,"f"),vp(this,_u,t,"f"),vp(this,wp,pr(this,yp,"f").own(new he(pr(this,mg,"f"))),"f"),this.namedParameter=pr(this,ow,"m",r1).call(this,t),pr(this,yp,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(i=>vp(this,vg,i.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(i=>vp(this,xp,dP(i.getValue(),.01),"f")))}unwarp(e){return pr(this,gg,"f").unwarp(e)}warp(e){return pr(this,gg,"f").warp(e)}get box(){return pr(this,_u,"f")}get uuid(){return pr(this,_u,"f").address.uuid}get address(){return pr(this,_u,"f").address}terminate(){pr(this,yp,"f").terminate()}};Pu=Fn,yp=new WeakMap,mg=new WeakMap,_u=new WeakMap,wp=new WeakMap,gg=new WeakMap,xp=new WeakMap,vg=new WeakMap,ow=new WeakSet,r1=function(e){return{duration:pr(this,wp,"f").createParameter(e.duration,S.values(Pu.DurationPPQNs),P.values("",Pu.DurationPPQNs,Pu.DurationStrings),"duration"),amount:pr(this,wp,"f").createParameter(e.amount,S.unipolar(),P.percent({fractionDigits:0}),"amount")}};Fn.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];Fn.DurationPPQNs=Pu.Durations.map(([r,e])=>Q.fromSignature(r,e));Fn.DurationStrings=Pu.Durations.map(([r,e])=>`${r}/${e}`);var Su=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ft=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Nn,sa,Eu,yg,xg,bp,Ap,aw,la=class{constructor(e,t,i,n,o){Nn.set(this,void 0),sa.set(this,void 0),Eu.set(this,void 0),yg.set(this,void 0),xg.set(this,void 0),bp.set(this,new U),Ap.set(this,void 0),aw.set(this,g.None),Su(this,Nn,e,"f"),Su(this,sa,t,"f"),Su(this,Eu,i,"f"),Su(this,yg,n,"f"),Su(this,xg,o??0,"f"),Su(this,Ap,ft(this,bp,"f").own(new te),"f"),ft(this,bp,"f").own(ft(this,Nn,"f").subscribe(()=>ft(this,Ap,"f").notify(this))),e.getValue()!==t.clamp(e.getValue())&&console.warn(`${n} (${e.getValue()}) is out of bounds`,t)}get field(){return ft(this,Nn,"f")}get valueMapping(){return ft(this,sa,"f")}get stringMapping(){return ft(this,Eu,"f")}get name(){return ft(this,yg,"f")}get anchor(){return ft(this,xg,"f")}get type(){return ft(this,Nn,"f").type}get address(){return ft(this,Nn,"f").address}get track(){return ft(this,aw,"f")}subscribe(e){return ft(this,Ap,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return ft(this,Nn,"f").getValue()}setValue(e){ft(this,Nn,"f").setValue(ft(this,sa,"f").clamp(e))}setUnitValue(e){this.setValue(ft(this,sa,"f").y(e))}getUnitValue(){return ft(this,sa,"f").x(this.getValue())}getPrintValue(){return ft(this,Eu,"f").x(this.getValue())}setPrintValue(e){let t=ft(this,Eu,"f").y(e);t.type==="unitValue"?this.setUnitValue(le(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(ft(this,sa,"f").clamp(ft(this,Nn,"f").initValue))}terminate(){ft(this,bp,"f").terminate()}};Nn=new WeakMap,sa=new WeakMap,Eu=new WeakMap,yg=new WeakMap,xg=new WeakMap,bp=new WeakMap,Ap=new WeakMap,aw=new WeakMap;var Bu=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},fi=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},kn,wg,bg,Ag,_g,Pg,Sg=class{constructor(e){kn.set(this,void 0),wg.set(this,void 0),bg.set(this,void 0),Ag.set(this,void 0),_g.set(this,void 0),Pg.set(this,void 0),Bu(this,kn,e,"f"),Bu(this,wg,new la(fi(this,kn,"f").keyboard,S.values([88,76,61,49]),P.numeric({fractionDigits:1}),"Keyboard Type"),"f"),Bu(this,bg,new la(fi(this,kn,"f").timeRangeInQuarters,S.exponential(1,64),P.numeric({fractionDigits:1}),"Time-Range"),"f"),Bu(this,Ag,new la(fi(this,kn,"f").noteScale,S.exponential(.5,2),P.numeric({fractionDigits:1}),"Note Scale"),"f"),Bu(this,_g,new la(fi(this,kn,"f").noteLabels,S.bool,P.bool,"Note Labels"),"f"),Bu(this,Pg,new la(fi(this,kn,"f").transpose,S.linearInteger(-48,48),P.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return fi(this,kn,"f").box.subscribe(ke.Children,()=>e(this))}get object(){return fi(this,kn,"f")}get keyboard(){return fi(this,wg,"f")}get timeRangeInQuarters(){return fi(this,bg,"f")}get noteScale(){return fi(this,Ag,"f")}get noteLabels(){return fi(this,_g,"f")}get transpose(){return fi(this,Pg,"f")}};kn=new WeakMap,wg=new WeakMap,bg=new WeakMap,Ag=new WeakMap,_g=new WeakMap,Pg=new WeakMap;var _p=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Tt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Is,Lr,Fu,Eg,Bg,Nu=class{constructor(e,t){Is.set(this,void 0),Lr.set(this,void 0),Fu.set(this,void 0),Eg.set(this,void 0),Bg.set(this,void 0),_p(this,Is,e,"f"),_p(this,Lr,t,"f"),_p(this,Fu,jt.create(Tt(this,Lr,"f").audioUnits,i=>Tt(this,Is,"f").boxAdapters.adapterFor(i,si),u.AudioUnits),"f"),_p(this,Eg,new Hm(Tt(this,Lr,"f").audioBusses.pointerHub,i=>Tt(this,Is,"f").boxAdapters.adapterFor(i,cr),u.AudioBusses),"f"),_p(this,Bg,new Sg(Tt(this,Lr,"f").pianoMode),"f")}get uuid(){return Tt(this,Lr,"f").address.uuid}get address(){return Tt(this,Lr,"f").address}get box(){return Tt(this,Lr,"f")}get audioBusses(){return Tt(this,Eg,"f")}get audioUnits(){return Tt(this,Fu,"f")}get clips(){return Tt(this,Fu,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return Tt(this,Is,"f").boxAdapters.adapterFor(Tt(this,Lr,"f").groove.targetVertex.unwrap("no groove").box,Fn)}get timeline(){return Tt(this,Is,"f").boxAdapters.adapterFor(Tt(this,Lr,"f").timeline.targetVertex.unwrap("no timeline").box,Bn)}get pianoMode(){return Tt(this,Bg,"f")}get created(){return new Date(Tt(this,Lr,"f").created.getValue())}get midiOutputDevices(){return Tt(this,Lr,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>Ne(e,Ci))}terminate(){Tt(this,Fu,"f").terminate()}};Is=new WeakMap,Lr=new WeakMap,Fu=new WeakMap,Eg=new WeakMap,Bg=new WeakMap;var sw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Qt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},lw,Pp,Wi,ua,i1,ku=class{constructor(e,t){lw.add(this),this.type="instrument",this.accepts="audio",Pp.set(this,void 0),Wi.set(this,void 0),ua.set(this,void 0),sw(this,Pp,e,"f"),sw(this,Wi,t,"f"),sw(this,ua,new he(Qt(this,Pp,"f")),"f"),this.namedParameter=Qt(this,lw,"m",i1).call(this,t)}get box(){return Qt(this,Wi,"f")}get uuid(){return Qt(this,Wi,"f").address.uuid}get address(){return Qt(this,Wi,"f").address}get labelField(){return Qt(this,Wi,"f").label}get iconField(){return Qt(this,Wi,"f").icon}get defaultTrackType(){return re.Audio}get enabledField(){return Qt(this,Wi,"f").enabled}get minimizedField(){return Qt(this,Wi,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return Qt(this,Pp,"f").boxAdapters.adapterFor(Qt(this,Wi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Qt(this,ua,"f").terminate()}};Pp=new WeakMap,Wi=new WeakMap,ua=new WeakMap,lw=new WeakSet,i1=function(e){return{flutter:Qt(this,ua,"f").createParameter(e.flutter,S.unipolar(),P.percent(),"flutter"),wow:Qt(this,ua,"f").createParameter(e.wow,S.unipolar(),P.percent(),"wow"),noise:Qt(this,ua,"f").createParameter(e.noise,S.unipolar(),P.percent(),"noise"),saturation:Qt(this,ua,"f").createParameter(e.saturation,S.unipolar(),P.percent(),"saturation")}};var $n=(()=>{let t=[1,2,3,4],i=["12","24","36","48"],n=[We.sine,We.triangle,We.saw,We.square],o=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:S.exponential(20,2e4),CUTOFF_STRING_MAPPING:P.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:t,FILTER_ORDER_STRINGS:i,FILTER_ORDER_VALUE_MAPPING:S.values(t),FILTER_ORDER_STRING_MAPPING:P.values("db",t,i),LFO_WAVEFORM_VALUES:n,LFO_WAVEFORM_STRINGS:o,LFO_WAVEFORM_VALUE_MAPPING:S.values(n),LFO_WAVEFORM_STRING_MAPPING:P.values("",n,o)}})();var uw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Be=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},cw,Sp,Zi,ze,n1,$u=class{constructor(e,t){cw.add(this),this.type="instrument",this.accepts="midi",Sp.set(this,void 0),Zi.set(this,void 0),ze.set(this,void 0),uw(this,Sp,e,"f"),uw(this,Zi,t,"f"),uw(this,ze,new he(Be(this,Sp,"f")),"f"),this.namedParameter=Be(this,cw,"m",n1).call(this,t)}get box(){return Be(this,Zi,"f")}get uuid(){return Be(this,Zi,"f").address.uuid}get address(){return Be(this,Zi,"f").address}get labelField(){return Be(this,Zi,"f").label}get iconField(){return Be(this,Zi,"f").icon}get defaultTrackType(){return re.Notes}get enabledField(){return Be(this,Zi,"f").enabled}get minimizedField(){return Be(this,Zi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Be(this,Sp,"f").boxAdapters.adapterFor(Be(this,Zi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Be(this,ze,"f").terminate()}};Sp=new WeakMap,Zi=new WeakMap,ze=new WeakMap,cw=new WeakSet,n1=function(e){let t=[un.Monophonic,un.Polyphonic];return{oscillators:e.oscillators.fields().map(i=>({waveform:Be(this,ze,"f").createParameter(i.waveform,S.linearInteger(0,3),P.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:Be(this,ze,"f").createParameter(i.volume,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:Be(this,ze,"f").createParameter(i.octave,S.linearInteger(-3,3),P.numeric({unit:"oct"}),"Octave",.5),tune:Be(this,ze,"f").createParameter(i.tune,S.linear(-1200,1200),P.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:Be(this,ze,"f").createParameter(e.noise.volume,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:Be(this,ze,"f").createParameter(e.noise.attack,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:Be(this,ze,"f").createParameter(e.noise.hold,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Hold"),release:Be(this,ze,"f").createParameter(e.noise.release,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:Be(this,ze,"f").createParameter(e.filterOrder,$n.FILTER_ORDER_VALUE_MAPPING,$n.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:Be(this,ze,"f").createParameter(e.cutoff,$n.CUTOFF_VALUE_MAPPING,$n.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:Be(this,ze,"f").createParameter(e.resonance,S.exponential(.01,10),P.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:Be(this,ze,"f").createParameter(e.attack,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:Be(this,ze,"f").createParameter(e.decay,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:Be(this,ze,"f").createParameter(e.sustain,S.unipolar(),P.percent({fractionDigits:1}),"Sustain"),release:Be(this,ze,"f").createParameter(e.release,S.exponential(.001,5),P.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:Be(this,ze,"f").createParameter(e.filterEnvelope,S.bipolar(),P.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:Be(this,ze,"f").createParameter(e.filterKeyboard,S.bipolar(),P.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:Be(this,ze,"f").createParameter(e.voicingMode,S.values(t),P.values("",t,["mono","poly"]),"Play Mode",.5),glideTime:Be(this,ze,"f").createParameter(e.glideTime,S.unipolar(),P.percent({fractionDigits:1}),"Glide time",0),unisonCount:Be(this,ze,"f").createParameter(e.unisonCount,S.values([1,3,5]),P.values("#",[1,3,5],[1,3,5].map(i=>String(i))),"Unisono",0),unisonDetune:Be(this,ze,"f").createParameter(e.unisonDetune,S.exponential(1,1200),P.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:Be(this,ze,"f").createParameter(e.unisonStereo,S.unipolar(),P.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:Be(this,ze,"f").createParameter(e.lfo.waveform,$n.LFO_WAVEFORM_VALUE_MAPPING,$n.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:Be(this,ze,"f").createParameter(e.lfo.rate,S.exponential(1e-4,30),P.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:Be(this,ze,"f").createParameter(e.lfo.targetTune,S.bipolar(),P.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:Be(this,ze,"f").createParameter(e.lfo.targetVolume,S.bipolar(),P.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:Be(this,ze,"f").createParameter(e.lfo.targetCutoff,S.bipolar(),P.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};var dw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Rt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},pw,Fg,Ep,mi,Mn,o1,Gi=class{constructor(e,t){pw.add(this),this.type="midi-effect",this.accepts="midi",Ep.set(this,void 0),mi.set(this,void 0),Mn.set(this,void 0),dw(this,Ep,e,"f"),dw(this,mi,t,"f"),dw(this,Mn,new he(Rt(this,Ep,"f")),"f"),this.namedParameter=Rt(this,pw,"m",o1).call(this,t)}get box(){return Rt(this,mi,"f")}get uuid(){return Rt(this,mi,"f").address.uuid}get address(){return Rt(this,mi,"f").address}get indexField(){return Rt(this,mi,"f").index}get labelField(){return Rt(this,mi,"f").label}get enabledField(){return Rt(this,mi,"f").enabled}get minimizedField(){return Rt(this,mi,"f").minimized}get host(){return Rt(this,mi,"f").host}deviceHost(){return Rt(this,Ep,"f").boxAdapters.adapterFor(Rt(this,mi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Rt(this,Mn,"f").terminate()}};Fg=Gi,Ep=new WeakMap,mi=new WeakMap,Mn=new WeakMap,pw=new WeakSet,o1=function(e){return{modeIndex:Rt(this,Mn,"f").createParameter(e.modeIndex,S.linearInteger(0,2),P.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:Rt(this,Mn,"f").createParameter(e.numOctaves,S.linearInteger(1,5),P.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:Rt(this,Mn,"f").createParameter(e.rateIndex,S.linearInteger(0,Fg.RateFractions.length-1),Fg.RateStringMapping,"Rate"),gate:Rt(this,Mn,"f").createParameter(e.gate,S.linear(0,2),P.percent({fractionDigits:0}),"Gate"),repeat:Rt(this,Mn,"f").createParameter(e.repeat,S.linearInteger(1,16),P.numeric({fractionDigits:0}),"Repeat"),velocity:Rt(this,Mn,"f").createParameter(e.velocity,S.bipolar(),P.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};Gi.RateFractions=ir.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();Gi.RateStringMapping=P.indices("",Fg.RateFractions.map(([r,e])=>`${r}/${e}`));var hw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Yt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},fw,Bp,gi,Cs,a1,Mu=class{constructor(e,t){fw.add(this),this.type="midi-effect",this.accepts="midi",Bp.set(this,void 0),gi.set(this,void 0),Cs.set(this,void 0),hw(this,Bp,e,"f"),hw(this,gi,t,"f"),hw(this,Cs,new he(Yt(this,Bp,"f")),"f"),this.namedParameter=Yt(this,fw,"m",a1).call(this,t)}get box(){return Yt(this,gi,"f")}get uuid(){return Yt(this,gi,"f").address.uuid}get address(){return Yt(this,gi,"f").address}get indexField(){return Yt(this,gi,"f").index}get labelField(){return Yt(this,gi,"f").label}get enabledField(){return Yt(this,gi,"f").enabled}get minimizedField(){return Yt(this,gi,"f").minimized}get host(){return Yt(this,gi,"f").host}deviceHost(){return Yt(this,Bp,"f").boxAdapters.adapterFor(Yt(this,gi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Yt(this,Cs,"f").terminate()}};Bp=new WeakMap,gi=new WeakMap,Cs=new WeakMap,fw=new WeakSet,a1=function(e){return{octaves:Yt(this,Cs,"f").createParameter(e.octaves,S.linearInteger(-7,7),P.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:Yt(this,Cs,"f").createParameter(e.semiTones,S.linearInteger(-36,36),P.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:Yt(this,Cs,"f").createParameter(e.cents,S.linear(-50,50),P.numeric({unit:"cents",fractionDigits:1}),"cents")}};var mw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Pr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},gw,Fp,qi,Du,s1,Iu=class{constructor(e,t){gw.add(this),this.type="instrument",this.accepts="midi",Fp.set(this,void 0),qi.set(this,void 0),Du.set(this,void 0),mw(this,Fp,e,"f"),mw(this,qi,t,"f"),mw(this,Du,new he(Pr(this,Fp,"f")),"f"),this.namedParameter=Pr(this,gw,"m",s1).call(this,t)}get box(){return Pr(this,qi,"f")}get uuid(){return Pr(this,qi,"f").address.uuid}get address(){return Pr(this,qi,"f").address}get labelField(){return Pr(this,qi,"f").label}get iconField(){return Pr(this,qi,"f").icon}get defaultTrackType(){return re.Notes}get enabledField(){return Pr(this,qi,"f").enabled}get minimizedField(){return Pr(this,qi,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Pr(this,Fp,"f").boxAdapters.adapterFor(Pr(this,qi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Pr(this,Du,"f").terminate()}};Fp=new WeakMap,qi=new WeakMap,Du=new WeakMap,gw=new WeakSet,s1=function(e){return{volume:Pr(this,Du,"f").createParameter(e.volume,S.DefaultDecibel,P.numeric({unit:"db",fractionDigits:1}),"volume"),release:Pr(this,Du,"f").createParameter(e.release,S.exponential(.001,8),P.numeric({unit:"s",fractionDigits:3}),"release")}};var Cu=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},H=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},vw,Ts,ca,be,Ng,kg,Kr,Tu,l1,Ru=class{constructor(e,t){vw.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",Ts.set(this,new U),ca.set(this,void 0),be.set(this,void 0),Ng.set(this,void 0),kg.set(this,void 0),Kr.set(this,void 0),Tu.set(this,g.None),Cu(this,ca,e,"f"),Cu(this,be,t,"f"),Cu(this,Ng,H(this,Ts,"f").own(jt.create(H(this,be,"f").midiEffects,i=>H(this,ca,"f").boxAdapters.adapterFor(i,ie.isMidiEffect),u.MidiEffectHost)),"f"),Cu(this,kg,H(this,Ts,"f").own(jt.create(H(this,be,"f").audioEffects,i=>H(this,ca,"f").boxAdapters.adapterFor(i,ie.isAudioEffect),u.AudioEffectHost)),"f"),Cu(this,Kr,H(this,Ts,"f").own(new he(H(this,ca,"f"))),"f"),this.namedParameter=H(this,vw,"m",l1).call(this,t),H(this,Ts,"f").own(H(this,be,"f").file.catchupAndSubscribe(i=>{Cu(this,Tu,i.targetVertex.map(({box:n})=>H(this,ca,"f").boxAdapters.adapterFor(n,Ri)),"f"),H(this,Tu,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return H(this,be,"f")}get uuid(){return H(this,be,"f").address.uuid}get address(){return H(this,be,"f").address}get peakAddress(){return H(this,be,"f").address.append(1001)}get indexField(){return H(this,be,"f").index}get gate(){return H(this,be,"f").gate.getValue()}get exclude(){return H(this,be,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${H(this,Tu,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return H(this,be,"f").icon}get defaultTrackType(){return re.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return H(this,be,"f").midiEffects}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return H(this,be,"f").audioEffects}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}file(){return H(this,Tu,"f")}fileUUID(){return H(this,be,"f").file.targetAddress.unwrap().uuid}resetParameters(){H(this,be,"f").mute.reset(),H(this,be,"f").solo.reset(),H(this,be,"f").exclude.reset(),H(this,be,"f").polyphone.reset(),H(this,be,"f").pitch.reset(),H(this,be,"f").attack.reset(),H(this,be,"f").release.reset(),H(this,be,"f").sampleStart.reset(),H(this,be,"f").sampleEnd.reset(),H(this,be,"f").gate.reset()}copyToIndex(e){Co.create(H(this,be,"f").graph,A.generate(),t=>{t.file.refer(H(this,be,"f").file.targetVertex.unwrap()),t.device.refer(H(this,be,"f").device.targetVertex.unwrap()),t.index.setValue(e),t.mute.setValue(H(this,be,"f").mute.getValue()),t.solo.setValue(H(this,be,"f").solo.getValue()),t.sampleStart.setValue(H(this,be,"f").sampleStart.getValue()),t.sampleEnd.setValue(H(this,be,"f").sampleEnd.getValue()),t.attack.setValue(H(this,be,"f").attack.getValue()),t.release.setValue(H(this,be,"f").release.getValue()),t.pitch.setValue(H(this,be,"f").pitch.getValue()),t.exclude.setValue(H(this,be,"f").exclude.getValue()),t.gate.setValue(H(this,be,"f").gate.getValue())})}get midiEffects(){return H(this,Ng,"f")}get inputAdapter(){return g.wrap(this)}get audioEffects(){return H(this,kg,"f")}get labelField(){return H(this,be,"f").label}get enabledField(){return H(this,be,"f").enabled}get minimizedField(){return H(this,be,"f").minimized}device(){return H(this,ca,"f").boxAdapters.adapterFor(H(this,be,"f").device.targetVertex.unwrap().box,da)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){H(this,Ts,"f").terminate()}};Ts=new WeakMap,ca=new WeakMap,be=new WeakMap,Ng=new WeakMap,kg=new WeakMap,Kr=new WeakMap,Tu=new WeakMap,vw=new WeakSet,l1=function(e){return{gate:H(this,Kr,"f").createParameter(e.gate,S.linearInteger(0,2),P.indices("",["Off","On","Loop"]),"Gate"),mute:H(this,Kr,"f").createParameter(e.mute,S.bool,P.bool,"Mute"),solo:H(this,Kr,"f").createParameter(e.solo,S.bool,P.bool,"Solo"),polyphone:H(this,Kr,"f").createParameter(e.polyphone,S.bool,P.bool,"Polyphone"),exclude:H(this,Kr,"f").createParameter(e.exclude,S.bool,P.bool,"Exclude"),pitch:H(this,Kr,"f").createParameter(e.pitch,S.linear(-1200,1200),P.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:H(this,Kr,"f").createParameter(e.sampleStart,S.unipolar(),P.percent(),"Start",0),sampleEnd:H(this,Kr,"f").createParameter(e.sampleEnd,S.unipolar(),P.percent(),"End",1),attack:H(this,Kr,"f").createParameter(e.attack,S.exponential(.001,5),P.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:H(this,Kr,"f").createParameter(e.release,S.exponential(.001,5),P.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release")}};var $g=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Sr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ou,Hi,Np,Mg,da=class{constructor(e,t){this.type="instrument",this.accepts="midi",Ou.set(this,void 0),Hi.set(this,void 0),Np.set(this,void 0),Mg.set(this,void 0),$g(this,Ou,e,"f"),$g(this,Hi,t,"f"),$g(this,Np,jt.create(t.samples,i=>e.boxAdapters.adapterFor(i,Ru),u.Sample),"f"),$g(this,Mg,new he(Sr(this,Ou,"f")),"f")}reset(){Sr(this,Np,"f").adapters().forEach(e=>e.box.delete())}get box(){return Sr(this,Hi,"f")}get uuid(){return Sr(this,Hi,"f").address.uuid}get address(){return Sr(this,Hi,"f").address}get labelField(){return Sr(this,Hi,"f").label}get iconField(){return Sr(this,Hi,"f").icon}get defaultTrackType(){return re.Notes}get enabledField(){return Sr(this,Hi,"f").enabled}get minimizedField(){return Sr(this,Hi,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return Sr(this,Np,"f")}get context(){return Sr(this,Ou,"f")}deviceHost(){return Sr(this,Ou,"f").boxAdapters.adapterFor(Sr(this,Hi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Sr(this,Mg,"f").terminate()}};Ou=new WeakMap,Hi=new WeakMap,Np=new WeakMap,Mg=new WeakMap;var yw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ot=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},xw,kp,vi,Dn,u1,Vu=class{constructor(e,t){xw.add(this),this.type="audio-effect",this.accepts="audio",kp.set(this,void 0),vi.set(this,void 0),Dn.set(this,void 0),yw(this,kp,e,"f"),yw(this,vi,t,"f"),yw(this,Dn,new he(Ot(this,kp,"f")),"f"),this.namedParameter=Ot(this,xw,"m",u1).call(this,t)}get box(){return Ot(this,vi,"f")}get uuid(){return Ot(this,vi,"f").address.uuid}get address(){return Ot(this,vi,"f").address}get indexField(){return Ot(this,vi,"f").index}get labelField(){return Ot(this,vi,"f").label}get enabledField(){return Ot(this,vi,"f").enabled}get minimizedField(){return Ot(this,vi,"f").minimized}get host(){return Ot(this,vi,"f").host}deviceHost(){return Ot(this,kp,"f").boxAdapters.adapterFor(Ot(this,vi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Ot(this,Dn,"f").terminate()}};kp=new WeakMap,vi=new WeakMap,Dn=new WeakMap,xw=new WeakSet,u1=function(e){return{volume:Ot(this,Dn,"f").createParameter(e.volume,S.decibel(-72,0,12),P.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:Ot(this,Dn,"f").createParameter(e.panning,S.bipolar(),P.panning,"Panning",.5),stereo:Ot(this,Dn,"f").createParameter(e.stereo,S.bipolar(),P.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:Ot(this,Dn,"f").createParameter(e.invertL,S.bool,P.bool,"Invert Left"),invertR:Ot(this,Dn,"f").createParameter(e.invertR,S.bool,P.bool,"Invert Right"),swap:Ot(this,Dn,"f").createParameter(e.swap,S.bool,P.bool,"Swap")}};var Rs;(function(r){r.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(Rs||(Rs={}));var c1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Er=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},zu,Br,Uu=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",zu.set(this,void 0),Br.set(this,void 0),c1(this,zu,e,"f"),c1(this,Br,t,"f"),this.groove()}get box(){return Er(this,Br,"f")}get uuid(){return Er(this,Br,"f").address.uuid}get address(){return Er(this,Br,"f").address}get indexField(){return Er(this,Br,"f").index}get labelField(){return Er(this,Br,"f").label}get enabledField(){return Er(this,Br,"f").enabled}get minimizedField(){return Er(this,Br,"f").minimized}get host(){return Er(this,Br,"f").host}deviceHost(){return Er(this,zu,"f").boxAdapters.adapterFor(Er(this,Br,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}groove(){return Er(this,zu,"f").boxAdapters.adapterFor(Er(this,Br,"f").groove.targetVertex.unwrap("no groove").box,Rs.checkType)}catchupAndSubscribeGroove(e){return Er(this,Br,"f").groove.catchupAndSubscribe(t=>e(Er(this,zu,"f").boxAdapters.adapterFor(t.targetVertex.unwrap("No groove found").box,Rs.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};zu=new WeakMap,Br=new WeakMap;var d1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ji=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Dg,Wr,ju=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",Dg.set(this,void 0),Wr.set(this,void 0),d1(this,Dg,e,"f"),d1(this,Wr,t,"f")}get box(){return Ji(this,Wr,"f")}get uuid(){return Ji(this,Wr,"f").address.uuid}get address(){return Ji(this,Wr,"f").address}get indexField(){return Ji(this,Wr,"f").index}get labelField(){return Ji(this,Wr,"f").label}get enabledField(){return Ji(this,Wr,"f").enabled}get minimizedField(){return Ji(this,Wr,"f").minimized}get host(){return Ji(this,Wr,"f").host}get commentField(){return Ji(this,Wr,"f").comment}deviceHost(){return Ji(this,Dg,"f").boxAdapters.adapterFor(Ji(this,Wr,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Dg=new WeakMap,Wr=new WeakMap;var p1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Qi=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ig,Zr,Lu=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",Ig.set(this,void 0),Zr.set(this,void 0),p1(this,Ig,e,"f"),p1(this,Zr,t,"f")}get box(){return Qi(this,Zr,"f")}get uuid(){return Qi(this,Zr,"f").address.uuid}get address(){return Qi(this,Zr,"f").address}get indexField(){return Qi(this,Zr,"f").index}get labelField(){return Qi(this,Zr,"f").label}get enabledField(){return Qi(this,Zr,"f").enabled}get minimizedField(){return Qi(this,Zr,"f").minimized}get host(){return Qi(this,Zr,"f").host}get commentField(){return Qi(this,Zr,"f").comment}deviceHost(){return Qi(this,Ig,"f").boxAdapters.adapterFor(Qi(this,Zr,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Ig=new WeakMap,Zr=new WeakMap;var pa=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Fe=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},ww,bw,$p,Fr,Cg,Ku,Yi,yi,Wu,h1,Aw,Zu=class{constructor(e,t){ww.add(this),this.type="instrument",this.accepts="midi",bw.set(this,new U),$p.set(this,void 0),Fr.set(this,void 0),Cg.set(this,void 0),Ku.set(this,void 0),Yi.set(this,void 0),yi.set(this,void 0),Wu.set(this,K.Empty),Aw.set(this,i=>i.match({none:()=>{Fe(this,yi,"f").clear(),Fe(this,Yi,"f").clear()},some:n=>n.soundfont.match({none:()=>{Fe(this,yi,"f").clear(),Fe(this,Yi,"f").clear(),Fe(this,Wu,"f").terminate(),pa(this,Wu,n.subscribe(o=>{if(o.type==="loaded"){let a=n.soundfont.unwrap();Fe(this,yi,"f").wrap(a.presets[this.presetIndex]??a.presets[0]),Fe(this,Yi,"f").wrap(a)}else o.type==="error"?(Fe(this,yi,"f").clear(),Fe(this,Yi,"f").clear()):o.type==="idle"&&(Fe(this,yi,"f").clear(),Fe(this,Yi,"f").clear())}),"f")},some:o=>{Fe(this,Yi,"f").wrap(o),Fe(this,yi,"f").wrap(o.presets[this.presetIndex]??o.presets[0])}})})),pa(this,$p,e,"f"),pa(this,Fr,t,"f"),pa(this,Cg,new he(Fe(this,$p,"f")),"f"),this.namedParameter=Fe(this,ww,"m",h1).call(this,t),pa(this,Ku,new Yr,"f"),pa(this,Yi,new Yr,"f"),pa(this,yi,new Yr,"f"),Fe(this,bw,"f").ownAll(Fe(this,Ku,"f").subscribe(Fe(this,Aw,"f")),Fe(this,Fr,"f").file.catchupAndSubscribe(({targetVertex:i})=>Fe(this,Ku,"f").wrapOption(i.map(({box:n})=>e.soundfontManager.getOrCreate(n.address.uuid)))),Fe(this,Fr,"f").presetIndex.catchupAndSubscribe(i=>Fe(this,Yi,"f").match({none:()=>Fe(this,yi,"f").clear(),some:n=>Fe(this,yi,"f").wrap(n.presets[i.getValue()]??n.presets[0])})))}get loader(){return Fe(this,Ku,"f")}get soundfont(){return Fe(this,Yi,"f")}get preset(){return Fe(this,yi,"f")}get presetIndex(){return Fe(this,Fr,"f").presetIndex.getValue()}get box(){return Fe(this,Fr,"f")}get uuid(){return Fe(this,Fr,"f").address.uuid}get address(){return Fe(this,Fr,"f").address}get labelField(){return Fe(this,Fr,"f").label}get iconField(){return Fe(this,Fr,"f").icon}get defaultTrackType(){return re.Notes}get enabledField(){return Fe(this,Fr,"f").enabled}get minimizedField(){return Fe(this,Fr,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Fe(this,$p,"f").boxAdapters.adapterFor(Fe(this,Fr,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Fe(this,Wu,"f").terminate(),pa(this,Wu,K.Empty,"f"),Fe(this,Cg,"f").terminate()}};bw=new WeakMap,$p=new WeakMap,Fr=new WeakMap,Cg=new WeakMap,Ku=new WeakMap,Yi=new WeakMap,yi=new WeakMap,Wu=new WeakMap,Aw=new WeakMap,ww=new WeakSet,h1=function(e){return{}};var f1=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Mp=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Tg,Os,Rg=class{constructor(e,t){Tg.set(this,void 0),Os.set(this,void 0),f1(this,Tg,e,"f"),f1(this,Os,t,"f")}get box(){return Mp(this,Os,"f")}get uuid(){return Mp(this,Os,"f").address.uuid}get address(){return Mp(this,Os,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return Mp(this,Tg,"f").soundfontManager.getOrCreate(Mp(this,Os,"f").address.uuid)}terminate(){}};Tg=new WeakMap,Os=new WeakMap;var _w=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},ot=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Pw,Dp,xi,Xt,m1,Gu=class{constructor(e,t){Pw.add(this),this.type="audio-effect",this.accepts="audio",Dp.set(this,void 0),xi.set(this,void 0),Xt.set(this,void 0),_w(this,Dp,e,"f"),_w(this,xi,t,"f"),_w(this,Xt,new he(ot(this,Dp,"f")),"f"),this.namedParameter=ot(this,Pw,"m",m1).call(this,t)}get box(){return ot(this,xi,"f")}get uuid(){return ot(this,xi,"f").address.uuid}get address(){return ot(this,xi,"f").address}get indexField(){return ot(this,xi,"f").index}get labelField(){return ot(this,xi,"f").label}get enabledField(){return ot(this,xi,"f").enabled}get minimizedField(){return ot(this,xi,"f").minimized}get host(){return ot(this,xi,"f").host}deviceHost(){return ot(this,Dp,"f").boxAdapters.adapterFor(ot(this,xi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){ot(this,Xt,"f").terminate()}};Dp=new WeakMap,xi=new WeakMap,Xt=new WeakMap,Pw=new WeakSet,m1=function(e){return{lookahead:ot(this,Xt,"f").createParameter(e.lookahead,S.bool,P.bool,"Lookahead"),automakeup:ot(this,Xt,"f").createParameter(e.automakeup,S.bool,P.bool,"Auto Makeup"),autoattack:ot(this,Xt,"f").createParameter(e.autoattack,S.bool,P.bool,"Auto Attack"),autorelease:ot(this,Xt,"f").createParameter(e.autorelease,S.bool,P.bool,"Auto Release"),inputgain:ot(this,Xt,"f").createParameter(e.inputgain,S.linear(-30,30),P.decible,"Input Gain"),threshold:ot(this,Xt,"f").createParameter(e.threshold,S.linear(-60,0),P.decible,"Threshold"),ratio:ot(this,Xt,"f").createParameter(e.ratio,S.exponential(1,24),P.numeric({fractionDigits:1}),"Ratio"),knee:ot(this,Xt,"f").createParameter(e.knee,S.linear(0,24),P.decible,"Knee"),attack:ot(this,Xt,"f").createParameter(e.attack,S.linear(0,100),P.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:ot(this,Xt,"f").createParameter(e.release,S.linear(5,1500),P.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:ot(this,Xt,"f").createParameter(e.makeup,S.linear(-40,40),P.decible,"Makeup Gain"),mix:ot(this,Xt,"f").createParameter(e.mix,S.unipolar(),P.percent(),"Dry/Wet")}};var Sw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Zt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Ew,Ip,wi,ha,g1,qu=class{constructor(e,t){Ew.add(this),this.type="audio-effect",this.accepts="audio",Ip.set(this,void 0),wi.set(this,void 0),ha.set(this,void 0),Sw(this,Ip,e,"f"),Sw(this,wi,t,"f"),Sw(this,ha,new he(Zt(this,Ip,"f")),"f"),this.namedParameter=Zt(this,Ew,"m",g1).call(this,t)}get box(){return Zt(this,wi,"f")}get uuid(){return Zt(this,wi,"f").address.uuid}get address(){return Zt(this,wi,"f").address}get indexField(){return Zt(this,wi,"f").index}get labelField(){return Zt(this,wi,"f").label}get enabledField(){return Zt(this,wi,"f").enabled}get minimizedField(){return Zt(this,wi,"f").minimized}get host(){return Zt(this,wi,"f").host}deviceHost(){return Zt(this,Ip,"f").boxAdapters.adapterFor(Zt(this,wi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Zt(this,ha,"f").terminate()}};Ip=new WeakMap,wi=new WeakMap,ha=new WeakMap,Ew=new WeakSet,g1=function(e){return{crush:Zt(this,ha,"f").createParameter(e.crush,S.unipolar(),P.percent(),"Crush"),bits:Zt(this,ha,"f").createParameter(e.bits,S.linearInteger(1,16),P.numeric(),"Bits"),boost:Zt(this,ha,"f").createParameter(e.boost,S.linear(0,24),P.decible,"Boost"),mix:Zt(this,ha,"f").createParameter(e.mix,S.exponential(.001,1),P.percent(),"Mix")}};var Bw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},hr=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Fw,Cp,bi,Hu,v1,Ju=class{constructor(e,t){Fw.add(this),this.type="audio-effect",this.accepts="audio",Cp.set(this,void 0),bi.set(this,void 0),Hu.set(this,void 0),Bw(this,Cp,e,"f"),Bw(this,bi,t,"f"),Bw(this,Hu,new he(hr(this,Cp,"f")),"f"),this.namedParameter=hr(this,Fw,"m",v1).call(this,t)}get box(){return hr(this,bi,"f")}get uuid(){return hr(this,bi,"f").address.uuid}get address(){return hr(this,bi,"f").address}get indexField(){return hr(this,bi,"f").index}get labelField(){return hr(this,bi,"f").label}get enabledField(){return hr(this,bi,"f").enabled}get minimizedField(){return hr(this,bi,"f").minimized}get host(){return hr(this,bi,"f").host}deviceHost(){return hr(this,Cp,"f").boxAdapters.adapterFor(hr(this,bi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){hr(this,Hu,"f").terminate()}};Cp=new WeakMap,bi=new WeakMap,Hu=new WeakMap,Fw=new WeakSet,v1=function(e){return{drive:hr(this,Hu,"f").createParameter(e.drive,S.linear(0,30),P.decible,"Drive"),volume:hr(this,Hu,"f").createParameter(e.volume,S.linear(-18,0),P.decible,"Volume")}};var Og=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Ft=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Tp,Rp,Ai,Qu,Yu,Xu=class{constructor(e,t){Tp.set(this,new U),this.type="instrument",this.accepts="midi",Rp.set(this,void 0),Ai.set(this,void 0),Qu.set(this,void 0),Yu.set(this,void 0),Og(this,Rp,e,"f"),Og(this,Ai,t,"f"),Og(this,Qu,new Yr,"f"),Og(this,Yu,Ft(this,Tp,"f").own(new he(Ft(this,Rp,"f"))),"f"),Ft(this,Tp,"f").ownAll(t.parameters.pointerHub.catchupAndSubscribe({onAdded:({box:i})=>Ft(this,Yu,"f").createParameter(Ne(i,Ti).value,S.unipolar(),P.percent({fractionDigits:1}),"",0),onRemoved:({box:i})=>Ft(this,Yu,"f").removeParameter(Ne(i,Ti).value.address)}),Ft(this,Ai,"f").device.catchupAndSubscribe(({targetVertex:i})=>i.match({none:()=>Ft(this,Qu,"f").clear(),some:({box:n})=>Ft(this,Qu,"f").wrap(Ne(n,Ci))})))}get box(){return Ft(this,Ai,"f")}get uuid(){return Ft(this,Ai,"f").address.uuid}get address(){return Ft(this,Ai,"f").address}get labelField(){return Ft(this,Ai,"f").label}get iconField(){return Ft(this,Ai,"f").icon}get defaultTrackType(){return re.Notes}get enabledField(){return Ft(this,Ai,"f").enabled}get minimizedField(){return Ft(this,Ai,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return Ft(this,Yu,"f")}get midiDevice(){return Ft(this,Qu,"f")}deviceHost(){return Ft(this,Rp,"f").boxAdapters.adapterFor(Ft(this,Ai,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Ft(this,Tp,"f").terminate()}};Tp=new WeakMap,Rp=new WeakMap,Ai=new WeakMap,Qu=new WeakMap,Yu=new WeakMap;var Vg=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},bt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Nw,Op,_i,In,Vp,y1,ec=class{constructor(e,t){Nw.add(this),this.type="midi-effect",this.accepts="midi",Op.set(this,void 0),_i.set(this,void 0),In.set(this,void 0),Vp.set(this,void 0),Vg(this,Op,e,"f"),Vg(this,_i,t,"f"),Vg(this,In,new he(bt(this,Op,"f")),"f"),Vg(this,Vp,Xs.create(),"f"),this.namedParameter=bt(this,Nw,"m",y1).call(this,t)}computeVelocity(e,t){let{magnetPosition:i,magnetStrength:n,randomSeed:o,randomAmount:a,offset:s,mix:l}=this.namedParameter;bt(this,Vp,"f").setSeed(o.valueAt(e)+e);let c=t+(i.valueAt(e)-t)*n.valueAt(e),p=(bt(this,Vp,"f").uniform()*2-1)*a.valueAt(e),d=s.valueAt(e),f=l.valueAt(e);return t*(1-f)+Jr(c+p+d)*f}get box(){return bt(this,_i,"f")}get uuid(){return bt(this,_i,"f").address.uuid}get address(){return bt(this,_i,"f").address}get indexField(){return bt(this,_i,"f").index}get labelField(){return bt(this,_i,"f").label}get enabledField(){return bt(this,_i,"f").enabled}get minimizedField(){return bt(this,_i,"f").minimized}get host(){return bt(this,_i,"f").host}deviceHost(){return bt(this,Op,"f").boxAdapters.adapterFor(bt(this,_i,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){bt(this,In,"f").terminate()}};Op=new WeakMap,_i=new WeakMap,In=new WeakMap,Vp=new WeakMap,Nw=new WeakSet,y1=function(e){return{magnetPosition:bt(this,In,"f").createParameter(e.magnetPosition,S.unipolar(),P.percent(),"Position"),magnetStrength:bt(this,In,"f").createParameter(e.magnetStrength,S.unipolar(),P.percent(),"Strength"),randomSeed:bt(this,In,"f").createParameter(e.randomSeed,S.linearInteger(0,65535),P.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:bt(this,In,"f").createParameter(e.randomAmount,S.unipolar(),P.percent(),"Amount"),offset:bt(this,In,"f").createParameter(e.offset,S.bipolar(),P.percent(),"Offset"),mix:bt(this,In,"f").createParameter(e.mix,S.unipolar(),P.percent(),"Mix")}};var kw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Vt=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},$w,Mw,zp,Pi,Cn,x1,Xi=class{constructor(e,t){$w.add(this),this.type="audio-effect",this.accepts="audio",zp.set(this,void 0),Pi.set(this,void 0),Cn.set(this,void 0),kw(this,zp,e,"f"),kw(this,Pi,t,"f"),kw(this,Cn,new he(Vt(this,zp,"f")),"f"),this.namedParameter=Vt(this,$w,"m",x1).call(this,t)}get box(){return Vt(this,Pi,"f")}get uuid(){return Vt(this,Pi,"f").address.uuid}get address(){return Vt(this,Pi,"f").address}get indexField(){return Vt(this,Pi,"f").index}get labelField(){return Vt(this,Pi,"f").label}get enabledField(){return Vt(this,Pi,"f").enabled}get minimizedField(){return Vt(this,Pi,"f").minimized}get host(){return Vt(this,Pi,"f").host}deviceHost(){return Vt(this,zp,"f").boxAdapters.adapterFor(Vt(this,Pi,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Vt(this,Cn,"f").terminate()}};Mw=Xi,zp=new WeakMap,Pi=new WeakMap,Cn=new WeakMap,$w=new WeakSet,x1=function(e){let{RateFractions:t,RateStringMapping:i}=Mw;return{slope:Vt(this,Cn,"f").createParameter(e.slope,S.bipolar(),P.percent({fractionDigits:1}),"Slope",.5),symmetry:Vt(this,Cn,"f").createParameter(e.symmetry,S.unipolar(),P.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:Vt(this,Cn,"f").createParameter(e.rate,S.values(t.map((n,o)=>o)),i,"Rate",0),depth:Vt(this,Cn,"f").createParameter(e.depth,S.unipolar(),P.percent({fractionDigits:1}),"Depth",0),offset:Vt(this,Cn,"f").createParameter(e.offset,S.linear(-180,180),P.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:Vt(this,Cn,"f").createParameter(e.channelOffset,S.linear(-180,180),P.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};Xi.RateFractions=ir.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();Xi.RateStringMapping=P.indices("",Mw.RateFractions.map(([r,e])=>`${r}/${e}`));var Dw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},at=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Iw,Up,Si,er,w1,tc=class{constructor(e,t){Iw.add(this),this.type="audio-effect",this.accepts="audio",Up.set(this,void 0),Si.set(this,void 0),er.set(this,void 0),Dw(this,Up,e,"f"),Dw(this,Si,t,"f"),Dw(this,er,new he(at(this,Up,"f")),"f"),this.namedParameter=at(this,Iw,"m",w1).call(this,t)}get box(){return at(this,Si,"f")}get uuid(){return at(this,Si,"f").address.uuid}get address(){return at(this,Si,"f").address}get indexField(){return at(this,Si,"f").index}get labelField(){return at(this,Si,"f").label}get enabledField(){return at(this,Si,"f").enabled}get minimizedField(){return at(this,Si,"f").minimized}get host(){return at(this,Si,"f").host}deviceHost(){return at(this,Up,"f").boxAdapters.adapterFor(at(this,Si,"f").host.targetVertex.unwrap("no device-host").box,ie.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){at(this,er,"f").terminate()}};Up=new WeakMap,Si=new WeakMap,er=new WeakMap,Iw=new WeakSet,w1=function(e){return{preDelay:at(this,er,"f").createParameter(e.preDelay,S.linear(0,1e3),P.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:at(this,er,"f").createParameter(e.bandwidth,S.unipolar(),P.percent(),"Bandwidth"),inputDiffusion1:at(this,er,"f").createParameter(e.inputDiffusion1,S.unipolar(),P.percent(),"Tank 1"),inputDiffusion2:at(this,er,"f").createParameter(e.inputDiffusion2,S.unipolar(),P.percent(),"Tank 2"),decay:at(this,er,"f").createParameter(e.decay,S.unipolar(),P.percent(),"Decay"),decayDiffusion1:at(this,er,"f").createParameter(e.decayDiffusion1,S.unipolar(),P.percent(),"Tank 1"),decayDiffusion2:at(this,er,"f").createParameter(e.decayDiffusion2,S.unipolar(),P.percent(),"Tank 2"),damping:at(this,er,"f").createParameter(e.damping,S.unipolar(),P.percent(),"Damping"),excursionRate:at(this,er,"f").createParameter(e.excursionRate,S.unipolar(),P.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:at(this,er,"f").createParameter(e.excursionDepth,S.unipolar(),P.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:at(this,er,"f").createParameter(e.wet,S.DefaultDecibel,P.decible,"Wet"),dry:at(this,er,"f").createParameter(e.dry,S.DefaultDecibel,P.decible,"Dry")}};var zg=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},J=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Cw,X,fo,jp,Ug,b1,jg=class{constructor(e){Cw.add(this),X.set(this,void 0),fo.set(this,void 0),jp.set(this,void 0),Ug.set(this,void 0),zg(this,X,e,"f"),zg(this,fo,A.newSet(t=>t.uuid),"f"),zg(this,jp,new Set,"f"),zg(this,Ug,J(this,X,"f").boxGraph.subscribeToAllUpdates({onUpdate:t=>{if(t.type==="delete"){let i=J(this,fo,"f").getOrNull(t.uuid);Z(i)&&(J(this,jp,"f").add(i.box),J(this,fo,"f").removeByValue(i).terminate())}}}),"f")}terminate(){J(this,fo,"f").values().forEach(e=>e.terminate()),J(this,fo,"f").clear(),J(this,Ug,"f").terminate()}adapterFor(e,t){if(J(this,jp,"f").has(e))return F(`Cannot resolve adapter for already deleted box: ${e}`);let i=J(this,fo,"f").getOrNull(e.address.uuid);if(i===null){i=J(this,Cw,"m",b1).call(this,e);let n=J(this,fo,"f").add(i);I(n,`Could not add adapter for ${e}`)}return typeof t=="function"?Object.hasOwn(t,"prototype")?i instanceof t?i:F(`${i} is not instance of ${t}`):t(i)?i:F(`${i} did not pass custom type guard`):F("Unknown checkType method")}};X=new WeakMap,fo=new WeakMap,jp=new WeakMap,Ug=new WeakMap,Cw=new WeakSet,b1=function(e){return ee(e.accept({visitArpeggioDeviceBox:t=>new Gi(J(this,X,"f"),t),visitAudioBusBox:t=>new cr(J(this,X,"f"),t),visitAudioClipBox:t=>new to(J(this,X,"f"),t),visitAudioFileBox:t=>new Ri(J(this,X,"f"),t),visitAudioTimeStretchBox:t=>new gn(J(this,X,"f"),t),visitAudioPitchStretchBox:t=>new fn(J(this,X,"f"),t),visitTransientMarkerBox:t=>new Fl(t),visitWarpMarkerBox:t=>new jo(J(this,X,"f"),t),visitAudioRegionBox:t=>new Zo(J(this,X,"f"),t),visitAudioUnitBox:t=>new si(J(this,X,"f"),t),visitAuxSendBox:t=>new nu(J(this,X,"f"),t),visitCompressorDeviceBox:t=>new Gu(J(this,X,"f"),t),visitCrusherDeviceBox:t=>new qu(J(this,X,"f"),t),visitDattorroReverbDeviceBox:t=>new tc(J(this,X,"f"),t),visitDelayDeviceBox:t=>new ui(J(this,X,"f"),t),visitDeviceInterfaceKnobBox:t=>new xu(J(this,X,"f"),t),visitTidalDeviceBox:t=>new Xi(J(this,X,"f"),t),visitFoldDeviceBox:t=>new Ju(J(this,X,"f"),t),visitGrooveShuffleBox:t=>new Fn(J(this,X,"f"),t),visitMarkerBox:t=>new ea(J(this,X,"f"),t),visitMIDIOutputDeviceBox:t=>new Xu(J(this,X,"f"),t),visitModularAudioInputBox:t=>new vu(J(this,X,"f"),t),visitModularAudioOutputBox:t=>new fu(J(this,X,"f"),t),visitModularBox:t=>new ia(J(this,X,"f"),t),visitModularDeviceBox:t=>new oa(J(this,X,"f"),t),visitModuleConnectionBox:t=>new ra(J(this,X,"f"),t),visitModuleDelayBox:t=>new hu(J(this,X,"f"),t),visitModuleGainBox:t=>new mu(J(this,X,"f"),t),visitModuleMultiplierBox:t=>new gu(J(this,X,"f"),t),visitNanoDeviceBox:t=>new Iu(J(this,X,"f"),t),visitNoteClipBox:t=>new Ul(J(this,X,"f"),t),visitNoteEventBox:t=>new ns(J(this,X,"f"),t),visitNoteEventCollectionBox:t=>new ri(J(this,X,"f"),t),visitNoteRegionBox:t=>new Go(J(this,X,"f"),t),visitPitchDeviceBox:t=>new Mu(J(this,X,"f"),t),visitPlayfieldDeviceBox:t=>new da(J(this,X,"f"),t),visitPlayfieldSampleBox:t=>new Ru(J(this,X,"f"),t),visitRevampDeviceBox:t=>new du(J(this,X,"f"),t),visitReverbDeviceBox:t=>new cu(J(this,X,"f"),t),visitRootBox:t=>new Nu(J(this,X,"f"),t),visitSoundfontDeviceBox:t=>new Zu(J(this,X,"f"),t),visitSoundfontFileBox:t=>new Rg(J(this,X,"f"),t),visitStereoToolDeviceBox:t=>new Vu(J(this,X,"f"),t),visitTapeDeviceBox:t=>new ku(J(this,X,"f"),t),visitTimelineBox:t=>new Bn(J(this,X,"f"),t),visitTrackBox:t=>new gt(J(this,X,"f"),t),visitUnknownAudioEffectDeviceBox:t=>new ju(J(this,X,"f"),t),visitUnknownMidiEffectDeviceBox:t=>new Lu(J(this,X,"f"),t),visitValueClipBox:t=>new Uo(J(this,X,"f"),t),visitValueEventBox:t=>new Yn(J(this,X,"f"),t),visitValueEventCollectionBox:t=>new sr(J(this,X,"f"),t),visitValueRegionBox:t=>new ao(J(this,X,"f"),t),visitVaporisateurDeviceBox:t=>new $u(J(this,X,"f"),t),visitVelocityDeviceBox:t=>new ec(J(this,X,"f"),t),visitZeitgeistDeviceBox:t=>new Uu(J(this,X,"f"),t)}),`Could not find factory for ${e}`)};var rc;(function(r){r.PEAKS=Ae.compose(A.Lowest).append(0),r.SPECTRUM=Ae.compose(A.Lowest).append(1),r.WAVEFORM=Ae.compose(A.Lowest).append(2)})(rc||(rc={}));var A1;(function(r){r.countStems=e=>e.match({none:()=>1,some:t=>Object.keys(t).length}),r.sanitizeFileName=e=>e.replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").trim(),r.sanitizeExportNamesInPlace=e=>{let t=new Map,i=n=>{let o=t.get(n)??0,a=n;for(;t.has(a);)o++,a=`${n} ${o}`;return t.set(n,o),t.set(a,1),a};Object.keys(e).forEach(n=>{let o=e[n];o.fileName=i(r.sanitizeFileName(o.fileName))})}})(A1||(A1={}));var _1=yr.createBuilder({position:yr.float,playbackTimestamp:yr.float,countInBeatsRemaining:yr.float,isPlaying:yr.bool,isCountingIn:yr.bool,isRecording:yr.bool});var P1;(function(r){r.store=(e,t,i)=>{if(i==="")return F("MetaData.store: origin must be unique to your app.");let n=e.pointerHub.filter(u.MetaData).map(({box:a})=>a).find(a=>a instanceof Hn&&a.origin.getValue()===i),o=a=>{a.target.refer(e),a.origin.setValue(i),a.value.setValue(JSON.stringify(t))};Ma(n)?o(n):Hn.create(e.graph,A.generate(),o)},r.read=(e,t)=>{if(t==="")return F("MetaData.read: origin must be unique to your app.");let i=e.pointerHub.filter(u.MetaData).map(({box:n})=>n).find(n=>n instanceof Hn&&n.origin.getValue()===t);if(Ma(i)){let{status:n,value:o,error:a}=zn(()=>JSON.parse(i.value.getValue()));if(n==="success")return o;console.warn(a)}return null},r.clear=(e,t)=>{if(t==="")return F("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(u.MetaData).map(({box:i})=>i).filter(i=>i instanceof Hn&&i.origin.getValue()===t).forEach(i=>i.delete())}})(P1||(P1={}));var Tw=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},fa=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Lg,Kg,Wg,Vs,Ei=class{constructor(e,t){Lg.set(this,new U),Kg.set(this,void 0),Wg.set(this,void 0),Vs.set(this,void 0),Tw(this,Kg,e,"f"),Tw(this,Wg,t,"f"),Tw(this,Vs,new rt(128),"f"),fa(this,Lg,"f").own(fa(this,Kg,"f").broadcastIntegers(fa(this,Wg,"f"),new Int32Array(fa(this,Vs,"f").buffer),ki))}noteOn(e){e>=0&&e<128&&fa(this,Vs,"f").setBit(e,!0)}noteOff(e){e>=0&&e<128&&fa(this,Vs,"f").setBit(e,!1)}reset(){}clear(){fa(this,Vs,"f").clear()}terminate(){fa(this,Lg,"f").terminate()}toString(){return`{${this.constructor.name}}`}};Lg=new WeakMap,Kg=new WeakMap,Wg=new WeakMap,Vs=new WeakMap;var st;(function(r){let e;(function(t){t[t.NoteOn=144]="NoteOn",t[t.NoteOff=128]="NoteOff",t[t.PitchBend=224]="PitchBend",t[t.Controller=176]="Controller",t[t.Start=250]="Start",t[t.Continue=251]="Continue",t[t.Stop=252]="Stop",t[t.Clock=248]="Clock",t[t.Position=242]="Position"})(e=r.Command||(r.Command={})),r.readCommand=t=>t[0]&240,r.readChannel=t=>t[0]&15,r.readParam1=t=>t.length>1?t[1]&255:0,r.readParam2=t=>t.length>2?t[2]&255:0,r.readPitch=t=>t[1],r.readVelocity=t=>t[2]/127,r.isNoteOn=t=>r.readCommand(t)===e.NoteOn&&r.readVelocity(t)>0,r.isNoteOff=t=>r.readCommand(t)===e.NoteOff||r.readCommand(t)===e.NoteOn&&r.readVelocity(t)===0,r.isPitchWheel=t=>r.readCommand(t)===e.PitchBend,r.isController=t=>r.readCommand(t)===e.Controller,r.isClock=t=>t[0]===e.Clock,r.isStart=t=>t[0]===e.Start,r.isContinue=t=>t[0]===e.Continue,r.isStop=t=>t[0]===e.Stop,r.isPosition=t=>t[0]===e.Position,r.asPitchBend=t=>{let i=r.readParam1(t)&127,n=r.readParam2(t)&127,o=i|n<<7;return 8192>=o?o/8192-1:(o-8191)/8192},r.asValue=t=>{let i=r.readParam2(t);return i>64?.5+(i-63)/128:i<64?i/128:.5},r.Clock=new Uint8Array([e.Clock]),r.Start=new Uint8Array([e.Start]),r.Continue=new Uint8Array([e.Continue]),r.Stop=new Uint8Array([e.Stop]),r.noteOn=(t,i,n)=>new Uint8Array([e.NoteOn|t,i,n]),r.noteOff=(t,i)=>new Uint8Array([e.NoteOff|t,i,0]),r.control=(t,i,n)=>new Uint8Array([e.Controller|t,i&127,n&127]),r.position=(t,i)=>new Uint8Array([e.Position,t&127,i&127]),r.positionInPPQN=t=>{let i=Math.floor(t/96),n=i&127,o=i>>7&127;return new Uint8Array([e.Position,n,o])},r.accept=(t,i)=>{$a(t)||(r.isNoteOn(t)?_(i.noteOn,r.readPitch(t),r.readVelocity(t)):r.isNoteOff(t)?_(i.noteOff,r.readPitch(t)):r.isPitchWheel(t)?_(i.pitchBend,r.asPitchBend(t)):r.isController(t)?_(i.controller,r.readParam1(t),r.readParam2(t)/127):r.isClock(t)?_(i.clock):r.isStart(t)?_(i.start):r.isContinue(t)?_(i.continue):r.isStop(t)?_(i.stop):r.isPosition(t)&&_(i.songPos,r.readParam1(t)|r.readParam2(t)<<7))},r.debug=t=>t===null?"null":r.isNoteOn(t)?`NoteOn #${r.readChannel(t)} ${r.readPitch(t)} : ${r.readVelocity(t).toFixed(2)}`:r.isNoteOff(t)?`NoteOff #${r.readChannel(t)} ${r.readPitch(t)}`:r.isPitchWheel(t)?`PitchWheel #${r.readChannel(t)} ${r.asPitchBend(t)}`:r.isController(t)?`Control #${r.readChannel(t)} ${r.asValue(t)}`:r.isClock(t)?"Clock":r.isStart(t)?"Start":r.isContinue(t)?"Continue":r.isStop(t)?"Stop":r.isPosition(t)?`SongPosition ${r.readParam1(t)|r.readParam2(t)<<7}`:"Unknown"})(st||(st={}));var ma;(function(r){r.on=(e,t,i)=>({type:"note-on",uuid:e,pitch:t,velocity:i}),r.off=(e,t)=>({type:"note-off",uuid:e,pitch:t}),r.isOn=e=>e.type==="note-on",r.isOff=e=>e.type==="note-off",r.fromEvent=(e,t)=>{let i=e.data;if(st.isNoteOn(i)){let n=st.readPitch(i),o=st.readVelocity(i);return{type:"note-on",uuid:t,pitch:n,velocity:o}}else if(st.isNoteOff(i)){let n=st.readPitch(i);return{type:"note-off",uuid:t,pitch:n}}return F("Unknown MIDI event")}})(ma||(ma={}));var S1;(function(r){r.start=(e,t,i,n=1)=>{let o=!0;return e(ma.on(t,i,n)),{terminate:()=>{o&&(e(ma.off(t,i)),o=!1)}}}})(S1||(S1={}));var AB,_B,PB,SB,EB;AB=new WeakMap,_B=new WeakMap,PB=new WeakMap,SB=new WeakMap,EB=new WeakMap;var BB=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},Zg=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},zs,Gg=class{constructor(){zs.set(this,void 0),BB(this,zs,Ae.newSet(e=>e.field.address),"f")}register(e){return Zg(this,zs,"f").add(e),{terminate:()=>Zg(this,zs,"f").removeByValue(e)}}get(e){return Zg(this,zs,"f").get(e)}opt(e){return Zg(this,zs,"f").opt(e)}};zs=new WeakMap;var ga={isClipBox:r=>r.accept({visitNoteClipBox:e=>!0,visitAudioClipBox:e=>!0,visitValueClipBox:e=>!0})??!1,isRegionBox:r=>r.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1,asRegionBox:r=>r.accept({visitNoteRegionBox:e=>e,visitAudioRegionBox:e=>e,visitValueRegionBox:e=>e})??F("Could not cast to AnyRegionBox"),isLoopableRegionBox:r=>r.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var qg;(function(r){r.isTimeSignatureValid=(e,t)=>!Number.isInteger(e)||e<1||e>31?Un.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(t)||t<1||t>32||t&t-1?Un.err("Denominator must be a power of two between 1 and 32"):Un.ok([e,t]),r.MIN_BPM=30,r.MAX_BPM=1e3,r.clampBpm=e=>Number.isFinite(e)?le(e,r.MIN_BPM,r.MAX_BPM):120,r.hasOverlappingRegions=e=>e.boxes().some(t=>t.accept({visitTrackBox:i=>{for(let[n,o]of R.iterateAdjacent(i.regions.pointerHub.incoming().map(({box:a})=>ga.asRegionBox(a)).sort(({position:a},{position:s})=>a.getValue()-s.getValue()))){if(n instanceof Mo&&n.timeBase.getValue()===or.Seconds)return!1;if(n.position.getValue()+n.duration.getValue()>o.position.getValue())return!0}return!1}})??!1)})(qg||(qg={}));var E1;(function(r){r.parseTimeSignature=e=>{let[t,i]=e.split("/"),n=parseInt(t,10),o=parseInt(i,10);return qg.isTimeSignatureValid(n,o)}})(E1||(E1={}));var Hg;(function(r){r.reader=({sab:e,numChunks:t,numberOfChannels:i,bufferSize:n},o)=>{let a=!0,s=new Int32Array(e,0,2),l=new Float32Array(e,8),c=new Float32Array(i*n),p=typeof document>"u",d=()=>{if(!a)return;let f=Atomics.load(s,1),v=Atomics.load(s,0);if(f===v){if(p)Atomics.wait(s,0,v);else{setTimeout(d,1);return}v=Atomics.load(s,0)}for(;f!==v;){let m=f*i*n;c.set(l.subarray(m,m+i*n));let y=[];for(let x=0;x<i;x++){let M=x*n,D=M+n;y.push(c.slice(M,D))}if(f=(f+1)%t,Atomics.store(s,1,f),!a)return;o(y)}d()};return d(),{stop:()=>a=!1}},r.writer=({sab:e,numChunks:t,numberOfChannels:i,bufferSize:n})=>{let o=new Int32Array(e,0,2),a=new Float32Array(e,8);return Object.freeze({write:s=>{if(s.length!==i)return;for(let p of s)if(p.length!==n)return F("Each channel buffer must contain 'bufferSize' samples");let l=Atomics.load(o,0),c=l*i*n;s.forEach((p,d)=>a.set(p,c+d*n)),Atomics.store(o,0,(l+1)%t),Atomics.notify(o,0)}})}})(Hg||(Hg={}));var Rw={isRegion:r=>ga.isRegionBox(r.box),isLoopableRegion:r=>ga.isLoopableRegionBox(r.box)};var Tn;(function(r){r[r.Off=0]="Off",r[r.On=1]="On",r[r.Loop=2]="Loop"})(Tn||(Tn={}));var FB,NB,kB,$B;FB=new WeakMap,NB=new WeakMap,kB=new WeakMap,$B=new WeakMap;var MB,DB,IB,CB;MB=new WeakMap,DB=new WeakMap,IB=new WeakMap,CB=new WeakMap;var ic={[St.Instrument]:0,[St.Aux]:1,[St.Bus]:2,[St.Output]:3};var Jg;(function(r){r.create=({boxGraph:e,mandatoryBoxes:{rootBox:t,primaryAudioBus:i}},n,o,a)=>{let s=a??r.orderAndGetIndex(t,n);return console.debug(`createAudioUnit type: ${n}, insertIndex: ${s}`),it.create(e,A.generate(),l=>{l.collection.refer(t.audioUnits),l.output.refer(i.input),l.index.setValue(s),l.type.setValue(n),o.ifSome(c=>l.capture.refer(c))})},r.orderAndGetIndex=(e,t)=>{let i=ul.collectIndexedBoxes(e.audioUnits,it),n=ic[t],o=0;for(;o<i.length&&!(ic[i[o].type.getValue()]>n);o++);let a=o;for(;o<i.length;)i[o].index.setValue(++o);return a},r.trackTypeToCapture=(e,t)=>{switch(t){case re.Audio:return g.wrap(Do.create(e,A.generate()));case re.Notes:return g.wrap(Io.create(e,A.generate()));default:return g.None}}})(Jg||(Jg={}));var B1;(function(r){r.create=(e,t,i,n,o)=>{console.debug(`createAudioBus '${t}', type: ${n}, color: ${o}`);let{boxGraph:a,mandatoryBoxes:{rootBox:s}}=e;I(s.isAttached(),"rootBox not attached");let l=A.generate(),c=Ii.create(a,l,d=>{d.collection.refer(s.audioBusses),d.label.setValue(t),d.icon.setValue(Me.toName(i)),d.color.setValue(o.toString())}),p=Jg.create(e,n,g.None);return ar.create(a,A.generate(),d=>{d.tracks.refer(p.tracks),d.target.refer(p),d.index.setValue(0),d.type.setValue(re.Undefined)}),c.output.refer(p.input),c}})(B1||(B1={}));var F1;(function(r){r.forAudioType=e=>{switch(e){case St.Output:return cl.blue;case St.Aux:return cl.purple;case St.Bus:return cl.orange;case St.Instrument:return cl.green;default:return cl.dark}},r.forTrackType=e=>{switch(e){case re.Audio:return 200;case re.Notes:return 45;case re.Value:return 156;default:return 0}}})(F1||(F1={}));var N1;(function(r){r.Tape={defaultName:"Tape",defaultIcon:Me.Tape,description:"Plays audio regions & clips",trackType:re.Audio,create:(i,n,o,a,s)=>_l.create(i,A.generate(),l=>{l.label.setValue(o),l.icon.setValue(Me.toName(a)),l.flutter.setValue(.2),l.wow.setValue(.05),l.noise.setValue(.02),l.saturation.setValue(.5),l.host.refer(n)})},r.Nano={defaultName:"Nano",defaultIcon:Me.NanoWave,description:"Simple sampler",trackType:re.Notes,create:(i,n,o,a,s)=>{let l;if(Z(s))l=s;else{let c=A.parse("c1678daa-4a47-4cba-b88f-4f4e384663c3"),p=5.34;l=i.findBox(c).unwrapOrElse(()=>Cr.create(i,c,d=>{d.fileName.setValue("Rhode"),d.endInSeconds.setValue(p)}))}return bl.create(i,A.generate(),c=>{c.label.setValue(o),c.icon.setValue(Me.toName(a)),c.file.refer(l),c.host.refer(n)})}},r.Playfield={defaultName:"Playfield",defaultIcon:Me.Playfield,description:"Drum computer",trackType:re.Notes,create:(i,n,o,a,s)=>{let l=Al.create(i,A.generate(),c=>{c.label.setValue(o),c.icon.setValue(Me.toName(a)),c.host.refer(n)});return Z(s)&&s.filter(({note:c,uuid:p,name:d,durationInSeconds:f,exclude:v})=>{let m=e(i,p,d,f);Co.create(i,A.generate(),y=>{y.device.refer(l.samples),y.file.refer(m),y.index.setValue(c),y.exclude.setValue(v)})}),l}},r.Vaporisateur={defaultName:"Vaporisateur",defaultIcon:Me.Piano,description:"Classic subtractive synthesizer",trackType:re.Notes,create:(i,n,o,a,s)=>yl.create(i,A.generate(),l=>{l.label.setValue(o),l.icon.setValue(Me.toName(a)),l.tune.setInitValue(0),l.cutoff.setInitValue(8e3),l.resonance.setInitValue(.1),l.attack.setInitValue(.005),l.decay.setInitValue(.1),l.sustain.setInitValue(.5),l.release.setInitValue(.5),l.voicingMode.setInitValue(un.Polyphonic),l.lfo.rate.setInitValue(1),l.oscillators.fields()[0].waveform.setInitValue(We.saw),l.oscillators.fields()[0].volume.setInitValue(-6),l.oscillators.fields()[1].volume.setInitValue(Number.NEGATIVE_INFINITY),l.oscillators.fields()[1].waveform.setInitValue(We.square),l.host.refer(n),l.version.setValue(2)})},r.MIDIOutput={defaultName:"MIDIOutput",defaultIcon:Me.Midi,description:"MIDI Output",trackType:re.Notes,create:(i,n,o,a,s)=>xl.create(i,A.generate(),l=>{l.label.setValue(o),l.icon.setValue(Me.toName(a)),l.host.refer(n)})},r.Soundfont={defaultName:"Soundfont",defaultIcon:Me.SoundFont,description:"Soundfont Player",trackType:re.Notes,create:(i,n,o,a,s)=>{s??(s={uuid:"d9f51577-2096-4671-9067-27ca2e12b329",name:"Upright Piano KW"});let l=s.uuid,c=A.parse(l),p=t(i,c,s.name);return wl.create(i,A.generate(),d=>{d.label.setValue(o),d.icon.setValue(Me.toName(a)),d.host.refer(n),d.file.refer(p)})}},r.Named={Vaporisateur:r.Vaporisateur,Playfield:r.Playfield,Nano:r.Nano,Tape:r.Tape,Soundfont:r.Soundfont,MIDIOutput:r.MIDIOutput};let e=(i,n,o,a)=>i.findBox(n).unwrapOrElse(()=>Cr.create(i,n,s=>{s.fileName.setValue(o),s.endInSeconds.setValue(a)})),t=(i,n,o)=>i.findBox(n).unwrapOrElse(()=>Xr.create(i,n,a=>a.fileName.setValue(o)))})(N1||(N1={}));var va;(function(r){r.empty=i=>{let n=new Va(g.wrap(za.create)),o=new Date().toISOString();console.debug(`New Project created on ${o}`),n.beginTransaction();let a=gl.create(n,A.generate(),f=>{f.label.setValue("Groove Shuffle")}),s=dl.create(n,A.generate(),f=>{f.groove.refer(a),f.created.setValue(o)}),l=Ii.create(n,A.generate(),f=>{f.collection.refer(s.audioBusses),f.label.setValue("Output"),f.icon.setValue(Me.toName(Me.SpeakerHeadphone)),f.color.setValue("hsl(189, 100%, 65%)")}),c=it.create(n,A.generate(),f=>{f.type.setValue(St.Output),f.collection.refer(s.audioUnits),f.output.refer(s.outputDevice),f.index.setValue(0)});i.createOutputCompressor&&vl.create(n,A.generate(),f=>{f.label.setValue("Compressor"),f.index.setValue(0),f.host.refer(c.audioEffects),f.threshold.setValue(0),f.ratio.setValue(24)});let p=ja.create(n,A.generate());s.timeline.refer(p.root),l.output.refer(c.input);let d=[];if(i.createDefaultUser){let f=Ua.create(n,A.generate());f.root.refer(s.users),d.push(f)}return n.endTransaction(),{boxGraph:n,mandatoryBoxes:{rootBox:s,primaryAudioBus:l,primaryAudioOutputUnit:c,timelineBox:p,userInterfaceBoxes:d}}},r.encode=i=>{let n=kt.create();n.writeInt(1330660686),n.writeInt(2);let o=i.toArrayBuffer();return n.writeInt(o.byteLength),n.writeBytes(new Int8Array(o)),n.toArrayBuffer()},r.decode=i=>{let n=new ut(i);I(n.readInt()===1330660686,"Corrupt header. Probably not an openDAW project file."),I(n.readInt()===2,"Deprecated Format");let o=n.readInt(),a=new Int8Array(o);n.readBytes(a);let s=new Va(g.wrap(za.create));return s.fromArrayBuffer(a.buffer),{boxGraph:s,mandatoryBoxes:r.findMandatoryBoxes(s)}},r.findMandatoryBoxes=i=>{let n=i.boxes().find(o=>o.accept({visitRootBox:()=>!0}));if(Z(n)){let o=Ne(n.outputDevice.pointerHub.incoming().at(0)?.box,it),a=Ne(o.input.pointerHub.incoming().at(0)?.box,Ii),s=Ne(n.timeline.targetVertex.unwrap("TimelineBox not found").box,ja),l=n.users.pointerHub.incoming().map(({box:c})=>Ne(c,Ua));return{rootBox:n,primaryAudioBus:a,primaryAudioOutputUnit:o,timelineBox:s,userInterfaceBoxes:l}}return F("Could not find mandatory boxes")}})(va||(va={}));var nc;(function(r){let e=({graph:s},{graph:l})=>s===l,t=(s,l)=>s.index.getValue()-l.index.getValue(),i=s=>s.accept({visitTrackBox:l=>!0})===!0;r.extractAudioUnits=(s,{boxGraph:l,mandatoryBoxes:{primaryAudioBus:c,rootBox:p}},d={})=>{I(R.satisfy(s,e),"AudioUnits must share the same BoxGraph"),I(!d.includeAux&&!d.includeBus,"Options are not yet implemented");let f=d?.excludeTimeline===!0?i:bo.alwaysFalse,v=s.flatMap(y=>Array.from(y.graph.dependenciesOf(y,{alwaysFollowMandatory:!0,excludeBox:f}).boxes)).filter(y=>y.name!==cn.ClassName&&y.name!==Wa.ClassName),m=n(s,v,p.audioUnits.address.uuid,c.address.uuid);return o(m,l,s,v),a(m,s,p),console.debug("inTransaction",l.inTransaction()),s.map(y=>Ne(p.graph.findBox(m.get(y.address.uuid).target).unwrap("Target Track has not been copied"),it))},r.extractRegions=(s,{boxGraph:l,mandatoryBoxes:{primaryAudioBus:c,rootBox:p}},d=0)=>{I(R.satisfy(s,e),"Region smust be from the same BoxGraph");let f=new Set(s),v=new Set,m=new Ys;s.forEach(V=>{let Y=Ne(V.regions.targetVertex.unwrap().box,ar);v.add(Y);let ne=Ne(Y.tracks.targetVertex.unwrap().box,it);m.add(ne,Y)}),console.debug(`Found ${m.keyCount()} audioUnits`),console.debug(`Found ${v.size} tracks`);let y=[...m.keys()],x=V=>Te(V,ar)&&!v.has(V)||ga.isRegionBox(V)&&!f.has(V),M=y.flatMap(V=>Array.from(V.graph.dependenciesOf(V,{excludeBox:x,alwaysFollowMandatory:!0}).boxes)).filter(V=>V.name!==cn.ClassName&&V.name!==Wa.ClassName),D=n(y,M,p.audioUnits.address.uuid,c.address.uuid);o(D,l,y,M),a(D,y,p),m.forEach((V,Y)=>[...Y].sort(t).forEach((ne,G)=>{let de=l.findBox(D.get(ne.address.uuid).target).unwrap("Target Track has not been copied");Ne(de,ar).index.setValue(G)}));let O=s.reduce((V,Y)=>Math.min(V,Y.position.getValue()),Number.MAX_VALUE),T=d-O;s.forEach(V=>{let Y=l.findBox(D.get(V.address.uuid).target).unwrap("Target Track has not been copied"),ne=ga.asRegionBox(Y).position;ne.setValue(ne.getValue()+T)})};let n=(s,l,c,p)=>{let d=A.newSet(({source:f})=>f);return d.addMany([...s.filter(({output:{targetAddress:f}})=>f.nonEmpty()).map(f=>({source:f.output.targetAddress.unwrap().uuid,target:p})),...s.map(f=>({source:f.collection.targetAddress.unwrap("AudioUnitBox was not connected to a RootBox").uuid,target:c})),...s.map(f=>({source:f.address.uuid,target:A.generate()})),...l.map(({address:{uuid:f},name:v})=>({source:f,target:v===Cr.ClassName||v===Xr.ClassName?f:A.generate()}))]),d},o=(s,l,c,p)=>{B.decodeWith({map:(d,f)=>f.map(v=>s.opt(v.uuid).match({none:()=>v,some:({target:m})=>v.moveTo(m)}))},()=>{c.forEach(d=>{let f=new ut(d.toArrayBuffer()),v=d.name,m=s.get(d.address.uuid).target;l.createBox(v,m,y=>y.read(f))}),p.forEach(d=>{let f=new ut(d.toArrayBuffer()),v=d.name,m=s.get(d.address.uuid).target;if((d instanceof Cr||d instanceof Xr)&&l.findBox(d.address.uuid).nonEmpty()){d.read(f);return}l.createBox(v,m,y=>y.read(f))})})},a=(s,l,c)=>l.toSorted(t).map(p=>Ne(c.graph.findBox(s.get(p.address.uuid).target).unwrap("Target Track has not been copied"),it)).forEach(p=>ul.collectIndexedBoxes(c.audioUnits,it).toSorted((d,f)=>{let v=ic[d.type.getValue()],m=ic[f.type.getValue()],y=v-m;return y===0?f===p?-1:1:y}).forEach((d,f)=>d.index.setValue(f)))})(nc||(nc={}));var ya;(function(r){r.MAGIC_HEADER_OPEN=1330664005,r.FORMAT_VERSION=1})(ya||(ya={}));var k1;(function(r){r.decode=(e,t)=>{let i=new ut(e.slice(0,8));if(i.readInt()!==ya.MAGIC_HEADER_OPEN){tl.info({headline:"Could Not Import Preset",message:"Invalid preset file"}).then();return}if(i.readInt()!==ya.FORMAT_VERSION){tl.info({headline:"Could Not Import Preset",message:"Invalid preset version"}).then();return}let n=new Va(g.wrap(za.create));try{n.fromArrayBuffer(e.slice(8))}catch(a){tl.info({headline:"Could Not Import Preset",message:String(a)}).then();return}let o=n.boxes().filter(a=>Te(a,it)).filter(a=>a.type.getValue()!==St.Output);nc.extractAudioUnits(o,t,{excludeTimeline:!0}).filter(a=>a.type.getValue()!==St.Output).forEach(a=>{let s=a.input.pointerHub.incoming().at(0)?.box;Z(s)&&a.capture.targetVertex.ifSome(({box:l})=>{l instanceof Io?ar.create(t.boxGraph,A.generate(),c=>{c.index.setValue(0),c.type.setValue(re.Notes),c.target.refer(a),c.tracks.refer(a.tracks)}):l instanceof Do&&ar.create(t.boxGraph,A.generate(),c=>{c.index.setValue(0),c.type.setValue(re.Audio),c.target.refer(a),c.tracks.refer(a.tracks)})})})},r.replaceAudioUnit=(e,t,i)=>{console.debug("ReplaceAudioUnit with preset...");let n=va.empty({createDefaultUser:!1,createOutputCompressor:!1}),o=n.boxGraph,a=t.graph;o.beginTransaction(),r.decode(e,n),o.endTransaction();let s=ee(n.mandatoryBoxes.rootBox.audioUnits.pointerHub.incoming().map(({box:y})=>Ne(y,it)).find(y=>y.type.getValue()!==St.Output),"Source has no audioUnitBox"),l=s.capture.targetVertex.mapOr(({box:y})=>y.name,""),c=t.capture.targetVertex.mapOr(({box:y})=>y.name,"");if(l!==c)return Un.err("Cannot replace incompatible instruments");let p=i?.keepMIDIEffects!==!0,d=i?.keepAudioEffects!==!0;console.debug("replaceMIDIEffects",p),console.debug("replaceAudioEffects",d),ee(t.input.pointerHub.incoming().at(0)?.box,"Target has no input").delete(),p?t.midiEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()):(o.beginTransaction(),s.midiEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()),o.endTransaction()),d?t.audioEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()):(o.beginTransaction(),s.audioEffects.pointerHub.incoming().forEach(({box:y})=>y.delete()),o.endTransaction());let f=y=>y.accept({visitTrackBox:x=>!0,visitCaptureMidiBox:x=>!0,visitCaptureAudioBox:x=>!0})===!0,v=A.newSet(({source:y})=>y),m=Array.from(o.dependenciesOf(s,{excludeBox:f,alwaysFollowMandatory:!1}).boxes);return v.addMany([{source:s.address.uuid,target:t.address.uuid},...m.map(({address:{uuid:y},name:x})=>({source:y,target:x===Cr.ClassName||x===Xr.ClassName?y:A.generate()}))]),B.decodeWith({map:(y,x)=>x.map(M=>v.opt(M.uuid).match({none:()=>M,some:({target:D})=>M.moveTo(D)}))},()=>{m.forEach(y=>{let x=new ut(y.toArrayBuffer()),M=y.name,D=v.get(y.address.uuid).target;if((y instanceof Cr||y instanceof Xr)&&a.findBox(y.address.uuid).nonEmpty()){y.read(x);return}a.createBox(M,D,O=>O.read(x))})}),Un.Ok}})(k1||(k1={}));var $1;(function(r){r.encode=e=>{let t=kt.create();t.writeInt(ya.MAGIC_HEADER_OPEN),t.writeInt(ya.FORMAT_VERSION);let i=va.empty({createOutputCompressor:!1,createDefaultUser:!1});return i.boxGraph.beginTransaction(),nc.extractAudioUnits([e],i,{excludeTimeline:!0}),i.boxGraph.endTransaction(),console.debug("SAVING..."),i.boxGraph.debugBoxes(),R.concatArrayBuffers(t.toArrayBuffer(),i.boxGraph.toArrayBuffer())}})($1||($1={}));var M1;(function(r){r.existingInstrumentNames=e=>e.audioUnits.pointerHub.incoming().map(({box:t})=>{let i=ee(Ne(t,it).input.pointerHub.incoming().at(0)).box;return"label"in i&&i.label instanceof C?i.label.getValue():"N/A"})})(M1||(M1={}));var Nt={};ka(Nt,{$brand:()=>Qg,$input:()=>iA,$output:()=>rA,NEVER:()=>Ow,TimePrecision:()=>sA,ZodAny:()=>cE,ZodArray:()=>fE,ZodBase64:()=>E_,ZodBase64URL:()=>B_,ZodBigInt:()=>Fh,ZodBigIntFormat:()=>k_,ZodBoolean:()=>Bh,ZodCIDRv4:()=>P_,ZodCIDRv6:()=>S_,ZodCUID:()=>v_,ZodCUID2:()=>y_,ZodCatch:()=>DE,ZodCodec:()=>z_,ZodCustom:()=>oy,ZodCustomStringFormat:()=>Sh,ZodDate:()=>ry,ZodDefault:()=>BE,ZodDiscriminatedUnion:()=>mE,ZodE164:()=>F_,ZodEmail:()=>f_,ZodEmoji:()=>m_,ZodEnum:()=>_h,ZodError:()=>pk,ZodFile:()=>PE,ZodFirstPartyTypeKind:()=>U_,ZodFunction:()=>jE,ZodGUID:()=>Qv,ZodIPv4:()=>A_,ZodIPv6:()=>__,ZodISODate:()=>Gv,ZodISODateTime:()=>Zv,ZodISODuration:()=>Hv,ZodISOTime:()=>qv,ZodIntersection:()=>gE,ZodIssueCode:()=>E$,ZodJWT:()=>N_,ZodKSUID:()=>b_,ZodLazy:()=>VE,ZodLiteral:()=>_E,ZodMAC:()=>iE,ZodMap:()=>bE,ZodNaN:()=>CE,ZodNanoID:()=>g_,ZodNever:()=>pE,ZodNonOptional:()=>O_,ZodNull:()=>lE,ZodNullable:()=>EE,ZodNumber:()=>Eh,ZodNumberFormat:()=>xc,ZodObject:()=>ny,ZodOptional:()=>R_,ZodPipe:()=>V_,ZodPrefault:()=>NE,ZodPromise:()=>UE,ZodReadonly:()=>TE,ZodRealError:()=>$r,ZodRecord:()=>I_,ZodSet:()=>AE,ZodString:()=>Ph,ZodStringFormat:()=>Qe,ZodSuccess:()=>ME,ZodSymbol:()=>aE,ZodTemplateLiteral:()=>OE,ZodTransform:()=>SE,ZodTuple:()=>yE,ZodType:()=>Pe,ZodULID:()=>x_,ZodURL:()=>ty,ZodUUID:()=>yo,ZodUndefined:()=>sE,ZodUnion:()=>M_,ZodUnknown:()=>dE,ZodVoid:()=>hE,ZodXID:()=>w_,_ZodString:()=>h_,_default:()=>FE,_function:()=>v$,any:()=>Qk,array:()=>iy,base64:()=>Ik,base64url:()=>Ck,bigint:()=>Zk,boolean:()=>oE,catch:()=>IE,check:()=>y$,cidrv4:()=>Mk,cidrv6:()=>Dk,clone:()=>fr,codec:()=>f$,coerce:()=>j_,config:()=>At,core:()=>vo,cuid:()=>Pk,cuid2:()=>Sk,custom:()=>x$,date:()=>Xk,decode:()=>n_,decodeAsync:()=>a_,describe:()=>w$,discriminatedUnion:()=>n$,e164:()=>Tk,email:()=>fk,emoji:()=>Ak,encode:()=>i_,encodeAsync:()=>o_,endsWith:()=>mh,enum:()=>C_,file:()=>c$,flattenError:()=>Qp,float32:()=>jk,float64:()=>Lk,formatError:()=>Yp,function:()=>v$,getErrorMap:()=>F$,globalRegistry:()=>mr,gt:()=>go,gte:()=>kr,guid:()=>mk,hash:()=>Uk,hex:()=>zk,hostname:()=>Vk,httpUrl:()=>bk,includes:()=>hh,instanceof:()=>A$,int:()=>p_,int32:()=>Kk,int64:()=>Gk,intersection:()=>vE,ipv4:()=>Nk,ipv6:()=>$k,iso:()=>Jv,json:()=>P$,jwt:()=>Rk,keyof:()=>e$,ksuid:()=>Fk,lazy:()=>zE,length:()=>gc,literal:()=>u$,locales:()=>ah,looseObject:()=>i$,lowercase:()=>dh,lt:()=>mo,lte:()=>Ni,mac:()=>kk,map:()=>a$,maxLength:()=>mc,maxSize:()=>fc,meta:()=>b$,mime:()=>gh,minLength:()=>Sa,minSize:()=>Ws,multipleOf:()=>Ks,nan:()=>h$,nanoid:()=>_k,nativeEnum:()=>l$,negative:()=>TA,never:()=>$_,nonnegative:()=>OA,nonoptional:()=>$E,nonpositive:()=>RA,normalize:()=>vh,null:()=>uE,nullable:()=>Xv,nullish:()=>d$,number:()=>nE,object:()=>t$,optional:()=>Yv,overwrite:()=>Rn,parse:()=>XA,parseAsync:()=>e_,partialRecord:()=>o$,pipe:()=>ey,positive:()=>CA,prefault:()=>kE,preprocess:()=>S$,prettifyError:()=>Jw,promise:()=>g$,property:()=>VA,readonly:()=>RE,record:()=>wE,refine:()=>LE,regex:()=>ch,regexes:()=>Fi,registry:()=>Sv,safeDecode:()=>l_,safeDecodeAsync:()=>c_,safeEncode:()=>s_,safeEncodeAsync:()=>u_,safeParse:()=>t_,safeParseAsync:()=>r_,set:()=>s$,setErrorMap:()=>B$,size:()=>uh,slugify:()=>bh,startsWith:()=>fh,strictObject:()=>r$,string:()=>d_,stringFormat:()=>Ok,stringbool:()=>_$,success:()=>p$,superRefine:()=>KE,symbol:()=>Hk,templateLiteral:()=>m$,toJSONSchema:()=>qA,toLowerCase:()=>xh,toUpperCase:()=>wh,transform:()=>T_,treeifyError:()=>Hw,trim:()=>yh,tuple:()=>xE,uint32:()=>Wk,uint64:()=>qk,ulid:()=>Ek,undefined:()=>Jk,union:()=>D_,unknown:()=>yc,uppercase:()=>ph,url:()=>wk,util:()=>L,uuid:()=>gk,uuidv4:()=>vk,uuidv6:()=>yk,uuidv7:()=>xk,void:()=>Yk,xid:()=>Bk});var vo={};ka(vo,{$ZodAny:()=>S0,$ZodArray:()=>k0,$ZodAsyncError:()=>en,$ZodBase64:()=>m0,$ZodBase64URL:()=>g0,$ZodBigInt:()=>xv,$ZodBigIntFormat:()=>b0,$ZodBoolean:()=>rh,$ZodCIDRv4:()=>p0,$ZodCIDRv6:()=>h0,$ZodCUID:()=>e0,$ZodCUID2:()=>t0,$ZodCatch:()=>G0,$ZodCheck:()=>Je,$ZodCheckBigIntFormat:()=>kb,$ZodCheckEndsWith:()=>jb,$ZodCheckGreaterThan:()=>pv,$ZodCheckIncludes:()=>zb,$ZodCheckLengthEquals:()=>Tb,$ZodCheckLessThan:()=>dv,$ZodCheckLowerCase:()=>Ob,$ZodCheckMaxLength:()=>Ib,$ZodCheckMaxSize:()=>$b,$ZodCheckMimeType:()=>Kb,$ZodCheckMinLength:()=>Cb,$ZodCheckMinSize:()=>Mb,$ZodCheckMultipleOf:()=>Fb,$ZodCheckNumberFormat:()=>Nb,$ZodCheckOverwrite:()=>Wb,$ZodCheckProperty:()=>Lb,$ZodCheckRegex:()=>Rb,$ZodCheckSizeEquals:()=>Db,$ZodCheckStartsWith:()=>Ub,$ZodCheckStringFormat:()=>pc,$ZodCheckUpperCase:()=>Vb,$ZodCodec:()=>ih,$ZodCustom:()=>tA,$ZodCustomStringFormat:()=>x0,$ZodDate:()=>N0,$ZodDefault:()=>L0,$ZodDiscriminatedUnion:()=>M0,$ZodE164:()=>v0,$ZodEmail:()=>Jb,$ZodEmoji:()=>Yb,$ZodEncodeError:()=>xa,$ZodEnum:()=>R0,$ZodError:()=>Jp,$ZodFile:()=>V0,$ZodFunction:()=>Y0,$ZodGUID:()=>qb,$ZodIPv4:()=>u0,$ZodIPv6:()=>c0,$ZodISODate:()=>a0,$ZodISODateTime:()=>o0,$ZodISODuration:()=>l0,$ZodISOTime:()=>s0,$ZodIntersection:()=>D0,$ZodJWT:()=>y0,$ZodKSUID:()=>n0,$ZodLazy:()=>eA,$ZodLiteral:()=>O0,$ZodMAC:()=>d0,$ZodMap:()=>C0,$ZodNaN:()=>q0,$ZodNanoID:()=>Xb,$ZodNever:()=>B0,$ZodNonOptional:()=>W0,$ZodNull:()=>P0,$ZodNullable:()=>j0,$ZodNumber:()=>yv,$ZodNumberFormat:()=>w0,$ZodObject:()=>nS,$ZodObjectJIT:()=>$0,$ZodOptional:()=>U0,$ZodPipe:()=>H0,$ZodPrefault:()=>K0,$ZodPromise:()=>X0,$ZodReadonly:()=>J0,$ZodRealError:()=>Nr,$ZodRecord:()=>I0,$ZodRegistry:()=>hc,$ZodSet:()=>T0,$ZodString:()=>Ls,$ZodStringFormat:()=>Ze,$ZodSuccess:()=>Z0,$ZodSymbol:()=>A0,$ZodTemplateLiteral:()=>Q0,$ZodTransform:()=>z0,$ZodTuple:()=>bv,$ZodType:()=>fe,$ZodULID:()=>r0,$ZodURL:()=>Qb,$ZodUUID:()=>Hb,$ZodUndefined:()=>_0,$ZodUnion:()=>wv,$ZodUnknown:()=>E0,$ZodVoid:()=>F0,$ZodXID:()=>i0,$brand:()=>Qg,$constructor:()=>b,$input:()=>iA,$output:()=>rA,Doc:()=>th,JSONSchema:()=>eE,JSONSchemaGenerator:()=>Ah,NEVER:()=>Ow,TimePrecision:()=>sA,_any:()=>FA,_array:()=>zA,_base64:()=>jv,_base64url:()=>Lv,_bigint:()=>bA,_boolean:()=>xA,_catch:()=>ok,_check:()=>XS,_cidrv4:()=>zv,_cidrv6:()=>Uv,_coercedBigint:()=>AA,_coercedBoolean:()=>wA,_coercedDate:()=>DA,_coercedNumber:()=>hA,_coercedString:()=>oA,_cuid:()=>Dv,_cuid2:()=>Iv,_custom:()=>jA,_date:()=>MA,_decode:()=>iv,_decodeAsync:()=>ov,_default:()=>rk,_discriminatedUnion:()=>KN,_e164:()=>Kv,_email:()=>Ev,_emoji:()=>$v,_encode:()=>rv,_encodeAsync:()=>nv,_endsWith:()=>mh,_enum:()=>JN,_file:()=>UA,_float32:()=>mA,_float64:()=>gA,_gt:()=>go,_gte:()=>kr,_guid:()=>sh,_includes:()=>hh,_int:()=>fA,_int32:()=>vA,_int64:()=>_A,_intersection:()=>WN,_ipv4:()=>Ov,_ipv6:()=>Vv,_isoDate:()=>uA,_isoDateTime:()=>lA,_isoDuration:()=>dA,_isoTime:()=>cA,_jwt:()=>Wv,_ksuid:()=>Rv,_lazy:()=>uk,_length:()=>gc,_literal:()=>YN,_lowercase:()=>dh,_lt:()=>mo,_lte:()=>Ni,_mac:()=>aA,_map:()=>qN,_max:()=>Ni,_maxLength:()=>mc,_maxSize:()=>fc,_mime:()=>gh,_min:()=>kr,_minLength:()=>Sa,_minSize:()=>Ws,_multipleOf:()=>Ks,_nan:()=>IA,_nanoid:()=>Mv,_nativeEnum:()=>QN,_negative:()=>TA,_never:()=>kA,_nonnegative:()=>OA,_nonoptional:()=>ik,_nonpositive:()=>RA,_normalize:()=>vh,_null:()=>BA,_nullable:()=>tk,_number:()=>pA,_optional:()=>ek,_overwrite:()=>Rn,_parse:()=>lc,_parseAsync:()=>uc,_pipe:()=>ak,_positive:()=>CA,_promise:()=>ck,_property:()=>VA,_readonly:()=>sk,_record:()=>GN,_refine:()=>LA,_regex:()=>ch,_safeDecode:()=>sv,_safeDecodeAsync:()=>uv,_safeEncode:()=>av,_safeEncodeAsync:()=>lv,_safeParse:()=>cc,_safeParseAsync:()=>dc,_set:()=>HN,_size:()=>uh,_slugify:()=>bh,_startsWith:()=>fh,_string:()=>nA,_stringFormat:()=>vc,_stringbool:()=>GA,_success:()=>nk,_superRefine:()=>KA,_symbol:()=>SA,_templateLiteral:()=>lk,_toLowerCase:()=>xh,_toUpperCase:()=>wh,_transform:()=>XN,_trim:()=>yh,_tuple:()=>ZN,_uint32:()=>yA,_uint64:()=>PA,_ulid:()=>Cv,_undefined:()=>EA,_union:()=>LN,_unknown:()=>NA,_uppercase:()=>ph,_url:()=>lh,_uuid:()=>Bv,_uuidv4:()=>Fv,_uuidv6:()=>Nv,_uuidv7:()=>kv,_void:()=>$A,_xid:()=>Tv,clone:()=>fr,config:()=>At,decode:()=>uF,decodeAsync:()=>dF,describe:()=>WA,encode:()=>lF,encodeAsync:()=>cF,flattenError:()=>Qp,formatError:()=>Yp,globalConfig:()=>Lp,globalRegistry:()=>mr,isValidBase64:()=>f0,isValidBase64URL:()=>eS,isValidJWT:()=>tS,locales:()=>ah,meta:()=>ZA,parse:()=>ev,parseAsync:()=>tv,prettifyError:()=>Jw,regexes:()=>Fi,registry:()=>Sv,safeDecode:()=>hF,safeDecodeAsync:()=>mF,safeEncode:()=>pF,safeEncodeAsync:()=>fF,safeParse:()=>Qw,safeParseAsync:()=>Yw,toDotPath:()=>R1,toJSONSchema:()=>qA,treeifyError:()=>Hw,util:()=>L,version:()=>Zb});var Ow=Object.freeze({status:"aborted"});function b(r,e,t){function i(s,l){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:l,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(r))return;s._zod.traits.add(r),e(s,l);let c=a.prototype,p=Object.keys(c);for(let d=0;d<p.length;d++){let f=p[d];f in s||(s[f]=c[f].bind(s))}}let n=t?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:r});function a(s){var l;let c=t?.Parent?new o:this;i(c,s),(l=c._zod).deferred??(l.deferred=[]);for(let p of c._zod.deferred)p();return c}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>t?.Parent&&s instanceof t.Parent?!0:s?._zod?.traits?.has(r)}),Object.defineProperty(a,"name",{value:r}),a}var Qg=Symbol("zod_brand"),en=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},xa=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Lp={};function At(r){return r&&Object.assign(Lp,r),Lp}var L={};ka(L,{BIGINT_FORMAT_RANGES:()=>qw,Class:()=>zw,NUMBER_FORMAT_RANGES:()=>Gw,aborted:()=>Pa,allowsEval:()=>Lw,assert:()=>zB,assertEqual:()=>TB,assertIs:()=>OB,assertNever:()=>VB,assertNotEqual:()=>RB,assignProp:()=>ba,base64ToUint8Array:()=>I1,base64urlToUint8Array:()=>iF,cached:()=>ac,captureStackTrace:()=>Xg,cleanEnum:()=>rF,cleanRegex:()=>Zp,clone:()=>fr,cloneDef:()=>jB,createTransparentProxy:()=>qB,defineLazy:()=>$e,esc:()=>Yg,escapeRegex:()=>Bi,extend:()=>QB,finalizeIssue:()=>qr,floatSafeRemainder:()=>Uw,getElementAtPath:()=>LB,getEnumValues:()=>Wp,getLengthableOrigin:()=>Hp,getParsedType:()=>GB,getSizableOrigin:()=>qp,hexToUint8Array:()=>oF,isObject:()=>Us,isPlainObject:()=>_a,issue:()=>sc,joinValues:()=>k,jsonStringifyReplacer:()=>oc,merge:()=>XB,mergeDefs:()=>Aa,normalizeParams:()=>j,nullish:()=>wa,numKeys:()=>ZB,objectClone:()=>UB,omit:()=>JB,optionalKeys:()=>Zw,partial:()=>eF,pick:()=>HB,prefixIssues:()=>Gr,primitiveTypes:()=>Ww,promiseAllObject:()=>KB,propertyKeyTypes:()=>Gp,randomString:()=>WB,required:()=>tF,safeExtend:()=>YB,shallowClone:()=>Kw,slugify:()=>jw,stringifyPrimitive:()=>z,uint8ArrayToBase64:()=>C1,uint8ArrayToBase64url:()=>nF,uint8ArrayToHex:()=>aF,unwrapMessage:()=>Kp});function TB(r){return r}function RB(r){return r}function OB(r){}function VB(r){throw new Error}function zB(r){}function Wp(r){let e=Object.values(r).filter(i=>typeof i=="number");return Object.entries(r).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function k(r,e="|"){return r.map(t=>z(t)).join(e)}function oc(r,e){return typeof e=="bigint"?e.toString():e}function ac(r){return{get value(){{let t=r();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}function wa(r){return r==null}function Zp(r){let e=r.startsWith("^")?1:0,t=r.endsWith("$")?r.length-1:r.length;return r.slice(e,t)}function Uw(r,e){let t=(r.toString().split(".")[1]||"").length,i=e.toString(),n=(i.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(i)){let l=i.match(/\d?e-(\d?)/);l?.[1]&&(n=Number.parseInt(l[1]))}let o=t>n?t:n,a=Number.parseInt(r.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return a%s/10**o}var D1=Symbol("evaluating");function $e(r,e,t){let i;Object.defineProperty(r,e,{get(){if(i!==D1)return i===void 0&&(i=D1,i=t()),i},set(n){Object.defineProperty(r,e,{value:n})},configurable:!0})}function UB(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function ba(r,e,t){Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Aa(...r){let e={};for(let t of r){let i=Object.getOwnPropertyDescriptors(t);Object.assign(e,i)}return Object.defineProperties({},e)}function jB(r){return Aa(r._zod.def)}function LB(r,e){return e?e.reduce((t,i)=>t?.[i],r):r}function KB(r){let e=Object.keys(r),t=e.map(i=>r[i]);return Promise.all(t).then(i=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function WB(r=10){let e="abcdefghijklmnopqrstuvwxyz",t="";for(let i=0;i<r;i++)t+=e[Math.floor(Math.random()*e.length)];return t}function Yg(r){return JSON.stringify(r)}function jw(r){return r.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Xg="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function Us(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var Lw=ac(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let r=Function;return new r(""),!0}catch{return!1}});function _a(r){if(Us(r)===!1)return!1;let e=r.constructor;if(e===void 0||typeof e!="function")return!0;let t=e.prototype;return!(Us(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function Kw(r){return _a(r)?{...r}:Array.isArray(r)?[...r]:r}function ZB(r){let e=0;for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&e++;return e}var GB=r=>{let e=typeof r;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(r)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(r)?"array":r===null?"null":r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?"promise":typeof Map<"u"&&r instanceof Map?"map":typeof Set<"u"&&r instanceof Set?"set":typeof Date<"u"&&r instanceof Date?"date":typeof File<"u"&&r instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},Gp=new Set(["string","number","symbol"]),Ww=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Bi(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fr(r,e,t){let i=new r._zod.constr(e??r._zod.def);return(!e||t?.parent)&&(i._zod.parent=r),i}function j(r){let e=r;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function qB(r){let e;return new Proxy({},{get(t,i,n){return e??(e=r()),Reflect.get(e,i,n)},set(t,i,n,o){return e??(e=r()),Reflect.set(e,i,n,o)},has(t,i){return e??(e=r()),Reflect.has(e,i)},deleteProperty(t,i){return e??(e=r()),Reflect.deleteProperty(e,i)},ownKeys(t){return e??(e=r()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(t,i){return e??(e=r()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(t,i,n){return e??(e=r()),Reflect.defineProperty(e,i,n)}})}function z(r){return typeof r=="bigint"?r.toString()+"n":typeof r=="string"?`"${r}"`:`${r}`}function Zw(r){return Object.keys(r).filter(e=>r[e]._zod.optin==="optional"&&r[e]._zod.optout==="optional")}var Gw={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},qw={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function HB(r,e){let t=r._zod.def,i=Aa(r._zod.def,{get shape(){let n={};for(let o in e){if(!(o in t.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(n[o]=t.shape[o])}return ba(this,"shape",n),n},checks:[]});return fr(r,i)}function JB(r,e){let t=r._zod.def,i=Aa(r._zod.def,{get shape(){let n={...r._zod.def.shape};for(let o in e){if(!(o in t.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete n[o]}return ba(this,"shape",n),n},checks:[]});return fr(r,i)}function QB(r,e){if(!_a(e))throw new Error("Invalid input to extend: expected a plain object");let t=r._zod.def.checks;if(t&&t.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let n=Aa(r._zod.def,{get shape(){let o={...r._zod.def.shape,...e};return ba(this,"shape",o),o},checks:[]});return fr(r,n)}function YB(r,e){if(!_a(e))throw new Error("Invalid input to safeExtend: expected a plain object");let t={...r._zod.def,get shape(){let i={...r._zod.def.shape,...e};return ba(this,"shape",i),i},checks:r._zod.def.checks};return fr(r,t)}function XB(r,e){let t=Aa(r._zod.def,{get shape(){let i={...r._zod.def.shape,...e._zod.def.shape};return ba(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return fr(r,t)}function eF(r,e,t){let i=Aa(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(t)for(let a in t){if(!(a in n))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=r?new r({type:"optional",innerType:n[a]}):n[a])}else for(let a in n)o[a]=r?new r({type:"optional",innerType:n[a]}):n[a];return ba(this,"shape",o),o},checks:[]});return fr(e,i)}function tF(r,e,t){let i=Aa(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(t)for(let a in t){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=new r({type:"nonoptional",innerType:n[a]}))}else for(let a in n)o[a]=new r({type:"nonoptional",innerType:n[a]});return ba(this,"shape",o),o},checks:[]});return fr(e,i)}function Pa(r,e=0){if(r.aborted===!0)return!0;for(let t=e;t<r.issues.length;t++)if(r.issues[t]?.continue!==!0)return!0;return!1}function Gr(r,e){return e.map(t=>{var i;return(i=t).path??(i.path=[]),t.path.unshift(r),t})}function Kp(r){return typeof r=="string"?r:r?.message}function qr(r,e,t){let i={...r,path:r.path??[]};if(!r.message){let n=Kp(r.inst?._zod.def?.error?.(r))??Kp(e?.error?.(r))??Kp(t.customError?.(r))??Kp(t.localeError?.(r))??"Invalid input";i.message=n}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function qp(r){return r instanceof Set?"set":r instanceof Map?"map":r instanceof File?"file":"unknown"}function Hp(r){return Array.isArray(r)?"array":typeof r=="string"?"string":"unknown"}function sc(...r){let[e,t,i]=r;return typeof e=="string"?{message:e,code:"custom",input:t,inst:i}:{...e}}function rF(r){return Object.entries(r).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function I1(r){let e=atob(r),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}function C1(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e)}function iF(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t="=".repeat((4-e.length%4)%4);return I1(e+t)}function nF(r){return C1(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function oF(r){let e=r.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let t=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)t[i/2]=Number.parseInt(e.slice(i,i+2),16);return t}function aF(r){return Array.from(r).map(e=>e.toString(16).padStart(2,"0")).join("")}var zw=class{constructor(...e){}};var T1=(r,e)=>{r.name="$ZodError",Object.defineProperty(r,"_zod",{value:r._zod,enumerable:!1}),Object.defineProperty(r,"issues",{value:e,enumerable:!1}),r.message=JSON.stringify(e,oc,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},Jp=b("$ZodError",T1),Nr=b("$ZodError",T1,{Parent:Error});function Qp(r,e=t=>t.message){let t={},i=[];for(let n of r.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:t}}function Yp(r,e=t=>t.message){let t={_errors:[]},i=n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)t._errors.push(e(o));else{let a=t,s=0;for(;s<o.path.length;){let l=o.path[s];s===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(e(o))):a[l]=a[l]||{_errors:[]},a=a[l],s++}}};return i(r),t}function Hw(r,e=t=>t.message){let t={errors:[]},i=(n,o=[])=>{var a,s;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(c=>i({issues:c},l.path));else if(l.code==="invalid_key")i({issues:l.issues},l.path);else if(l.code==="invalid_element")i({issues:l.issues},l.path);else{let c=[...o,...l.path];if(c.length===0){t.errors.push(e(l));continue}let p=t,d=0;for(;d<c.length;){let f=c[d],v=d===c.length-1;typeof f=="string"?(p.properties??(p.properties={}),(a=p.properties)[f]??(a[f]={errors:[]}),p=p.properties[f]):(p.items??(p.items=[]),(s=p.items)[f]??(s[f]={errors:[]}),p=p.items[f]),v&&p.errors.push(e(l)),d++}}};return i(r),t}function R1(r){let e=[],t=r.map(i=>typeof i=="object"?i.key:i);for(let i of t)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function Jw(r){let e=[],t=[...r.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of t)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${R1(i.path)}`);return e.join(`
4
+ `)}var lc=r=>(e,t,i,n)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise)throw new en;if(a.issues.length){let s=new(n?.Err??r)(a.issues.map(l=>qr(l,o,At())));throw Xg(s,n?.callee),s}return a.value},ev=lc(Nr),uc=r=>async(e,t,i,n)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??r)(a.issues.map(l=>qr(l,o,At())));throw Xg(s,n?.callee),s}return a.value},tv=uc(Nr),cc=r=>(e,t,i)=>{let n=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:t,issues:[]},n);if(o instanceof Promise)throw new en;return o.issues.length?{success:!1,error:new(r??Jp)(o.issues.map(a=>qr(a,n,At())))}:{success:!0,data:o.value}},Qw=cc(Nr),dc=r=>async(e,t,i)=>{let n=i?Object.assign(i,{async:!0}):{async:!0},o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new r(o.issues.map(a=>qr(a,n,At())))}:{success:!0,data:o.value}},Yw=dc(Nr),rv=r=>(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return lc(r)(e,t,n)},lF=rv(Nr),iv=r=>(e,t,i)=>lc(r)(e,t,i),uF=iv(Nr),nv=r=>async(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return uc(r)(e,t,n)},cF=nv(Nr),ov=r=>async(e,t,i)=>uc(r)(e,t,i),dF=ov(Nr),av=r=>(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return cc(r)(e,t,n)},pF=av(Nr),sv=r=>(e,t,i)=>cc(r)(e,t,i),hF=sv(Nr),lv=r=>async(e,t,i)=>{let n=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return dc(r)(e,t,n)},fF=lv(Nr),uv=r=>async(e,t,i)=>dc(r)(e,t,i),mF=uv(Nr);var Fi={};ka(Fi,{base64:()=>fb,base64url:()=>cv,bigint:()=>wb,boolean:()=>_b,browserEmail:()=>_F,cidrv4:()=>pb,cidrv6:()=>hb,cuid:()=>Xw,cuid2:()=>eb,date:()=>gb,datetime:()=>yb,domain:()=>EF,duration:()=>ob,e164:()=>mb,email:()=>sb,emoji:()=>lb,extendedDuration:()=>gF,guid:()=>ab,hex:()=>BF,hostname:()=>SF,html5Email:()=>wF,idnEmail:()=>AF,integer:()=>bb,ipv4:()=>ub,ipv6:()=>cb,ksuid:()=>ib,lowercase:()=>Eb,mac:()=>db,md5_base64:()=>NF,md5_base64url:()=>kF,md5_hex:()=>FF,nanoid:()=>nb,null:()=>Pb,number:()=>Ab,rfc5322Email:()=>bF,sha1_base64:()=>MF,sha1_base64url:()=>DF,sha1_hex:()=>$F,sha256_base64:()=>CF,sha256_base64url:()=>TF,sha256_hex:()=>IF,sha384_base64:()=>OF,sha384_base64url:()=>VF,sha384_hex:()=>RF,sha512_base64:()=>UF,sha512_base64url:()=>jF,sha512_hex:()=>zF,string:()=>xb,time:()=>vb,ulid:()=>tb,undefined:()=>Sb,unicodeEmail:()=>O1,uppercase:()=>Bb,uuid:()=>js,uuid4:()=>vF,uuid6:()=>yF,uuid7:()=>xF,xid:()=>rb});var Xw=/^[cC][^\s-]{8,}$/,eb=/^[0-9a-z]+$/,tb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rb=/^[0-9a-vA-V]{20}$/,ib=/^[A-Za-z0-9]{27}$/,nb=/^[a-zA-Z0-9_-]{21}$/,ob=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gF=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ab=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,js=r=>r?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${r}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,vF=js(4),yF=js(6),xF=js(7),sb=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,wF=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,bF=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,O1=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,AF=O1,_F=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,PF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function lb(){return new RegExp(PF,"u")}var ub=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,db=r=>{let e=Bi(r??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},pb=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,hb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,cv=/^[A-Za-z0-9_-]*$/,SF=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,EF=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,mb=/^\+(?:[0-9]){6,14}[0-9]$/,V1="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",gb=new RegExp(`^${V1}$`);function z1(r){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof r.precision=="number"?r.precision===-1?`${e}`:r.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${r.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function vb(r){return new RegExp(`^${z1(r)}$`)}function yb(r){let e=z1({precision:r.precision}),t=["Z"];r.local&&t.push(""),r.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${t.join("|")})`;return new RegExp(`^${V1}T(?:${i})$`)}var xb=r=>{let e=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},wb=/^-?\d+n?$/,bb=/^-?\d+$/,Ab=/^-?\d+(?:\.\d+)?/,_b=/^(?:true|false)$/i,Pb=/^null$/i;var Sb=/^undefined$/i;var Eb=/^[^A-Z]*$/,Bb=/^[^a-z]*$/,BF=/^[0-9a-fA-F]*$/;function Xp(r,e){return new RegExp(`^[A-Za-z0-9+/]{${r}}${e}$`)}function eh(r){return new RegExp(`^[A-Za-z0-9_-]{${r}}$`)}var FF=/^[0-9a-fA-F]{32}$/,NF=Xp(22,"=="),kF=eh(22),$F=/^[0-9a-fA-F]{40}$/,MF=Xp(27,"="),DF=eh(27),IF=/^[0-9a-fA-F]{64}$/,CF=Xp(43,"="),TF=eh(43),RF=/^[0-9a-fA-F]{96}$/,OF=Xp(64,""),VF=eh(64),zF=/^[0-9a-fA-F]{128}$/,UF=Xp(86,"=="),jF=eh(86);var Je=b("$ZodCheck",(r,e)=>{var t;r._zod??(r._zod={}),r._zod.def=e,(t=r._zod).onattach??(t.onattach=[])}),j1={number:"number",bigint:"bigint",object:"date"},dv=b("$ZodCheckLessThan",(r,e)=>{Je.init(r,e);let t=j1[typeof e.value];r._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),r._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:t,code:"too_big",maximum:e.value,input:i.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),pv=b("$ZodCheckGreaterThan",(r,e)=>{Je.init(r,e);let t=j1[typeof e.value];r._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),r._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:t,code:"too_small",minimum:e.value,input:i.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),Fb=b("$ZodCheckMultipleOf",(r,e)=>{Je.init(r,e),r._zod.onattach.push(t=>{var i;(i=t._zod.bag).multipleOf??(i.multipleOf=e.value)}),r._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof t.value=="bigint"?t.value%e.value===BigInt(0):Uw(t.value,e.value)===0)||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:e.value,input:t.value,inst:r,continue:!e.abort})}}),Nb=b("$ZodCheckNumberFormat",(r,e)=>{Je.init(r,e),e.format=e.format||"float64";let t=e.format?.includes("int"),i=t?"int":"number",[n,o]=Gw[e.format];r._zod.onattach.push(a=>{let s=a._zod.bag;s.format=e.format,s.minimum=n,s.maximum=o,t&&(s.pattern=bb)}),r._zod.check=a=>{let s=a.value;if(t){if(!Number.isInteger(s)){a.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:s,inst:r});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:i,continue:!e.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:i,continue:!e.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:r,continue:!e.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inst:r})}}),kb=b("$ZodCheckBigIntFormat",(r,e)=>{Je.init(r,e);let[t,i]=qw[e.format];r._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,o.minimum=t,o.maximum=i}),r._zod.check=n=>{let o=n.value;o<t&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:t,inclusive:!0,inst:r,continue:!e.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inst:r})}}),$b=b("$ZodCheckMaxSize",(r,e)=>{var t;Je.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!wa(n)&&n.size!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),r._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:qp(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),Mb=b("$ZodCheckMinSize",(r,e)=>{var t;Je.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!wa(n)&&n.size!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),r._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:qp(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),Db=b("$ZodCheckSizeEquals",(r,e)=>{var t;Je.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!wa(n)&&n.size!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),r._zod.check=i=>{let n=i.value,o=n.size;if(o===e.size)return;let a=o>e.size;i.issues.push({origin:qp(n),...a?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:r,continue:!e.abort})}}),Ib=b("$ZodCheckMaxLength",(r,e)=>{var t;Je.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!wa(n)&&n.length!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),r._zod.check=i=>{let n=i.value;if(n.length<=e.maximum)return;let a=Hp(n);i.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),Cb=b("$ZodCheckMinLength",(r,e)=>{var t;Je.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!wa(n)&&n.length!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),r._zod.check=i=>{let n=i.value;if(n.length>=e.minimum)return;let a=Hp(n);i.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:r,continue:!e.abort})}}),Tb=b("$ZodCheckLengthEquals",(r,e)=>{var t;Je.init(r,e),(t=r._zod.def).when??(t.when=i=>{let n=i.value;return!wa(n)&&n.length!==void 0}),r._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),r._zod.check=i=>{let n=i.value,o=n.length;if(o===e.length)return;let a=Hp(n),s=o>e.length;i.issues.push({origin:a,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:r,continue:!e.abort})}}),pc=b("$ZodCheckStringFormat",(r,e)=>{var t,i;Je.init(r,e),r._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(t=r._zod).check??(t.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:r,continue:!e.abort})}):(i=r._zod).check??(i.check=()=>{})}),Rb=b("$ZodCheckRegex",(r,e)=>{pc.init(r,e),r._zod.check=t=>{e.pattern.lastIndex=0,!e.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:e.pattern.toString(),inst:r,continue:!e.abort})}}),Ob=b("$ZodCheckLowerCase",(r,e)=>{e.pattern??(e.pattern=Eb),pc.init(r,e)}),Vb=b("$ZodCheckUpperCase",(r,e)=>{e.pattern??(e.pattern=Bb),pc.init(r,e)}),zb=b("$ZodCheckIncludes",(r,e)=>{Je.init(r,e);let t=Bi(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=i,r._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),r._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:r,continue:!e.abort})}}),Ub=b("$ZodCheckStartsWith",(r,e)=>{Je.init(r,e);let t=new RegExp(`^${Bi(e.prefix)}.*`);e.pattern??(e.pattern=t),r._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),r._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:r,continue:!e.abort})}}),jb=b("$ZodCheckEndsWith",(r,e)=>{Je.init(r,e);let t=new RegExp(`.*${Bi(e.suffix)}$`);e.pattern??(e.pattern=t),r._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),r._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:r,continue:!e.abort})}});function U1(r,e,t){r.issues.length&&e.issues.push(...Gr(t,r.issues))}var Lb=b("$ZodCheckProperty",(r,e)=>{Je.init(r,e),r._zod.check=t=>{let i=e.schema._zod.run({value:t.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>U1(n,t,e.property));U1(i,t,e.property)}}),Kb=b("$ZodCheckMimeType",(r,e)=>{Je.init(r,e);let t=new Set(e.mime);r._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),r._zod.check=i=>{t.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:r,continue:!e.abort})}}),Wb=b("$ZodCheckOverwrite",(r,e)=>{Je.init(r,e),r._zod.check=t=>{t.value=e.tx(t.value)}});var th=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
5
5
  `).filter(a=>a),n=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...t,n.join(`
6
- `))}};var Zb={major:4,minor:1,patch:13};var he=b("$ZodType",(r,e)=>{var t;r??(r={}),r._zod.def=e,r._zod.bag=r._zod.bag||{},r._zod.version=Zb;let i=[...r._zod.def.checks??[]];r._zod.traits.has("$ZodCheck")&&i.unshift(r);for(let n of i)for(let o of n._zod.onattach)o(r);if(i.length===0)(t=r._zod).deferred??(t.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{let n=(a,s,u)=>{let c=ba(a),p;for(let d of s){if(d._zod.def.when){if(!d._zod.def.when(a))continue}else if(c)continue;let f=a.issues.length,v=d._zod.check(a);if(v instanceof Promise&&u?.async===!1)throw new en;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,a.issues.length!==f&&(c||(c=ba(a,f)))});else{if(a.issues.length===f)continue;c||(c=ba(a,f))}}return p?p.then(()=>a):a},o=(a,s,u)=>{if(ba(a))return a.aborted=!0,a;let c=n(s,i,u);if(c instanceof Promise){if(u.async===!1)throw new en;return c.then(p=>r._zod.parse(p,u))}return r._zod.parse(c,u)};r._zod.run=(a,s)=>{if(s.skipChecks)return r._zod.parse(a,s);if(s.direction==="backward"){let c=r._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return c instanceof Promise?c.then(p=>o(p,a,s)):o(c,a,s)}let u=r._zod.parse(a,s);if(u instanceof Promise){if(s.async===!1)throw new en;return u.then(c=>n(c,i,s))}return n(u,i,s)}}r["~standard"]={validate:n=>{try{let o=Qw(r,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Yw(r,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),Rs=b("$ZodString",(r,e)=>{he.init(r,e),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??xb(r._zod.bag),r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:r}),t}}),je=b("$ZodStringFormat",(r,e)=>{lc.init(r,e),Rs.init(r,e)}),qb=b("$ZodGUID",(r,e)=>{e.pattern??(e.pattern=ab),je.init(r,e)}),Hb=b("$ZodUUID",(r,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=Ts(i))}else e.pattern??(e.pattern=Ts());je.init(r,e)}),Jb=b("$ZodEmail",(r,e)=>{e.pattern??(e.pattern=sb),je.init(r,e)}),Qb=b("$ZodURL",(r,e)=>{je.init(r,e),r._zod.check=t=>{try{let i=t.value.trim(),n=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:t.value,inst:r,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:r,continue:!e.abort})),e.normalize?t.value=n.href:t.value=i;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:r,continue:!e.abort})}}}),Yb=b("$ZodEmoji",(r,e)=>{e.pattern??(e.pattern=lb()),je.init(r,e)}),Xb=b("$ZodNanoID",(r,e)=>{e.pattern??(e.pattern=nb),je.init(r,e)}),e0=b("$ZodCUID",(r,e)=>{e.pattern??(e.pattern=Xw),je.init(r,e)}),t0=b("$ZodCUID2",(r,e)=>{e.pattern??(e.pattern=eb),je.init(r,e)}),r0=b("$ZodULID",(r,e)=>{e.pattern??(e.pattern=tb),je.init(r,e)}),i0=b("$ZodXID",(r,e)=>{e.pattern??(e.pattern=rb),je.init(r,e)}),n0=b("$ZodKSUID",(r,e)=>{e.pattern??(e.pattern=ib),je.init(r,e)}),o0=b("$ZodISODateTime",(r,e)=>{e.pattern??(e.pattern=yb(e)),je.init(r,e)}),a0=b("$ZodISODate",(r,e)=>{e.pattern??(e.pattern=gb),je.init(r,e)}),s0=b("$ZodISOTime",(r,e)=>{e.pattern??(e.pattern=vb(e)),je.init(r,e)}),l0=b("$ZodISODuration",(r,e)=>{e.pattern??(e.pattern=ob),je.init(r,e)}),u0=b("$ZodIPv4",(r,e)=>{e.pattern??(e.pattern=ub),je.init(r,e),r._zod.bag.format="ipv4"}),c0=b("$ZodIPv6",(r,e)=>{e.pattern??(e.pattern=cb),je.init(r,e),r._zod.bag.format="ipv6",r._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:r,continue:!e.abort})}}}),d0=b("$ZodMAC",(r,e)=>{e.pattern??(e.pattern=db(e.delimiter)),je.init(r,e),r._zod.bag.format="mac"}),p0=b("$ZodCIDRv4",(r,e)=>{e.pattern??(e.pattern=pb),je.init(r,e)}),h0=b("$ZodCIDRv6",(r,e)=>{e.pattern??(e.pattern=hb),je.init(r,e),r._zod.check=t=>{let i=t.value.split("/");try{if(i.length!==2)throw new Error;let[n,o]=i;if(!o)throw new Error;let a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:r,continue:!e.abort})}}});function f0(r){if(r==="")return!0;if(r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}var m0=b("$ZodBase64",(r,e)=>{e.pattern??(e.pattern=fb),je.init(r,e),r._zod.bag.contentEncoding="base64",r._zod.check=t=>{f0(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:r,continue:!e.abort})}});function Q1(r){if(!av.test(r))return!1;let e=r.replace(/[-_]/g,i=>i==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return f0(t)}var g0=b("$ZodBase64URL",(r,e)=>{e.pattern??(e.pattern=av),je.init(r,e),r._zod.bag.contentEncoding="base64url",r._zod.check=t=>{Q1(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:r,continue:!e.abort})}}),v0=b("$ZodE164",(r,e)=>{e.pattern??(e.pattern=mb),je.init(r,e)});function Y1(r,e=null){try{let t=r.split(".");if(t.length!==3)return!1;let[i]=t;if(!i)return!1;let n=JSON.parse(atob(i));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}var y0=b("$ZodJWT",(r,e)=>{je.init(r,e),r._zod.check=t=>{Y1(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:r,continue:!e.abort})}}),x0=b("$ZodCustomStringFormat",(r,e)=>{je.init(r,e),r._zod.check=t=>{e.fn(t.value)||t.issues.push({code:"invalid_format",format:e.format,input:t.value,inst:r,continue:!e.abort})}}),fv=b("$ZodNumber",(r,e)=>{he.init(r,e),r._zod.pattern=r._zod.bag.pattern??Ab,r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}let n=t.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return t;let o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:n,inst:r,...o?{received:o}:{}}),t}}),w0=b("$ZodNumberFormat",(r,e)=>{Nb.init(r,e),fv.init(r,e)}),Hp=b("$ZodBoolean",(r,e)=>{he.init(r,e),r._zod.pattern=_b,r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=!!t.value}catch{}let n=t.value;return typeof n=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:r}),t}}),mv=b("$ZodBigInt",(r,e)=>{he.init(r,e),r._zod.pattern=wb,r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=BigInt(t.value)}catch{}return typeof t.value=="bigint"||t.issues.push({expected:"bigint",code:"invalid_type",input:t.value,inst:r}),t}}),b0=b("$ZodBigIntFormat",(r,e)=>{kb.init(r,e),mv.init(r,e)}),A0=b("$ZodSymbol",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;return typeof n=="symbol"||t.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:r}),t}}),_0=b("$ZodUndefined",(r,e)=>{he.init(r,e),r._zod.pattern=Eb,r._zod.values=new Set([void 0]),r._zod.optin="optional",r._zod.optout="optional",r._zod.parse=(t,i)=>{let n=t.value;return typeof n>"u"||t.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:r}),t}}),P0=b("$ZodNull",(r,e)=>{he.init(r,e),r._zod.pattern=Pb,r._zod.values=new Set([null]),r._zod.parse=(t,i)=>{let n=t.value;return n===null||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:r}),t}}),E0=b("$ZodAny",(r,e)=>{he.init(r,e),r._zod.parse=t=>t}),S0=b("$ZodUnknown",(r,e)=>{he.init(r,e),r._zod.parse=t=>t}),B0=b("$ZodNever",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:r}),t)}),F0=b("$ZodVoid",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;return typeof n>"u"||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:r}),t}}),N0=b("$ZodDate",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=new Date(t.value)}catch{}let n=t.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||t.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:r}),t}});function U1(r,e,t){r.issues.length&&e.issues.push(...Gr(t,r.issues)),e.value[t]=r.value}var k0=b("$ZodArray",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!Array.isArray(n))return t.issues.push({expected:"array",code:"invalid_type",input:n,inst:r}),t;t.value=Array(n.length);let o=[];for(let a=0;a<n.length;a++){let s=n[a],u=e.element._zod.run({value:s,issues:[]},i);u instanceof Promise?o.push(u.then(c=>U1(c,t,a))):U1(u,t,a)}return o.length?Promise.all(o).then(()=>t):t}});function hv(r,e,t,i){r.issues.length&&e.issues.push(...Gr(t,r.issues)),r.value===void 0?t in i&&(e.value[t]=void 0):e.value[t]=r.value}function X1(r){let e=Object.keys(r.shape);for(let i of e)if(!r.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let t=Zw(r.shape);return{...r,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function eE(r,e,t,i,n,o){let a=[],s=n.keySet,u=n.catchall._zod,c=u.def.type;for(let p in e){if(s.has(p))continue;if(c==="never"){a.push(p);continue}let d=u.run({value:e[p],issues:[]},i);d instanceof Promise?r.push(d.then(f=>hv(f,t,p,e))):hv(d,t,p,e)}return a.length&&t.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:o}),r.length?Promise.all(r).then(()=>t):t}var tE=b("$ZodObject",(r,e)=>{if(he.init(r,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let s=e.shape;Object.defineProperty(e,"shape",{get:()=>{let u={...s};return Object.defineProperty(e,"shape",{value:u}),u}})}let i=rc(()=>X1(e));Ne(r._zod,"propValues",()=>{let s=e.shape,u={};for(let c in s){let p=s[c]._zod;if(p.values){u[c]??(u[c]=new Set);for(let d of p.values)u[c].add(d)}}return u});let n=Cs,o=e.catchall,a;r._zod.parse=(s,u)=>{a??(a=i.value);let c=s.value;if(!n(c))return s.issues.push({expected:"object",code:"invalid_type",input:c,inst:r}),s;s.value={};let p=[],d=a.shape;for(let f of a.keys){let m=d[f]._zod.run({value:c[f],issues:[]},u);m instanceof Promise?p.push(m.then(y=>hv(y,s,f,c))):hv(m,s,f,c)}return o?eE(p,c,s,u,i.value,r):p.length?Promise.all(p).then(()=>s):s}}),$0=b("$ZodObjectJIT",(r,e)=>{tE.init(r,e);let t=r._zod.parse,i=rc(()=>X1(e)),n=f=>{let v=new qp(["shape","payload","ctx"]),m=i.value,y=T=>{let R=qg(T);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};v.write("const input = payload.value;");let x=Object.create(null),$=0;for(let T of m.keys)x[T]=`key_${$++}`;v.write("const newResult = {};");for(let T of m.keys){let R=x[T],L=qg(T);v.write(`const ${R} = ${y(T)};`),v.write(`
7
- if (${R}.issues.length) {
8
- payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
6
+ `))}};var Zb={major:4,minor:1,patch:13};var fe=b("$ZodType",(r,e)=>{var t;r??(r={}),r._zod.def=e,r._zod.bag=r._zod.bag||{},r._zod.version=Zb;let i=[...r._zod.def.checks??[]];r._zod.traits.has("$ZodCheck")&&i.unshift(r);for(let n of i)for(let o of n._zod.onattach)o(r);if(i.length===0)(t=r._zod).deferred??(t.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{let n=(a,s,l)=>{let c=Pa(a),p;for(let d of s){if(d._zod.def.when){if(!d._zod.def.when(a))continue}else if(c)continue;let f=a.issues.length,v=d._zod.check(a);if(v instanceof Promise&&l?.async===!1)throw new en;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,a.issues.length!==f&&(c||(c=Pa(a,f)))});else{if(a.issues.length===f)continue;c||(c=Pa(a,f))}}return p?p.then(()=>a):a},o=(a,s,l)=>{if(Pa(a))return a.aborted=!0,a;let c=n(s,i,l);if(c instanceof Promise){if(l.async===!1)throw new en;return c.then(p=>r._zod.parse(p,l))}return r._zod.parse(c,l)};r._zod.run=(a,s)=>{if(s.skipChecks)return r._zod.parse(a,s);if(s.direction==="backward"){let c=r._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return c instanceof Promise?c.then(p=>o(p,a,s)):o(c,a,s)}let l=r._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new en;return l.then(c=>n(c,i,s))}return n(l,i,s)}}r["~standard"]={validate:n=>{try{let o=Qw(r,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return Yw(r,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),Ls=b("$ZodString",(r,e)=>{fe.init(r,e),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??xb(r._zod.bag),r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=String(t.value)}catch{}return typeof t.value=="string"||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:r}),t}}),Ze=b("$ZodStringFormat",(r,e)=>{pc.init(r,e),Ls.init(r,e)}),qb=b("$ZodGUID",(r,e)=>{e.pattern??(e.pattern=ab),Ze.init(r,e)}),Hb=b("$ZodUUID",(r,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=js(i))}else e.pattern??(e.pattern=js());Ze.init(r,e)}),Jb=b("$ZodEmail",(r,e)=>{e.pattern??(e.pattern=sb),Ze.init(r,e)}),Qb=b("$ZodURL",(r,e)=>{Ze.init(r,e),r._zod.check=t=>{try{let i=t.value.trim(),n=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:t.value,inst:r,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:r,continue:!e.abort})),e.normalize?t.value=n.href:t.value=i;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:r,continue:!e.abort})}}}),Yb=b("$ZodEmoji",(r,e)=>{e.pattern??(e.pattern=lb()),Ze.init(r,e)}),Xb=b("$ZodNanoID",(r,e)=>{e.pattern??(e.pattern=nb),Ze.init(r,e)}),e0=b("$ZodCUID",(r,e)=>{e.pattern??(e.pattern=Xw),Ze.init(r,e)}),t0=b("$ZodCUID2",(r,e)=>{e.pattern??(e.pattern=eb),Ze.init(r,e)}),r0=b("$ZodULID",(r,e)=>{e.pattern??(e.pattern=tb),Ze.init(r,e)}),i0=b("$ZodXID",(r,e)=>{e.pattern??(e.pattern=rb),Ze.init(r,e)}),n0=b("$ZodKSUID",(r,e)=>{e.pattern??(e.pattern=ib),Ze.init(r,e)}),o0=b("$ZodISODateTime",(r,e)=>{e.pattern??(e.pattern=yb(e)),Ze.init(r,e)}),a0=b("$ZodISODate",(r,e)=>{e.pattern??(e.pattern=gb),Ze.init(r,e)}),s0=b("$ZodISOTime",(r,e)=>{e.pattern??(e.pattern=vb(e)),Ze.init(r,e)}),l0=b("$ZodISODuration",(r,e)=>{e.pattern??(e.pattern=ob),Ze.init(r,e)}),u0=b("$ZodIPv4",(r,e)=>{e.pattern??(e.pattern=ub),Ze.init(r,e),r._zod.bag.format="ipv4"}),c0=b("$ZodIPv6",(r,e)=>{e.pattern??(e.pattern=cb),Ze.init(r,e),r._zod.bag.format="ipv6",r._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:r,continue:!e.abort})}}}),d0=b("$ZodMAC",(r,e)=>{e.pattern??(e.pattern=db(e.delimiter)),Ze.init(r,e),r._zod.bag.format="mac"}),p0=b("$ZodCIDRv4",(r,e)=>{e.pattern??(e.pattern=pb),Ze.init(r,e)}),h0=b("$ZodCIDRv6",(r,e)=>{e.pattern??(e.pattern=hb),Ze.init(r,e),r._zod.check=t=>{let i=t.value.split("/");try{if(i.length!==2)throw new Error;let[n,o]=i;if(!o)throw new Error;let a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:r,continue:!e.abort})}}});function f0(r){if(r==="")return!0;if(r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}var m0=b("$ZodBase64",(r,e)=>{e.pattern??(e.pattern=fb),Ze.init(r,e),r._zod.bag.contentEncoding="base64",r._zod.check=t=>{f0(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:r,continue:!e.abort})}});function eS(r){if(!cv.test(r))return!1;let e=r.replace(/[-_]/g,i=>i==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return f0(t)}var g0=b("$ZodBase64URL",(r,e)=>{e.pattern??(e.pattern=cv),Ze.init(r,e),r._zod.bag.contentEncoding="base64url",r._zod.check=t=>{eS(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:r,continue:!e.abort})}}),v0=b("$ZodE164",(r,e)=>{e.pattern??(e.pattern=mb),Ze.init(r,e)});function tS(r,e=null){try{let t=r.split(".");if(t.length!==3)return!1;let[i]=t;if(!i)return!1;let n=JSON.parse(atob(i));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}var y0=b("$ZodJWT",(r,e)=>{Ze.init(r,e),r._zod.check=t=>{tS(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:r,continue:!e.abort})}}),x0=b("$ZodCustomStringFormat",(r,e)=>{Ze.init(r,e),r._zod.check=t=>{e.fn(t.value)||t.issues.push({code:"invalid_format",format:e.format,input:t.value,inst:r,continue:!e.abort})}}),yv=b("$ZodNumber",(r,e)=>{fe.init(r,e),r._zod.pattern=r._zod.bag.pattern??Ab,r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}let n=t.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return t;let o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:n,inst:r,...o?{received:o}:{}}),t}}),w0=b("$ZodNumberFormat",(r,e)=>{Nb.init(r,e),yv.init(r,e)}),rh=b("$ZodBoolean",(r,e)=>{fe.init(r,e),r._zod.pattern=_b,r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=!!t.value}catch{}let n=t.value;return typeof n=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:r}),t}}),xv=b("$ZodBigInt",(r,e)=>{fe.init(r,e),r._zod.pattern=wb,r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=BigInt(t.value)}catch{}return typeof t.value=="bigint"||t.issues.push({expected:"bigint",code:"invalid_type",input:t.value,inst:r}),t}}),b0=b("$ZodBigIntFormat",(r,e)=>{kb.init(r,e),xv.init(r,e)}),A0=b("$ZodSymbol",(r,e)=>{fe.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;return typeof n=="symbol"||t.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:r}),t}}),_0=b("$ZodUndefined",(r,e)=>{fe.init(r,e),r._zod.pattern=Sb,r._zod.values=new Set([void 0]),r._zod.optin="optional",r._zod.optout="optional",r._zod.parse=(t,i)=>{let n=t.value;return typeof n>"u"||t.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:r}),t}}),P0=b("$ZodNull",(r,e)=>{fe.init(r,e),r._zod.pattern=Pb,r._zod.values=new Set([null]),r._zod.parse=(t,i)=>{let n=t.value;return n===null||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:r}),t}}),S0=b("$ZodAny",(r,e)=>{fe.init(r,e),r._zod.parse=t=>t}),E0=b("$ZodUnknown",(r,e)=>{fe.init(r,e),r._zod.parse=t=>t}),B0=b("$ZodNever",(r,e)=>{fe.init(r,e),r._zod.parse=(t,i)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:r}),t)}),F0=b("$ZodVoid",(r,e)=>{fe.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;return typeof n>"u"||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:r}),t}}),N0=b("$ZodDate",(r,e)=>{fe.init(r,e),r._zod.parse=(t,i)=>{if(e.coerce)try{t.value=new Date(t.value)}catch{}let n=t.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||t.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:r}),t}});function K1(r,e,t){r.issues.length&&e.issues.push(...Gr(t,r.issues)),e.value[t]=r.value}var k0=b("$ZodArray",(r,e)=>{fe.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!Array.isArray(n))return t.issues.push({expected:"array",code:"invalid_type",input:n,inst:r}),t;t.value=Array(n.length);let o=[];for(let a=0;a<n.length;a++){let s=n[a],l=e.element._zod.run({value:s,issues:[]},i);l instanceof Promise?o.push(l.then(c=>K1(c,t,a))):K1(l,t,a)}return o.length?Promise.all(o).then(()=>t):t}});function vv(r,e,t,i){r.issues.length&&e.issues.push(...Gr(t,r.issues)),r.value===void 0?t in i&&(e.value[t]=void 0):e.value[t]=r.value}function rS(r){let e=Object.keys(r.shape);for(let i of e)if(!r.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let t=Zw(r.shape);return{...r,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function iS(r,e,t,i,n,o){let a=[],s=n.keySet,l=n.catchall._zod,c=l.def.type;for(let p in e){if(s.has(p))continue;if(c==="never"){a.push(p);continue}let d=l.run({value:e[p],issues:[]},i);d instanceof Promise?r.push(d.then(f=>vv(f,t,p,e))):vv(d,t,p,e)}return a.length&&t.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:o}),r.length?Promise.all(r).then(()=>t):t}var nS=b("$ZodObject",(r,e)=>{if(fe.init(r,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let s=e.shape;Object.defineProperty(e,"shape",{get:()=>{let l={...s};return Object.defineProperty(e,"shape",{value:l}),l}})}let i=ac(()=>rS(e));$e(r._zod,"propValues",()=>{let s=e.shape,l={};for(let c in s){let p=s[c]._zod;if(p.values){l[c]??(l[c]=new Set);for(let d of p.values)l[c].add(d)}}return l});let n=Us,o=e.catchall,a;r._zod.parse=(s,l)=>{a??(a=i.value);let c=s.value;if(!n(c))return s.issues.push({expected:"object",code:"invalid_type",input:c,inst:r}),s;s.value={};let p=[],d=a.shape;for(let f of a.keys){let m=d[f]._zod.run({value:c[f],issues:[]},l);m instanceof Promise?p.push(m.then(y=>vv(y,s,f,c))):vv(m,s,f,c)}return o?iS(p,c,s,l,i.value,r):p.length?Promise.all(p).then(()=>s):s}}),$0=b("$ZodObjectJIT",(r,e)=>{nS.init(r,e);let t=r._zod.parse,i=ac(()=>rS(e)),n=f=>{let v=new th(["shape","payload","ctx"]),m=i.value,y=O=>{let T=Yg(O);return`shape[${T}]._zod.run({ value: input[${T}], issues: [] }, ctx)`};v.write("const input = payload.value;");let x=Object.create(null),M=0;for(let O of m.keys)x[O]=`key_${M++}`;v.write("const newResult = {};");for(let O of m.keys){let T=x[O],V=Yg(O);v.write(`const ${T} = ${y(O)};`),v.write(`
7
+ if (${T}.issues.length) {
8
+ payload.issues = payload.issues.concat(${T}.issues.map(iss => ({
9
9
  ...iss,
10
- path: iss.path ? [${L}, ...iss.path] : [${L}]
10
+ path: iss.path ? [${V}, ...iss.path] : [${V}]
11
11
  })));
12
12
  }
13
13
 
14
14
 
15
- if (${R}.value === undefined) {
16
- if (${L} in input) {
17
- newResult[${L}] = undefined;
15
+ if (${T}.value === undefined) {
16
+ if (${V} in input) {
17
+ newResult[${V}] = undefined;
18
18
  }
19
19
  } else {
20
- newResult[${L}] = ${R}.value;
20
+ newResult[${V}] = ${T}.value;
21
21
  }
22
22
 
23
- `)}v.write("payload.value = newResult;"),v.write("return payload;");let I=v.compile();return(T,R)=>I(f,T,R)},o,a=Cs,s=!Tp.jitless,c=s&&Lw.value,p=e.catchall,d;r._zod.parse=(f,v)=>{d??(d=i.value);let m=f.value;return a(m)?s&&c&&v?.async===!1&&v.jitless!==!0?(o||(o=n(e.shape)),f=o(f,v),p?eE([],m,f,v,d,r):f):t(f,v):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:r}),f)}});function j1(r,e,t,i){for(let o of r)if(o.issues.length===0)return e.value=o.value,e;let n=r.filter(o=>!ba(o));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:r.map(o=>o.issues.map(a=>qr(a,i,yt())))}),e)}var gv=b("$ZodUnion",(r,e)=>{he.init(r,e),Ne(r._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Ne(r._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Ne(r._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),Ne(r._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>Vp(o.source)).join("|")})$`)}});let t=e.options.length===1,i=e.options[0]._zod.run;r._zod.parse=(n,o)=>{if(t)return i(n,o);let a=!1,s=[];for(let u of e.options){let c=u._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)s.push(c),a=!0;else{if(c.issues.length===0)return c;s.push(c)}}return a?Promise.all(s).then(u=>j1(u,n,r,o)):j1(s,n,r,o)}}),M0=b("$ZodDiscriminatedUnion",(r,e)=>{gv.init(r,e);let t=r._zod.parse;Ne(r._zod,"propValues",()=>{let n={};for(let o of e.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[s,u]of Object.entries(a)){n[s]||(n[s]=new Set);for(let c of u)n[s].add(c)}}return n});let i=rc(()=>{let n=e.options,o=new Map;for(let a of n){let s=a._zod.propValues?.[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let u of s){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,a)}}return o});r._zod.parse=(n,o)=>{let a=n.value;if(!Cs(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:r}),n;let s=i.value.get(a?.[e.discriminator]);return s?s._zod.run(n,o):e.unionFallback?t(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:a,path:[e.discriminator],inst:r}),n)}}),D0=b("$ZodIntersection",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value,o=e.left._zod.run({value:n,issues:[]},i),a=e.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([u,c])=>L1(t,u,c)):L1(t,o,a)}});function Gb(r,e){if(r===e)return{valid:!0,data:r};if(r instanceof Date&&e instanceof Date&&+r==+e)return{valid:!0,data:r};if(wa(r)&&wa(e)){let t=Object.keys(e),i=Object.keys(r).filter(o=>t.indexOf(o)!==-1),n={...r,...e};for(let o of i){let a=Gb(r[o],e[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n[o]=a.data}return{valid:!0,data:n}}if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return{valid:!1,mergeErrorPath:[]};let t=[];for(let i=0;i<r.length;i++){let n=r[i],o=e[i],a=Gb(n,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};t.push(a.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function L1(r,e,t){if(e.issues.length&&r.issues.push(...e.issues),t.issues.length&&r.issues.push(...t.issues),ba(r))return r;let i=Gb(e.value,t.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return r.value=i.data,r}var vv=b("$ZodTuple",(r,e)=>{he.init(r,e);let t=e.items;r._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:r,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[],s=[...t].reverse().findIndex(p=>p._zod.optin!=="optional"),u=s===-1?0:t.length-s;if(!e.rest){let p=o.length>t.length,d=o.length<u-1;if(p||d)return i.issues.push({...p?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:o,inst:r,origin:"array"}),i}let c=-1;for(let p of t){if(c++,c>=o.length&&c>=u)continue;let d=p._zod.run({value:o[c],issues:[]},n);d instanceof Promise?a.push(d.then(f=>uv(f,i,c))):uv(d,i,c)}if(e.rest){let p=o.slice(t.length);for(let d of p){c++;let f=e.rest._zod.run({value:d,issues:[]},n);f instanceof Promise?a.push(f.then(v=>uv(v,i,c))):uv(f,i,c)}}return a.length?Promise.all(a).then(()=>i):i}});function uv(r,e,t){r.issues.length&&e.issues.push(...Gr(t,r.issues)),e.value[t]=r.value}var I0=b("$ZodRecord",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!wa(n))return t.issues.push({expected:"record",code:"invalid_type",input:n,inst:r}),t;let o=[],a=e.keyType._zod.values;if(a){t.value={};let s=new Set;for(let c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){s.add(typeof c=="number"?c.toString():c);let p=e.valueType._zod.run({value:n[c],issues:[]},i);p instanceof Promise?o.push(p.then(d=>{d.issues.length&&t.issues.push(...Gr(c,d.issues)),t.value[c]=d.value})):(p.issues.length&&t.issues.push(...Gr(c,p.issues)),t.value[c]=p.value)}let u;for(let c in n)s.has(c)||(u=u??[],u.push(c));u&&u.length>0&&t.issues.push({code:"unrecognized_keys",input:n,inst:r,keys:u})}else{t.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__")continue;let u=e.keyType._zod.run({value:s,issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){t.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>qr(p,i,yt())),input:s,path:[s],inst:r}),t.value[u.value]=u.value;continue}let c=e.valueType._zod.run({value:n[s],issues:[]},i);c instanceof Promise?o.push(c.then(p=>{p.issues.length&&t.issues.push(...Gr(s,p.issues)),t.value[u.value]=p.value})):(c.issues.length&&t.issues.push(...Gr(s,c.issues)),t.value[u.value]=c.value)}}return o.length?Promise.all(o).then(()=>t):t}}),C0=b("$ZodMap",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!(n instanceof Map))return t.issues.push({expected:"map",code:"invalid_type",input:n,inst:r}),t;let o=[];t.value=new Map;for(let[a,s]of n){let u=e.keyType._zod.run({value:a,issues:[]},i),c=e.valueType._zod.run({value:s,issues:[]},i);u instanceof Promise||c instanceof Promise?o.push(Promise.all([u,c]).then(([p,d])=>{K1(p,d,t,a,n,r,i)})):K1(u,c,t,a,n,r,i)}return o.length?Promise.all(o).then(()=>t):t}});function K1(r,e,t,i,n,o,a){r.issues.length&&(zp.has(typeof i)?t.issues.push(...Gr(i,r.issues)):t.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:r.issues.map(s=>qr(s,a,yt()))})),e.issues.length&&(zp.has(typeof i)?t.issues.push(...Gr(i,e.issues)):t.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(s=>qr(s,a,yt()))})),t.value.set(r.value,e.value)}var T0=b("$ZodSet",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!(n instanceof Set))return t.issues.push({input:n,inst:r,expected:"set",code:"invalid_type"}),t;let o=[];t.value=new Set;for(let a of n){let s=e.valueType._zod.run({value:a,issues:[]},i);s instanceof Promise?o.push(s.then(u=>W1(u,t))):W1(s,t)}return o.length?Promise.all(o).then(()=>t):t}});function W1(r,e){r.issues.length&&e.issues.push(...r.issues),e.value.add(r.value)}var R0=b("$ZodEnum",(r,e)=>{he.init(r,e);let t=Op(e.entries),i=new Set(t);r._zod.values=i,r._zod.pattern=new RegExp(`^(${t.filter(n=>zp.has(typeof n)).map(n=>typeof n=="string"?Bi(n):n.toString()).join("|")})$`),r._zod.parse=(n,o)=>{let a=n.value;return i.has(a)||n.issues.push({code:"invalid_value",values:t,input:a,inst:r}),n}}),O0=b("$ZodLiteral",(r,e)=>{if(he.init(r,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let t=new Set(e.values);r._zod.values=t,r._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Bi(i):i?Bi(i.toString()):String(i)).join("|")})$`),r._zod.parse=(i,n)=>{let o=i.value;return t.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:r}),i}}),V0=b("$ZodFile",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;return n instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:n,inst:r}),t}}),z0=b("$ZodTransform",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{if(i.direction==="backward")throw new ga(r.constructor.name);let n=e.transform(t.value,t);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(t.value=a,t));if(n instanceof Promise)throw new en;return t.value=n,t}});function Z1(r,e){return r.issues.length&&e===void 0?{issues:[],value:void 0}:r}var U0=b("$ZodOptional",(r,e)=>{he.init(r,e),r._zod.optin="optional",r._zod.optout="optional",Ne(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Ne(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${Vp(t.source)})?$`):void 0}),r._zod.parse=(t,i)=>{if(e.innerType._zod.optin==="optional"){let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>Z1(o,t.value)):Z1(n,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,i)}}),j0=b("$ZodNullable",(r,e)=>{he.init(r,e),Ne(r._zod,"optin",()=>e.innerType._zod.optin),Ne(r._zod,"optout",()=>e.innerType._zod.optout),Ne(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${Vp(t.source)}|null)$`):void 0}),Ne(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),r._zod.parse=(t,i)=>t.value===null?t:e.innerType._zod.run(t,i)}),L0=b("$ZodDefault",(r,e)=>{he.init(r,e),r._zod.optin="optional",Ne(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);if(t.value===void 0)return t.value=e.defaultValue,t;let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>G1(o,e)):G1(n,e)}});function G1(r,e){return r.value===void 0&&(r.value=e.defaultValue),r}var K0=b("$ZodPrefault",(r,e)=>{he.init(r,e),r._zod.optin="optional",Ne(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,i)=>(i.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,i))}),W0=b("$ZodNonOptional",(r,e)=>{he.init(r,e),Ne(r._zod,"values",()=>{let t=e.innerType._zod.values;return t?new Set([...t].filter(i=>i!==void 0)):void 0}),r._zod.parse=(t,i)=>{let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>q1(o,r)):q1(n,r)}});function q1(r,e){return!r.issues.length&&r.value===void 0&&r.issues.push({code:"invalid_type",expected:"nonoptional",input:r.value,inst:e}),r}var Z0=b("$ZodSuccess",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>{if(i.direction==="backward")throw new ga("ZodSuccess");let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>(t.value=o.issues.length===0,t)):(t.value=n.issues.length===0,t)}}),G0=b("$ZodCatch",(r,e)=>{he.init(r,e),Ne(r._zod,"optin",()=>e.innerType._zod.optin),Ne(r._zod,"optout",()=>e.innerType._zod.optout),Ne(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(a=>qr(a,i,yt()))},input:t.value}),t.issues=[]),t)):(t.value=n.value,n.issues.length&&(t.value=e.catchValue({...t,error:{issues:n.issues.map(o=>qr(o,i,yt()))},input:t.value}),t.issues=[]),t)}}),q0=b("$ZodNaN",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>((typeof t.value!="number"||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:r,expected:"nan",code:"invalid_type"}),t)}),H0=b("$ZodPipe",(r,e)=>{he.init(r,e),Ne(r._zod,"values",()=>e.in._zod.values),Ne(r._zod,"optin",()=>e.in._zod.optin),Ne(r._zod,"optout",()=>e.out._zod.optout),Ne(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(t,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(t,i);return o instanceof Promise?o.then(a=>cv(a,e.in,i)):cv(o,e.in,i)}let n=e.in._zod.run(t,i);return n instanceof Promise?n.then(o=>cv(o,e.out,i)):cv(n,e.out,i)}});function cv(r,e,t){return r.issues.length?(r.aborted=!0,r):e._zod.run({value:r.value,issues:r.issues},t)}var Jp=b("$ZodCodec",(r,e)=>{he.init(r,e),Ne(r._zod,"values",()=>e.in._zod.values),Ne(r._zod,"optin",()=>e.in._zod.optin),Ne(r._zod,"optout",()=>e.out._zod.optout),Ne(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(t,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(t,i);return o instanceof Promise?o.then(a=>dv(a,e,i)):dv(o,e,i)}else{let o=e.out._zod.run(t,i);return o instanceof Promise?o.then(a=>dv(a,e,i)):dv(o,e,i)}}});function dv(r,e,t){if(r.issues.length)return r.aborted=!0,r;if((t.direction||"forward")==="forward"){let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>pv(r,o,e.out,t)):pv(r,n,e.out,t)}else{let n=e.reverseTransform(r.value,r);return n instanceof Promise?n.then(o=>pv(r,o,e.in,t)):pv(r,n,e.in,t)}}function pv(r,e,t,i){return r.issues.length?(r.aborted=!0,r):t._zod.run({value:e,issues:r.issues},i)}var J0=b("$ZodReadonly",(r,e)=>{he.init(r,e),Ne(r._zod,"propValues",()=>e.innerType._zod.propValues),Ne(r._zod,"values",()=>e.innerType._zod.values),Ne(r._zod,"optin",()=>e.innerType?._zod?.optin),Ne(r._zod,"optout",()=>e.innerType?._zod?.optout),r._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(H1):H1(n)}});function H1(r){return r.value=Object.freeze(r.value),r}var Q0=b("$ZodTemplateLiteral",(r,e)=>{he.init(r,e);let t=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;t.push(n.slice(o,a))}else if(i===null||Ww.has(typeof i))t.push(Bi(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);r._zod.pattern=new RegExp(`^${t.join("")}$`),r._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:r,expected:"template_literal",code:"invalid_type"}),i):(r._zod.pattern.lastIndex=0,r._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:r,code:"invalid_format",format:e.format??"template_literal",pattern:r._zod.pattern.source}),i)}),Y0=b("$ZodFunction",(r,e)=>(he.init(r,e),r._def=e,r._zod.def=e,r.implement=t=>{if(typeof t!="function")throw new Error("implement() must be called with a function");return function(...i){let n=r._def.input?Jg(r._def.input,i):i,o=Reflect.apply(t,this,n);return r._def.output?Jg(r._def.output,o):o}},r.implementAsync=t=>{if(typeof t!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=r._def.input?await Qg(r._def.input,i):i,o=await Reflect.apply(t,this,n);return r._def.output?await Qg(r._def.output,o):o}},r._zod.parse=(t,i)=>typeof t.value!="function"?(t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:r}),t):(r._def.output&&r._def.output._zod.def.type==="promise"?t.value=r.implementAsync(t.value):t.value=r.implement(t.value),t),r.input=(...t)=>{let i=r.constructor;return Array.isArray(t[0])?new i({type:"function",input:new vv({type:"tuple",items:t[0],rest:t[1]}),output:r._def.output}):new i({type:"function",input:t[0],output:r._def.output})},r.output=t=>{let i=r.constructor;return new i({type:"function",input:r._def.input,output:t})},r)),X0=b("$ZodPromise",(r,e)=>{he.init(r,e),r._zod.parse=(t,i)=>Promise.resolve(t.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i))}),eA=b("$ZodLazy",(r,e)=>{he.init(r,e),Ne(r._zod,"innerType",()=>e.getter()),Ne(r._zod,"pattern",()=>r._zod.innerType?._zod?.pattern),Ne(r._zod,"propValues",()=>r._zod.innerType?._zod?.propValues),Ne(r._zod,"optin",()=>r._zod.innerType?._zod?.optin??void 0),Ne(r._zod,"optout",()=>r._zod.innerType?._zod?.optout??void 0),r._zod.parse=(t,i)=>r._zod.innerType._zod.run(t,i)}),tA=b("$ZodCustom",(r,e)=>{We.init(r,e),he.init(r,e),r._zod.parse=(t,i)=>t,r._zod.check=t=>{let i=t.value,n=e.fn(i);if(n instanceof Promise)return n.then(o=>J1(o,t,i,r));J1(n,t,i,r)}});function J1(r,e,t,i){if(!r){let n={code:"custom",input:t,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),e.issues.push(ic(n))}}var Xp={};Pa(Xp,{ar:()=>rE,az:()=>iE,be:()=>oE,bg:()=>aE,ca:()=>sE,cs:()=>lE,da:()=>uE,de:()=>cE,en:()=>yv,eo:()=>dE,es:()=>pE,fa:()=>hE,fi:()=>fE,fr:()=>mE,frCA:()=>gE,he:()=>vE,hu:()=>yE,id:()=>xE,is:()=>wE,it:()=>bE,ja:()=>AE,ka:()=>_E,kh:()=>PE,km:()=>xv,ko:()=>EE,lt:()=>BE,mk:()=>FE,ms:()=>NE,nl:()=>kE,no:()=>$E,ota:()=>ME,pl:()=>IE,ps:()=>DE,pt:()=>CE,ru:()=>RE,sl:()=>OE,sv:()=>VE,ta:()=>zE,th:()=>UE,tr:()=>jE,ua:()=>LE,uk:()=>wv,ur:()=>KE,vi:()=>WE,yo:()=>qE,zhCN:()=>ZE,zhTW:()=>GE});var UF=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\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 ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${t(n.input)}`;case"invalid_value":return n.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 ${V(n.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: ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()} ${a.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 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${n.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${k(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.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 ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function rE(){return{localeError:UF()}}var jF=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${n.expected}, daxil olan ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${V(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${i[o.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${k(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function iE(){return{localeError:jF()}}function nE(r,e,t,i){let n=Math.abs(r),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?t:i}var LF=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0456\u045E";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${t(n.input)}`;case"invalid_value":return n.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 ${V(n.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 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),u=nE(s,a.unit.one,a.unit.few,a.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 ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${n.maximum.toString()} ${u}`}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 ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),u=nE(s,a.unit.one,a.unit.few,a.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 ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${n.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${k(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.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 ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function oE(){return{localeError:LF()}}var KF=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},WF=()=>{let r={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 r[i]??null}let t={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"};return i=>{switch(i.code){case"invalid_type":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${KF(i.input)}`;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 ${V(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 ${k(i.values,"|")}`;case"too_big":{let n=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 ${n}${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 ${n}${i.maximum.toString()}`}case"too_small":{let n=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 ${n}${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 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.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 "${n.prefix}"`;if(n.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 "${n.suffix}"`;if(n.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 "${n.includes}"`;if(n.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 ${n.pattern}`;let o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return n.format==="emoji"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="datetime"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="date"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),n.format==="time"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="duration"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${o} ${t[n.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":""}: ${k(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 aE(){return{localeError:WF()}}var ZF=()=>{let r={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${n.expected}, s'ha rebut ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${V(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${k(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",a=e(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=e(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${i[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function sE(){return{localeError:ZF()}}var GF=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(n))return"pole";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${n.expected}, obdr\u017Eeno ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${V(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${i[o.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${k(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function lE(){return{localeError:GF()}}var qF=()=>{let r={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},e={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};function t(a){return r[a]??null}function i(a){return e[a]??a}let n=a=>{let s=typeof a;switch(s){case"number":return Number.isNaN(a)?"NaN":"tal";case"object":return Array.isArray(a)?"liste":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype&&a.constructor?a.constructor.name:"objekt"}return s},o={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"};return a=>{switch(a.code){case"invalid_type":return`Ugyldigt input: forventede ${i(a.expected)}, fik ${i(n(a.input))}`;case"invalid_value":return a.values.length===1?`Ugyldig v\xE6rdi: forventede ${V(a.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${k(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",u=t(a.origin),c=i(a.origin);return u?`For stor: forventede ${c??"value"} ${u.verb} ${s} ${a.maximum.toString()} ${u.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",u=t(a.origin),c=i(a.origin);return u?`For lille: forventede ${c} ${u.verb} ${s} ${a.minimum.toString()} ${u.unit}`:`For lille: forventede ${c} havde ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Ugyldig streng: skal starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: skal ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: skal indeholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${o[s.format]??a.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${k(a.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${a.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${a.origin}`;default:return"Ugyldigt input"}}};function uE(){return{localeError:qF()}}var HF=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"Zahl";case"object":{if(Array.isArray(n))return"Array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${n.expected}, erhalten ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${V(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${k(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function cE(){return{localeError:HF()}}var JF=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},QF=()=>{let r={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(i){return r[i]??null}let t={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"};return i=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${JF(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${V(i.values[0])}`:`Invalid option: expected one of ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Too big: expected ${i.origin??"value"} to have ${n}${i.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Too small: expected ${i.origin} to have ${n}${i.minimum.toString()} ${o.unit}`:`Too small: expected ${i.origin} to be ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Invalid string: must start with "${n.prefix}"`:n.format==="ends_with"?`Invalid string: must end with "${n.suffix}"`:n.format==="includes"?`Invalid string: must include "${n.includes}"`:n.format==="regex"?`Invalid string: must match pattern ${n.pattern}`:`Invalid ${t[n.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":""}: ${k(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function yv(){return{localeError:QF()}}var YF=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"nombro";case"object":{if(Array.isArray(r))return"tabelo";if(r===null)return"senvalora";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},XF=()=>{let r={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(i){return r[i]??null}let t={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"};return i=>{switch(i.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${i.expected}, ricevi\u011Dis ${YF(i.input)}`;case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${V(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${n}${i.minimum.toString()} ${o.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${n.prefix}"`:n.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${n.suffix}"`:n.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${n.includes}"`:n.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${n.pattern}`:`Nevalida ${t[n.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":""}: ${k(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 dE(){return{localeError:XF()}}var eN=()=>{let r={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},e={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"};function t(a){return r[a]??null}function i(a){return e[a]??a}let n=a=>{let s=typeof a;switch(s){case"number":return Number.isNaN(a)?"NaN":"number";case"object":return Array.isArray(a)?"array":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype?a.constructor.name:"object"}return s},o={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"};return a=>{switch(a.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${i(a.expected)}, recibido ${i(n(a.input))}`;case"invalid_value":return a.values.length===1?`Entrada inv\xE1lida: se esperaba ${V(a.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${k(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",u=t(a.origin),c=i(a.origin);return u?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${s}${a.maximum.toString()} ${u.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${s}${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",u=t(a.origin),c=i(a.origin);return u?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${s}${a.minimum.toString()} ${u.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${s}${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${o[s.format]??a.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${a.divisor}`;case"unrecognized_keys":return`Llave${a.keys.length>1?"s":""} desconocida${a.keys.length>1?"s":""}: ${k(a.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i(a.origin)}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i(a.origin)}`;default:return"Entrada inv\xE1lida"}}};function pE(){return{localeError:eN()}}var tN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(n))return"\u0622\u0631\u0627\u06CC\u0647";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${t(n.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${V(n.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 ${k(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${i[o.format]??n.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 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${k(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.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 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function hE(){return{localeError:tN()}}var rN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${n.expected}, oli ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${V(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${i[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${k(n.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 fE(){return{localeError:rN()}}var iN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombre";case"object":{if(Array.isArray(n))return"tableau";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Entr\xE9e invalide : ${n.expected} attendu, ${t(n.input)} re\xE7u`;case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${V(n.values[0])} attendu`:`Option invalide : une valeur parmi ${k(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Trop grand : ${n.origin??"valeur"} doit ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Trop petit : ${n.origin} doit ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${k(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function mE(){return{localeError:iN()}}var nN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${n.expected}, re\xE7u ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${V(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",a=e(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",a=e(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${k(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function gE(){return{localeError:nN()}}var oN=()=>{let r={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"}},t=c=>c?r[c]:void 0,i=c=>{let p=t(c);return p?p.label:c??r.unknown.label},n=c=>`\u05D4${i(c)}`,o=c=>(t(c)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=c=>c?e[c]??null:null,s=c=>{let p=typeof c;switch(p){case"number":return Number.isNaN(c)?"NaN":"number";case"object":return Array.isArray(c)?"array":c===null?"null":Object.getPrototypeOf(c)!==Object.prototype&&c.constructor?c.constructor.name:"object";default:return p}},u={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"}};return c=>{switch(c.code){case"invalid_type":{let p=c.expected,d=i(p),f=s(c.input),v=r[f]?.label??f;return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${v}`}case"invalid_value":{if(c.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 ${V(c.values[0])}`;let p=c.values.map(v=>V(v));if(c.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 ${p[0]} \u05D0\u05D5 ${p[1]}`;let d=p[p.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 ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let p=a(c.origin),d=n(c.origin??"value");if(c.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.maximum.toString()} ${p?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(c.origin==="number"){let m=c.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${c.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(c.origin==="array"||c.origin==="set"){let m=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=c.inclusive?`${c.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${c.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let f=c.inclusive?"<=":"<",v=o(c.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${c.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${c.maximum.toString()}`}case"too_small":{let p=a(c.origin),d=n(c.origin??"value");if(c.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.minimum.toString()} ${p?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(c.origin==="number"){let m=c.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${c.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(c.origin==="array"||c.origin==="set"){let m=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(c.minimum===1&&c.inclusive){let x=(c.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let y=c.inclusive?`${c.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${c.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let f=c.inclusive?">=":">",v=o(c.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${c.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${c.minimum.toString()}`}case"invalid_format":{let p=c;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.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 ${p.pattern}`;let d=u[p.format],f=d?.label??p.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${m}`}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 ${c.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${c.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${c.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${k(c.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${n(c.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function vE(){return{localeError:oN()}}var aN=()=>{let r={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(n))return"t\xF6mb";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${n.expected}, a kapott \xE9rt\xE9k ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${V(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${i[o.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function yE(){return{localeError:aN()}}var sN=()=>{let r={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Input tidak valid: diharapkan ${n.expected}, diterima ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${V(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${i[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function xE(){return{localeError:sN()}}var lN=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"n\xFAmer";case"object":{if(Array.isArray(r))return"fylki";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},uN=()=>{let r={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 r[i]??null}let t={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"};return i=>{switch(i.code){case"invalid_type":return`Rangt gildi: \xDE\xFA sl\xF3st inn ${lN(i.input)} \xFEar sem \xE1 a\xF0 vera ${i.expected}`;case"invalid_value":return i.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${V(i.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} hafi ${n}${i.maximum.toString()} ${o.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} s\xE9 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} hafi ${n}${i.minimum.toString()} ${o.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} s\xE9 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${n.prefix}"`:n.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${n.suffix}"`:n.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${n.includes}"`:n.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${n.pattern}`:`Rangt ${t[n.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"}: ${k(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 wE(){return{localeError:uN()}}var cN=()=>{let r={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numero";case"object":{if(Array.isArray(n))return"vettore";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Input non valido: atteso ${n.expected}, ricevuto ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Input non valido: atteso ${V(n.values[0])}`:`Opzione non valida: atteso uno tra ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${k(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function bE(){return{localeError:cN()}}var dN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(n))return"\u914D\u5217";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${t(n.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${V(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${k(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=e(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=e(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${i[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.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${n.keys.length>1?"\u7FA4":""}: ${k(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function AE(){return{localeError:dN()}}var pN=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8";case"object":{if(Array.isArray(r))return"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return{string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0"}[e]??e},hN=()=>{let r={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 r[i]??null}let t={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 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"};return i=>{switch(i.code){case"invalid_type":return`\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 ${i.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${pN(i.input)}`;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 ${V(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 ${k(i.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let n=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} ${n}${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 ${n}${i.maximum.toString()}`}case"too_small":{let n=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} ${n}${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 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${n.prefix}"-\u10D8\u10D7`:n.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${n.suffix}"-\u10D8\u10D7`:n.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${n.includes}"-\u10E1`:n.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\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 ${n.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${t[n.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"}: ${k(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 _E(){return{localeError:hN()}}var fN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(n))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(n===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\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 ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${t(n.input)}`;case"invalid_value":return n.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 ${V(n.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 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${k(n.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 ${n.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 ${n.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 xv(){return{localeError:fN()}}function PE(){return xv()}var mN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${t(n.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${V(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${k(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(n.origin),u=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${u} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${a}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(n.origin),u=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${u} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${a}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${i[o.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${k(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function EE(){return{localeError:mN()}}var gN=r=>Yp(typeof r,r),Yp=(r,e=void 0)=>{switch(r){case"number":return Number.isNaN(e)?"NaN":"skai\u010Dius";case"bigint":return"sveikasis skai\u010Dius";case"string":return"eilut\u0117";case"boolean":return"login\u0117 reik\u0161m\u0117";case"undefined":case"void":return"neapibr\u0117\u017Eta reik\u0161m\u0117";case"function":return"funkcija";case"symbol":return"simbolis";case"object":return e===void 0?"ne\u017Einomas objektas":e===null?"nulin\u0117 reik\u0161m\u0117":Array.isArray(e)?"masyvas":Object.getPrototypeOf(e)!==Object.prototype&&e.constructor?e.constructor.name:"objektas";case"null":return"nulin\u0117 reik\u0161m\u0117"}return r},Qp=r=>r.charAt(0).toUpperCase()+r.slice(1);function SE(r){let e=Math.abs(r),t=e%10,i=e%100;return i>=11&&i<=19||t===0?"many":t===1?"one":"few"}var vN=()=>{let r={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,n,o,a){let s=r[i]??null;return s===null?s:{unit:s.unit[n],verb:s.verb[a][o?"inclusive":"notInclusive"]}}let t={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"};return i=>{switch(i.code){case"invalid_type":return`Gautas tipas ${gN(i.input)}, o tik\u0117tasi - ${Yp(i.expected)}`;case"invalid_value":return i.values.length===1?`Privalo b\u016Bti ${V(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${k(i.values,"|")} pasirinkim\u0173`;case"too_big":{let n=Yp(i.origin),o=e(i.origin,SE(Number(i.maximum)),i.inclusive??!1,"smaller");if(o?.verb)return`${Qp(n??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.maximum.toString()} ${o.unit??"element\u0173"}`;let a=i.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Qp(n??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.maximum.toString()} ${o?.unit}`}case"too_small":{let n=Yp(i.origin),o=e(i.origin,SE(Number(i.minimum)),i.inclusive??!1,"bigger");if(o?.verb)return`${Qp(n??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.minimum.toString()} ${o.unit??"element\u0173"}`;let a=i.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Qp(n??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.minimum.toString()} ${o?.unit}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${n.prefix}"`:n.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${n.suffix}"`:n.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${n.includes}"`:n.format==="regex"?`Eilut\u0117 privalo atitikti ${n.pattern}`:`Neteisingas ${t[n.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"}: ${k(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let n=Yp(i.origin);return`${Qp(n??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function BE(){return{localeError:vN()}}var yN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(n))return"\u043D\u0438\u0437\u0430";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${V(n.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 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.maximum.toString()} ${a.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 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`Invalid ${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`${n.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"}: ${k(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.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 ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function FE(){return{localeError:yN()}}var xN=()=>{let r={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombor";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Input tidak sah: dijangka ${n.expected}, diterima ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${V(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${i[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${k(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function NE(){return{localeError:xN()}}var wN=()=>{let r={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"getal";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Ongeldige invoer: verwacht ${n.expected}, ontving ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${V(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Te groot: verwacht dat ${n.origin??"waarde"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elementen"}`:`Te groot: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Te klein: verwacht dat ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Te klein: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function kE(){return{localeError:wN()}}var bN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"tall";case"object":{if(Array.isArray(n))return"liste";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Ugyldig input: forventet ${n.expected}, fikk ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${V(n.values[0])}`:`Ugyldig valg: forventet en av ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${k(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function $E(){return{localeError:bN()}}var AN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numara";case"object":{if(Array.isArray(n))return"saf";if(n===null)return"gayb";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`F\xE2sit giren: umulan ${n.expected}, al\u0131nan ${t(n.input)}`;case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${V(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=n;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${i[o.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function ME(){return{localeError:AN()}}var _N=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(n))return"\u0627\u0631\u06D0";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${t(n.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${V(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${k(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${i[o.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${k(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.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 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function DE(){return{localeError:_N()}}var PN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"liczba";case"object":{if(Array.isArray(n))return"tablica";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${n.expected}, otrzymano ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${V(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${i[o.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function IE(){return{localeError:PN()}}var EN=()=>{let r={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(n))return"array";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${n.expected}, recebido ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${V(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${i[o.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function CE(){return{localeError:EN()}}function TE(r,e,t,i){let n=Math.abs(r),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?t:i}var SN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${V(n.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 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),u=TE(s,a.unit.one,a.unit.few,a.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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.maximum.toString()} ${u}`}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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),u=TE(s,a.unit.one,a.unit.few,a.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 ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.minimum.toString()} ${u}`}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 ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${k(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.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 ${n.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 RE(){return{localeError:SN()}}var BN=()=>{let r={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(n))return"tabela";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${n.expected}, prejeto ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${V(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${i[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${k(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function OE(){return{localeError:BN()}}var FN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"antal";case"object":{if(Array.isArray(n))return"lista";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${n.expected}, fick ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${V(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${i[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${k(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function VE(){return{localeError:FN()}}var NN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(n))return"\u0B85\u0BA3\u0BBF";if(n===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\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 ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t(n.input)}`;case"invalid_value":return n.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 ${V(n.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 ${k(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\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 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} ${a.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 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\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 ${n.origin} ${o}${n.minimum.toString()} ${a.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 ${n.origin} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.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 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.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${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${k(n.keys,", ")}`;case"invalid_key":return`${n.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`${n.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 zE(){return{localeError:NN()}}var kN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(n))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(n===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\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 ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${V(n.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 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=e(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=e(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.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 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${i[o.format]??n.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 ${n.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: ${k(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.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 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function UE(){return{localeError:kN()}}var $N=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},MN=()=>{let r={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 r[i]??null}let t={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"};return i=>{switch(i.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${i.expected}, al\u0131nan ${$N(i.input)}`;case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${V(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${n}${i.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${n}${i.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Ge\xE7ersiz metin: "${n.prefix}" ile ba\u015Flamal\u0131`:n.format==="ends_with"?`Ge\xE7ersiz metin: "${n.suffix}" ile bitmeli`:n.format==="includes"?`Ge\xE7ersiz metin: "${n.includes}" i\xE7ermeli`:n.format==="regex"?`Ge\xE7ersiz metin: ${n.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${t[n.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":""}: ${k(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 jE(){return{localeError:MN()}}var DN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\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 ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${t(n.input)}`;case"invalid_value":return n.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 ${V(n.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 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${o}${n.maximum.toString()} ${a.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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${k(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.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 ${n.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 wv(){return{localeError:DN()}}function LE(){return wv()}var IN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(n))return"\u0622\u0631\u06D2";if(n===null)return"\u0646\u0644";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${t(n.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${V(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${k(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.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${n.keys.length>1?"\u0632":""}: ${k(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function KE(){return{localeError:IN()}}var CN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(n))return"m\u1EA3ng";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${V(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${k(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.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 ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function WE(){return{localeError:CN()}}var TN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(n))return"\u6570\u7EC4";if(n===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${V(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${i[o.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${k(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function ZE(){return{localeError:TN()}}var RN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${n.expected}\uFF0C\u4F46\u6536\u5230 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${V(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${k(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function GE(){return{localeError:RN()}}var ON=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"n\u1ECD\u0301mb\xE0";case"object":{if(Array.isArray(n))return"akop\u1ECD";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${V(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${o}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${o}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${k(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.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 ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function qE(){return{localeError:ON()}}var HE,rA=Symbol("ZodOutput"),iA=Symbol("ZodInput"),uc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let i=t[0];if(this._map.set(e,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let i={...this.get(t)??{}};delete i.id;let n={...i,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function bv(){return new uc}(HE=globalThis).__zod_globalRegistry??(HE.__zod_globalRegistry=bv());var fr=globalThis.__zod_globalRegistry;function nA(r,e){return new r({type:"string",...U(e)})}function oA(r,e){return new r({type:"string",coerce:!0,...U(e)})}function Av(r,e){return new r({type:"string",format:"email",check:"string_format",abort:!1,...U(e)})}function eh(r,e){return new r({type:"string",format:"guid",check:"string_format",abort:!1,...U(e)})}function _v(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,...U(e)})}function Pv(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...U(e)})}function Ev(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...U(e)})}function Sv(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...U(e)})}function th(r,e){return new r({type:"string",format:"url",check:"string_format",abort:!1,...U(e)})}function Bv(r,e){return new r({type:"string",format:"emoji",check:"string_format",abort:!1,...U(e)})}function Fv(r,e){return new r({type:"string",format:"nanoid",check:"string_format",abort:!1,...U(e)})}function Nv(r,e){return new r({type:"string",format:"cuid",check:"string_format",abort:!1,...U(e)})}function kv(r,e){return new r({type:"string",format:"cuid2",check:"string_format",abort:!1,...U(e)})}function $v(r,e){return new r({type:"string",format:"ulid",check:"string_format",abort:!1,...U(e)})}function Mv(r,e){return new r({type:"string",format:"xid",check:"string_format",abort:!1,...U(e)})}function Dv(r,e){return new r({type:"string",format:"ksuid",check:"string_format",abort:!1,...U(e)})}function Iv(r,e){return new r({type:"string",format:"ipv4",check:"string_format",abort:!1,...U(e)})}function Cv(r,e){return new r({type:"string",format:"ipv6",check:"string_format",abort:!1,...U(e)})}function aA(r,e){return new r({type:"string",format:"mac",check:"string_format",abort:!1,...U(e)})}function Tv(r,e){return new r({type:"string",format:"cidrv4",check:"string_format",abort:!1,...U(e)})}function Rv(r,e){return new r({type:"string",format:"cidrv6",check:"string_format",abort:!1,...U(e)})}function Ov(r,e){return new r({type:"string",format:"base64",check:"string_format",abort:!1,...U(e)})}function Vv(r,e){return new r({type:"string",format:"base64url",check:"string_format",abort:!1,...U(e)})}function zv(r,e){return new r({type:"string",format:"e164",check:"string_format",abort:!1,...U(e)})}function Uv(r,e){return new r({type:"string",format:"jwt",check:"string_format",abort:!1,...U(e)})}var sA={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function lA(r,e){return new r({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...U(e)})}function uA(r,e){return new r({type:"string",format:"date",check:"string_format",...U(e)})}function cA(r,e){return new r({type:"string",format:"time",check:"string_format",precision:null,...U(e)})}function dA(r,e){return new r({type:"string",format:"duration",check:"string_format",...U(e)})}function pA(r,e){return new r({type:"number",checks:[],...U(e)})}function hA(r,e){return new r({type:"number",coerce:!0,checks:[],...U(e)})}function fA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"safeint",...U(e)})}function mA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float32",...U(e)})}function gA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float64",...U(e)})}function vA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"int32",...U(e)})}function yA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"uint32",...U(e)})}function xA(r,e){return new r({type:"boolean",...U(e)})}function wA(r,e){return new r({type:"boolean",coerce:!0,...U(e)})}function bA(r,e){return new r({type:"bigint",...U(e)})}function AA(r,e){return new r({type:"bigint",coerce:!0,...U(e)})}function _A(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...U(e)})}function PA(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...U(e)})}function EA(r,e){return new r({type:"symbol",...U(e)})}function SA(r,e){return new r({type:"undefined",...U(e)})}function BA(r,e){return new r({type:"null",...U(e)})}function FA(r){return new r({type:"any"})}function NA(r){return new r({type:"unknown"})}function kA(r,e){return new r({type:"never",...U(e)})}function $A(r,e){return new r({type:"void",...U(e)})}function MA(r,e){return new r({type:"date",...U(e)})}function DA(r,e){return new r({type:"date",coerce:!0,...U(e)})}function IA(r,e){return new r({type:"nan",...U(e)})}function po(r,e){return new sv({check:"less_than",...U(e),value:r,inclusive:!1})}function Ni(r,e){return new sv({check:"less_than",...U(e),value:r,inclusive:!0})}function ho(r,e){return new lv({check:"greater_than",...U(e),value:r,inclusive:!1})}function Nr(r,e){return new lv({check:"greater_than",...U(e),value:r,inclusive:!0})}function CA(r){return ho(0,r)}function TA(r){return po(0,r)}function RA(r){return Ni(0,r)}function OA(r){return Nr(0,r)}function Os(r,e){return new Fb({check:"multiple_of",...U(e),value:r})}function cc(r,e){return new $b({check:"max_size",...U(e),maximum:r})}function Vs(r,e){return new Mb({check:"min_size",...U(e),minimum:r})}function rh(r,e){return new Db({check:"size_equals",...U(e),size:r})}function dc(r,e){return new Ib({check:"max_length",...U(e),maximum:r})}function Aa(r,e){return new Cb({check:"min_length",...U(e),minimum:r})}function pc(r,e){return new Tb({check:"length_equals",...U(e),length:r})}function ih(r,e){return new Rb({check:"string_format",format:"regex",...U(e),pattern:r})}function nh(r){return new Ob({check:"string_format",format:"lowercase",...U(r)})}function oh(r){return new Vb({check:"string_format",format:"uppercase",...U(r)})}function ah(r,e){return new zb({check:"string_format",format:"includes",...U(e),includes:r})}function sh(r,e){return new Ub({check:"string_format",format:"starts_with",...U(e),prefix:r})}function lh(r,e){return new jb({check:"string_format",format:"ends_with",...U(e),suffix:r})}function VA(r,e,t){return new Lb({check:"property",property:r,schema:e,...U(t)})}function uh(r,e){return new Kb({check:"mime_type",mime:r,...U(e)})}function Cn(r){return new Wb({check:"overwrite",tx:r})}function ch(r){return Cn(e=>e.normalize(r))}function dh(){return Cn(r=>r.trim())}function ph(){return Cn(r=>r.toLowerCase())}function hh(){return Cn(r=>r.toUpperCase())}function fh(){return Cn(r=>jw(r))}function zA(r,e,t){return new r({type:"array",element:e,...U(t)})}function zN(r,e,t){return new r({type:"union",options:e,...U(t)})}function UN(r,e,t,i){return new r({type:"union",options:t,discriminator:e,...U(i)})}function jN(r,e,t){return new r({type:"intersection",left:e,right:t})}function LN(r,e,t,i){let n=t instanceof he,o=n?i:t,a=n?t:null;return new r({type:"tuple",items:e,rest:a,...U(o)})}function KN(r,e,t,i){return new r({type:"record",keyType:e,valueType:t,...U(i)})}function WN(r,e,t,i){return new r({type:"map",keyType:e,valueType:t,...U(i)})}function ZN(r,e,t){return new r({type:"set",valueType:e,...U(t)})}function GN(r,e,t){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new r({type:"enum",entries:i,...U(t)})}function qN(r,e,t){return new r({type:"enum",entries:e,...U(t)})}function HN(r,e,t){return new r({type:"literal",values:Array.isArray(e)?e:[e],...U(t)})}function UA(r,e){return new r({type:"file",...U(e)})}function JN(r,e){return new r({type:"transform",transform:e})}function QN(r,e){return new r({type:"optional",innerType:e})}function YN(r,e){return new r({type:"nullable",innerType:e})}function XN(r,e,t){return new r({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Kw(t)}})}function ek(r,e,t){return new r({type:"nonoptional",innerType:e,...U(t)})}function tk(r,e){return new r({type:"success",innerType:e})}function rk(r,e,t){return new r({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function ik(r,e,t){return new r({type:"pipe",in:e,out:t})}function nk(r,e){return new r({type:"readonly",innerType:e})}function ok(r,e,t){return new r({type:"template_literal",parts:e,...U(t)})}function ak(r,e){return new r({type:"lazy",getter:e})}function sk(r,e){return new r({type:"promise",innerType:e})}function jA(r,e,t){let i=U(t);return i.abort??(i.abort=!0),new r({type:"custom",check:"custom",fn:e,...i})}function LA(r,e,t){return new r({type:"custom",check:"custom",fn:e,...U(t)})}function KA(r){let e=JE(t=>(t.addIssue=i=>{if(typeof i=="string")t.issues.push(ic(i,t.value,e._zod.def));else{let n=i;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=t.value),n.inst??(n.inst=e),n.continue??(n.continue=!e._zod.def.abort),t.issues.push(ic(n))}},r(t.value,t)));return e}function JE(r,e){let t=new We({check:"custom",...U(e)});return t._zod.check=r,t}function WA(r){let e=new We({check:"describe"});return e._zod.onattach=[t=>{let i=fr.get(t)??{};fr.add(t,{...i,description:r})}],e._zod.check=()=>{},e}function ZA(r){let e=new We({check:"meta"});return e._zod.onattach=[t=>{let i=fr.get(t)??{};fr.add(t,{...i,...r})}],e._zod.check=()=>{},e}function GA(r,e){let t=U(e),i=t.truthy??["true","1","yes","on","y","enabled"],n=t.falsy??["false","0","no","off","n","disabled"];t.case!=="sensitive"&&(i=i.map(v=>typeof v=="string"?v.toLowerCase():v),n=n.map(v=>typeof v=="string"?v.toLowerCase():v));let o=new Set(i),a=new Set(n),s=r.Codec??Jp,u=r.Boolean??Hp,c=r.String??Rs,p=new c({type:"string",error:t.error}),d=new u({type:"boolean",error:t.error}),f=new s({type:"pipe",in:p,out:d,transform:((v,m)=>{let y=v;return t.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:a.has(y)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:m.value,inst:f,continue:!1}),{})}),reverseTransform:((v,m)=>v===!0?i[0]||"true":n[0]||"false"),error:t.error});return f}function hc(r,e,t,i={}){let n=U(i),o={...U(i),check:"string_format",type:"string",format:e,fn:typeof t=="function"?t:s=>t.test(s),...n};return t instanceof RegExp&&(o.pattern=t),new r(o)}var mh=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??fr,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var i;let n=e._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(e);if(a)return a.count++,t.schemaPath.includes(e)&&(a.cycle=t.path),a.schema;let s={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,s);let u=e._zod.toJSONSchema?.();if(u)s.schema=u;else{let d={...t,schemaPath:[...t.schemaPath,e],path:t.path},f=e._zod.parent;if(f)s.ref=f,this.process(f,d),this.seen.get(f).isParent=!0;else{let v=s.schema;switch(n.type){case"string":{let m=v;m.type="string";let{minimum:y,maximum:x,format:$,patterns:I,contentEncoding:T}=e._zod.bag;if(typeof y=="number"&&(m.minLength=y),typeof x=="number"&&(m.maxLength=x),$&&(m.format=o[$]??$,m.format===""&&delete m.format),T&&(m.contentEncoding=T),I&&I.size>0){let R=[...I];R.length===1?m.pattern=R[0].source:R.length>1&&(s.schema.allOf=[...R.map(L=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:L.source}))])}break}case"number":{let m=v,{minimum:y,maximum:x,format:$,multipleOf:I,exclusiveMaximum:T,exclusiveMinimum:R}=e._zod.bag;typeof $=="string"&&$.includes("int")?m.type="integer":m.type="number",typeof R=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(m.minimum=R,m.exclusiveMinimum=!0):m.exclusiveMinimum=R),typeof y=="number"&&(m.minimum=y,typeof R=="number"&&this.target!=="draft-4"&&(R>=y?delete m.minimum:delete m.exclusiveMinimum)),typeof T=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(m.maximum=T,m.exclusiveMaximum=!0):m.exclusiveMaximum=T),typeof x=="number"&&(m.maximum=x,typeof T=="number"&&this.target!=="draft-4"&&(T<=x?delete m.maximum:delete m.exclusiveMaximum)),typeof I=="number"&&(m.multipleOf=I);break}case"boolean":{let m=v;m.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{this.target==="openapi-3.0"?(v.type="string",v.nullable=!0,v.enum=[null]):v.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{v.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let m=v,{minimum:y,maximum:x}=e._zod.bag;typeof y=="number"&&(m.minItems=y),typeof x=="number"&&(m.maxItems=x),m.type="array",m.items=this.process(n.element,{...d,path:[...d.path,"items"]});break}case"object":{let m=v;m.type="object",m.properties={};let y=n.shape;for(let I in y)m.properties[I]=this.process(y[I],{...d,path:[...d.path,"properties",I]});let x=new Set(Object.keys(y)),$=new Set([...x].filter(I=>{let T=n.shape[I]._zod;return this.io==="input"?T.optin===void 0:T.optout===void 0}));$.size>0&&(m.required=Array.from($)),n.catchall?._zod.def.type==="never"?m.additionalProperties=!1:n.catchall?n.catchall&&(m.additionalProperties=this.process(n.catchall,{...d,path:[...d.path,"additionalProperties"]})):this.io==="output"&&(m.additionalProperties=!1);break}case"union":{let m=v,y=n.discriminator!==void 0,x=n.options.map(($,I)=>this.process($,{...d,path:[...d.path,y?"oneOf":"anyOf",I]}));y?m.oneOf=x:m.anyOf=x;break}case"intersection":{let m=v,y=this.process(n.left,{...d,path:[...d.path,"allOf",0]}),x=this.process(n.right,{...d,path:[...d.path,"allOf",1]}),$=T=>"allOf"in T&&Object.keys(T).length===1,I=[...$(y)?y.allOf:[y],...$(x)?x.allOf:[x]];m.allOf=I;break}case"tuple":{let m=v;m.type="array";let y=this.target==="draft-2020-12"?"prefixItems":"items",x=this.target==="draft-2020-12"||this.target==="openapi-3.0"?"items":"additionalItems",$=n.items.map((L,ae)=>this.process(L,{...d,path:[...d.path,y,ae]})),I=n.rest?this.process(n.rest,{...d,path:[...d.path,x,...this.target==="openapi-3.0"?[n.items.length]:[]]}):null;this.target==="draft-2020-12"?(m.prefixItems=$,I&&(m.items=I)):this.target==="openapi-3.0"?(m.items={anyOf:$},I&&m.items.anyOf.push(I),m.minItems=$.length,I||(m.maxItems=$.length)):(m.items=$,I&&(m.additionalItems=I));let{minimum:T,maximum:R}=e._zod.bag;typeof T=="number"&&(m.minItems=T),typeof R=="number"&&(m.maxItems=R);break}case"record":{let m=v;m.type="object",(this.target==="draft-7"||this.target==="draft-2020-12")&&(m.propertyNames=this.process(n.keyType,{...d,path:[...d.path,"propertyNames"]})),m.additionalProperties=this.process(n.valueType,{...d,path:[...d.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let m=v,y=Op(n.entries);y.every(x=>typeof x=="number")&&(m.type="number"),y.every(x=>typeof x=="string")&&(m.type="string"),m.enum=y;break}case"literal":{let m=v,y=[];for(let x of n.values)if(x===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof x=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");y.push(Number(x))}else y.push(x);if(y.length!==0)if(y.length===1){let x=y[0];m.type=x===null?"null":typeof x,this.target==="draft-4"||this.target==="openapi-3.0"?m.enum=[x]:m.const=x}else y.every(x=>typeof x=="number")&&(m.type="number"),y.every(x=>typeof x=="string")&&(m.type="string"),y.every(x=>typeof x=="boolean")&&(m.type="string"),y.every(x=>x===null)&&(m.type="null"),m.enum=y;break}case"file":{let m=v,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:x,maximum:$,mime:I}=e._zod.bag;x!==void 0&&(y.minLength=x),$!==void 0&&(y.maxLength=$),I?I.length===1?(y.contentMediaType=I[0],Object.assign(m,y)):m.anyOf=I.map(T=>({...y,contentMediaType:T})):Object.assign(m,y);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let m=this.process(n.innerType,d);this.target==="openapi-3.0"?(s.ref=n.innerType,v.nullable=!0):v.anyOf=[m,{type:"null"}];break}case"nonoptional":{this.process(n.innerType,d),s.ref=n.innerType;break}case"success":{let m=v;m.type="boolean";break}case"default":{this.process(n.innerType,d),s.ref=n.innerType,v.default=JSON.parse(JSON.stringify(n.defaultValue));break}case"prefault":{this.process(n.innerType,d),s.ref=n.innerType,this.io==="input"&&(v._prefault=JSON.parse(JSON.stringify(n.defaultValue)));break}case"catch":{this.process(n.innerType,d),s.ref=n.innerType;let m;try{m=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}v.default=m;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let m=v,y=e._zod.pattern;if(!y)throw new Error("Pattern not found in template literal");m.type="string",m.pattern=y.source;break}case"pipe":{let m=this.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;this.process(m,d),s.ref=m;break}case"readonly":{this.process(n.innerType,d),s.ref=n.innerType,v.readOnly=!0;break}case"promise":{this.process(n.innerType,d),s.ref=n.innerType;break}case"optional":{this.process(n.innerType,d),s.ref=n.innerType;break}case"lazy":{let m=e._zod.innerType;this.process(m,d),s.ref=m;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema");break}default:}}}let c=this.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),this.io==="input"&&mr(e)&&(delete s.schema.examples,delete s.schema.default),this.io==="input"&&s.schema._prefault&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,this.seen.get(e).schema}emit(e,t){let i={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},n=this.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=p=>{let d=this.target==="draft-2020-12"?"$defs":"definitions";if(i.external){let y=i.external.registry.get(p[0])?.id,x=i.external.uri??(I=>I);if(y)return{ref:x(y)};let $=p[1].defId??p[1].schema.id??`schema${this.counter++}`;return p[1].defId=$,{defId:$,ref:`${x("__shared")}#/${d}/${$}`}}if(p[1]===n)return{ref:"#"};let v=`#/${d}/`,m=p[1].schema.id??`__schema${this.counter++}`;return{defId:m,ref:v+m}},a=p=>{if(p[1].schema.$ref)return;let d=p[1],{ref:f,defId:v}=o(p);d.def={...d.schema},v&&(d.defId=v);let m=d.schema;for(let y in m)delete m[y];m.$ref=f};if(i.cycles==="throw")for(let p of this.seen.entries()){let d=p[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
23
+ `)}v.write("payload.value = newResult;"),v.write("return payload;");let D=v.compile();return(O,T)=>D(f,O,T)},o,a=Us,s=!Lp.jitless,c=s&&Lw.value,p=e.catchall,d;r._zod.parse=(f,v)=>{d??(d=i.value);let m=f.value;return a(m)?s&&c&&v?.async===!1&&v.jitless!==!0?(o||(o=n(e.shape)),f=o(f,v),p?iS([],m,f,v,d,r):f):t(f,v):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:r}),f)}});function W1(r,e,t,i){for(let o of r)if(o.issues.length===0)return e.value=o.value,e;let n=r.filter(o=>!Pa(o));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:r.map(o=>o.issues.map(a=>qr(a,i,At())))}),e)}var wv=b("$ZodUnion",(r,e)=>{fe.init(r,e),$e(r._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),$e(r._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),$e(r._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),$e(r._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>Zp(o.source)).join("|")})$`)}});let t=e.options.length===1,i=e.options[0]._zod.run;r._zod.parse=(n,o)=>{if(t)return i(n,o);let a=!1,s=[];for(let l of e.options){let c=l._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)s.push(c),a=!0;else{if(c.issues.length===0)return c;s.push(c)}}return a?Promise.all(s).then(l=>W1(l,n,r,o)):W1(s,n,r,o)}}),M0=b("$ZodDiscriminatedUnion",(r,e)=>{wv.init(r,e);let t=r._zod.parse;$e(r._zod,"propValues",()=>{let n={};for(let o of e.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[s,l]of Object.entries(a)){n[s]||(n[s]=new Set);for(let c of l)n[s].add(c)}}return n});let i=ac(()=>{let n=e.options,o=new Map;for(let a of n){let s=a._zod.propValues?.[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let l of s){if(o.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);o.set(l,a)}}return o});r._zod.parse=(n,o)=>{let a=n.value;if(!Us(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:r}),n;let s=i.value.get(a?.[e.discriminator]);return s?s._zod.run(n,o):e.unionFallback?t(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:a,path:[e.discriminator],inst:r}),n)}}),D0=b("$ZodIntersection",(r,e)=>{fe.init(r,e),r._zod.parse=(t,i)=>{let n=t.value,o=e.left._zod.run({value:n,issues:[]},i),a=e.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([l,c])=>Z1(t,l,c)):Z1(t,o,a)}});function Gb(r,e){if(r===e)return{valid:!0,data:r};if(r instanceof Date&&e instanceof Date&&+r==+e)return{valid:!0,data:r};if(_a(r)&&_a(e)){let t=Object.keys(e),i=Object.keys(r).filter(o=>t.indexOf(o)!==-1),n={...r,...e};for(let o of i){let a=Gb(r[o],e[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n[o]=a.data}return{valid:!0,data:n}}if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return{valid:!1,mergeErrorPath:[]};let t=[];for(let i=0;i<r.length;i++){let n=r[i],o=e[i],a=Gb(n,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};t.push(a.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function Z1(r,e,t){if(e.issues.length&&r.issues.push(...e.issues),t.issues.length&&r.issues.push(...t.issues),Pa(r))return r;let i=Gb(e.value,t.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return r.value=i.data,r}var bv=b("$ZodTuple",(r,e)=>{fe.init(r,e);let t=e.items;r._zod.parse=(i,n)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:r,expected:"tuple",code:"invalid_type"}),i;i.value=[];let a=[],s=[...t].reverse().findIndex(p=>p._zod.optin!=="optional"),l=s===-1?0:t.length-s;if(!e.rest){let p=o.length>t.length,d=o.length<l-1;if(p||d)return i.issues.push({...p?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:o,inst:r,origin:"array"}),i}let c=-1;for(let p of t){if(c++,c>=o.length&&c>=l)continue;let d=p._zod.run({value:o[c],issues:[]},n);d instanceof Promise?a.push(d.then(f=>hv(f,i,c))):hv(d,i,c)}if(e.rest){let p=o.slice(t.length);for(let d of p){c++;let f=e.rest._zod.run({value:d,issues:[]},n);f instanceof Promise?a.push(f.then(v=>hv(v,i,c))):hv(f,i,c)}}return a.length?Promise.all(a).then(()=>i):i}});function hv(r,e,t){r.issues.length&&e.issues.push(...Gr(t,r.issues)),e.value[t]=r.value}var I0=b("$ZodRecord",(r,e)=>{fe.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!_a(n))return t.issues.push({expected:"record",code:"invalid_type",input:n,inst:r}),t;let o=[],a=e.keyType._zod.values;if(a){t.value={};let s=new Set;for(let c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){s.add(typeof c=="number"?c.toString():c);let p=e.valueType._zod.run({value:n[c],issues:[]},i);p instanceof Promise?o.push(p.then(d=>{d.issues.length&&t.issues.push(...Gr(c,d.issues)),t.value[c]=d.value})):(p.issues.length&&t.issues.push(...Gr(c,p.issues)),t.value[c]=p.value)}let l;for(let c in n)s.has(c)||(l=l??[],l.push(c));l&&l.length>0&&t.issues.push({code:"unrecognized_keys",input:n,inst:r,keys:l})}else{t.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__")continue;let l=e.keyType._zod.run({value:s,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>qr(p,i,At())),input:s,path:[s],inst:r}),t.value[l.value]=l.value;continue}let c=e.valueType._zod.run({value:n[s],issues:[]},i);c instanceof Promise?o.push(c.then(p=>{p.issues.length&&t.issues.push(...Gr(s,p.issues)),t.value[l.value]=p.value})):(c.issues.length&&t.issues.push(...Gr(s,c.issues)),t.value[l.value]=c.value)}}return o.length?Promise.all(o).then(()=>t):t}}),C0=b("$ZodMap",(r,e)=>{fe.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!(n instanceof Map))return t.issues.push({expected:"map",code:"invalid_type",input:n,inst:r}),t;let o=[];t.value=new Map;for(let[a,s]of n){let l=e.keyType._zod.run({value:a,issues:[]},i),c=e.valueType._zod.run({value:s,issues:[]},i);l instanceof Promise||c instanceof Promise?o.push(Promise.all([l,c]).then(([p,d])=>{G1(p,d,t,a,n,r,i)})):G1(l,c,t,a,n,r,i)}return o.length?Promise.all(o).then(()=>t):t}});function G1(r,e,t,i,n,o,a){r.issues.length&&(Gp.has(typeof i)?t.issues.push(...Gr(i,r.issues)):t.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:r.issues.map(s=>qr(s,a,At()))})),e.issues.length&&(Gp.has(typeof i)?t.issues.push(...Gr(i,e.issues)):t.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(s=>qr(s,a,At()))})),t.value.set(r.value,e.value)}var T0=b("$ZodSet",(r,e)=>{fe.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;if(!(n instanceof Set))return t.issues.push({input:n,inst:r,expected:"set",code:"invalid_type"}),t;let o=[];t.value=new Set;for(let a of n){let s=e.valueType._zod.run({value:a,issues:[]},i);s instanceof Promise?o.push(s.then(l=>q1(l,t))):q1(s,t)}return o.length?Promise.all(o).then(()=>t):t}});function q1(r,e){r.issues.length&&e.issues.push(...r.issues),e.value.add(r.value)}var R0=b("$ZodEnum",(r,e)=>{fe.init(r,e);let t=Wp(e.entries),i=new Set(t);r._zod.values=i,r._zod.pattern=new RegExp(`^(${t.filter(n=>Gp.has(typeof n)).map(n=>typeof n=="string"?Bi(n):n.toString()).join("|")})$`),r._zod.parse=(n,o)=>{let a=n.value;return i.has(a)||n.issues.push({code:"invalid_value",values:t,input:a,inst:r}),n}}),O0=b("$ZodLiteral",(r,e)=>{if(fe.init(r,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let t=new Set(e.values);r._zod.values=t,r._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Bi(i):i?Bi(i.toString()):String(i)).join("|")})$`),r._zod.parse=(i,n)=>{let o=i.value;return t.has(o)||i.issues.push({code:"invalid_value",values:e.values,input:o,inst:r}),i}}),V0=b("$ZodFile",(r,e)=>{fe.init(r,e),r._zod.parse=(t,i)=>{let n=t.value;return n instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:n,inst:r}),t}}),z0=b("$ZodTransform",(r,e)=>{fe.init(r,e),r._zod.parse=(t,i)=>{if(i.direction==="backward")throw new xa(r.constructor.name);let n=e.transform(t.value,t);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(t.value=a,t));if(n instanceof Promise)throw new en;return t.value=n,t}});function H1(r,e){return r.issues.length&&e===void 0?{issues:[],value:void 0}:r}var U0=b("$ZodOptional",(r,e)=>{fe.init(r,e),r._zod.optin="optional",r._zod.optout="optional",$e(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),$e(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${Zp(t.source)})?$`):void 0}),r._zod.parse=(t,i)=>{if(e.innerType._zod.optin==="optional"){let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>H1(o,t.value)):H1(n,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,i)}}),j0=b("$ZodNullable",(r,e)=>{fe.init(r,e),$e(r._zod,"optin",()=>e.innerType._zod.optin),$e(r._zod,"optout",()=>e.innerType._zod.optout),$e(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${Zp(t.source)}|null)$`):void 0}),$e(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),r._zod.parse=(t,i)=>t.value===null?t:e.innerType._zod.run(t,i)}),L0=b("$ZodDefault",(r,e)=>{fe.init(r,e),r._zod.optin="optional",$e(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);if(t.value===void 0)return t.value=e.defaultValue,t;let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>J1(o,e)):J1(n,e)}});function J1(r,e){return r.value===void 0&&(r.value=e.defaultValue),r}var K0=b("$ZodPrefault",(r,e)=>{fe.init(r,e),r._zod.optin="optional",$e(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,i)=>(i.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,i))}),W0=b("$ZodNonOptional",(r,e)=>{fe.init(r,e),$e(r._zod,"values",()=>{let t=e.innerType._zod.values;return t?new Set([...t].filter(i=>i!==void 0)):void 0}),r._zod.parse=(t,i)=>{let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>Q1(o,r)):Q1(n,r)}});function Q1(r,e){return!r.issues.length&&r.value===void 0&&r.issues.push({code:"invalid_type",expected:"nonoptional",input:r.value,inst:e}),r}var Z0=b("$ZodSuccess",(r,e)=>{fe.init(r,e),r._zod.parse=(t,i)=>{if(i.direction==="backward")throw new xa("ZodSuccess");let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>(t.value=o.issues.length===0,t)):(t.value=n.issues.length===0,t)}}),G0=b("$ZodCatch",(r,e)=>{fe.init(r,e),$e(r._zod,"optin",()=>e.innerType._zod.optin),$e(r._zod,"optout",()=>e.innerType._zod.optout),$e(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(o=>(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(a=>qr(a,i,At()))},input:t.value}),t.issues=[]),t)):(t.value=n.value,n.issues.length&&(t.value=e.catchValue({...t,error:{issues:n.issues.map(o=>qr(o,i,At()))},input:t.value}),t.issues=[]),t)}}),q0=b("$ZodNaN",(r,e)=>{fe.init(r,e),r._zod.parse=(t,i)=>((typeof t.value!="number"||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:r,expected:"nan",code:"invalid_type"}),t)}),H0=b("$ZodPipe",(r,e)=>{fe.init(r,e),$e(r._zod,"values",()=>e.in._zod.values),$e(r._zod,"optin",()=>e.in._zod.optin),$e(r._zod,"optout",()=>e.out._zod.optout),$e(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(t,i)=>{if(i.direction==="backward"){let o=e.out._zod.run(t,i);return o instanceof Promise?o.then(a=>fv(a,e.in,i)):fv(o,e.in,i)}let n=e.in._zod.run(t,i);return n instanceof Promise?n.then(o=>fv(o,e.out,i)):fv(n,e.out,i)}});function fv(r,e,t){return r.issues.length?(r.aborted=!0,r):e._zod.run({value:r.value,issues:r.issues},t)}var ih=b("$ZodCodec",(r,e)=>{fe.init(r,e),$e(r._zod,"values",()=>e.in._zod.values),$e(r._zod,"optin",()=>e.in._zod.optin),$e(r._zod,"optout",()=>e.out._zod.optout),$e(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(t,i)=>{if((i.direction||"forward")==="forward"){let o=e.in._zod.run(t,i);return o instanceof Promise?o.then(a=>mv(a,e,i)):mv(o,e,i)}else{let o=e.out._zod.run(t,i);return o instanceof Promise?o.then(a=>mv(a,e,i)):mv(o,e,i)}}});function mv(r,e,t){if(r.issues.length)return r.aborted=!0,r;if((t.direction||"forward")==="forward"){let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>gv(r,o,e.out,t)):gv(r,n,e.out,t)}else{let n=e.reverseTransform(r.value,r);return n instanceof Promise?n.then(o=>gv(r,o,e.in,t)):gv(r,n,e.in,t)}}function gv(r,e,t,i){return r.issues.length?(r.aborted=!0,r):t._zod.run({value:e,issues:r.issues},i)}var J0=b("$ZodReadonly",(r,e)=>{fe.init(r,e),$e(r._zod,"propValues",()=>e.innerType._zod.propValues),$e(r._zod,"values",()=>e.innerType._zod.values),$e(r._zod,"optin",()=>e.innerType?._zod?.optin),$e(r._zod,"optout",()=>e.innerType?._zod?.optout),r._zod.parse=(t,i)=>{if(i.direction==="backward")return e.innerType._zod.run(t,i);let n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(Y1):Y1(n)}});function Y1(r){return r.value=Object.freeze(r.value),r}var Q0=b("$ZodTemplateLiteral",(r,e)=>{fe.init(r,e);let t=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;t.push(n.slice(o,a))}else if(i===null||Ww.has(typeof i))t.push(Bi(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);r._zod.pattern=new RegExp(`^${t.join("")}$`),r._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:r,expected:"template_literal",code:"invalid_type"}),i):(r._zod.pattern.lastIndex=0,r._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:r,code:"invalid_format",format:e.format??"template_literal",pattern:r._zod.pattern.source}),i)}),Y0=b("$ZodFunction",(r,e)=>(fe.init(r,e),r._def=e,r._zod.def=e,r.implement=t=>{if(typeof t!="function")throw new Error("implement() must be called with a function");return function(...i){let n=r._def.input?ev(r._def.input,i):i,o=Reflect.apply(t,this,n);return r._def.output?ev(r._def.output,o):o}},r.implementAsync=t=>{if(typeof t!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=r._def.input?await tv(r._def.input,i):i,o=await Reflect.apply(t,this,n);return r._def.output?await tv(r._def.output,o):o}},r._zod.parse=(t,i)=>typeof t.value!="function"?(t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:r}),t):(r._def.output&&r._def.output._zod.def.type==="promise"?t.value=r.implementAsync(t.value):t.value=r.implement(t.value),t),r.input=(...t)=>{let i=r.constructor;return Array.isArray(t[0])?new i({type:"function",input:new bv({type:"tuple",items:t[0],rest:t[1]}),output:r._def.output}):new i({type:"function",input:t[0],output:r._def.output})},r.output=t=>{let i=r.constructor;return new i({type:"function",input:r._def.input,output:t})},r)),X0=b("$ZodPromise",(r,e)=>{fe.init(r,e),r._zod.parse=(t,i)=>Promise.resolve(t.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i))}),eA=b("$ZodLazy",(r,e)=>{fe.init(r,e),$e(r._zod,"innerType",()=>e.getter()),$e(r._zod,"pattern",()=>r._zod.innerType?._zod?.pattern),$e(r._zod,"propValues",()=>r._zod.innerType?._zod?.propValues),$e(r._zod,"optin",()=>r._zod.innerType?._zod?.optin??void 0),$e(r._zod,"optout",()=>r._zod.innerType?._zod?.optout??void 0),r._zod.parse=(t,i)=>r._zod.innerType._zod.run(t,i)}),tA=b("$ZodCustom",(r,e)=>{Je.init(r,e),fe.init(r,e),r._zod.parse=(t,i)=>t,r._zod.check=t=>{let i=t.value,n=e.fn(i);if(n instanceof Promise)return n.then(o=>X1(o,t,i,r));X1(n,t,i,r)}});function X1(r,e,t,i){if(!r){let n={code:"custom",input:t,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),e.issues.push(sc(n))}}var ah={};ka(ah,{ar:()=>oS,az:()=>aS,be:()=>lS,bg:()=>uS,ca:()=>cS,cs:()=>dS,da:()=>pS,de:()=>hS,en:()=>Av,eo:()=>fS,es:()=>mS,fa:()=>gS,fi:()=>vS,fr:()=>yS,frCA:()=>xS,he:()=>wS,hu:()=>bS,id:()=>AS,is:()=>_S,it:()=>PS,ja:()=>SS,ka:()=>ES,kh:()=>BS,km:()=>_v,ko:()=>FS,lt:()=>kS,mk:()=>$S,ms:()=>MS,nl:()=>DS,no:()=>IS,ota:()=>CS,pl:()=>RS,ps:()=>TS,pt:()=>OS,ru:()=>zS,sl:()=>US,sv:()=>jS,ta:()=>LS,th:()=>KS,tr:()=>WS,ua:()=>ZS,uk:()=>Pv,ur:()=>GS,vi:()=>qS,yo:()=>QS,zhCN:()=>HS,zhTW:()=>JS});var KF=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\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 ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${t(n.input)}`;case"invalid_value":return n.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(n.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: ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()} ${a.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 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${n.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${k(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.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 ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function oS(){return{localeError:KF()}}var WF=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${n.expected}, daxil olan ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${z(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${i[o.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${k(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function aS(){return{localeError:WF()}}function sS(r,e,t,i){let n=Math.abs(r),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?t:i}var ZF=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0456\u045E";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${t(n.input)}`;case"invalid_value":return n.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(n.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 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),l=sS(s,a.unit.one,a.unit.few,a.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 ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${n.maximum.toString()} ${l}`}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 ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),l=sS(s,a.unit.one,a.unit.few,a.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 ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${n.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${k(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.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 ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function lS(){return{localeError:ZF()}}var GF=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},qF=()=>{let r={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 r[i]??null}let t={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"};return i=>{switch(i.code){case"invalid_type":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${GF(i.input)}`;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 ${k(i.values,"|")}`;case"too_big":{let n=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 ${n}${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 ${n}${i.maximum.toString()}`}case"too_small":{let n=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 ${n}${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 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;if(n.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 "${n.prefix}"`;if(n.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 "${n.suffix}"`;if(n.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 "${n.includes}"`;if(n.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 ${n.pattern}`;let o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return n.format==="emoji"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="datetime"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="date"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),n.format==="time"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),n.format==="duration"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${o} ${t[n.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":""}: ${k(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 uS(){return{localeError:qF()}}var HF=()=>{let r={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${n.expected}, s'ha rebut ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${z(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${k(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",a=e(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=e(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${i[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function cS(){return{localeError:HF()}}var JF=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(n))return"pole";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${n.expected}, obdr\u017Eeno ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${z(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${i[o.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${k(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function dS(){return{localeError:JF()}}var QF=()=>{let r={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},e={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};function t(a){return r[a]??null}function i(a){return e[a]??a}let n=a=>{let s=typeof a;switch(s){case"number":return Number.isNaN(a)?"NaN":"tal";case"object":return Array.isArray(a)?"liste":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype&&a.constructor?a.constructor.name:"objekt"}return s},o={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"};return a=>{switch(a.code){case"invalid_type":return`Ugyldigt input: forventede ${i(a.expected)}, fik ${i(n(a.input))}`;case"invalid_value":return a.values.length===1?`Ugyldig v\xE6rdi: forventede ${z(a.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${k(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",l=t(a.origin),c=i(a.origin);return l?`For stor: forventede ${c??"value"} ${l.verb} ${s} ${a.maximum.toString()} ${l.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",l=t(a.origin),c=i(a.origin);return l?`For lille: forventede ${c} ${l.verb} ${s} ${a.minimum.toString()} ${l.unit}`:`For lille: forventede ${c} havde ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Ugyldig streng: skal starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: skal ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: skal indeholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${o[s.format]??a.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${k(a.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${a.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${a.origin}`;default:return"Ugyldigt input"}}};function pS(){return{localeError:QF()}}var YF=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"Zahl";case"object":{if(Array.isArray(n))return"Array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${n.expected}, erhalten ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${z(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${k(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function hS(){return{localeError:YF()}}var XF=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},eN=()=>{let r={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(i){return r[i]??null}let t={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"};return i=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${XF(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${z(i.values[0])}`:`Invalid option: expected one of ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Too big: expected ${i.origin??"value"} to have ${n}${i.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Too small: expected ${i.origin} to have ${n}${i.minimum.toString()} ${o.unit}`:`Too small: expected ${i.origin} to be ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Invalid string: must start with "${n.prefix}"`:n.format==="ends_with"?`Invalid string: must end with "${n.suffix}"`:n.format==="includes"?`Invalid string: must include "${n.includes}"`:n.format==="regex"?`Invalid string: must match pattern ${n.pattern}`:`Invalid ${t[n.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":""}: ${k(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Av(){return{localeError:eN()}}var tN=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"nombro";case"object":{if(Array.isArray(r))return"tabelo";if(r===null)return"senvalora";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},rN=()=>{let r={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(i){return r[i]??null}let t={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"};return i=>{switch(i.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${i.expected}, ricevi\u011Dis ${tN(i.input)}`;case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${z(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${n}${i.minimum.toString()} ${o.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${n.prefix}"`:n.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${n.suffix}"`:n.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${n.includes}"`:n.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${n.pattern}`:`Nevalida ${t[n.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":""}: ${k(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 fS(){return{localeError:rN()}}var iN=()=>{let r={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},e={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"};function t(a){return r[a]??null}function i(a){return e[a]??a}let n=a=>{let s=typeof a;switch(s){case"number":return Number.isNaN(a)?"NaN":"number";case"object":return Array.isArray(a)?"array":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype?a.constructor.name:"object"}return s},o={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"};return a=>{switch(a.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${i(a.expected)}, recibido ${i(n(a.input))}`;case"invalid_value":return a.values.length===1?`Entrada inv\xE1lida: se esperaba ${z(a.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${k(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",l=t(a.origin),c=i(a.origin);return l?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${s}${a.maximum.toString()} ${l.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${s}${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",l=t(a.origin),c=i(a.origin);return l?`Demasiado peque\xF1o: se esperaba que ${c} tuviera ${s}${a.minimum.toString()} ${l.unit}`:`Demasiado peque\xF1o: se esperaba que ${c} fuera ${s}${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${o[s.format]??a.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${a.divisor}`;case"unrecognized_keys":return`Llave${a.keys.length>1?"s":""} desconocida${a.keys.length>1?"s":""}: ${k(a.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${i(a.origin)}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${i(a.origin)}`;default:return"Entrada inv\xE1lida"}}};function mS(){return{localeError:iN()}}var nN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(n))return"\u0622\u0631\u0627\u06CC\u0647";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${t(n.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${z(n.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 ${k(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${i[o.format]??n.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 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${k(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.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 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function gS(){return{localeError:nN()}}var oN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${n.expected}, oli ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${z(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${i[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${k(n.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 vS(){return{localeError:oN()}}var aN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombre";case"object":{if(Array.isArray(n))return"tableau";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Entr\xE9e invalide : ${n.expected} attendu, ${t(n.input)} re\xE7u`;case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${z(n.values[0])} attendu`:`Option invalide : une valeur parmi ${k(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Trop grand : ${n.origin??"valeur"} doit ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Trop petit : ${n.origin} doit ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${k(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function yS(){return{localeError:aN()}}var sN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${n.expected}, re\xE7u ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${z(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",a=e(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",a=e(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${k(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function xS(){return{localeError:sN()}}var lN=()=>{let r={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"}},t=c=>c?r[c]:void 0,i=c=>{let p=t(c);return p?p.label:c??r.unknown.label},n=c=>`\u05D4${i(c)}`,o=c=>(t(c)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=c=>c?e[c]??null:null,s=c=>{let p=typeof c;switch(p){case"number":return Number.isNaN(c)?"NaN":"number";case"object":return Array.isArray(c)?"array":c===null?"null":Object.getPrototypeOf(c)!==Object.prototype&&c.constructor?c.constructor.name:"object";default:return p}},l={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"}};return c=>{switch(c.code){case"invalid_type":{let p=c.expected,d=i(p),f=s(c.input),v=r[f]?.label??f;return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${v}`}case"invalid_value":{if(c.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(c.values[0])}`;let p=c.values.map(v=>z(v));if(c.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 ${p[0]} \u05D0\u05D5 ${p[1]}`;let d=p[p.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 ${p.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case"too_big":{let p=a(c.origin),d=n(c.origin??"value");if(c.origin==="string")return`${p?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.maximum.toString()} ${p?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(c.origin==="number"){let m=c.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${c.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(c.origin==="array"||c.origin==="set"){let m=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=c.inclusive?`${c.maximum} ${p?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${c.maximum} ${p?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let f=c.inclusive?"<=":"<",v=o(c.origin??"value");return p?.unit?`${p.longLabel} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${c.maximum.toString()} ${p.unit}`:`${p?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${c.maximum.toString()}`}case"too_small":{let p=a(c.origin),d=n(c.origin??"value");if(c.origin==="string")return`${p?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.minimum.toString()} ${p?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(c.origin==="number"){let m=c.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${c.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(c.origin==="array"||c.origin==="set"){let m=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(c.minimum===1&&c.inclusive){let x=(c.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let y=c.inclusive?`${c.minimum} ${p?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${c.minimum} ${p?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let f=c.inclusive?">=":">",v=o(c.origin??"value");return p?.unit?`${p.shortLabel} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${c.minimum.toString()} ${p.unit}`:`${p?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${v} ${f}${c.minimum.toString()}`}case"invalid_format":{let p=c;if(p.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${p.prefix}"`;if(p.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${p.suffix}"`;if(p.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${p.includes}"`;if(p.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 ${p.pattern}`;let d=l[p.format],f=d?.label??p.format,m=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${m}`}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 ${c.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${c.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${c.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${k(c.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${n(c.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function wS(){return{localeError:lN()}}var uN=()=>{let r={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(n))return"t\xF6mb";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${n.expected}, a kapott \xE9rt\xE9k ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${z(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${i[o.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function bS(){return{localeError:uN()}}var cN=()=>{let r={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Input tidak valid: diharapkan ${n.expected}, diterima ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${z(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${i[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function AS(){return{localeError:cN()}}var dN=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"n\xFAmer";case"object":{if(Array.isArray(r))return"fylki";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},pN=()=>{let r={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 r[i]??null}let t={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"};return i=>{switch(i.code){case"invalid_type":return`Rangt gildi: \xDE\xFA sl\xF3st inn ${dN(i.input)} \xFEar sem \xE1 a\xF0 vera ${i.expected}`;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 ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} hafi ${n}${i.maximum.toString()} ${o.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} s\xE9 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} hafi ${n}${i.minimum.toString()} ${o.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} s\xE9 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${n.prefix}"`:n.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${n.suffix}"`:n.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${n.includes}"`:n.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${n.pattern}`:`Rangt ${t[n.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"}: ${k(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 _S(){return{localeError:pN()}}var hN=()=>{let r={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numero";case"object":{if(Array.isArray(n))return"vettore";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Input non valido: atteso ${n.expected}, ricevuto ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Input non valido: atteso ${z(n.values[0])}`:`Opzione non valida: atteso uno tra ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${k(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function PS(){return{localeError:hN()}}var fN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(n))return"\u914D\u5217";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${t(n.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${z(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${k(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=e(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=e(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${i[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.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${n.keys.length>1?"\u7FA4":""}: ${k(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function SS(){return{localeError:fN()}}var mN=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8";case"object":{if(Array.isArray(r))return"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return{string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0"}[e]??e},gN=()=>{let r={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 r[i]??null}let t={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 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"};return i=>{switch(i.code){case"invalid_type":return`\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 ${i.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${mN(i.input)}`;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 ${k(i.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let n=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} ${n}${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 ${n}${i.maximum.toString()}`}case"too_small":{let n=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} ${n}${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 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${n.prefix}"-\u10D8\u10D7`:n.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${n.suffix}"-\u10D8\u10D7`:n.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${n.includes}"-\u10E1`:n.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\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 ${n.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${t[n.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"}: ${k(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 ES(){return{localeError:gN()}}var vN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(n))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(n===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\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 ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${t(n.input)}`;case"invalid_value":return n.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(n.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 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${k(n.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 ${n.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 ${n.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 _v(){return{localeError:vN()}}function BS(){return _v()}var yN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${t(n.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${z(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${k(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${a}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${a}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${i[o.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${k(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function FS(){return{localeError:yN()}}var xN=r=>oh(typeof r,r),oh=(r,e=void 0)=>{switch(r){case"number":return Number.isNaN(e)?"NaN":"skai\u010Dius";case"bigint":return"sveikasis skai\u010Dius";case"string":return"eilut\u0117";case"boolean":return"login\u0117 reik\u0161m\u0117";case"undefined":case"void":return"neapibr\u0117\u017Eta reik\u0161m\u0117";case"function":return"funkcija";case"symbol":return"simbolis";case"object":return e===void 0?"ne\u017Einomas objektas":e===null?"nulin\u0117 reik\u0161m\u0117":Array.isArray(e)?"masyvas":Object.getPrototypeOf(e)!==Object.prototype&&e.constructor?e.constructor.name:"objektas";case"null":return"nulin\u0117 reik\u0161m\u0117"}return r},nh=r=>r.charAt(0).toUpperCase()+r.slice(1);function NS(r){let e=Math.abs(r),t=e%10,i=e%100;return i>=11&&i<=19||t===0?"many":t===1?"one":"few"}var wN=()=>{let r={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,n,o,a){let s=r[i]??null;return s===null?s:{unit:s.unit[n],verb:s.verb[a][o?"inclusive":"notInclusive"]}}let t={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"};return i=>{switch(i.code){case"invalid_type":return`Gautas tipas ${xN(i.input)}, o tik\u0117tasi - ${oh(i.expected)}`;case"invalid_value":return i.values.length===1?`Privalo b\u016Bti ${z(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${k(i.values,"|")} pasirinkim\u0173`;case"too_big":{let n=oh(i.origin),o=e(i.origin,NS(Number(i.maximum)),i.inclusive??!1,"smaller");if(o?.verb)return`${nh(n??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.maximum.toString()} ${o.unit??"element\u0173"}`;let a=i.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${nh(n??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.maximum.toString()} ${o?.unit}`}case"too_small":{let n=oh(i.origin),o=e(i.origin,NS(Number(i.minimum)),i.inclusive??!1,"bigger");if(o?.verb)return`${nh(n??i.origin??"reik\u0161m\u0117")} ${o.verb} ${i.minimum.toString()} ${o.unit??"element\u0173"}`;let a=i.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${nh(n??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${i.minimum.toString()} ${o?.unit}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${n.prefix}"`:n.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${n.suffix}"`:n.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${n.includes}"`:n.format==="regex"?`Eilut\u0117 privalo atitikti ${n.pattern}`:`Neteisingas ${t[n.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"}: ${k(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let n=oh(i.origin);return`${nh(n??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function kS(){return{localeError:wN()}}var bN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(n))return"\u043D\u0438\u0437\u0430";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${z(n.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 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.maximum.toString()} ${a.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 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`Invalid ${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`${n.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"}: ${k(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.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 ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function $S(){return{localeError:bN()}}var AN=()=>{let r={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombor";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Input tidak sah: dijangka ${n.expected}, diterima ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${z(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${i[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${k(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function MS(){return{localeError:AN()}}var _N=()=>{let r={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"getal";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Ongeldige invoer: verwacht ${n.expected}, ontving ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${z(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Te groot: verwacht dat ${n.origin??"waarde"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elementen"}`:`Te groot: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Te klein: verwacht dat ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Te klein: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function DS(){return{localeError:_N()}}var PN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"tall";case"object":{if(Array.isArray(n))return"liste";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Ugyldig input: forventet ${n.expected}, fikk ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${z(n.values[0])}`:`Ugyldig valg: forventet en av ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${k(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function IS(){return{localeError:PN()}}var SN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numara";case"object":{if(Array.isArray(n))return"saf";if(n===null)return"gayb";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`F\xE2sit giren: umulan ${n.expected}, al\u0131nan ${t(n.input)}`;case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${z(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=n;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${i[o.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function CS(){return{localeError:SN()}}var EN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(n))return"\u0627\u0631\u06D0";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${t(n.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${z(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${k(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${i[o.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${k(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.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 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function TS(){return{localeError:EN()}}var BN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"liczba";case"object":{if(Array.isArray(n))return"tablica";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${n.expected}, otrzymano ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${z(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${i[o.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function RS(){return{localeError:BN()}}var FN=()=>{let r={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(n))return"array";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${n.expected}, recebido ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${z(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${i[o.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${k(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function OS(){return{localeError:FN()}}function VS(r,e,t,i){let n=Math.abs(r),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?t:i}var NN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${t(n.input)}`;case"invalid_value":return n.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(n.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 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),l=VS(s,a.unit.one,a.unit.few,a.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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.maximum.toString()} ${l}`}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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),l=VS(s,a.unit.one,a.unit.few,a.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 ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.minimum.toString()} ${l}`}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 ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${k(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.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 ${n.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 zS(){return{localeError:NN()}}var kN=()=>{let r={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(n))return"tabela";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${n.expected}, prejeto ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${z(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${i[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${k(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function US(){return{localeError:kN()}}var $N=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"antal";case"object":{if(Array.isArray(n))return"lista";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${n.expected}, fick ${t(n.input)}`;case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${z(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${i[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${k(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function jS(){return{localeError:$N()}}var MN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(n))return"\u0B85\u0BA3\u0BBF";if(n===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\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 ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t(n.input)}`;case"invalid_value":return n.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(n.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 ${k(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\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 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} ${a.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 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\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 ${n.origin} ${o}${n.minimum.toString()} ${a.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 ${n.origin} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.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 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.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${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${k(n.keys,", ")}`;case"invalid_key":return`${n.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`${n.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 LS(){return{localeError:MN()}}var DN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(n))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(n===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\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 ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${z(n.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 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=e(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=e(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.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 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${i[o.format]??n.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 ${n.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: ${k(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.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 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function KS(){return{localeError:DN()}}var IN=r=>{let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return e},CN=()=>{let r={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 r[i]??null}let t={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"};return i=>{switch(i.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${i.expected}, al\u0131nan ${IN(i.input)}`;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: ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${n}${i.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${n}${i.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Ge\xE7ersiz metin: "${n.prefix}" ile ba\u015Flamal\u0131`:n.format==="ends_with"?`Ge\xE7ersiz metin: "${n.suffix}" ile bitmeli`:n.format==="includes"?`Ge\xE7ersiz metin: "${n.includes}" i\xE7ermeli`:n.format==="regex"?`Ge\xE7ersiz metin: ${n.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${t[n.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":""}: ${k(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 WS(){return{localeError:CN()}}var TN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\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 ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${t(n.input)}`;case"invalid_value":return n.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(n.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 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${o}${n.maximum.toString()} ${a.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 ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.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 "${o.suffix}"`:o.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 "${o.includes}"`:o.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 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${k(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.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 ${n.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 Pv(){return{localeError:TN()}}function ZS(){return Pv()}var RN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(n))return"\u0622\u0631\u06D2";if(n===null)return"\u0646\u0644";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${t(n.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${z(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${k(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.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${n.keys.length>1?"\u0632":""}: ${k(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function GS(){return{localeError:RN()}}var ON=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(n))return"m\u1EA3ng";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${z(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${k(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.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 ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function qS(){return{localeError:ON()}}var VN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(n))return"\u6570\u7EC4";if(n===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${z(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${i[o.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${k(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function HS(){return{localeError:VN()}}var zN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${n.expected}\uFF0C\u4F46\u6536\u5230 ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${z(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${k(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function JS(){return{localeError:zN()}}var UN=()=>{let r={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(n){return r[n]??null}let t=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"n\u1ECD\u0301mb\xE0";case"object":{if(Array.isArray(n))return"akop\u1ECD";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={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"};return n=>{switch(n.code){case"invalid_type":return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${t(n.input)}`;case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${z(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${k(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${o}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${o}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case"invalid_format":{let o=n;return o.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 "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${k(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.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 ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function QS(){return{localeError:UN()}}var YS,rA=Symbol("ZodOutput"),iA=Symbol("ZodInput"),hc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let i=t[0];if(this._map.set(e,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let i={...this.get(t)??{}};delete i.id;let n={...i,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Sv(){return new hc}(YS=globalThis).__zod_globalRegistry??(YS.__zod_globalRegistry=Sv());var mr=globalThis.__zod_globalRegistry;function nA(r,e){return new r({type:"string",...j(e)})}function oA(r,e){return new r({type:"string",coerce:!0,...j(e)})}function Ev(r,e){return new r({type:"string",format:"email",check:"string_format",abort:!1,...j(e)})}function sh(r,e){return new r({type:"string",format:"guid",check:"string_format",abort:!1,...j(e)})}function Bv(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,...j(e)})}function Fv(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...j(e)})}function Nv(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...j(e)})}function kv(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...j(e)})}function lh(r,e){return new r({type:"string",format:"url",check:"string_format",abort:!1,...j(e)})}function $v(r,e){return new r({type:"string",format:"emoji",check:"string_format",abort:!1,...j(e)})}function Mv(r,e){return new r({type:"string",format:"nanoid",check:"string_format",abort:!1,...j(e)})}function Dv(r,e){return new r({type:"string",format:"cuid",check:"string_format",abort:!1,...j(e)})}function Iv(r,e){return new r({type:"string",format:"cuid2",check:"string_format",abort:!1,...j(e)})}function Cv(r,e){return new r({type:"string",format:"ulid",check:"string_format",abort:!1,...j(e)})}function Tv(r,e){return new r({type:"string",format:"xid",check:"string_format",abort:!1,...j(e)})}function Rv(r,e){return new r({type:"string",format:"ksuid",check:"string_format",abort:!1,...j(e)})}function Ov(r,e){return new r({type:"string",format:"ipv4",check:"string_format",abort:!1,...j(e)})}function Vv(r,e){return new r({type:"string",format:"ipv6",check:"string_format",abort:!1,...j(e)})}function aA(r,e){return new r({type:"string",format:"mac",check:"string_format",abort:!1,...j(e)})}function zv(r,e){return new r({type:"string",format:"cidrv4",check:"string_format",abort:!1,...j(e)})}function Uv(r,e){return new r({type:"string",format:"cidrv6",check:"string_format",abort:!1,...j(e)})}function jv(r,e){return new r({type:"string",format:"base64",check:"string_format",abort:!1,...j(e)})}function Lv(r,e){return new r({type:"string",format:"base64url",check:"string_format",abort:!1,...j(e)})}function Kv(r,e){return new r({type:"string",format:"e164",check:"string_format",abort:!1,...j(e)})}function Wv(r,e){return new r({type:"string",format:"jwt",check:"string_format",abort:!1,...j(e)})}var sA={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function lA(r,e){return new r({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...j(e)})}function uA(r,e){return new r({type:"string",format:"date",check:"string_format",...j(e)})}function cA(r,e){return new r({type:"string",format:"time",check:"string_format",precision:null,...j(e)})}function dA(r,e){return new r({type:"string",format:"duration",check:"string_format",...j(e)})}function pA(r,e){return new r({type:"number",checks:[],...j(e)})}function hA(r,e){return new r({type:"number",coerce:!0,checks:[],...j(e)})}function fA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"safeint",...j(e)})}function mA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float32",...j(e)})}function gA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float64",...j(e)})}function vA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"int32",...j(e)})}function yA(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"uint32",...j(e)})}function xA(r,e){return new r({type:"boolean",...j(e)})}function wA(r,e){return new r({type:"boolean",coerce:!0,...j(e)})}function bA(r,e){return new r({type:"bigint",...j(e)})}function AA(r,e){return new r({type:"bigint",coerce:!0,...j(e)})}function _A(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...j(e)})}function PA(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...j(e)})}function SA(r,e){return new r({type:"symbol",...j(e)})}function EA(r,e){return new r({type:"undefined",...j(e)})}function BA(r,e){return new r({type:"null",...j(e)})}function FA(r){return new r({type:"any"})}function NA(r){return new r({type:"unknown"})}function kA(r,e){return new r({type:"never",...j(e)})}function $A(r,e){return new r({type:"void",...j(e)})}function MA(r,e){return new r({type:"date",...j(e)})}function DA(r,e){return new r({type:"date",coerce:!0,...j(e)})}function IA(r,e){return new r({type:"nan",...j(e)})}function mo(r,e){return new dv({check:"less_than",...j(e),value:r,inclusive:!1})}function Ni(r,e){return new dv({check:"less_than",...j(e),value:r,inclusive:!0})}function go(r,e){return new pv({check:"greater_than",...j(e),value:r,inclusive:!1})}function kr(r,e){return new pv({check:"greater_than",...j(e),value:r,inclusive:!0})}function CA(r){return go(0,r)}function TA(r){return mo(0,r)}function RA(r){return Ni(0,r)}function OA(r){return kr(0,r)}function Ks(r,e){return new Fb({check:"multiple_of",...j(e),value:r})}function fc(r,e){return new $b({check:"max_size",...j(e),maximum:r})}function Ws(r,e){return new Mb({check:"min_size",...j(e),minimum:r})}function uh(r,e){return new Db({check:"size_equals",...j(e),size:r})}function mc(r,e){return new Ib({check:"max_length",...j(e),maximum:r})}function Sa(r,e){return new Cb({check:"min_length",...j(e),minimum:r})}function gc(r,e){return new Tb({check:"length_equals",...j(e),length:r})}function ch(r,e){return new Rb({check:"string_format",format:"regex",...j(e),pattern:r})}function dh(r){return new Ob({check:"string_format",format:"lowercase",...j(r)})}function ph(r){return new Vb({check:"string_format",format:"uppercase",...j(r)})}function hh(r,e){return new zb({check:"string_format",format:"includes",...j(e),includes:r})}function fh(r,e){return new Ub({check:"string_format",format:"starts_with",...j(e),prefix:r})}function mh(r,e){return new jb({check:"string_format",format:"ends_with",...j(e),suffix:r})}function VA(r,e,t){return new Lb({check:"property",property:r,schema:e,...j(t)})}function gh(r,e){return new Kb({check:"mime_type",mime:r,...j(e)})}function Rn(r){return new Wb({check:"overwrite",tx:r})}function vh(r){return Rn(e=>e.normalize(r))}function yh(){return Rn(r=>r.trim())}function xh(){return Rn(r=>r.toLowerCase())}function wh(){return Rn(r=>r.toUpperCase())}function bh(){return Rn(r=>jw(r))}function zA(r,e,t){return new r({type:"array",element:e,...j(t)})}function LN(r,e,t){return new r({type:"union",options:e,...j(t)})}function KN(r,e,t,i){return new r({type:"union",options:t,discriminator:e,...j(i)})}function WN(r,e,t){return new r({type:"intersection",left:e,right:t})}function ZN(r,e,t,i){let n=t instanceof fe,o=n?i:t,a=n?t:null;return new r({type:"tuple",items:e,rest:a,...j(o)})}function GN(r,e,t,i){return new r({type:"record",keyType:e,valueType:t,...j(i)})}function qN(r,e,t,i){return new r({type:"map",keyType:e,valueType:t,...j(i)})}function HN(r,e,t){return new r({type:"set",valueType:e,...j(t)})}function JN(r,e,t){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new r({type:"enum",entries:i,...j(t)})}function QN(r,e,t){return new r({type:"enum",entries:e,...j(t)})}function YN(r,e,t){return new r({type:"literal",values:Array.isArray(e)?e:[e],...j(t)})}function UA(r,e){return new r({type:"file",...j(e)})}function XN(r,e){return new r({type:"transform",transform:e})}function ek(r,e){return new r({type:"optional",innerType:e})}function tk(r,e){return new r({type:"nullable",innerType:e})}function rk(r,e,t){return new r({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Kw(t)}})}function ik(r,e,t){return new r({type:"nonoptional",innerType:e,...j(t)})}function nk(r,e){return new r({type:"success",innerType:e})}function ok(r,e,t){return new r({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function ak(r,e,t){return new r({type:"pipe",in:e,out:t})}function sk(r,e){return new r({type:"readonly",innerType:e})}function lk(r,e,t){return new r({type:"template_literal",parts:e,...j(t)})}function uk(r,e){return new r({type:"lazy",getter:e})}function ck(r,e){return new r({type:"promise",innerType:e})}function jA(r,e,t){let i=j(t);return i.abort??(i.abort=!0),new r({type:"custom",check:"custom",fn:e,...i})}function LA(r,e,t){return new r({type:"custom",check:"custom",fn:e,...j(t)})}function KA(r){let e=XS(t=>(t.addIssue=i=>{if(typeof i=="string")t.issues.push(sc(i,t.value,e._zod.def));else{let n=i;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=t.value),n.inst??(n.inst=e),n.continue??(n.continue=!e._zod.def.abort),t.issues.push(sc(n))}},r(t.value,t)));return e}function XS(r,e){let t=new Je({check:"custom",...j(e)});return t._zod.check=r,t}function WA(r){let e=new Je({check:"describe"});return e._zod.onattach=[t=>{let i=mr.get(t)??{};mr.add(t,{...i,description:r})}],e._zod.check=()=>{},e}function ZA(r){let e=new Je({check:"meta"});return e._zod.onattach=[t=>{let i=mr.get(t)??{};mr.add(t,{...i,...r})}],e._zod.check=()=>{},e}function GA(r,e){let t=j(e),i=t.truthy??["true","1","yes","on","y","enabled"],n=t.falsy??["false","0","no","off","n","disabled"];t.case!=="sensitive"&&(i=i.map(v=>typeof v=="string"?v.toLowerCase():v),n=n.map(v=>typeof v=="string"?v.toLowerCase():v));let o=new Set(i),a=new Set(n),s=r.Codec??ih,l=r.Boolean??rh,c=r.String??Ls,p=new c({type:"string",error:t.error}),d=new l({type:"boolean",error:t.error}),f=new s({type:"pipe",in:p,out:d,transform:(v,m)=>{let y=v;return t.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:a.has(y)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:m.value,inst:f,continue:!1}),{})},reverseTransform:(v,m)=>v===!0?i[0]||"true":n[0]||"false",error:t.error});return f}function vc(r,e,t,i={}){let n=j(i),o={...j(i),check:"string_format",type:"string",format:e,fn:typeof t=="function"?t:s=>t.test(s),...n};return t instanceof RegExp&&(o.pattern=t),new r(o)}var Ah=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??mr,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var i;let n=e._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(e);if(a)return a.count++,t.schemaPath.includes(e)&&(a.cycle=t.path),a.schema;let s={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,s);let l=e._zod.toJSONSchema?.();if(l)s.schema=l;else{let d={...t,schemaPath:[...t.schemaPath,e],path:t.path},f=e._zod.parent;if(f)s.ref=f,this.process(f,d),this.seen.get(f).isParent=!0;else{let v=s.schema;switch(n.type){case"string":{let m=v;m.type="string";let{minimum:y,maximum:x,format:M,patterns:D,contentEncoding:O}=e._zod.bag;if(typeof y=="number"&&(m.minLength=y),typeof x=="number"&&(m.maxLength=x),M&&(m.format=o[M]??M,m.format===""&&delete m.format),O&&(m.contentEncoding=O),D&&D.size>0){let T=[...D];T.length===1?m.pattern=T[0].source:T.length>1&&(s.schema.allOf=[...T.map(V=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:V.source}))])}break}case"number":{let m=v,{minimum:y,maximum:x,format:M,multipleOf:D,exclusiveMaximum:O,exclusiveMinimum:T}=e._zod.bag;typeof M=="string"&&M.includes("int")?m.type="integer":m.type="number",typeof T=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(m.minimum=T,m.exclusiveMinimum=!0):m.exclusiveMinimum=T),typeof y=="number"&&(m.minimum=y,typeof T=="number"&&this.target!=="draft-4"&&(T>=y?delete m.minimum:delete m.exclusiveMinimum)),typeof O=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(m.maximum=O,m.exclusiveMaximum=!0):m.exclusiveMaximum=O),typeof x=="number"&&(m.maximum=x,typeof O=="number"&&this.target!=="draft-4"&&(O<=x?delete m.maximum:delete m.exclusiveMaximum)),typeof D=="number"&&(m.multipleOf=D);break}case"boolean":{let m=v;m.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{this.target==="openapi-3.0"?(v.type="string",v.nullable=!0,v.enum=[null]):v.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{v.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let m=v,{minimum:y,maximum:x}=e._zod.bag;typeof y=="number"&&(m.minItems=y),typeof x=="number"&&(m.maxItems=x),m.type="array",m.items=this.process(n.element,{...d,path:[...d.path,"items"]});break}case"object":{let m=v;m.type="object",m.properties={};let y=n.shape;for(let D in y)m.properties[D]=this.process(y[D],{...d,path:[...d.path,"properties",D]});let x=new Set(Object.keys(y)),M=new Set([...x].filter(D=>{let O=n.shape[D]._zod;return this.io==="input"?O.optin===void 0:O.optout===void 0}));M.size>0&&(m.required=Array.from(M)),n.catchall?._zod.def.type==="never"?m.additionalProperties=!1:n.catchall?n.catchall&&(m.additionalProperties=this.process(n.catchall,{...d,path:[...d.path,"additionalProperties"]})):this.io==="output"&&(m.additionalProperties=!1);break}case"union":{let m=v,y=n.discriminator!==void 0,x=n.options.map((M,D)=>this.process(M,{...d,path:[...d.path,y?"oneOf":"anyOf",D]}));y?m.oneOf=x:m.anyOf=x;break}case"intersection":{let m=v,y=this.process(n.left,{...d,path:[...d.path,"allOf",0]}),x=this.process(n.right,{...d,path:[...d.path,"allOf",1]}),M=O=>"allOf"in O&&Object.keys(O).length===1,D=[...M(y)?y.allOf:[y],...M(x)?x.allOf:[x]];m.allOf=D;break}case"tuple":{let m=v;m.type="array";let y=this.target==="draft-2020-12"?"prefixItems":"items",x=this.target==="draft-2020-12"||this.target==="openapi-3.0"?"items":"additionalItems",M=n.items.map((V,Y)=>this.process(V,{...d,path:[...d.path,y,Y]})),D=n.rest?this.process(n.rest,{...d,path:[...d.path,x,...this.target==="openapi-3.0"?[n.items.length]:[]]}):null;this.target==="draft-2020-12"?(m.prefixItems=M,D&&(m.items=D)):this.target==="openapi-3.0"?(m.items={anyOf:M},D&&m.items.anyOf.push(D),m.minItems=M.length,D||(m.maxItems=M.length)):(m.items=M,D&&(m.additionalItems=D));let{minimum:O,maximum:T}=e._zod.bag;typeof O=="number"&&(m.minItems=O),typeof T=="number"&&(m.maxItems=T);break}case"record":{let m=v;m.type="object",(this.target==="draft-7"||this.target==="draft-2020-12")&&(m.propertyNames=this.process(n.keyType,{...d,path:[...d.path,"propertyNames"]})),m.additionalProperties=this.process(n.valueType,{...d,path:[...d.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let m=v,y=Wp(n.entries);y.every(x=>typeof x=="number")&&(m.type="number"),y.every(x=>typeof x=="string")&&(m.type="string"),m.enum=y;break}case"literal":{let m=v,y=[];for(let x of n.values)if(x===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof x=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");y.push(Number(x))}else y.push(x);if(y.length!==0)if(y.length===1){let x=y[0];m.type=x===null?"null":typeof x,this.target==="draft-4"||this.target==="openapi-3.0"?m.enum=[x]:m.const=x}else y.every(x=>typeof x=="number")&&(m.type="number"),y.every(x=>typeof x=="string")&&(m.type="string"),y.every(x=>typeof x=="boolean")&&(m.type="string"),y.every(x=>x===null)&&(m.type="null"),m.enum=y;break}case"file":{let m=v,y={type:"string",format:"binary",contentEncoding:"binary"},{minimum:x,maximum:M,mime:D}=e._zod.bag;x!==void 0&&(y.minLength=x),M!==void 0&&(y.maxLength=M),D?D.length===1?(y.contentMediaType=D[0],Object.assign(m,y)):m.anyOf=D.map(O=>({...y,contentMediaType:O})):Object.assign(m,y);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let m=this.process(n.innerType,d);this.target==="openapi-3.0"?(s.ref=n.innerType,v.nullable=!0):v.anyOf=[m,{type:"null"}];break}case"nonoptional":{this.process(n.innerType,d),s.ref=n.innerType;break}case"success":{let m=v;m.type="boolean";break}case"default":{this.process(n.innerType,d),s.ref=n.innerType,v.default=JSON.parse(JSON.stringify(n.defaultValue));break}case"prefault":{this.process(n.innerType,d),s.ref=n.innerType,this.io==="input"&&(v._prefault=JSON.parse(JSON.stringify(n.defaultValue)));break}case"catch":{this.process(n.innerType,d),s.ref=n.innerType;let m;try{m=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}v.default=m;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let m=v,y=e._zod.pattern;if(!y)throw new Error("Pattern not found in template literal");m.type="string",m.pattern=y.source;break}case"pipe":{let m=this.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;this.process(m,d),s.ref=m;break}case"readonly":{this.process(n.innerType,d),s.ref=n.innerType,v.readOnly=!0;break}case"promise":{this.process(n.innerType,d),s.ref=n.innerType;break}case"optional":{this.process(n.innerType,d),s.ref=n.innerType;break}case"lazy":{let m=e._zod.innerType;this.process(m,d),s.ref=m;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema");break}default:}}}let c=this.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),this.io==="input"&&gr(e)&&(delete s.schema.examples,delete s.schema.default),this.io==="input"&&s.schema._prefault&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,this.seen.get(e).schema}emit(e,t){let i={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},n=this.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=p=>{let d=this.target==="draft-2020-12"?"$defs":"definitions";if(i.external){let y=i.external.registry.get(p[0])?.id,x=i.external.uri??(D=>D);if(y)return{ref:x(y)};let M=p[1].defId??p[1].schema.id??`schema${this.counter++}`;return p[1].defId=M,{defId:M,ref:`${x("__shared")}#/${d}/${M}`}}if(p[1]===n)return{ref:"#"};let v=`#/${d}/`,m=p[1].schema.id??`__schema${this.counter++}`;return{defId:m,ref:v+m}},a=p=>{if(p[1].schema.$ref)return;let d=p[1],{ref:f,defId:v}=o(p);d.def={...d.schema},v&&(d.defId=v);let m=d.schema;for(let y in m)delete m[y];m.$ref=f};if(i.cycles==="throw")for(let p of this.seen.entries()){let d=p[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
24
24
 
25
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let p of this.seen.entries()){let d=p[1];if(e===p[0]){a(p);continue}if(i.external){let v=i.external.registry.get(p[0])?.id;if(e!==p[0]&&v){a(p);continue}}if(this.metadataRegistry.get(p[0])?.id){a(p);continue}if(d.cycle){a(p);continue}if(d.count>1&&i.reused==="ref"){a(p);continue}}let s=(p,d)=>{let f=this.seen.get(p),v=f.def??f.schema,m={...v};if(f.ref===null)return;let y=f.ref;if(f.ref=null,y){s(y,d);let x=this.seen.get(y).schema;x.$ref&&(d.target==="draft-7"||d.target==="draft-4"||d.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(x)):(Object.assign(v,x),Object.assign(v,m))}f.isParent||this.override({zodSchema:p,jsonSchema:v,path:f.path??[]})};for(let p of[...this.seen.entries()].reverse())s(p[0],{target:this.target});let u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?u.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn(`Invalid target: ${this.target}`),i.external?.uri){let p=i.external.registry.get(e)?.id;if(!p)throw new Error("Schema is missing an `id` property");u.$id=i.external.uri(p)}Object.assign(u,n.def);let c=i.external?.defs??{};for(let p of this.seen.entries()){let d=p[1];d.def&&d.defId&&(c[d.defId]=d.def)}i.external||Object.keys(c).length>0&&(this.target==="draft-2020-12"?u.$defs=c:u.definitions=c);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}};function qA(r,e){if(r instanceof uc){let i=new mh(e),n={};for(let s of r._idmap.entries()){let[u,c]=s;i.process(c)}let o={},a={registry:r,uri:e?.uri,defs:n};for(let s of r._idmap.entries()){let[u,c]=s;o[u]=i.emit(c,{...e,external:a})}if(Object.keys(n).length>0){let s=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[s]:n}}return{schemas:o}}let t=new mh(e);return t.process(r),t.emit(r,e)}function mr(r,e){let t=e??{seen:new Set};if(t.seen.has(r))return!1;t.seen.add(r);let i=r._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return mr(i.element,t);if(i.type==="set")return mr(i.valueType,t);if(i.type==="lazy")return mr(i.getter(),t);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return mr(i.innerType,t);if(i.type==="intersection")return mr(i.left,t)||mr(i.right,t);if(i.type==="record"||i.type==="map")return mr(i.keyType,t)||mr(i.valueType,t);if(i.type==="pipe")return mr(i.in,t)||mr(i.out,t);if(i.type==="object"){for(let n in i.shape)if(mr(i.shape[n],t))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(mr(n,t))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(mr(n,t))return!0;return!!(i.rest&&mr(i.rest,t))}return!1}var QE={};var Zv={};Pa(Zv,{ZodISODate:()=>Lv,ZodISODateTime:()=>jv,ZodISODuration:()=>Wv,ZodISOTime:()=>Kv,date:()=>JA,datetime:()=>HA,duration:()=>YA,time:()=>QA});var jv=b("ZodISODateTime",(r,e)=>{o0.init(r,e),Ze.init(r,e)});function HA(r){return lA(jv,r)}var Lv=b("ZodISODate",(r,e)=>{a0.init(r,e),Ze.init(r,e)});function JA(r){return uA(Lv,r)}var Kv=b("ZodISOTime",(r,e)=>{s0.init(r,e),Ze.init(r,e)});function QA(r){return cA(Kv,r)}var Wv=b("ZodISODuration",(r,e)=>{l0.init(r,e),Ze.init(r,e)});function YA(r){return dA(Wv,r)}var XE=(r,e)=>{Lp.init(r,e),r.name="ZodError",Object.defineProperties(r,{format:{value:t=>Wp(r,t)},flatten:{value:t=>Kp(r,t)},addIssue:{value:t=>{r.issues.push(t),r.message=JSON.stringify(r.issues,tc,2)}},addIssues:{value:t=>{r.issues.push(...t),r.message=JSON.stringify(r.issues,tc,2)}},isEmpty:{get(){return r.issues.length===0}}})},uk=b("ZodError",XE),kr=b("ZodError",XE,{Parent:Error});var XA=nc(kr),e_=oc(kr),t_=ac(kr),r_=sc(kr),i_=Yg(kr),n_=Xg(kr),o_=ev(kr),a_=tv(kr),s_=rv(kr),l_=iv(kr),u_=nv(kr),c_=ov(kr);var Ae=b("ZodType",(r,e)=>(he.init(r,e),r.def=e,r.type=e.type,Object.defineProperty(r,"_def",{value:e}),r.check=(...t)=>r.clone(j.mergeDefs(e,{checks:[...e.checks??[],...t.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]})),r.clone=(t,i)=>hr(r,t,i),r.brand=()=>r,r.register=((t,i)=>(t.add(r,i),r)),r.parse=(t,i)=>XA(r,t,i,{callee:r.parse}),r.safeParse=(t,i)=>t_(r,t,i),r.parseAsync=async(t,i)=>e_(r,t,i,{callee:r.parseAsync}),r.safeParseAsync=async(t,i)=>r_(r,t,i),r.spa=r.safeParseAsync,r.encode=(t,i)=>i_(r,t,i),r.decode=(t,i)=>n_(r,t,i),r.encodeAsync=async(t,i)=>o_(r,t,i),r.decodeAsync=async(t,i)=>a_(r,t,i),r.safeEncode=(t,i)=>s_(r,t,i),r.safeDecode=(t,i)=>l_(r,t,i),r.safeEncodeAsync=async(t,i)=>u_(r,t,i),r.safeDecodeAsync=async(t,i)=>c_(r,t,i),r.refine=(t,i)=>r.check(zS(t,i)),r.superRefine=t=>r.check(US(t)),r.overwrite=t=>r.check(Cn(t)),r.optional=()=>qv(r),r.nullable=()=>Hv(r),r.nullish=()=>qv(Hv(r)),r.nonoptional=t=>FS(r,t),r.array=()=>Xv(r),r.or=t=>D_([r,t]),r.and=t=>fS(r,t),r.transform=t=>Jv(r,T_(t)),r.default=t=>ES(r,t),r.prefault=t=>BS(r,t),r.catch=t=>$S(r,t),r.pipe=t=>Jv(r,t),r.readonly=()=>IS(r),r.describe=t=>{let i=r.clone();return fr.add(i,{description:t}),i},Object.defineProperty(r,"description",{get(){return fr.get(r)?.description},configurable:!0}),r.meta=(...t)=>{if(t.length===0)return fr.get(r);let i=r.clone();return fr.add(i,t[0]),i},r.isOptional=()=>r.safeParse(void 0).success,r.isNullable=()=>r.safeParse(null).success,r)),h_=b("_ZodString",(r,e)=>{Rs.init(r,e),Ae.init(r,e);let t=r._zod.bag;r.format=t.format??null,r.minLength=t.minimum??null,r.maxLength=t.maximum??null,r.regex=(...i)=>r.check(ih(...i)),r.includes=(...i)=>r.check(ah(...i)),r.startsWith=(...i)=>r.check(sh(...i)),r.endsWith=(...i)=>r.check(lh(...i)),r.min=(...i)=>r.check(Aa(...i)),r.max=(...i)=>r.check(dc(...i)),r.length=(...i)=>r.check(pc(...i)),r.nonempty=(...i)=>r.check(Aa(1,...i)),r.lowercase=i=>r.check(nh(i)),r.uppercase=i=>r.check(oh(i)),r.trim=()=>r.check(dh()),r.normalize=(...i)=>r.check(ch(...i)),r.toLowerCase=()=>r.check(ph()),r.toUpperCase=()=>r.check(hh()),r.slugify=()=>r.check(fh())}),vh=b("ZodString",(r,e)=>{Rs.init(r,e),h_.init(r,e),r.email=t=>r.check(Av(f_,t)),r.url=t=>r.check(th(Qv,t)),r.jwt=t=>r.check(Uv(N_,t)),r.emoji=t=>r.check(Bv(m_,t)),r.guid=t=>r.check(eh(Gv,t)),r.uuid=t=>r.check(_v(mo,t)),r.uuidv4=t=>r.check(Pv(mo,t)),r.uuidv6=t=>r.check(Ev(mo,t)),r.uuidv7=t=>r.check(Sv(mo,t)),r.nanoid=t=>r.check(Fv(g_,t)),r.guid=t=>r.check(eh(Gv,t)),r.cuid=t=>r.check(Nv(v_,t)),r.cuid2=t=>r.check(kv(y_,t)),r.ulid=t=>r.check($v(x_,t)),r.base64=t=>r.check(Ov(S_,t)),r.base64url=t=>r.check(Vv(B_,t)),r.xid=t=>r.check(Mv(w_,t)),r.ksuid=t=>r.check(Dv(b_,t)),r.ipv4=t=>r.check(Iv(A_,t)),r.ipv6=t=>r.check(Cv(__,t)),r.cidrv4=t=>r.check(Tv(P_,t)),r.cidrv6=t=>r.check(Rv(E_,t)),r.e164=t=>r.check(zv(F_,t)),r.datetime=t=>r.check(HA(t)),r.date=t=>r.check(JA(t)),r.time=t=>r.check(QA(t)),r.duration=t=>r.check(YA(t))});function d_(r){return nA(vh,r)}var Ze=b("ZodStringFormat",(r,e)=>{je.init(r,e),h_.init(r,e)}),f_=b("ZodEmail",(r,e)=>{Jb.init(r,e),Ze.init(r,e)});function dk(r){return Av(f_,r)}var Gv=b("ZodGUID",(r,e)=>{qb.init(r,e),Ze.init(r,e)});function pk(r){return eh(Gv,r)}var mo=b("ZodUUID",(r,e)=>{Hb.init(r,e),Ze.init(r,e)});function hk(r){return _v(mo,r)}function fk(r){return Pv(mo,r)}function mk(r){return Ev(mo,r)}function gk(r){return Sv(mo,r)}var Qv=b("ZodURL",(r,e)=>{Qb.init(r,e),Ze.init(r,e)});function vk(r){return th(Qv,r)}function yk(r){return th(Qv,{protocol:/^https?$/,hostname:Fi.domain,...j.normalizeParams(r)})}var m_=b("ZodEmoji",(r,e)=>{Yb.init(r,e),Ze.init(r,e)});function xk(r){return Bv(m_,r)}var g_=b("ZodNanoID",(r,e)=>{Xb.init(r,e),Ze.init(r,e)});function wk(r){return Fv(g_,r)}var v_=b("ZodCUID",(r,e)=>{e0.init(r,e),Ze.init(r,e)});function bk(r){return Nv(v_,r)}var y_=b("ZodCUID2",(r,e)=>{t0.init(r,e),Ze.init(r,e)});function Ak(r){return kv(y_,r)}var x_=b("ZodULID",(r,e)=>{r0.init(r,e),Ze.init(r,e)});function _k(r){return $v(x_,r)}var w_=b("ZodXID",(r,e)=>{i0.init(r,e),Ze.init(r,e)});function Pk(r){return Mv(w_,r)}var b_=b("ZodKSUID",(r,e)=>{n0.init(r,e),Ze.init(r,e)});function Ek(r){return Dv(b_,r)}var A_=b("ZodIPv4",(r,e)=>{u0.init(r,e),Ze.init(r,e)});function Sk(r){return Iv(A_,r)}var eS=b("ZodMAC",(r,e)=>{d0.init(r,e),Ze.init(r,e)});function Bk(r){return aA(eS,r)}var __=b("ZodIPv6",(r,e)=>{c0.init(r,e),Ze.init(r,e)});function Fk(r){return Cv(__,r)}var P_=b("ZodCIDRv4",(r,e)=>{p0.init(r,e),Ze.init(r,e)});function Nk(r){return Tv(P_,r)}var E_=b("ZodCIDRv6",(r,e)=>{h0.init(r,e),Ze.init(r,e)});function kk(r){return Rv(E_,r)}var S_=b("ZodBase64",(r,e)=>{m0.init(r,e),Ze.init(r,e)});function $k(r){return Ov(S_,r)}var B_=b("ZodBase64URL",(r,e)=>{g0.init(r,e),Ze.init(r,e)});function Mk(r){return Vv(B_,r)}var F_=b("ZodE164",(r,e)=>{v0.init(r,e),Ze.init(r,e)});function Dk(r){return zv(F_,r)}var N_=b("ZodJWT",(r,e)=>{y0.init(r,e),Ze.init(r,e)});function Ik(r){return Uv(N_,r)}var yh=b("ZodCustomStringFormat",(r,e)=>{x0.init(r,e),Ze.init(r,e)});function Ck(r,e,t={}){return hc(yh,r,e,t)}function Tk(r){return hc(yh,"hostname",Fi.hostname,r)}function Rk(r){return hc(yh,"hex",Fi.hex,r)}function Ok(r,e){let t=e?.enc??"hex",i=`${r}_${t}`,n=Fi[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return hc(yh,i,n,e)}var xh=b("ZodNumber",(r,e)=>{fv.init(r,e),Ae.init(r,e),r.gt=(i,n)=>r.check(ho(i,n)),r.gte=(i,n)=>r.check(Nr(i,n)),r.min=(i,n)=>r.check(Nr(i,n)),r.lt=(i,n)=>r.check(po(i,n)),r.lte=(i,n)=>r.check(Ni(i,n)),r.max=(i,n)=>r.check(Ni(i,n)),r.int=i=>r.check(p_(i)),r.safe=i=>r.check(p_(i)),r.positive=i=>r.check(ho(0,i)),r.nonnegative=i=>r.check(Nr(0,i)),r.negative=i=>r.check(po(0,i)),r.nonpositive=i=>r.check(Ni(0,i)),r.multipleOf=(i,n)=>r.check(Os(i,n)),r.step=(i,n)=>r.check(Os(i,n)),r.finite=()=>r;let t=r._zod.bag;r.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,r.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,r.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),r.isFinite=!0,r.format=t.format??null});function tS(r){return pA(xh,r)}var mc=b("ZodNumberFormat",(r,e)=>{w0.init(r,e),xh.init(r,e)});function p_(r){return fA(mc,r)}function Vk(r){return mA(mc,r)}function zk(r){return gA(mc,r)}function Uk(r){return vA(mc,r)}function jk(r){return yA(mc,r)}var wh=b("ZodBoolean",(r,e)=>{Hp.init(r,e),Ae.init(r,e)});function rS(r){return xA(wh,r)}var bh=b("ZodBigInt",(r,e)=>{mv.init(r,e),Ae.init(r,e),r.gte=(i,n)=>r.check(Nr(i,n)),r.min=(i,n)=>r.check(Nr(i,n)),r.gt=(i,n)=>r.check(ho(i,n)),r.gte=(i,n)=>r.check(Nr(i,n)),r.min=(i,n)=>r.check(Nr(i,n)),r.lt=(i,n)=>r.check(po(i,n)),r.lte=(i,n)=>r.check(Ni(i,n)),r.max=(i,n)=>r.check(Ni(i,n)),r.positive=i=>r.check(ho(BigInt(0),i)),r.negative=i=>r.check(po(BigInt(0),i)),r.nonpositive=i=>r.check(Ni(BigInt(0),i)),r.nonnegative=i=>r.check(Nr(BigInt(0),i)),r.multipleOf=(i,n)=>r.check(Os(i,n));let t=r._zod.bag;r.minValue=t.minimum??null,r.maxValue=t.maximum??null,r.format=t.format??null});function Lk(r){return bA(bh,r)}var k_=b("ZodBigIntFormat",(r,e)=>{b0.init(r,e),bh.init(r,e)});function Kk(r){return _A(k_,r)}function Wk(r){return PA(k_,r)}var iS=b("ZodSymbol",(r,e)=>{A0.init(r,e),Ae.init(r,e)});function Zk(r){return EA(iS,r)}var nS=b("ZodUndefined",(r,e)=>{_0.init(r,e),Ae.init(r,e)});function Gk(r){return SA(nS,r)}var oS=b("ZodNull",(r,e)=>{P0.init(r,e),Ae.init(r,e)});function aS(r){return BA(oS,r)}var sS=b("ZodAny",(r,e)=>{E0.init(r,e),Ae.init(r,e)});function qk(){return FA(sS)}var lS=b("ZodUnknown",(r,e)=>{S0.init(r,e),Ae.init(r,e)});function fc(){return NA(lS)}var uS=b("ZodNever",(r,e)=>{B0.init(r,e),Ae.init(r,e)});function $_(r){return kA(uS,r)}var cS=b("ZodVoid",(r,e)=>{F0.init(r,e),Ae.init(r,e)});function Hk(r){return $A(cS,r)}var Yv=b("ZodDate",(r,e)=>{N0.init(r,e),Ae.init(r,e),r.min=(i,n)=>r.check(Nr(i,n)),r.max=(i,n)=>r.check(Ni(i,n));let t=r._zod.bag;r.minDate=t.minimum?new Date(t.minimum):null,r.maxDate=t.maximum?new Date(t.maximum):null});function Jk(r){return MA(Yv,r)}var dS=b("ZodArray",(r,e)=>{k0.init(r,e),Ae.init(r,e),r.element=e.element,r.min=(t,i)=>r.check(Aa(t,i)),r.nonempty=t=>r.check(Aa(1,t)),r.max=(t,i)=>r.check(dc(t,i)),r.length=(t,i)=>r.check(pc(t,i)),r.unwrap=()=>r.element});function Xv(r,e){return zA(dS,r,e)}function Qk(r){let e=r._zod.def.shape;return C_(Object.keys(e))}var ey=b("ZodObject",(r,e)=>{$0.init(r,e),Ae.init(r,e),j.defineLazy(r,"shape",()=>e.shape),r.keyof=()=>C_(Object.keys(r._zod.def.shape)),r.catchall=t=>r.clone({...r._zod.def,catchall:t}),r.passthrough=()=>r.clone({...r._zod.def,catchall:fc()}),r.loose=()=>r.clone({...r._zod.def,catchall:fc()}),r.strict=()=>r.clone({...r._zod.def,catchall:$_()}),r.strip=()=>r.clone({...r._zod.def,catchall:void 0}),r.extend=t=>j.extend(r,t),r.safeExtend=t=>j.safeExtend(r,t),r.merge=t=>j.merge(r,t),r.pick=t=>j.pick(r,t),r.omit=t=>j.omit(r,t),r.partial=(...t)=>j.partial(R_,r,t[0]),r.required=(...t)=>j.required(O_,r,t[0])});function Yk(r,e){let t={type:"object",shape:r??{},...j.normalizeParams(e)};return new ey(t)}function Xk(r,e){return new ey({type:"object",shape:r,catchall:$_(),...j.normalizeParams(e)})}function e$(r,e){return new ey({type:"object",shape:r,catchall:fc(),...j.normalizeParams(e)})}var M_=b("ZodUnion",(r,e)=>{gv.init(r,e),Ae.init(r,e),r.options=e.options});function D_(r,e){return new M_({type:"union",options:r,...j.normalizeParams(e)})}var pS=b("ZodDiscriminatedUnion",(r,e)=>{M_.init(r,e),M0.init(r,e)});function t$(r,e,t){return new pS({type:"union",options:e,discriminator:r,...j.normalizeParams(t)})}var hS=b("ZodIntersection",(r,e)=>{D0.init(r,e),Ae.init(r,e)});function fS(r,e){return new hS({type:"intersection",left:r,right:e})}var mS=b("ZodTuple",(r,e)=>{vv.init(r,e),Ae.init(r,e),r.rest=t=>r.clone({...r._zod.def,rest:t})});function gS(r,e,t){let i=e instanceof he,n=i?t:e,o=i?e:null;return new mS({type:"tuple",items:r,rest:o,...j.normalizeParams(n)})}var I_=b("ZodRecord",(r,e)=>{I0.init(r,e),Ae.init(r,e),r.keyType=e.keyType,r.valueType=e.valueType});function vS(r,e,t){return new I_({type:"record",keyType:r,valueType:e,...j.normalizeParams(t)})}function r$(r,e,t){let i=hr(r);return i._zod.values=void 0,new I_({type:"record",keyType:i,valueType:e,...j.normalizeParams(t)})}var yS=b("ZodMap",(r,e)=>{C0.init(r,e),Ae.init(r,e),r.keyType=e.keyType,r.valueType=e.valueType});function i$(r,e,t){return new yS({type:"map",keyType:r,valueType:e,...j.normalizeParams(t)})}var xS=b("ZodSet",(r,e)=>{T0.init(r,e),Ae.init(r,e),r.min=(...t)=>r.check(Vs(...t)),r.nonempty=t=>r.check(Vs(1,t)),r.max=(...t)=>r.check(cc(...t)),r.size=(...t)=>r.check(rh(...t))});function n$(r,e){return new xS({type:"set",valueType:r,...j.normalizeParams(e)})}var gh=b("ZodEnum",(r,e)=>{R0.init(r,e),Ae.init(r,e),r.enum=e.entries,r.options=Object.values(e.entries);let t=new Set(Object.keys(e.entries));r.extract=(i,n)=>{let o={};for(let a of i)if(t.has(a))o[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new gh({...e,checks:[],...j.normalizeParams(n),entries:o})},r.exclude=(i,n)=>{let o={...e.entries};for(let a of i)if(t.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new gh({...e,checks:[],...j.normalizeParams(n),entries:o})}});function C_(r,e){let t=Array.isArray(r)?Object.fromEntries(r.map(i=>[i,i])):r;return new gh({type:"enum",entries:t,...j.normalizeParams(e)})}function o$(r,e){return new gh({type:"enum",entries:r,...j.normalizeParams(e)})}var wS=b("ZodLiteral",(r,e)=>{O0.init(r,e),Ae.init(r,e),r.values=new Set(e.values),Object.defineProperty(r,"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 a$(r,e){return new wS({type:"literal",values:Array.isArray(r)?r:[r],...j.normalizeParams(e)})}var bS=b("ZodFile",(r,e)=>{V0.init(r,e),Ae.init(r,e),r.min=(t,i)=>r.check(Vs(t,i)),r.max=(t,i)=>r.check(cc(t,i)),r.mime=(t,i)=>r.check(uh(Array.isArray(t)?t:[t],i))});function s$(r){return UA(bS,r)}var AS=b("ZodTransform",(r,e)=>{z0.init(r,e),Ae.init(r,e),r._zod.parse=(t,i)=>{if(i.direction==="backward")throw new ga(r.constructor.name);t.addIssue=o=>{if(typeof o=="string")t.issues.push(j.issue(o,t.value,e));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=t.value),a.inst??(a.inst=r),t.issues.push(j.issue(a))}};let n=e.transform(t.value,t);return n instanceof Promise?n.then(o=>(t.value=o,t)):(t.value=n,t)}});function T_(r){return new AS({type:"transform",transform:r})}var R_=b("ZodOptional",(r,e)=>{U0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType});function qv(r){return new R_({type:"optional",innerType:r})}var _S=b("ZodNullable",(r,e)=>{j0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType});function Hv(r){return new _S({type:"nullable",innerType:r})}function l$(r){return qv(Hv(r))}var PS=b("ZodDefault",(r,e)=>{L0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType,r.removeDefault=r.unwrap});function ES(r,e){return new PS({type:"default",innerType:r,get defaultValue(){return typeof e=="function"?e():j.shallowClone(e)}})}var SS=b("ZodPrefault",(r,e)=>{K0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType});function BS(r,e){return new SS({type:"prefault",innerType:r,get defaultValue(){return typeof e=="function"?e():j.shallowClone(e)}})}var O_=b("ZodNonOptional",(r,e)=>{W0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType});function FS(r,e){return new O_({type:"nonoptional",innerType:r,...j.normalizeParams(e)})}var NS=b("ZodSuccess",(r,e)=>{Z0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType});function u$(r){return new NS({type:"success",innerType:r})}var kS=b("ZodCatch",(r,e)=>{G0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType,r.removeCatch=r.unwrap});function $S(r,e){return new kS({type:"catch",innerType:r,catchValue:typeof e=="function"?e:()=>e})}var MS=b("ZodNaN",(r,e)=>{q0.init(r,e),Ae.init(r,e)});function c$(r){return IA(MS,r)}var V_=b("ZodPipe",(r,e)=>{H0.init(r,e),Ae.init(r,e),r.in=e.in,r.out=e.out});function Jv(r,e){return new V_({type:"pipe",in:r,out:e})}var z_=b("ZodCodec",(r,e)=>{V_.init(r,e),Jp.init(r,e)});function d$(r,e,t){return new z_({type:"pipe",in:r,out:e,transform:t.decode,reverseTransform:t.encode})}var DS=b("ZodReadonly",(r,e)=>{J0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType});function IS(r){return new DS({type:"readonly",innerType:r})}var CS=b("ZodTemplateLiteral",(r,e)=>{Q0.init(r,e),Ae.init(r,e)});function p$(r,e){return new CS({type:"template_literal",parts:r,...j.normalizeParams(e)})}var TS=b("ZodLazy",(r,e)=>{eA.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.getter()});function RS(r){return new TS({type:"lazy",getter:r})}var OS=b("ZodPromise",(r,e)=>{X0.init(r,e),Ae.init(r,e),r.unwrap=()=>r._zod.def.innerType});function h$(r){return new OS({type:"promise",innerType:r})}var VS=b("ZodFunction",(r,e)=>{Y0.init(r,e),Ae.init(r,e)});function f$(r){return new VS({type:"function",input:Array.isArray(r?.input)?gS(r?.input):r?.input??Xv(fc()),output:r?.output??fc()})}var ty=b("ZodCustom",(r,e)=>{tA.init(r,e),Ae.init(r,e)});function m$(r){let e=new We({check:"custom"});return e._zod.check=r,e}function g$(r,e){return jA(ty,r??(()=>!0),e)}function zS(r,e={}){return LA(ty,r,e)}function US(r){return KA(r)}var v$=WA,y$=ZA;function x$(r,e={error:`Input not instance of ${r.name}`}){let t=new ty({type:"custom",check:"custom",fn:i=>i instanceof r,abort:!0,...j.normalizeParams(e)});return t._zod.bag.Class=r,t}var w$=(...r)=>GA({Codec:z_,Boolean:wh,String:vh},...r);function b$(r){let e=RS(()=>D_([d_(r),tS(),rS(),aS(),Xv(e),vS(d_(),e)]));return e}function A$(r,e){return Jv(T_(r),e)}var _$={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 P$(r){yt({customError:r})}function E$(){return yt().customError}var U_;U_||(U_={});var j_={};Pa(j_,{bigint:()=>N$,boolean:()=>F$,date:()=>k$,number:()=>B$,string:()=>S$});function S$(r){return oA(vh,r)}function B$(r){return hA(xh,r)}function F$(r){return wA(wh,r)}function N$(r){return AA(bh,r)}function k$(r){return DA(Yv,r)}yt(yv());var jS=Et.object({name:Et.string(),bpm:Et.number(),duration:Et.number(),sample_rate:Et.number(),origin:Et.enum(["openDAW","recording","import"])});var oJ=jS.extend({uuid:A.zType(Et)});var $$,M$,D$,I$,C$,T$;$$=new WeakMap,M$=new WeakMap,D$=new WeakMap,I$=new WeakMap,C$=new WeakMap,T$=new WeakMap;var gc=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},R$,O$,L_,K_,W_,V$,z$;O$=new WeakMap,L_=new WeakMap,K_=new WeakMap,W_=new WeakMap,V$=new WeakMap,R$=new WeakSet,z$=function(e){return e.pointerHub.catchupAndSubscribe({onAdded:t=>{let i=Be(t.box,un);D(i.isAttached(),"SelectionBox is not attached");let n=i.selectable.targetVertex.unwrap(()=>`SelectionBox has no target (${i.selectable.targetAddress.unwrapOrUndefined()?.toString()??"No address"})`),o={box:i,selectable:n};gc(this,W_,"f").proxy.onSelected(n),D(gc(this,L_,"f").add(o),"Could not add to entityMap"),D(gc(this,K_,"f").add(o),"Could not add to selectableMap")},onRemoved:t=>{let i=Be(t.box,un),n=gc(this,L_,"f").removeByKey(i.address.uuid);D(n.box===i,"Broken selection");let o=n.selectable;gc(this,W_,"f").proxy.onDeselected(o),gc(this,K_,"f").removeByKey(o.address)}},l.Selection)};var LS=Et.object({name:Et.string(),size:Et.number().int(),url:Et.string(),license:Et.string(),origin:Et.enum(["openDAW","import"])});var wJ=LS.extend({uuid:A.zType(Et)});var KS;(function(r){r.cut=(e,t,i)=>{if(!(e.position>=t||t>=e.complete))if(Rw.isLoopableRegion(e)){let{position:n,complete:o,loopOffset:a,loopDuration:s}=e;e.duration=t-n,e.copyTo({position:t,duration:o-t,loopOffset:Sc(a+(t-n),s),consolidate:i})}else return F("Not yet implemented")},r.clip=(e,t,i)=>{if(Rw.isLoopableRegion(e)){let{position:n,complete:o,loopOffset:a,loopDuration:s}=e;if(o-i<=0)return F(`duration will zero or negative(${o-i})`);e.duration=t-n,e.copyTo({position:i,duration:o-i,loopOffset:Sc(a+(i-n),s)})}else return F("Not yet implemented")}})(KS||(KS={}));var vc;(e=>e.create=(t,i,n,o)=>0|(t?1:0)|(i?2:0)|(n?4:0)|(o?8:0))(vc||={});var _e=class r{static PEAK_DECAY=Math.exp(-1/(sampleRate*.25));static RMS_WINDOW=Math.floor(sampleRate*.1);#e;#t;#r;#i;#n;#o=0;#a=0;#l=0;#s=0;constructor(e,t){this.#e=e,this.#t=t,this.#r=new Float32Array(4),this.#i=O.create(()=>new il(r.RMS_WINDOW),2),this.#n=this.#e.broadcastFloats(this.#t,this.#r,()=>{this.#r[0]=this.#o,this.#r[1]=this.#a,this.#r[2]=this.#l,this.#r[3]=this.#s})}clear(){this.#i[0].clear(),this.#i[1].clear(),this.#o=0,this.#a=0}process(e,t,i=0,n=128){let o=n-i,a=r.PEAK_DECAY**o,s=0,u=0;for(let c=i;c<n;c++){let p=Math.abs(e[c]),d=Math.abs(t[c]);p>s&&(s=p),d>u&&(u=d)}this.#o=Math.max(s,this.#o*a),this.#a=Math.max(u,this.#a*a),this.#l=this.#i[0].processBlock(e,i,n),this.#s=this.#i[1].processBlock(t,i,n)}processStereo([e,t],i=0,n=128){this.process(e,t,i,n)}terminate(){this.#n.terminate()}};var ry=class{#e=new z;#t;#r;#i;#n=g.None;#o;constructor(e,t){this.#t=e,this.#r=t,this.#i=new ee,this.#o=this.#r.getValue(),this.#e.own(this.#r.subscribe(i=>{this.#o=i.getValue(),this.#i.notify(this)}))}get adapter(){return this.#r}get address(){return this.#r.address}subscribe(e){return this.#i.subscribe(e)}getValue(){return this.#o}getUnitValue(){return this.#r.valueMapping.x(this.#o)}onStartAutomation(){D(this.#n.isEmpty(),"Already broadcasting"),this.#n=g.wrap(this.#t.broadcaster.broadcastFloat(this.#r.address,()=>this.getUnitValue()))}updateAutomation(e){let t=this.#r.valueAt(e);return this.#o!==t?(this.#o=t,!0):!1}onStopAutomation(){D(this.#n.nonEmpty(),"Never started broadcasting"),this.#n.unwrap().terminate(),this.#n=g.None,this.#o=this.#r.getValue()}own(e){return this.#e.own(e)}ownAll(...e){this.#e.ownAll(...e)}spawn(){return this.#e.spawn()}terminate(){this.#e.terminate()}};var yc=class{#e;constructor(){this.#e=new Uh}add(e,t){this.#e.add(e,t)}get(e){return this.#e.get(e)}forEach(e){return this.#e.forEach(e)}clear(){this.#e.clear()}};var Xt=class{#e=new z;#t;#r;#i;#n;#o=g.None;constructor(e){this.#t=e,this.#r=new yc,this.#i=[],this.#n=[]}parameterChanged(e,t){return F(`Got update event for ${e}, but has no parameter change method`)}get context(){return this.#t}get eventInput(){return this.#r}bindParameter(e){let t=new ry(this.#t,e);return t.ownAll(e.field.pointerHub.catchupAndSubscribe({onAdded:i=>{this.#o.isEmpty()&&(this.#o=g.wrap(this.#t.updateClock.addEventOutput(this.#r))),this.#n.push(t),t.onStartAutomation()},onRemoved:i=>{O.remove(this.#n,t),this.#n.length===0&&(this.#o.ifSome(n=>n.terminate()),this.#o=g.None),t.onStopAutomation()}},l.Automation),t.subscribe(()=>this.parameterChanged(t))),this.#i.push(t),t}updateParameters(e,t){this.#n.forEach(i=>{i.updateAutomation(e)&&this.parameterChanged(i,t)})}readAllParameters(){this.#i.forEach(e=>this.parameterChanged(e,0))}own(e){return this.#e.own(e)}ownAll(...e){return this.#e.ownAll(...e)}spawn(){return this.#e.spawn()}terminate(){this.#o.ifSome(e=>e.terminate()),this.#o=g.None,this.#i.length=0,this.#e.terminate()}toString(){return`{${this.constructor.name}}`}};var Ah;(e=>e.isOfType=t=>t.type==="update-event")(Ah||={});var iy=class extends Xt{#e=[];constructor(e){super(e),this.own(this.context.registerProcessor(this))}reset(){this.eventInput.clear()}addEventOutput(e){return this.#e.push(e),{terminate:()=>O.remove(this.#e,e)}}process({blocks:e}){e.forEach(({p0:t,p1:i,flags:n},o)=>{if(nt.every(n,1))for(let a of nn.iterate(t,i,tf)){let s={type:"update-event",position:a};this.#e.forEach(u=>u.add(o,s))}})}toString(){return`{${this.constructor.name}}`}};var $e=class extends Xt{constructor(e){super(e)}process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:i,p0:n,s0:o,s1:a,bpm:s}=t,u=null,c=o;for(let p of this.eventInput.get(i)){let d=p.position-n,f=Math.abs(d)<1e-7?o:o+Math.floor(Q.pulsesToSamples(d,s,sampleRate));D(o<=f&&f<=a,()=>`${f} out of bounds. event: ${p.position} (${p.type}), p0: ${n}`),u?.forEach(v=>this.handleEvent(v)),u=null,c<f&&(this.processAudio(t,c,f),c=f),Ah.isOfType(p)?this.updateParameters(p.position,o/sampleRate+Q.pulsesToSeconds(p.position-n,s)):(u??=[]).push(p)}u?.forEach(p=>this.handleEvent(p)),u=null,c<a&&this.processAudio(t,c,a)}),this.eventInput.clear(),this.finishProcess()}introduceBlock(e){}handleEvent(e){return F(`${this} received an event but has no accepting method.`)}finishProcess(){}};var ny=class r{static#e=E.exponential(20/sampleRate,2e4/sampleRate);#t;#r;#i;#n;#o;feedback=.7;cross=0;wet=.75;dry=.75;#a=0;#l=0;#s=0;#u=0;#c=0;#d=!1;#p=!1;constructor(e,t){let i=go(e);this.#t=i,this.#r=[new Float32Array(i),new Float32Array(i)],this.#i=[new wt,new wt],this.#n=new rn,this.#o=t}reset(){this.#l=0,this.#d&&(this.#i.forEach(e=>e.reset()),this.#r.forEach(e=>e.fill(0)),this.#d=!1,this.#p=!1),this.#m()}set offset(e){D(0<=e&&e<this.#t,"Out of bounds"),this.#u!==e&&(this.#u=e,this.#d?this.#w():this.#m())}get offset(){return this.#u}set filter(e){e===0?this.#n.identity():e>0?this.#n.setHighpassParams(r.#e.y(e)):e<0&&this.#n.setLowpassParams(r.#e.y(1+e))}process(e,t,i,n){this.#p?this.#f(e,t,i,n):this.#h(e,t,i,n),this.#d=!0}#h(e,t,i,n){let o=this.#t-1,a=this.#r,s=this.feedback,u=this.wet,c=this.dry,p=this.#l,d=p-Math.floor(this.#s);d<0&&(d+=this.#t);let f=e[0],v=e[1],m=t[0],y=t[1],x=this.#i[0],$=this.#i[1],I=a[0],T=a[1];for(let R=i;R<n;++R){let L=f[R],ae=v[R],xe=x.processFrame(this.#n,I[d]*.96),J=$.processFrame(this.#n,T[d]*.96),oe=this.cross*(J-xe),se=xe+oe,Le=J-oe;I[p]=(L+se)*s+1e-18-1e-18,T[p]=(ae+Le)*s+1e-18-1e-18,m[R]=se*u+L*c,y[R]=Le*u+ae*c,d=++d&o,p=++p&o}this.#l=p}#f(e,t,i,n){let o=this.#t-1,a=this.#r,s=this.feedback,u=this.wet,c=this.dry,p=this.#l;for(let d=i;d<n;++d){0<this.#c?(this.#s+=this.#a,this.#c--):(this.#s=this.#u,this.#p=!1);let f=p-this.#s;f<0&&(f+=this.#t);let v=f|0,m=f-v,y=e[0][d],x=e[1][d],$=a[0][v],I=a[0][v],T=this.#i[0].processFrame(this.#n,$+m*(a[0][v+1&o]-$)),R=this.#i[1].processFrame(this.#n,I+m*(a[1][v+1&o]-I));a[0][p]=y+T*s+1e-18-1e-18,a[1][p]=x+T*s+1e-18-1e-18,t[0][d]=T*u+y*c,t[1][d]=R*u+x*c,p=++p&o}this.#l=p}#m(){this.#s=this.#u,this.#c=0,this.#p=!1}#w(){this.#u!==this.#s&&(this.#c=this.#o,this.#a=(this.#u-this.#s)/this.#c,this.#p=!0)}};var oy=class r extends $e{static ID=0;#e=r.ID++;#t;parameterDelay;parameterFeedback;parameterCross;parameterFilter;parameterDry;parameterWet;#r;#i;#n;#o=g.None;#a=!0;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=this.own(new _e(e.broadcaster,t.address));let{delay:i,feedback:n,cross:o,filter:a,dry:s,wet:u}=t.namedParameter;this.parameterDelay=this.own(this.bindParameter(i)),this.parameterFeedback=this.own(this.bindParameter(n)),this.parameterCross=this.own(this.bindParameter(o)),this.parameterFilter=this.own(this.bindParameter(a)),this.parameterDry=this.own(this.bindParameter(s)),this.parameterWet=this.own(this.bindParameter(u));let c=Q.pulsesToSamples(rr.toPPQN(ui.OffsetFractions[0]),30,sampleRate),p=Math.floor(.5*sampleRate);this.#n=new ny(c,p),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#n.reset(),this.#i.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio({bpm:e,flags:t},i,n){if(this.#o.isEmpty())return;if(this.#a||nt.some(t,8)){let a=this.parameterDelay.getValue(),s=rr.toPPQN(ui.OffsetFractions[a]);this.#n.offset=Q.pulsesToSamples(s,e,sampleRate),this.#a=!1}let o=this.#o.unwrap();this.#n.process(o.channels(),this.#r.channels(),i,n),this.#i.process(this.#r.getChannel(0),this.#r.getChannel(1),i,n)}parameterChanged(e){e===this.parameterDelay?this.#a=!0:e===this.parameterFeedback?this.#n.feedback=this.parameterFeedback.getValue():e===this.parameterCross?this.#n.cross=this.parameterCross.getValue():e===this.parameterFilter?this.#n.filter=this.parameterFilter.getValue():e===this.parameterDry?this.#n.dry=Te(this.parameterDry.getValue()):e===this.parameterWet&&(this.#n.wet=Te(this.parameterWet.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})}`}};var _h=class r extends Xt{static ID=0;#e=r.ID++;#t;#r;#i;#n=g.None;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=this.own(new _e(e.broadcaster,t.address)),this.own(e.registerProcessor(this))}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#n=g.wrap(e),{terminate:()=>this.#n=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}process(e){if(this.#n.isEmpty())return;let t=this.#n.unwrap(),[i,n]=t.channels(),[o,a]=this.#r.channels();for(let s=0;s<128;s++)o[s]=i[s],a[s]=n[s];this.#i.process(o,a)}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#e})`}};var xc=class r extends Xt{static ID=0;#e=r.ID++;#t;#r;#i;#n;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=this.own(new _e(e.broadcaster,t.address)),this.#n=[],this.own(e.registerProcessor(this))}get noteEventTarget(){return g.None}get incoming(){return this}get outgoing(){return this}get uuid(){return this.#t.uuid}reset(){this.#i.clear(),this.#r.clear()}addAudioSource(e){return this.#n.push(e),{terminate:()=>{O.remove(this.#n,e),this.#r.clear()}}}get adapter(){return this.#t}get audioOutput(){return this.#r}process(e){this.#r.clear();let[t,i]=this.#r.channels();for(let n of this.#n){let[o,a]=n.channels();for(let s=0;s<128;s++)t[s]+=o[s],i[s]+=a[s]}this.#r.assertSanity(),this.#i.process(this.#r.getChannel(0),this.#r.getChannel(1))}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#e})}`}};var ve;(s=>{s.Comparator=(u,c)=>{let p=u.position-c.position;return p!==0?p:u.type==="note-complete-event"?-1:c.type==="note-complete-event"?1:0},s.start=(u,c,p,d,f=0)=>({type:"note-event",position:u,duration:c,pitch:p,velocity:d,cent:f,id:++a}),s.startWith=(u,c,p)=>({type:"note-event",position:c??u.position,duration:p??u.duration,pitch:u.pitch,cent:u.cent,velocity:u.velocity,id:++a}),s.stop=({id:u,pitch:c},p)=>({type:"note-complete-event",position:p,pitch:c,id:u}),s.isStart=u=>u.type==="note-event"&&"id"in u&&typeof u.id=="number",s.isStop=u=>u.type==="note-complete-event";let a=0})(ve||={});var Tn=class{#e=new z;#t;#r;#i;#n=g.None;constructor(e,t,i){this.#t=e,this.#r=this.#e.own(new Si(t,i)),this.#i=new Array(16)}setNoteEventSource(e){return D(this.#n.isEmpty(),"NoteEventSource already set"),this.#n=g.wrap(e),this.#t.reset(),K.create(()=>{this.#n=g.None,this.#t.reset()})}introduceBlock({index:e,p0:t,p1:i,flags:n}){if(!this.#n.isEmpty()){for(let o of this.#n.unwrap().processNotes(t,i,n))this.#i.push(o);this.#i.sort(ve.Comparator).forEach(o=>{o.pitch>=0&&o.pitch<=127&&(this.#t.eventInput.add(e,o),this.#o(o))}),this.#i.length=0}}clear(){}terminate(){this.#e.terminate()}#o(e){ve.isStart(e)?this.#r.noteOn(e.pitch):ve.isStop(e)&&this.#r.noteOff(e.pitch)}};var Z_;(e=>e.NotSet={start:()=>F("VoicingStrategy.start"),stop:()=>F("VoicingStrategy.stop"),forceStop:()=>ki,process:()=>F("VoicingStrategy.process"),reset:ki,processing:()=>O.empty()})(Z_||={});var ay=class{#e;#t=[];constructor(e=Z_.NotSet){this.#e=e}set strategy(e){this.#t.push(this.#e),this.#e.forceStop(),this.#e=e}get strategy(){return this.#e}start(e){this.#e.start(e)}stop(e){this.#e.stop(e)}process(e,t,i,n){this.#e.process(e,t,i,n);for(let o=this.#t.length-1;o>=0;o--)this.#t[o].process(e,t,i,n)&&this.#t.splice(o,1)}reset(){this.#t.forEach(e=>e.reset()),this.#t.length=0,this.#e.reset()}};var sy=class{#e;#t=[];#r=[];constructor(e){this.#e=e}start(e){let t=NaN;for(let o=0;o<this.#r.length;o++){let a=this.#r[o];if(!a.gate){t=a.currentFrequency,this.#r.splice(o,1);break}}let i=this.#e.computeFrequency(e),n=this.#e.create();isNaN(t)?n.start(e,i,1,0):(n.start(e,t,1,0),n.startGlide(i,this.#e.glideTime)),this.#r.push(n),this.#t.push(n)}stop(e){this.#t.find(t=>t.id===e)?.stop()}forceStop(){this.#t.forEach(e=>e.forceStop())}reset(){this.#t.length=0,this.#r.length=0}process(e,t,i,n){e.clear(i,n);for(let o=this.#t.length-1;o>=0;o--){let a=this.#t[o];a.process(e,t,i,n)&&(O.removeIf(this.#r,s=>s===a),this.#t.splice(o,1))}return this.#t.length===0}processing(){return this.#t}};var ly=class{#e;#t=[];#r=[];#i=null;#n=null;constructor(e){this.#e=e}start(e){if(this.#r.push(e),Z(this.#i)&&this.#i.gate){this.#i.startGlide(this.#e.computeFrequency(e),this.#e.glideTime);return}Z(this.#n)&&this.#n.forceStop();let t=this.#e.create();t.start(e,this.#e.computeFrequency(e),1,0),this.#i=t,this.#n=t,this.#t.push(t)}stop(e){let t=this.#r.findIndex(i=>i.id===e);if(t!==-1&&(this.#r.splice(t,1),!!Z(this.#i))){if(t===this.#r.length){let i=this.#r.at(-1);if(Z(i)){this.#i.startGlide(this.#e.computeFrequency(i),this.#e.glideTime);return}}this.#r.length===0&&(this.#i.stop(),this.#i=null)}}forceStop(){this.#t.forEach(e=>e.forceStop())}reset(){this.#r.length=0,this.#t.length=0,this.#i=null,this.#n=null}process(e,t,i,n){e.clear(i,n);for(let o=this.#t.length-1;o>=0;o--){let a=this.#t[o];a.process(e,t,i,n)&&(this.#t.splice(o,1),a===this.#i&&(this.#i=null),a===this.#n&&(this.#n=null))}return this.#t.length===0}processing(){return this.#t}};var Ph=class{#e;#t=[];#r=new rl;#i;gate=!0;id=-1;constructor(e,t){this.#e=e,this.#i=t}get currentFrequency(){return this.#r.currentFrequency()}start(e,t,i,n){if(this.id=e.id,this.#r.init(t),this.#i===1){let o=this.#e();o.start(e,t,i,n),this.#t.push(o)}else for(let o=0;o<this.#i;++o){let a=o/(this.#i-1)*2-1,s=this.#e(),u=(1-Math.abs(n))*a+n;s.start(e,t,i/Math.sqrt(this.#i),u),this.#t.push(s)}}startGlide(e,t){this.#r.glideTo(e,t),this.#t.forEach(i=>i.startGlide(e,t))}process(e,t,i,n){this.#r.advance(t.bpm,i,n);for(let o=this.#t.length-1;o>=0;o--)this.#t[o].process(e,t,i,n)&&this.#t.splice(o,1);return this.#t.length===0}stop(){this.#t.forEach(e=>e.stop()),this.gate=!1}forceStop(){this.#t.forEach(e=>e.forceStop()),this.gate=!1}processing(){return this.#t}};var[WS,ZS,G_,GS,qS,uy,HS,JS,cy]=dP(Float32Array,128),Eh=class{device;oscA;oscB;lfo;filter;env;glide;gainASmooth;gainBSmooth;gainVcaSmooth;#e=Ba("NoteEvent not set");#t=1;#r=1;id=-1;phase=0;filter_keyboard_delta=0;constructor(e){this.device=e,this.oscA=new Ic(sampleRate),this.oscB=new Ic(sampleRate),this.lfo=new Hh(sampleRate),this.filter=new jh(Nn.MIN_CUTOFF,Nn.MAX_CUTOFF,sampleRate),this.filter.order=1,this.env=new Xs(sampleRate),this.env.set(this.device.env_attack,this.device.env_decay,this.device.env_sustain,this.device.env_release),this.env.gateOn(),this.glide=new rl,this.gainASmooth=new Mi(.003,sampleRate),this.gainBSmooth=new Mi(.003,sampleRate),this.gainVcaSmooth=new Mi(.003,sampleRate)}start(e,t,i,n){this.#e=e,this.#t=i,this.#r=n,this.filter_keyboard_delta=Jh.keyboardTracking(e.pitch,this.device.parameterFilterKeyboard.getValue()),this.glide.init(t)}stop(){this.env.gateOff()}forceStop(){this.env.forceStop()}startGlide(e,t){this.glide.glideTo(e,t)}get gate(){return this.env.gate}get currentFrequency(){return this.glide.currentFrequency()}process(e,{bpm:t},i,n){let{gainOscA:o,gainOscB:a,oscA_waveform:s,oscB_waveform:u,flt_cutoff:c,flt_resonance:p,flt_env_amount:d,flt_order:f,frequencyAMultiplier:v,frequencyBMultiplier:m,parameterLfoShape:y,parameterLfoRate:x,parameterLfoTargetTune:$,parameterLfoTargetCutoff:I,parameterLfoTargetVolume:T,parameterUnisonDetune:R,parameterUnisonStereo:L}=this.device,ae=el(this.#e.velocity)*this.#t,xe=2**(this.#r*(R.getValue()/1200)),J=this.#r*L.getValue(),[oe,se]=jn.panningToGains(J,on.Linear),[Le,Ge]=e.channels();G_.fill(xe,i,n),this.glide.process(G_,t,i,n),this.lfo.fill(HS,y.getValue(),x.getValue(),i,n),this.env.process(uy,i,n);let St=$.getValue(),er=I.getValue(),qe=T.getValue();for(let Ce=i;Ce<n;Ce++){let Tt=HS[Ce];JS[Ce]=c+this.filter_keyboard_delta+uy[Ce]*d+Tt*er,uy[Ce]*=Jr(ae+Tt*qe);let gr=G_[Ce]*2**(Tt*St);GS[Ce]=gr*v,qS[Ce]=gr*m}this.oscA.generateFromFrequencies(WS,GS,s,i,n),this.oscB.generateFromFrequencies(ZS,qS,u,i,n);for(let Ce=i;Ce<n;Ce++)cy[Ce]=WS[Ce]*this.gainASmooth.process(o)+ZS[Ce]*this.gainBSmooth.process(a);this.filter.order=f,this.filter.process(cy,cy,JS,p,i,n);for(let Ce=i;Ce<n;Ce++){let Tt=this.gainVcaSmooth.process(Jr(uy[Ce])),gr=cy[Ce]*Tt;if(Le[Ce]+=gr*oe,Ge[Ce]+=gr*se,this.env.complete&&Tt<1e-4)return!0}return!1}};var dy=class extends $e{#e;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c;#d;#p;#h;#f;#m;#w;#b;#A;#N;#B;#P;#k;#g;#v;#y;#S;#F;#E;#_;#$;#M;#I;gainOscA=1;gainOscB=1;frequencyAMultiplier=1;frequencyBMultiplier=1;env_attack=1;env_decay=1;env_sustain=1;env_release=1;oscA_waveform=Ue.sine;oscB_waveform=Ue.sine;flt_cutoff=1;flt_resonance=Math.SQRT1_2;flt_env_amount=0;flt_order=1;#C=0;constructor(e,t){super(e),this.#e=t,this.#t=new ay,this.#r=new Tn(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new ge,this.#n=new Xh(sampleRate),this.#o=this.own(new _e(e.broadcaster,t.address));let{namedParameter:i}=this.#e,{oscillators:n}=i;this.#a=this.own(this.bindParameter(n[0].waveform)),this.#l=this.own(this.bindParameter(n[0].octave)),this.#s=this.own(this.bindParameter(n[0].tune)),this.#u=this.own(this.bindParameter(n[0].volume)),this.#c=this.own(this.bindParameter(n[1].waveform)),this.#d=this.own(this.bindParameter(n[1].octave)),this.#p=this.own(this.bindParameter(n[1].tune)),this.#h=this.own(this.bindParameter(n[1].volume)),this.#f=this.own(this.bindParameter(i.attack)),this.#m=this.own(this.bindParameter(i.decay)),this.#w=this.own(this.bindParameter(i.sustain)),this.#b=this.own(this.bindParameter(i.release)),this.#A=this.own(this.bindParameter(i.cutoff)),this.#N=this.own(this.bindParameter(i.resonance)),this.#B=this.own(this.bindParameter(i.filterEnvelope)),this.#P=this.own(this.bindParameter(i.filterOrder)),this.#k=this.own(this.bindParameter(i.filterKeyboard)),this.#g=this.own(this.bindParameter(i.glideTime)),this.#v=this.own(this.bindParameter(i.voicingMode)),this.#y=this.own(this.bindParameter(i.unisonCount)),this.#S=this.own(this.bindParameter(i.unisonDetune)),this.#F=this.own(this.bindParameter(i.unisonStereo)),this.#E=this.own(this.bindParameter(i.lfoWaveform)),this.#_=this.own(this.bindParameter(i.lfoRate)),this.#$=this.own(this.bindParameter(i.lfoTargetTune)),this.#M=this.own(this.bindParameter(i.lfoTargetCutoff)),this.#I=this.own(this.bindParameter(i.lfoTargetVolume));let o=new Float32Array(32);this.ownAll(e.broadcaster.broadcastFloats(t.address.append(0),o,()=>{let a=0;this.#t.strategy.processing().forEach(s=>{let c=Be(s,Ph).processing().at(0);c instanceof Eh&&(o[a++]=c.env.phase),o.length-1}),o[a]=-1}),e.registerProcessor(this)),this.readAllParameters()}computeFrequency(e){return $c(e.pitch+e.cent/100,440)}get glideTime(){return this.#C}get parameterFilterKeyboard(){return this.#k}get parameterLfoShape(){return this.#E}get parameterLfoRate(){return this.#_}get parameterLfoTargetTune(){return this.#$}get parameterLfoTargetCutoff(){return this.#M}get parameterLfoTargetVolume(){return this.#I}get parameterUnisonDetune(){return this.#S}get parameterUnisonStereo(){return this.#F}create(){return new Ph(()=>new Eh(this),this.#y.getValue())}get noteEventTarget(){return g.wrap(this)}introduceBlock(e){this.#r.introduceBlock(e)}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#o.clear(),this.#t.reset(),this.#i.clear(),this.eventInput.clear()}get uuid(){return this.#e.uuid}get audioOutput(){return this.#i}get adapter(){return this.#e}handleEvent(e){ve.isStart(e)?this.#t.start(e):ve.isStop(e)&&this.#t.stop(e.id)}processAudio(e,t,i){this.#t.process(this.#i,e,t,i),this.#n.replace(this.#i,t,i)}parameterChanged(e){if(e===this.#u)this.gainOscA=Te(this.#u.getValue());else if(e===this.#h)this.gainOscB=Te(this.#h.getValue());else if(e===this.#l||e===this.#s)this.frequencyAMultiplier=2**(this.#l.getValue()+this.#s.getValue()/1200);else if(e===this.#d||e===this.#p)this.frequencyBMultiplier=2**(this.#d.getValue()+this.#p.getValue()/1200);else if(e===this.#f)this.env_attack=this.#f.getValue();else if(e===this.#m)this.env_decay=this.#m.getValue();else if(e===this.#w)this.env_sustain=this.#w.getValue();else if(e===this.#b)this.env_release=this.#b.getValue();else if(e===this.#a)this.oscA_waveform=Hr(this.#a.getValue(),Ue);else if(e===this.#c)this.oscB_waveform=Hr(this.#c.getValue(),Ue);else if(e===this.#A)this.flt_cutoff=this.#A.getUnitValue();else if(e===this.#N)this.flt_resonance=this.#N.getValue();else if(e===this.#B)this.flt_env_amount=this.#B.getValue();else if(e===this.#P)this.flt_order=this.#P.getValue();else if(e===this.#g)this.#C=this.#g.getValue()*Q.Bar;else if(e===this.#v){let t=this.#v.getValue();switch(t){case ln.Monophonic:{this.#t.strategy=new ly(this);return}case ln.Polyphonic:{this.#t.strategy=new sy(this);return}default:return F(`Unknown VoicingMode '${t}'`)}}}finishProcess(){this.#i.assertSanity(),this.#o.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{VaporisateurDevice}"}};var py=class{#e;#t;#r;#i;#n=1;#o;#a=0;#l;#s=0;constructor(e,t,i,n,o=0){this.#e=e,this.#t=t,this.#r=i,this.#i=n,this.#o=i.start,this.#l=o,this.#o>=i.end&&(this.#n=4)}done(){return this.#n===4}startFadeOut(e){if(!(this.#n===4||this.#n===3)){if(this.#n===1){let t=this.#a/this.#i;this.#a=this.#i*(1-t)}else this.#a=0;this.#n=3,this.#s=e}}process(e,t){let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],u=o.length===1?o[0]:o[1],c=this.#i,d=this.#r.end-c,f=this.#s,v=this.#n,m=this.#o,y=this.#a;for(let x=this.#l;x<t&&v!==4;x++){let $=e+x,I;if(v===1)I=y/c,++y>=c&&(v=2,y=0);else if(v===3){if(x<f)I=1;else if(I=1-y/c,++y>=c){v=4;break}}else I=1;let T=m|0;if(T>=0&&T<a-1){let R=m-T,L=s[T],ae=u[T];i[$]+=(L+R*(s[T+1]-L))*I,n[$]+=(ae+R*(u[T+1]-ae))*I}m+=1,v===2&&m>=d&&(v=3,y=0)}this.#n=v,this.#o=m,this.#a=y,this.#l=0,this.#s=0}};var hy=class{#e;#t;#r;#i;#n;#o;#a=1;#l;#s=0;#u=0;#c=0;#d;#p=0;constructor(e,t,i,n,o=0){this.#e=e,this.#t=t,this.#r=i,this.#i=n,this.#n=i.start+256,this.#o=i.end-256,this.#l=i.start,this.#d=o,this.#l>=i.end&&(this.#a=4)}done(){return this.#a===4}startFadeOut(e){if(!(this.#a===4||this.#a===3)){if(this.#a===1){let t=this.#s/this.#i;this.#s=this.#i*(1-t)}else this.#s=0;this.#a=3,this.#p=e}}process(e,t){let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],u=o.length===1?o[0]:o[1],c=this.#i,p=this.#n,f=this.#o-c,v=this.#p,m=this.#a,y=this.#l,x=this.#s,$=this.#u,I=this.#c;for(let T=this.#d;T<t&&m!==4;T++){let R=e+T,L;if(m===1)L=x/c,++x>=c&&(m=2,x=0);else if(m===3){if(T<v)L=1;else if(L=1-x/c,++x>=c){m=4;break}}else L=1;let ae=y|0,xe=0,J=0;if(ae>=0&&ae<a-1){let oe=y-ae,se=s[ae],Le=u[ae];xe=se+oe*(s[ae+1]-se),J=Le+oe*(u[ae+1]-Le)}if(y>=f){$===0&&(I=p);let oe=I|0;if(oe>=0&&oe<a-1){let se=I-oe,Le=s[oe],Ge=u[oe],St=Le+se*(s[oe+1]-Le),er=Ge+se*(u[oe+1]-Ge),qe=$/c;xe=xe*(1-qe)+St*qe,J=J*(1-qe)+er*qe}$+=1,I+=1,$>=c&&(y=I,$=0)}i[R]+=xe*L,n[R]+=J*L,y+=1}this.#a=m,this.#l=y,this.#s=x,this.#u=$,this.#c=I,this.#d=0,this.#p=0}};var fy=256,my=class{#e;#t;#r;#i;#n;#o=0;#a;#l=0;#s=1;#u=1;#c=0;#d=0;#p;#h=0;constructor(e,t,i,n,o=0){this.#e=e,this.#t=t,this.#r=n,this.#i=i.start+256,this.#n=i.end-256,this.#a=i.start,this.#p=o,this.#a>=i.end&&(this.#o=4)}done(){return this.#o===4}startFadeOut(e){this.#o!==4&&(this.#s<0||(this.#o===2&&(this.#o=0,this.#l=this.#r),this.#s=-1,this.#h=e))}process(e,t){let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],u=o.length===1?o[0]:o[1],c=this.#r,p=this.#i,d=this.#n,f=d-fy,v=p+fy,m=this.#h,y=this.#o,x=this.#a,$=this.#l,I=this.#s,T=this.#u,R=this.#c,L=this.#d;for(let ae=this.#p;ae<t&&y!==4;ae++){let xe=e+ae,J;if(y===0){if(I<0&&ae<m)J=1;else if(J=$/c,$+=I,$>=c)y=2;else if($<=0){y=4;break}}else J=1;let oe=x|0,se=0,Le=0;if(oe>=0&&oe<a-1){let Ge=x-oe,St=s[oe],er=u[oe];se=St+Ge*(s[oe+1]-St),Le=er+Ge*(u[oe+1]-er)}if(R===0&&(T>0&&x>=f?(R=1,L=d):T<0&&x<=v&&(R=1,L=p)),R>0){let Ge=L|0;if(Ge>=0&&Ge<a-1){let St=L-Ge,er=s[Ge],qe=u[Ge],Ce=er+St*(s[Ge+1]-er),Tt=qe+St*(u[Ge+1]-qe),gr=R/fy,$h=Math.cos(gr*Math.PI*.5),Mh=Math.sin(gr*Math.PI*.5);se=se*$h+Ce*Mh,Le=Le*$h+Tt*Mh}L-=T,R+=1,R>=fy&&(x=L,T=-T,R=0)}i[xe]+=se*J,n[xe]+=Le*J,x+=T}this.#o=y,this.#a=x,this.#l=$,this.#s=I,this.#u=T,this.#c=R,this.#d=L,this.#p=0,this.#h=0}};var Us=class{#e;#t;#r;#i=1;#n;#o=0;#a;#l;#s=0;constructor(e,t,i,n,o=0,a=0){this.#e=e,this.#t=t,this.#r=i,this.#a=n,this.#n=o,this.#l=a,this.#n>=t.numberOfFrames&&(this.#i=4)}get readPosition(){return this.#n}done(){return this.#i===4}isFadingOut(){return this.#i===3}startFadeOut(e){this.#i!==4&&this.#i!==3&&(this.#i=3,this.#o=0,this.#s=e)}setPlaybackRate(e){this.#a=e}process(e,t){let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],u=o.length===1?o[0]:o[1],c=this.#r,p=this.#a,d=a-c*p,f=this.#l,v=this.#s,m=this.#i,y=this.#n,x=this.#o;for(let $=0;$<t&&m!==4;$++){if($<f)continue;let I=e+$,T;if(m===1)T=x/c,++x>=c&&(m=2,x=0);else if(m===3){if($<v)T=1;else if(T=1-x/c,++x>=c){m=4;break}}else T=1;let R=y|0;if(R>=0&&R<a-1){let L=y-R,ae=s[R],xe=u[R];i[I]+=(ae+L*(s[R+1]-ae))*T,n[I]+=(xe+L*(u[R+1]-xe))*T}y+=p,m===2&&y>=d&&(m=3,x=0)}this.#i=m,this.#n=y,this.#o=x,this.#l=0,this.#s=0}};var gy=class extends Xt{#e;#t;#r;#i;constructor(e,t){super(e),this.#e=t,this.#t=new ge(2),this.#r=this.own(new _e(e.broadcaster,t.address)),this.#i=A.newSet(({adapter:{uuid:i}})=>i),this.ownAll(this.#e.deviceHost().audioUnitBoxAdapter().tracks.catchupAndSubscribe({onAdd:i=>this.#i.add({adapter:i,voices:[],lastTransientIndex:-1}),onRemove:i=>this.#i.removeByKey(i.uuid),onReorder:i=>{}}),e.registerProcessor(this))}get noteEventTarget(){return g.None}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#t}reset(){this.#r.clear(),this.#t.clear(),this.eventInput.clear(),this.#i.forEach(e=>{e.voices=[],e.lastTransientIndex=-1})}process({blocks:e}){this.#t.clear(0,128),this.#i.forEach(n=>e.forEach(o=>this.#n(n,o))),this.#t.assertSanity();let[t,i]=this.#t.channels();this.#r.process(t,i)}parameterChanged(e){}#n(e,t){let{adapter:i}=e;if(i.type!==te.Audio||!i.enabled.getValue()){e.voices.forEach(u=>u.startFadeOut(0)),e.lastTransientIndex=-1;return}let{p0:n,p1:o,flags:a}=t;if(!nt.every(a,5))return;let s=this.context.clipSequencing.iterate(i.uuid,n,o);for(let{optClip:u,sectionFrom:c,sectionTo:p}of s)u.match({none:()=>{for(let d of i.regions.collection.iterateRange(n,o)){if(d.mute||!Me(d,Lo))continue;let f=d.file,v=f.getOrCreateLoader().data;if(v.isEmpty())return;let m=d.waveformOffset.getValue(),y=d.asPlayModeTimeStretch;if(y.nonEmpty()){let x=f.transients;if(x.length()<2)return;for(let $ of Wt.locateLoops(d,n,o)){let I=y.unwrap();this.#l(e,t,$,v.unwrap(),I,x,m)}}else for(let x of Wt.locateLoops(d,n,o))this.#o(e,t,x,d,v.unwrap())}},some:d=>{if(!Me(d,Yn))return;let f=d.file,v=f.getOrCreateLoader().data;if(v.isEmpty())return;let m=d.asPlayModeTimeStretch;if(m.nonEmpty()){let y=m.unwrap(),x=f.transients;if(x.length()<2)return;for(let $ of Wt.locateLoops({position:0,loopDuration:d.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},c,p))this.#l(e,t,$,v.unwrap(),y,x,d.waveformOffset.getValue())}else for(let y of Wt.locateLoops({position:0,loopDuration:d.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},c,p))this.#o(e,t,y,d,v.unwrap())}})}#o(e,t,i,n,o){let{p0:a,p1:s,s0:u,s1:c,flags:p}=t,d=c-u,f=s-a,v=(i.resultStart-a)/f,m=(i.resultEnd-a)/f,y=u+d*v,x=u+d*m,$=x-y|0,I=n.waveformOffset.getValue();D(u<=y&&x<=c,()=>`Out of bounds ${y}, ${x}`),nt.some(p,2)&&(e.voices.forEach(R=>R.startFadeOut(0)),e.lastTransientIndex=-1);let T=n.asPlayModePitch;if(T.isEmpty()||n.observableOptPlayMode.isEmpty()){let R=o.numberOfFrames,ae=(i.resultEndValue-i.resultStartValue)*R,xe=(i.resultEnd-i.resultStart)/f*d,J=ae/xe,oe=i.resultStartValue*o.numberOfFrames+I*o.sampleRate;this.#a(e,o,J,oe,0)}else{let L=T.unwrap().warpMarkers,ae=L.first(),xe=L.last();if(ae===null||xe===null){e.voices.forEach(Ge=>Ge.startFadeOut(0));return}let J=i.resultStart-i.rawStart;if(J<ae.position||J>=xe.position){e.voices.forEach(Ge=>Ge.startFadeOut(0));return}let oe=this.#d(J,i.resultStartValue,L),se=this.#u(J,L,o.sampleRate,f,d),Le=(oe+I)*o.sampleRate;this.#a(e,o,se,Le,0)}for(let R of e.voices)R.process(y|0,$);e.voices=e.voices.filter(R=>!R.done())}#a(e,t,i,n,o){if(e.voices.length===0)e.voices.push(new Us(this.#t,t,256,i,n,o));else{let a=!1;for(let s of e.voices)if(s instanceof Us){if(s.isFadingOut())continue;Math.abs(s.readPosition-n)>256?s.startFadeOut(o):(s.setPlaybackRate(i),a=!0)}else s.startFadeOut(o);a||e.voices.push(new Us(this.#t,t,256,i,n,o))}}#l(e,t,i,n,o,a,s){let{p0:u,p1:c,s0:p,s1:d,flags:f}=t;nt.some(f,2)&&(e.lastTransientIndex=-1,e.voices.forEach(qe=>qe.startFadeOut(0)));for(let qe of e.voices)qe instanceof Us&&qe.startFadeOut(0);let v=d-p,m=c-u,y=(i.resultStart-u)/m,x=(i.resultEnd-u)/m,$=p+v*y,I=p+v*x,T=I-$|0,R=o.warpMarkers,L=o.transientPlayMode;D(p<=$&&I<=d,()=>`Out of bounds ${$}, ${I}`);let ae=Y(R.first(),"missing first warp marker"),xe=Y(R.last(),"missing last warp marker"),J=i.resultStart-i.rawStart;if(J<ae.position||J>=xe.position)return;let se=this.#d(J,i.resultStartValue,R)+s;if(se<0||se>=n.numberOfFrames/n.sampleRate)return;let Le=J+m,St=this.#d(Le,i.resultEndValue,R)+s,er=a.floorLastIndex(St);if(er<e.lastTransientIndex&&(e.lastTransientIndex=-1,e.voices.forEach(qe=>qe.startFadeOut(0))),er!==e.lastTransientIndex){let qe=e.lastTransientIndex===-1?er:e.lastTransientIndex+1,Ce=a.optAt(qe);if(Ce!==null){let Tt=this.#s(qe,a,n);if(Rn(Tt))return;let{segment:gr,hasNext:$h,nextTransientSeconds:Mh}=Tt,iP=gr.end-gr.start;if(iP>=256*2){let tB=Ce.position-s,fx=this.#c(tB,R),rB=fx-J,Dh=Math.max(0,Math.min(T-1,rB/m*T|0));e.voices.forEach(mx=>mx.startFadeOut(Dh));let nP=!1;if($h&&L!==_o.Once){let mx=Mh-s,oP=this.#c(mx,R),iB=(oP>fx?oP:xe.position)-fx,nB=T/m,oB=iB*nB,aP=iP,aB=aP-512;nP=oB>aP*1.01&&aB>=2048}L===_o.Once||!nP?e.voices.push(new py(this.#t,n,gr,256,Dh)):L===_o.Repeat?e.voices.push(new hy(this.#t,n,gr,256,Dh)):e.voices.push(new my(this.#t,n,gr,256,Dh))}e.lastTransientIndex=qe}}for(let qe of e.voices)qe.process($|0,T);e.voices=e.voices.filter(qe=>!qe.done())}#s(e,t,i){let n=t.optAt(e);if(n===null)return null;let o=t.optAt(e+1),a=n.position*i.sampleRate,s=o!==null?o.position*i.sampleRate:i.numberOfFrames;return{segment:{start:a,end:s},hasNext:o!==null,nextTransientSeconds:o!==null?o.position:Number.POSITIVE_INFINITY}}#u(e,t,i,n,o){let a=t.floorLastIndex(e),s=t.optAt(a),u=t.optAt(a+1);if(s===null||u===null)return 1;let c=u.position-s.position,f=(u.seconds-s.seconds)*i/c,v=o/n;return f/v}#c(e,t){for(let i=0;i<t.length()-1;i++){let n=t.optAt(i),o=t.optAt(i+1);if(!(n===null||o===null)&&e>=n.seconds&&e<o.seconds){let a=(e-n.seconds)/(o.seconds-n.seconds);return n.position+a*(o.position-n.position)}}return 0}#d(e,t,i){let n=i.floorLastIndex(e),o=i.optAt(n),a=i.optAt(n+1);if(o===null||a===null)return t;let s=(e-o.position)/(a.position-o.position);return o.seconds+s*(a.seconds-o.seconds)}};var $r=class extends Xt{process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:i,p0:n,p1:o,s0:a,bpm:s}=t,u=null,c=n;for(let p of this.eventInput.get(i))u?.forEach(d=>this.handleEvent(t,d)),u=null,c<p.position&&(this.processEvents(t,c,p.position),c=p.position),Ah.isOfType(p)?this.updateParameters(p.position,a/sampleRate+Q.pulsesToSeconds(p.position-n,s)):(u??=[]).push(p);u?.forEach(p=>this.handleEvent(t,p)),u=null,c<o&&this.processEvents(t,c,o)}),this.eventInput.clear()}introduceBlock(e){}};var wc;(t=>(t.create=()=>({mult:1,add:0}),t.apply=(i,n)=>n*i.mult+i.add))(wc||={});var vy=Object.freeze([{name:"up",run:(r,e,t,i,n,o)=>{let a=r.length,s=a*e,u=t%a,c=Math.floor(t%s/a),p=r[u];return ve.start(i,n,p.pitch+c*12,wc.apply(o,p.velocity))}},{name:"down",run:(r,e,t,i,n,o)=>{let a=r.length,s=a*e,u=a-1-t%a,c=e-1-Math.floor(t%s/a),p=r[u];return ve.start(i,n,p.pitch+c*12,wc.apply(o,p.velocity))}},{name:"up-down",run:(r,e,t,i,n,o)=>{let a=r.length,s=a*e,u=Math.max(1,s*2-2),c=t%u,p=c<s?c:u-c,d=p%a,f=Math.floor(p/a),v=r[d];return ve.start(i,n,v.pitch+f*12,wc.apply(o,v.velocity))}}]);var yy=class extends $r{#e;#t;#r;#i;#n;#o;#a;#l;#s;#u=wc.create();#c=g.None;#d=vy[0];#p=NaN;#h=1;#f=1;#m=1;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new tl,this.#i=this.own(this.bindParameter(t.namedParameter.modeIndex)),this.#n=this.own(this.bindParameter(t.namedParameter.rate)),this.#o=this.own(this.bindParameter(t.namedParameter.gate)),this.#a=this.own(this.bindParameter(t.namedParameter.repeat)),this.#l=this.own(this.bindParameter(t.namedParameter.numOctaves)),this.#s=this.own(this.bindParameter(t.namedParameter.velocity)),this.ownAll(e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}get noteEventTarget(){return g.wrap(this)}setNoteEventSource(e){return D(this.#c.isEmpty(),"NoteEventSource already set"),this.#c=g.wrap(e),K.create(()=>this.#c=g.None)}*processNotes(e,t,i){if(this.#r.nonEmpty())if(nt.every(i,2))for(let o of this.#r.releaseAll())yield ve.stop(o,e);else for(let o of this.#r.releaseLinearCompleted(t))yield ve.stop(o,o.position+o.duration);if(this.#c.nonEmpty()){let n=this.#c.unwrap();for(let a of n.processNotes(e,t,i));let o=!nt.every(i,1);for(let{position:a,index:s}of nn.iterateWithIndex(e,t,this.#p)){let u=Array.from(n.iterateActiveNotesAt(a,o));if(u.length===0)continue;let c=Math.floor(s/this.#f),p=Math.max(1,Math.floor(this.#p*this.#h)),d=this.#d.run(u,this.#m,c,a,p,this.#u);this.#r.addAndRetain({...d}),yield d}for(let a of this.#r.releaseLinearCompleted(t))yield ve.stop(a,a.position+a.duration)}}*iterateActiveNotesAt(e,t){this.#c.isEmpty()||t||(yield*this.#r.overlapping(e,ir.Comparator))}reset(){this.#t.length=0,this.#r.clear(),this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){if(e===this.#i)this.#d=vy.at(this.#i.getValue())??vy[0];else if(e===this.#n)this.#p=rr.toPPQN(Gi.RateFractions[this.#n.getValue()]);else if(e===this.#o)this.#h=this.#o.getValue();else if(e===this.#a)this.#f=this.#a.getValue();else if(e===this.#l)this.#m=this.#l.getValue();else if(e===this.#s){let t=this.#s.getValue();t<=0?(this.#u.add=1+t,this.#u.mult=0):(this.#u.add=1-t,this.#u.mult=t)}}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var xy=class extends $r{#e;#t;#r;#i;#n;#o=g.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Si(e.broadcaster,t.address)),this.#r=this.own(this.bindParameter(t.namedParameter.octaves)),this.#i=this.own(this.bindParameter(t.namedParameter.semiTones)),this.#n=this.own(this.bindParameter(t.namedParameter.cent)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return D(this.#o.isEmpty(),"NoteEventSource already set"),this.#o=g.wrap(e),K.create(()=>this.#o=g.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,i){if(!this.#o.isEmpty())for(let n of this.#o.unwrap().processNotes(e,t,i))if(ve.isStart(n)){this.#t.noteOn(n.pitch);let{cent:o,octaves:a,semiTones:s}=this.#e.namedParameter;yield Dr.overwrite(n,{pitch:n.pitch+a.valueAt(n.position)*12+s.valueAt(n.position),cent:n.cent+o.valueAt(n.position)})}else this.#t.noteOff(n.pitch),yield n}*iterateActiveNotesAt(e,t){if(!this.#o.isEmpty()){for(let i of this.#o.unwrap().iterateActiveNotesAt(e,t))if(i.type==="note-event"){let{cent:n,octaves:o,semiTones:a}=this.#e.namedParameter;yield Dr.overwrite(i,{pitch:i.pitch+o.valueAt(i.position)*12+a.valueAt(i.position),cent:i.cent+n.valueAt(i.position)})}}}reset(){this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var wy=class r extends $e{static ID=0;#e=r.ID++;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c;#d;#p;#h;#f;#m;#w;#b;#A;#N;#B;#P;#k;#g;#v;#y;#S;#F;#E;#_;#$;#M;#I;#C;#R;#T;#O;#D=g.None;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=this.own(new _e(e.broadcaster,t.address)),this.#n=new Ks,this.#o=new Float32Array(this.#n.numBins()),this.#a=O.create(()=>new rn,7),this.#l=[new yo(4),new yo(4)],this.#s=[new yo(4),new yo(4)],this.#u=[this.#s,[new wt,new wt],[new wt,new wt],[new wt,new wt],[new wt,new wt],[new wt,new wt],this.#l],this.#c=O.create(()=>!0,7);let i=this.#t.namedParameter;this.#d=this.own(this.bindParameter(i.highPass.enabled)),this.#h=this.own(this.bindParameter(i.highPass.q)),this.#p=this.own(this.bindParameter(i.highPass.frequency)),this.#f=this.own(this.bindParameter(i.highPass.order)),this.#m=this.own(this.bindParameter(i.lowShelf.enabled)),this.#w=this.own(this.bindParameter(i.lowShelf.frequency)),this.#b=this.own(this.bindParameter(i.lowShelf.gain)),this.#A=this.own(this.bindParameter(i.lowBell.enabled)),this.#N=this.own(this.bindParameter(i.lowBell.frequency)),this.#B=this.own(this.bindParameter(i.lowBell.gain)),this.#P=this.own(this.bindParameter(i.lowBell.q)),this.#k=this.own(this.bindParameter(i.midBell.enabled)),this.#g=this.own(this.bindParameter(i.midBell.frequency)),this.#v=this.own(this.bindParameter(i.midBell.gain)),this.#y=this.own(this.bindParameter(i.midBell.q)),this.#S=this.own(this.bindParameter(i.highBell.enabled)),this.#F=this.own(this.bindParameter(i.highBell.frequency)),this.#E=this.own(this.bindParameter(i.highBell.gain)),this.#_=this.own(this.bindParameter(i.highBell.q)),this.#$=this.own(this.bindParameter(i.highShelf.enabled)),this.#M=this.own(this.bindParameter(i.highShelf.frequency)),this.#I=this.own(this.bindParameter(i.highShelf.gain)),this.#C=this.own(this.bindParameter(i.lowPass.enabled)),this.#R=this.own(this.bindParameter(i.lowPass.frequency)),this.#T=this.own(this.bindParameter(i.lowPass.q)),this.#O=this.own(this.bindParameter(i.lowPass.order)),this.ownAll(e.registerProcessor(this),e.broadcaster.broadcastFloats(t.spectrum,this.#o,()=>{this.#o.set(this.#n.bins()),this.#n.decay=!0})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#r.clear(),this.#u.forEach(e=>e.forEach(t=>t.reset())),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#D=g.wrap(e),{terminate:()=>this.#D=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#D.isEmpty())return;let[n,o]=this.#r.channels(),a=this.#D.unwrap();if(this.#c.some(s=>s)){let[s,u]=a.channels();this.#a.forEach((c,p)=>{if(this.#c[p]){let[d,f]=this.#u[p];d.process(c,s,n,t,i),f.process(c,u,o,t,i),s=n,u=o}})}else{let[s,u]=a.channels();for(let c=t;c<i;c++)n[c]=s[c],o[c]=u[c]}this.#i.process(n,o,t,i),this.#n.process(n,o,t,i)}parameterChanged(e){if(e===this.#O){let i=this.#O.getValue()+1;this.#l[0].order=i,this.#l[1].order=i}else if(e===this.#f){let i=this.#f.getValue()+1;this.#s[0].order=i,this.#s[1].order=i}else if(e===this.#p||e===this.#h){let t=this.#p.getValue(),i=this.#h.getValue();this.#a[0].setHighpassParams(t/sampleRate,i)}else if(e===this.#w||e===this.#b){let t=this.#w.getValue(),i=this.#b.getValue();this.#a[1].setLowShelfParams(t/sampleRate,i)}else if(e===this.#N||e===this.#B||e===this.#P){let t=this.#N.getValue(),i=this.#B.getValue(),n=this.#P.getValue();this.#a[2].setPeakingParams(t/sampleRate,n,i)}else if(e===this.#g||e===this.#v||e===this.#y){let t=this.#g.getValue(),i=this.#v.getValue(),n=this.#y.getValue();this.#a[3].setPeakingParams(t/sampleRate,n,i)}else if(e===this.#F||e===this.#E||e===this.#_){let t=this.#F.getValue(),i=this.#E.getValue(),n=this.#_.getValue();this.#a[4].setPeakingParams(t/sampleRate,n,i)}else if(e===this.#M||e===this.#I){let t=this.#M.getValue(),i=this.#I.getValue();this.#a[5].setHighShelfParams(t/sampleRate,i)}else if(e===this.#R||e===this.#T){let t=this.#R.getValue(),i=this.#T.getValue();this.#a[6].setLowpassParams(t/sampleRate,i)}else e===this.#d?this.#c[0]=this.#d.getValue():e===this.#m?this.#c[1]=this.#m.getValue():e===this.#A?this.#c[2]=this.#A.getValue():e===this.#k?this.#c[3]=this.#k.getValue():e===this.#S?this.#c[4]=this.#S.getValue():e===this.#$?this.#c[5]=this.#$.getValue():e===this.#C&&(this.#c[6]=this.#C.getValue())}toString(){return`{${this.constructor.name} (${this.#e})`}};var by=class{roomSize;damp;predelayInSamples;wetGain;dryGain;#e=new Float32Array(2048);#t=new Float32Array(2048);#r=new Float32Array(2048);#i=new Float32Array(2048);#n=new Float32Array(2048);#o=new Float32Array(2048);#a=new Float32Array(2048);#l=new Float32Array(2048);#s=new Float32Array(1024);#u=new Float32Array(512);#c=new Float32Array(512);#d=new Float32Array(256);#p=new Float32Array(2048);#h=new Float32Array(2048);#f=new Float32Array(2048);#m=new Float32Array(2048);#w=new Float32Array(2048);#b=new Float32Array(2048);#A=new Float32Array(2048);#N=new Float32Array(2048);#B=new Float32Array(1024);#P=new Float32Array(512);#k=new Float32Array(512);#g=new Float32Array(256);#v;#y;#S=0;#F=0;#E=0;#_=0;#$=0;#M=0;#I=0;#C=0;#R=0;#T=0;#O=0;#D=0;#V=0;#z=0;#U=0;#j=0;#L=0;#K=0;#W=0;#Z=0;#q=0;#H=0;#J=0;#Q=0;#Y=0;#X=0;#ee=0;#te=0;#re=0;#ie=0;#ne=0;#oe=0;#ae=0;#se=0;#le=0;#ue=0;#ce=0;#de=0;#pe=0;#he=0;#x=0;#G=0;constructor(e=.5){this.#v=go(Math.ceil(e*sampleRate)),this.#y=new Float32Array(this.#v<<1),this.damp=0,this.roomSize=.5,this.wetGain=.3333,this.dryGain=1-this.wetGain,this.#x=0,this.#G=0,this.predelayInSamples=.008*sampleRate,this.clearHistory()}clear(){this.#x=0,this.#G=0,this.clearHistory(),this.clearBuffers()}process(e,t,i,n){let[o,a]=t.channels(),[s,u]=e.channels(),c=.4*this.damp,p=1-c,d=.7+.28*this.roomSize;for(let f=i;f<n;++f){let v=o[f],m=a[f],y=this.#G-this.predelayInSamples;y<0&&(y+=this.#v);let x;x=y<<1;let $=.01,I=this.#y[x]*$,T=this.#y[x+1]*$;x=this.#G<<1,this.#y[x]=v,this.#y[x+1]=m,this.#G=this.#G+1&this.#v-1;let R=this.#x&2047;this.#S=p*this.#F+c*this.#S,this.#e[R]=I+d*this.#S,this.#F=this.#e[this.#x-1617&2047],this.#E=p*this.#_+c*this.#E,this.#t[R]=I+d*this.#E,this.#_=this.#t[this.#x-1557&2047],this.#$=p*this.#M+c*this.#$,this.#r[R]=I+d*this.#$,this.#M=this.#r[this.#x-1491&2047],this.#I=p*this.#C+c*this.#I,this.#i[R]=I+d*this.#I,this.#C=this.#i[this.#x-1422&2047],this.#R=p*this.#T+c*this.#R,this.#n[R]=I+d*this.#R,this.#T=this.#n[this.#x-1356&2047],this.#O=p*this.#D+c*this.#O,this.#o[R]=I+d*this.#O,this.#D=this.#o[this.#x-1277&2047],this.#V=p*this.#z+c*this.#V,this.#a[R]=I+d*this.#V,this.#z=this.#a[this.#x-1188&2047],this.#U=p*this.#j+c*this.#U,this.#l[R]=I+d*this.#U,this.#j=this.#l[this.#x-1116&2047];let L=this.#j+this.#z+this.#D+this.#T+this.#C+this.#M+this.#_+this.#F,ae=this.#L-L,xe=this.#K-ae,J=this.#W-xe;this.#s[this.#x&1023]=L+.5*this.#L,this.#L=this.#s[this.#x-556&1023],this.#u[this.#x&511]=ae+.5*this.#K,this.#K=this.#u[this.#x-441&511],this.#c[this.#x&511]=xe+.5*this.#W,this.#W=this.#c[this.#x-341&511],this.#d[this.#x&255]=J+.5*this.#Z,this.#Z=this.#d[this.#x-225&255],s[f]=this.dryGain*v+this.wetGain*(this.#Z-J),this.#q=p*this.#H+c*this.#q,this.#p[R]=T+d*this.#q,this.#H=this.#p[this.#x-1640&2047],this.#J=p*this.#Q+c*this.#J,this.#h[R]=T+d*this.#J,this.#Q=this.#h[this.#x-1580&2047],this.#Y=p*this.#X+c*this.#Y,this.#f[R]=T+d*this.#Y,this.#X=this.#f[this.#x-1514&2047],this.#ee=p*this.#te+c*this.#ee,this.#m[R]=T+d*this.#ee,this.#te=this.#m[this.#x-1445&2047],this.#re=p*this.#ie+c*this.#re,this.#w[R]=T+d*this.#re,this.#ie=this.#w[this.#x-1379&2047],this.#ne=p*this.#oe+c*this.#ne,this.#b[R]=T+d*this.#ne,this.#oe=this.#b[this.#x-1300&2047],this.#ae=p*this.#se+c*this.#ae,this.#A[R]=T+d*this.#ae,this.#se=this.#A[this.#x-1211&2047],this.#le=p*this.#ue+c*this.#le,this.#N[R]=T+d*this.#le,this.#ue=this.#N[this.#x-1139&2047];let oe=this.#ue+this.#se+this.#oe+this.#ie+this.#te+this.#X+this.#Q+this.#H,se=this.#ce-oe,Le=this.#de-se,Ge=this.#pe-Le;this.#B[this.#x&1023]=oe+.5*this.#ce,this.#ce=this.#B[this.#x-579&1023],this.#P[this.#x&511]=se+.5*this.#de,this.#de=this.#P[this.#x-464&511],this.#k[this.#x&511]=Le+.5*this.#pe,this.#pe=this.#k[this.#x-364&511],this.#g[this.#x&255]=Ge+.5*this.#he,this.#he=this.#g[this.#x-248&255],u[f]=this.dryGain*m+this.wetGain*(this.#he-Ge),this.#x++}}clearBuffers(){this.#e.fill(0),this.#t.fill(0),this.#r.fill(0),this.#i.fill(0),this.#n.fill(0),this.#o.fill(0),this.#a.fill(0),this.#l.fill(0),this.#s.fill(0),this.#u.fill(0),this.#c.fill(0),this.#d.fill(0),this.#p.fill(0),this.#h.fill(0),this.#f.fill(0),this.#m.fill(0),this.#w.fill(0),this.#b.fill(0),this.#A.fill(0),this.#N.fill(0),this.#B.fill(0),this.#P.fill(0),this.#k.fill(0),this.#g.fill(0),this.#y.fill(0)}clearHistory(){this.#S=0,this.#F=0,this.#E=0,this.#_=0,this.#$=0,this.#M=0,this.#I=0,this.#C=0,this.#R=0,this.#T=0,this.#O=0,this.#D=0,this.#V=0,this.#z=0,this.#U=0,this.#j=0,this.#L=0,this.#K=0,this.#W=0,this.#Z=0,this.#q=0,this.#H=0,this.#J=0,this.#Q=0,this.#Y=0,this.#X=0,this.#ee=0,this.#te=0,this.#re=0,this.#ie=0,this.#ne=0,this.#oe=0,this.#ae=0,this.#se=0,this.#le=0,this.#ue=0,this.#ce=0,this.#de=0,this.#pe=0,this.#he=0}};var Ay=class r extends $e{static ID=0;#e=r.ID++;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c=g.None;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=this.own(new _e(e.broadcaster,t.address)),this.#n=new by;let{decay:i,preDelay:n,damp:o,wet:a,dry:s}=this.#t.namedParameter;this.#o=this.own(this.bindParameter(i)),this.#a=this.own(this.bindParameter(n)),this.#l=this.own(this.bindParameter(o)),this.#s=this.own(this.bindParameter(a)),this.#u=this.own(this.bindParameter(s)),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#n.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#c=g.wrap(e),{terminate:()=>this.#c=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#c.isEmpty())return;this.#n.process(this.#r,this.#c.unwrap(),t,i);let[n,o]=this.#r.channels();this.#i.process(n,o,t,i)}parameterChanged(e){this.#o===e?this.#n.roomSize=this.#o.getValue():this.#a===e?this.#n.predelayInSamples=Math.ceil(this.#a.getValue()*sampleRate):this.#l===e?this.#n.damp=this.#l.getValue():this.#s===e?this.#n.wetGain=Te(this.#s.getValue()):this.#u===e&&(this.#n.dryGain=Te(this.#u.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})`}};var _y=class extends $e{#e;#t;#r;#i;#n;#o;#a;gain=1;release=1;loader=g.None;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new ge,this.#i=new Tn(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#n=this.own(new _e(e.broadcaster,t.address)),this.#o=this.own(this.bindParameter(this.#e.namedParameter.volume)),this.#a=this.own(this.bindParameter(this.#e.namedParameter.release)),this.ownAll(e.registerProcessor(this),t.box.file.catchupAndSubscribe(i=>this.loader=i.targetVertex.map(({box:n})=>e.sampleManager.getOrCreate(n.address.uuid)))),this.readAllParameters()}get noteEventTarget(){return g.wrap(this)}introduceBlock(e){this.#i.introduceBlock(e)}setNoteEventSource(e){return this.#i.setNoteEventSource(e)}get incoming(){return this}get outgoing(){return this}reset(){this.#t.length=0,this.#r.clear(),this.eventInput.clear(),this.#i.clear(),this.#n.clear()}get uuid(){return this.#e.uuid}get audioOutput(){return this.#r}get adapter(){return this.#e}handleEvent(e){ve.isStart(e)?this.#t.push(new J_(this,e)):ve.isStop(e)&&this.#t.find(t=>t.event().id===e.id)?.stop()}processAudio(e,t,i){this.#r.clear(t,i);for(let n=this.#t.length-1;n>=0;n--)this.#t[n].processAdd(this.#r,t,i)&&this.#t.splice(n,1)}parameterChanged(e){e===this.#o?this.gain=Te(this.#o.getValue()):e===this.#a&&(this.release=this.#a.getValue()*sampleRate)}finishProcess(){this.#r.assertSanity(),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1))}toString(){return"{NanoDevice}"}},J_=class{#e;#t;#r=1;#i=0;#n=.003*sampleRate|0;#o=0;#a=Number.POSITIVE_INFINITY;constructor(e,t){this.#e=e,this.#t=t,this.#r=Math.pow(2,(t.pitch+t.cent/100)/12-5)}event(){return this.#t}stop(){this.#a=this.#o}processAdd(e,t,i){let n=this.#e.loader;if(n.isEmpty())return!0;let o=n.unwrap();return o.data.isEmpty()?!0:this.processSimple(e.channels(),o.data.unwrap(),t,i)}processSimple(e,t,i,n){let[o,a]=e,s=t.frames[0],u=t.frames[1]??s,c=t.numberOfFrames,p=t.sampleRate/sampleRate,d=this.#e.gain*this.#t.velocity,f=this.#e.release,v=1/f;for(let m=i;m<n;m++){let y=this.#i|0;if(y>=c-1)return!0;let x=this.#i-y,$=this.#o<this.#n?this.#o/this.#n:1,I=(Math.min(1-(this.#o-this.#a)*v,1)*$)**2,T=s[y]*(1-x)+s[y+1]*x,R=u[y]*(1-x)+u[y+1]*x;if(o[m]+=T*d*I,a[m]+=R*d*I,this.#i+=this.#r*p,++this.#o-this.#a>f)return!0}return!1}};var Py=class extends $r{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=new Tn(this,e.broadcaster,t.adapter.audioUnitBoxAdapter().address),this.own(e.registerProcessor(this)),this.readAllParameters()}introduceBlock(e){this.#t.introduceBlock(e)}setNoteEventSource(e){return this.#t.setNoteEventSource(e)}reset(){this.eventInput.clear(),this.#t.clear()}processEvents(e,t,i){}handleEvent({index:e},t){ve.isStart(t)?this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:i})=>i.add(e,t)):ve.isStop(t)&&this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:i})=>i.add(e,t))}toString(){return"{PlayfieldSequencer}"}};var Ey=class extends $e{#e;#t;#r;#i;#n;constructor(e,t){super(e),this.#e=t,this.#t=new ge,this.#r=this.own(new _e(e.broadcaster,t.adapter.address)),this.#i=[],this.#n=new yc,this.own(e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}setAudioSource(e){return this.#i.push(e),{terminate:()=>{O.remove(this.#i,e),this.#t.clear()}}}get audioOutput(){return this.#t}get eventInput(){return this.#n}processAudio(e,t,i){}reset(){this.#r.clear()}finishProcess(){this.#t.clear();let[e,t]=this.#t.channels();for(let i of this.#i){let[n,o]=i.channels();for(let a=0;a<128;a++)e[a]+=n[a],t[a]+=o[a]}this.#t.assertSanity(),this.#r.process(this.#t.getChannel(0),this.#t.getChannel(1))}toString(){return"{PlayfieldMixProcessor}"}};var Sy=class r{static create(e,t,i,n){return new r(e,t,i,n)}#e=new z;#t;#r;#i=[];#n=!0;constructor(e,t,i,n){this.#t=A.newSet(({device:o})=>o.uuid),this.#r=this.#e.own(new z),this.#e.ownAll(t.catchupAndSubscribe({onAdd:o=>{this.invalidateWiring();let a=Fh.create(e,o.box),s=this.#t.add({device:a,subscription:a.adapter().enabledField.subscribe(()=>this.invalidateWiring())});D(s,"Could not add.")},onRemove:o=>{this.invalidateWiring();let{device:a,subscription:s}=this.#t.removeByKey(o.uuid);s.terminate(),a.terminate()},onReorder:o=>this.invalidateWiring()}),e.subscribeProcessPhase(o=>{if(o===0&&this.#n){let a=i;O.replace(this.#i,t.adapters().map(({uuid:s})=>this.#t.get(s).device));for(let s of this.#i)s.adapter().enabledField.getValue()&&(this.#r.own(s.setAudioSource(a.audioOutput)),this.#r.own(e.registerEdge(a.outgoing,s.incoming)),a=s);this.#r.own(n.setAudioSource(a.audioOutput)),this.#r.own(e.registerEdge(a.outgoing,n.incoming)),this.#n=!1}}))}invalidateWiring(){this.#r.terminate(),this.#n=!0}terminate(){this.#e.terminate(),this.#t.forEach(({device:e})=>e.terminate()),this.#t.clear(),this.#i=[]}toString(){return`{${this.constructor.name}}`}};var Nh=Math.floor(.005*sampleRate),Fy=class{#e;#t;#r;#i;#n;#o;#a=0;#l=Number.POSITIVE_INFINITY;#s;#u;#c;#d;#p;#h;#f=!0;#m=!1;constructor(e,t,i,n){this.#e=e,this.#t=t,this.#i=i,this.#r=n,this.#n=e.gate,this.#o=el(this.#r.velocity);let{attack:o,release:a,sampleStart:s,sampleEnd:u}=this.#t;this.#s=o.getValue()*sampleRate,this.#u=a.getValue()*sampleRate,this.#c=(i.numberOfFrames-1)*s.getValue(),this.#d=(i.numberOfFrames-1)*u.getValue(),this.#p=this.#c,this.#h=0}get sample(){return this.#e}get event(){return this.#r}get position(){return this.#p}get envelope(){return this.#h}release(e=!1){this.#f&&(e?(this.#u=Nh,this.#w(),this.#f=!1):this.#n!==In.Off&&this.#w())}processAdd(e,t,i){let[n,o]=e,{frames:a,numberOfFrames:s}=this.#i,u=a[0],c=a[1]??u,{pitch:p}=this.#t,d=this.#d-this.#c,f=Math.sign(d),v=this.#i.sampleRate/sampleRate*f*2**(p.getValue()/1200),m=0;for(let y=t;y<i;y++){let x=this.#p|0,$=this.#p-x,I=u[x]*(1-$)+(u[x+1]??0)*$,T=c[x]*(1-$)+(c[x+1]??0)*$;if(m=Math.min(this.#a/this.#s,1-(this.#a-(this.#l+this.#s))/this.#u,1),this.#p+=v,f>0){if(this.#n===In.Off){if(this.#p>=s)return!0;!this.#m&&this.#p>=this.#d&&this.#w()}else if(this.#n===In.On){if(this.#p>=this.#d-Nh){if(this.#p>=this.#d)return!0;m*=(this.#d-this.#p)/Nh}}else if(this.#n===In.Loop)for(;this.#p>=this.#d;)this.#p-=d}else if(f<0){if(this.#n===In.Off){if(this.#p<=0)return!0;!this.#m&&this.#p<=this.#d&&this.#w()}else if(this.#n===In.On){if(this.#p<=this.#d+Nh){if(this.#p<=this.#d)return!0;m*=(this.#d-this.#p)/Nh}}else if(this.#n===In.Loop)for(;this.#p<=this.#d;)this.#p-=d}if(++this.#a-this.#l>this.#s+this.#u)return!0;m*=this.#o*m,n[y]+=I*m,o[y]+=T*m}return this.#h=m,!1}toString(){return"{PlayfieldSampleVoice}"}#w(){this.#m||(this.#m=!0,this.#l=this.#a<this.#s?this.#a-this.#s:this.#a)}};var Ny=class extends $e{#e;#t;#r;#i;#n;#o;constructor(e,t,i,n){super(e),this.#e=t,this.#t=i,this.#r=[],this.#i=new ge,this.#n=this.own(new _e(e.broadcaster,i.peakAddress));let{sampleStart:o,sampleEnd:a,attack:s,release:u,pitch:c}=i.namedParameter;this.#o=Object.freeze({sampleStart:this.own(this.bindParameter(o)),sampleEnd:this.own(this.bindParameter(a)),attack:this.own(this.bindParameter(s)),release:this.own(this.bindParameter(u)),pitch:this.own(this.bindParameter(c))});let p=new Float32Array(16);this.ownAll(Sy.create(e,i.audioEffects,this,n),e.broadcaster.broadcastFloats(i.address,p,()=>{let d=this.#r.length<p.length?this.#r:this.#r.slice(0,p.length);d.forEach(({position:f},v)=>p[v]=f),p[d.length]=-1}),e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#i}get adapter(){return this.#t}handleEvent(e){if(ve.isStart(e)){let t=this.#t.file().flatMap(p=>p.getOrCreateLoader().data);if(t.isEmpty())return;let{mute:i,solo:n,polyphone:o,exclude:a}=this.#t.namedParameter,s=i.getValue(),u=n.getValue();if(s||this.#e.hasSolo()&&!u)return;o.getValue()||this.#r.forEach(p=>p.release(!0)),a.getValue()&&this.#e.stopExcludeOthers(this.#t),this.#r.push(new Fy(this.#t,this.#o,t.unwrap(),e))}else ve.isStop(e)&&this.#r.find(t=>t.event.id===e.id)?.release()}processAudio(e,t,i){this.#i.clear(t,i);for(let n=this.#r.length-1;n>=0;n--)this.#r[n].processAdd(this.#i.channels(),t,i)&&this.#r.splice(n,1)}forceStop(){this.#r.forEach(e=>e.release(!0))}parameterChanged(e){}reset(){this.#r.length=0,this.#i.clear(),this.#n.clear()}finishProcess(){this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return`{PlayfieldSampleProcessor note: ${this.#t.indexField.getValue()}}`}};var ky=class{#e=new z;#t;#r;#i;#n;constructor(e,t){this.#t=t,this.#r=this.#e.own(new Py(e,this)),this.#i=this.#e.own(new Ey(e,this)),this.#n=A.newSet(i=>i.uuid),this.#e.ownAll(t.samples.catchupAndSubscribe({onAdd:i=>{let n=new Ny(e,this,i,this.#i);this.#n.add({uuid:i.uuid,processor:n,terminable:e.registerEdge(this.#r,n)}),e.sampleManager.getOrCreate(i.fileUUID())},onRemove:i=>{let{terminable:n,processor:o}=this.#n.removeByKey(i.uuid);n.terminate(),o.terminate()},onReorder:i=>{}}),{terminate:()=>{this.#n.forEach(({terminable:i,processor:n})=>{i.terminate(),n.terminate()}),this.#n.clear()}})}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get noteEventTarget(){return g.wrap(this)}get incoming(){return this.#r}get outgoing(){return this.#i}optSampleProcessor(e){return this.#t.samples.getAdapterByIndex(e).flatMap(t=>this.#n.opt(t.uuid)).map(t=>t.processor)}hasSolo(){return this.#t.samples.adapters().some(e=>e.namedParameter.solo.getValue())}stopExcludeOthers(e){for(let t of this.#t.samples.adapters())t.exclude&&t!==e&&this.#n.opt(t.uuid).ifSome(({processor:i})=>i.forceStop())}get uuid(){return this.#t.uuid}get adapter(){return this.#t}get audioOutput(){return this.#i.audioOutput}parameterChanged(e){}terminate(){this.#e.terminate()}toString(){return"{PlayfieldDeviceProcessor}"}};var $y=class extends $e{#e;#t;#r;#i=Zt.stereoMatrix(sampleRate);#n={gain:0,panning:0,stereo:0,invertL:!1,invertR:!1,swap:!1};#o;#a;#l;#s;#u;#c;#d=g.None;#p=on.Linear;#h=!0;#f=!1;constructor(e,t){super(e),this.#e=t,this.#t=new ge,this.#r=this.own(new _e(e.broadcaster,t.address)),this.#o=this.own(this.bindParameter(t.namedParameter.volume)),this.#a=this.own(this.bindParameter(t.namedParameter.panning)),this.#l=this.own(this.bindParameter(t.namedParameter.stereo)),this.#s=this.own(this.bindParameter(t.namedParameter.invertL)),this.#u=this.own(this.bindParameter(t.namedParameter.invertR)),this.#c=this.own(this.bindParameter(t.namedParameter.swap)),this.ownAll(t.box.panningMixing.catchupAndSubscribe(i=>{this.#p=i.getValue(),this.#h=!0}),e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#t.clear(),this.eventInput.clear(),this.#f=!1}get uuid(){return this.#e.uuid}get audioOutput(){return this.#t}setAudioSource(e){return this.#d=g.wrap(e),{terminate:()=>this.#d=g.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}processAudio(e,t,i){if(this.#d.isEmpty())return;this.#h&&(this.#i.update(this.#n,this.#p,this.#f),this.#h=!1);let n=this.#d.unwrap().channels(),o=this.#t.channels();this.#i.processFrames(n,o,t,i),this.#r.processStereo(o,t,i),this.#f=!0}parameterChanged(e){switch(e){case this.#o:this.#n.gain=Te(this.#o.getValue()),this.#h=!0;return;case this.#a:this.#n.panning=this.#a.getValue(),this.#h=!0;return;case this.#l:this.#n.stereo=this.#l.getValue(),this.#h=!0;return;case this.#s:this.#n.invertL=this.#s.getValue(),this.#h=!0;return;case this.#u:this.#n.invertR=this.#u.getValue(),this.#h=!0;return;case this.#c:this.#n.swap=this.#c.getValue(),this.#h=!0;return}}toString(){return`{${this.constructor.name}}`}};var My=class extends $r{#e;#t;#r=g.None;#i=g.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Si(e.broadcaster,t.address)),this.ownAll(t.box.groove.catchupAndSubscribe(i=>{this.#r.ifSome(n=>n.terminate()),this.#r=g.wrap(i.targetVertex.isEmpty()?null:e.boxAdapters.adapterFor(i.targetVertex.unwrap().box,$s.checkType))}),K.create(()=>{this.#r.ifSome(i=>i.terminate()),this.#r=g.None}),e.registerProcessor(this))}get uuid(){return this.#e.uuid}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}setNoteEventSource(e){return D(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=g.wrap(e),K.create(()=>this.#i=g.None)}*processNotes(e,t,i){if(this.#i.isEmpty())return;let n=this.#i.unwrap(),o=this.#r.mapOr(Pc,Dc.Identity);for(let a of n.processNotes(o.unwarp(e),o.unwarp(t),i))ve.isStart(a)?this.#t.noteOn(a.pitch):this.#t.noteOff(a.pitch),yield Dr.overwrite(a,{position:ce(o.warp(a.position),e,t)})}*iterateActiveNotesAt(e,t){if(this.#i.isEmpty())return;let i=this.#i.unwrap(),n=this.#r.mapOr(Pc,Dc.Identity);for(let o of i.iterateActiveNotesAt(n.unwarp(e),t))yield Dr.overwrite(o,{position:n.warp(o.position)})}reset(){this.eventInput.clear()}parameterChanged(e){}handleEvent(e,t){}processEvents(e,t,i){}};var Dy=class extends $r{#e;#t;#r=g.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Si(e.broadcaster,t.address)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return D(this.#r.isEmpty(),"NoteEventSource already set"),this.#r=g.wrap(e),K.create(()=>this.#r=g.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,i){if(!this.#r.isEmpty())for(let n of this.#r.unwrap().processNotes(e,t,i))yield n}*iterateActiveNotesAt(e,t){if(!this.#r.isEmpty())for(let i of this.#r.unwrap().iterateActiveNotesAt(e,t))yield i}reset(){this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Iy=(r,e)=>(r[e]??r[e.toString()])?.value,bc=(r,e,t)=>Iy(e,t)??Iy(r,t),QS=new Float32Array(128),Cy=class{event;sampleData;envelope;#e;rootKey;sampleRate;loopStart;loopEnd;pan;shouldLoop;playbackPosition=0;isReleasing=!1;constructor(e,t,i,n){this.event=e;let o=t.generators,a=i?.generators,s=Iy(a,53)??0,u=i?.sample??n.samples[s];this.sampleData=u.data,this.rootKey=Iy(a,58)??u?.header.originalPitch??60,this.sampleRate=u?.header.sampleRate??sampleRate,this.loopStart=u?.header.startLoop??0,this.loopEnd=u?.header.endLoop??this.sampleData.length;let c=bc(o,a,54)??0;this.shouldLoop=c===1||c===3,this.pan=(bc(o,a,17)??0)/1e3;let p=bc(o,a,34),d=bc(o,a,36),f=bc(o,a,37),v=bc(o,a,38),m=Ea(p)?Math.pow(2,p/1200):.005,y=Ea(d)?Math.pow(2,d/1200):.005,x=1-(f??0)/1e3,$=Ea(v)?Math.pow(2,v/1200):.005;this.envelope=new Xs(sampleRate),this.envelope.set(m,y,x,$),this.envelope.gateOn(),this.#e=new Mi(.003,sampleRate)}release(){this.isReleasing=!0,this.envelope.gateOff()}processAdd(e,t,i){let o=$c(this.event.pitch+this.event.cent/100,440)/$c(this.rootKey,440)*(this.sampleRate/sampleRate),a=el(this.event.velocity),s=Math.cos((this.pan+1)*Math.PI/4),u=Math.sin((this.pan+1)*Math.PI/4);this.envelope.process(QS,t,i);let c=e.getChannel(0),p=e.getChannel(1);for(let d=t;d<i;d++){let f=Math.floor(this.playbackPosition),m=this.#t(f)/32768*a*this.#e.process(QS[d]);if(c[d]+=m*s,p[d]+=m*u,this.playbackPosition+=o,this.shouldLoop)this.playbackPosition>=this.loopEnd&&this.loopEnd>this.loopStart&&(this.playbackPosition=this.loopStart+(this.playbackPosition-this.loopEnd));else if(this.playbackPosition>=this.sampleData.length-1)return!0}return this.envelope.complete&&this.#e.value<1e-4}#t(e){if(e>=this.sampleData.length-1)return this.sampleData[this.sampleData.length-1];let t=this.playbackPosition-e;return this.sampleData[e]*(1-t)+this.sampleData[e+1]*t}};var Ty=class extends $e{#e;#t;#r;#i;#n;#o=g.None;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new Tn(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new ge,this.#n=this.own(new _e(e.broadcaster,t.address)),this.ownAll(e.registerProcessor(this),t.box.file.catchupAndSubscribe(i=>this.#o=i.targetVertex.map(({box:n})=>e.soundfontManager.getOrCreate(n.address.uuid))))}introduceBlock(e){this.#r.introduceBlock(e)}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get noteEventTarget(){return g.wrap(this)}get incoming(){return this}get outgoing(){return this}get uuid(){return this.#e.uuid}get audioOutput(){return this.#i}get adapter(){return this.#e}reset(){this.#r.clear(),this.#n.clear(),this.#t.length=0,this.#i.clear(),this.eventInput.clear()}handleEvent(e){let t=this.#o.flatMap(n=>n.soundfont);if(t.isEmpty())return;let i=t.unwrap();if(ve.isStart(e)){let n=i.presets[this.#e.presetIndex]??i.presets[0];if(sP(n)){console.warn("No preset available");return}let o=0;for(let a of n.zones){let s=Math.round(e.velocity*127);if(this.#a(e.pitch,s,a)){let u=a.instrument.zones;for(let c=0;c<u.length;c++){let p=u[c];this.#a(e.pitch,s,p)&&(this.#t.push(new Cy(e,a,p,i)),o++)}}}}else ve.isStop(e)&&this.#t.forEach(n=>{n.event.id===e.id&&n.release()})}processAudio(e,t,i){this.#i.clear(t,i);for(let n=this.#t.length-1;n>=0;n--)this.#t[n].processAdd(this.#i,t,i)&&this.#t.splice(n,1)}finishProcess(){this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{SoundfontDevice}"}#a(e,t,i){return this.#l(i.generators[44]?.range,t)&&this.#l(i.generators[43]?.range,e)}#l(e,t){return Ws(e)||t>=e.lo&&t<=e.hi}};var YS=r=>r>0?20*Math.log10(r):-100,XS=r=>Math.pow(10,r*.05);var Ry=class{#e=.08;#t=1;#r;#i;#n=0;#o=.14;#a=0;#l=.14;#s=0;#u=0;#c=0;constructor(e){this.#r=Math.exp(-1/(e*.2)),this.#i=1-this.#r}process(e,t,i){this.#s===0&&(this.#s=e[0]),this.#u===0&&(this.#u=e[0]),this.#a=0,this.#l=0;for(let o=t;o<i;++o){let a=e[o]*e[o];this.#s=Math.max(a,this.#r*this.#s+this.#i*a),this.#u=this.#r*this.#u+this.#i*a;let s=this.#s/this.#u;this.#c=s>0?s:0,this.#c>0&&(this.#n=2*(this.#e/this.#c),this.#o=2*(this.#t/this.#c)-this.#n,this.#a+=this.#n,this.#l+=this.#o)}let n=i-t;this.#a/=n,this.#l/=n}getAvgAttack(){return this.#a}getAvgRelease(){return this.#l}};var Oy=class{#e=[];#t;#r;#i;#n=0;constructor(e,t,i,n){this.#i=n,this.#r=Math.floor(e*t),this.#t=i+this.#r;for(let o=0;o<n;o++)this.#e[o]=new Float32Array(this.#t);this.#n=0}process(e,t,i){if(this.#r===0)return;let n=(this.#n-this.#r+this.#t)%this.#t;for(let o=0;o<this.#i;o++){let a=e.getChannel(o),s=this.#n,u=n;for(let c=t;c<i;c++){let p=this.#e[o][u];this.#e[o][s]=a[c],a[c]=p,s=(s+1)%this.#t,u=(u+1)%this.#t}}this.#n=(this.#n+(i-t))%this.#t}};var Vy=class{#e=-20;#t=2;#r=6;#i=3;#n=-.5;setThreshold(e){this.#e=e}setRatio(e){this.#t!==e&&(this.#t=e,this.#t>23.9&&(this.#t=-1/0),this.#n=1/e-1)}setKnee(e){e!==this.#r&&(this.#r=e,this.#i=e/2)}applyCompression(e){let t=e-this.#e;return t<=-this.#i?0:t>-this.#i&&t<=this.#i?.5*this.#n*((t+this.#i)*(t+this.#i))/this.#r:this.#n*t}applyCompressionToBuffer(e,t,i){for(let n=t;n<i;++n){let o=Math.max(Math.abs(e[n]),1e-6),a=YS(o);e[n]=this.applyCompression(a)}}};var Ls=class{#e;#t=1;#r=0;#i=0;#n=!0;constructor(e){this.#e=e,this.#t=1,this.#r=1-this.#t}process(e){this.#n&&(this.#i=e,this.#n=!1),this.#i=this.#t*e+this.#r*this.#i}setAlpha(e){this.#t=e,this.#r=1-this.#t}setAlphaWithTime(e){this.#t=Math.exp(-1/(this.#e*e)),this.#r=1-this.#t}getState(){return this.#i}};var zy=class{#e;#t;#r;#i;#n=.01;#o=0;#a=.14;#l=0;#s=0;#u=0;#c=!1;#d=!1;constructor(e){this.#e=e,this.#t=new Ry(e),this.#r=new Ls(e),this.#i=new Ls(e),this.#o=Math.exp(-1/(e*this.#n)),this.#l=Math.exp(-1/(e*this.#a)),this.#s=0,this.#u=0}setAttack(e){e!==this.#n&&(this.#n=e,this.#o=Math.exp(-1/(this.#e*this.#n)))}setRelease(e){e!==this.#a&&(this.#a=e,this.#l=Math.exp(-1/(this.#e*this.#a)))}setAutoAttack(e){this.#c=e}setAutoRelease(e){this.#d=e}#p(e){return e<this.#s?this.#s=this.#o*this.#s+(1-this.#o)*e:this.#s=this.#l*this.#s+(1-this.#l)*e,this.#s}applyBallistics(e,t,i){for(let n=t;n<i;++n)e[n]=this.#p(e[n])}processCrestFactor(e,t,i){(this.#c||this.#d)&&(this.#t.process(e,t,i),this.#r.process(this.#t.getAvgAttack()),this.#i.process(this.#t.getAvgRelease()),this.#c&&this.setAttack(this.#r.getState()),this.#d&&this.setRelease(this.#i.getState()))}};var Uy=class{#e;#t;#r;#i=0;#n=0;constructor(e,t,i){this.#t=Math.floor(e*t),this.#r=i+this.#t,this.#e=new Float32Array(this.#r),this.#i=0}process(e,t,i){this.#o(e,t,i),this.#l(),this.#a(e,t,i)}#o(e,t,i){for(let n=t;n<i;n++)this.#e[this.#i]=e[n],this.#i=(this.#i+1)%this.#r;this.#n=i-t}#a(e,t,i){let n=this.#i-this.#n-this.#t;n<0&&(n+=this.#r);for(let o=t;o<i;o++)e[o]=this.#e[n],n=(n+1)%this.#r}#l(){let e=this.#i-1;e<0&&(e+=this.#r);let t=0,i=0;for(let o=0;o<this.#n;o++){let a=this.#e[e];a>t?(this.#e[e]=t,t+=i):(i=-a/this.#t,t=a+i),e=e-1,e<0&&(e+=this.#r)}let n=!1;for(let o=0;o<this.#t&&!n;o++){if(this.#e[e]>t)this.#e[e]=t,t+=i;else{n=!0;break}e=e-1,e<0&&(e+=this.#r)}}};var jy=class r extends $e{static PEAK_DECAY_PER_SAMPLE=Math.exp(-1/(sampleRate*.5));static REDUCTION_DECAY_PER_SAMPLE=128/sampleRate*.05;static ID=0;#e=r.ID++;#t;parameterLookahead;parameterAutomakeup;parameterAutoattack;parameterAutorelease;parameterInputgain;parameterThreshold;parameterRatio;parameterKnee;parameterAttack;parameterRelease;parameterMakeup;parameterMix;#r;#i;#n;#o;#a;#l;#s;#u;#c;#d=.005;#p;#h;#f=g.None;#m=!1;#w=!1;#b=!1;#A=!1;#N=-10;#B=2;#P=6;#k=2;#g=140;#v=0;#y=1;#S=0;#F=0;#E=0;#_=0;#$=!1;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=this.own(new _e(e.broadcaster,t.address)),this.#p=new Float32Array([Number.NEGATIVE_INFINITY,0,Number.NEGATIVE_INFINITY]),this.#h=Zt.linear(sampleRate);let{lookahead:i,automakeup:n,autoattack:o,autorelease:a,inputgain:s,threshold:u,ratio:c,knee:p,attack:d,release:f,makeup:v,mix:m}=t.namedParameter;this.parameterLookahead=this.own(this.bindParameter(i)),this.parameterAutomakeup=this.own(this.bindParameter(n)),this.parameterAutoattack=this.own(this.bindParameter(o)),this.parameterAutorelease=this.own(this.bindParameter(a)),this.parameterInputgain=this.own(this.bindParameter(s)),this.parameterThreshold=this.own(this.bindParameter(u)),this.parameterRatio=this.own(this.bindParameter(c)),this.parameterKnee=this.own(this.bindParameter(p)),this.parameterAttack=this.own(this.bindParameter(d)),this.parameterRelease=this.own(this.bindParameter(f)),this.parameterMakeup=this.own(this.bindParameter(v)),this.parameterMix=this.own(this.bindParameter(m)),this.#n=new zy(sampleRate),this.#o=new Vy,this.#a=new Oy(sampleRate,.005,128,2),this.#l=new Uy(sampleRate,this.#d,128),this.#s=new Ls(sampleRate),this.#s.setAlpha(.03),this.#u=new Float32Array(128),this.#c=[new Float32Array(128),new Float32Array(128)],this.ownAll(e.registerProcessor(this),e.broadcaster.broadcastFloats(t.address.append(0),this.#p,()=>{this.#p[0]=Nx(this.#F),this.#p[1]=this.#_,this.#p[2]=Nx(this.#E)})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#$=!1,this.#r.clear(),this.#i.clear(),this.eventInput.clear(),this.#u.fill(0),this.#c[0].fill(0),this.#c[1].fill(0),this.#S=0,this.#F=0,this.#E=0,this.#_=0}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#f=g.wrap(e),{terminate:()=>this.#f=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio(e,t,i){if(this.#f.isEmpty())return;let n=this.#f.unwrap(),o=n.getChannel(0),a=n.getChannel(1),s=this.#r.getChannel(0),u=this.#r.getChannel(1);for(let c=t;c<i;c++){let p=this.#h.moveAndGet(),d=s[c]=o[c]*p,f=u[c]=a[c]*p,v=Math.max(Math.abs(d),Math.abs(f));this.#F<=v?this.#F=v:this.#F*=r.PEAK_DECAY_PER_SAMPLE}this.#u.fill(0,t,i);for(let c=t;c<i;c++)this.#u[c]=Math.max(Math.abs(s[c]),Math.abs(u[c]));this.#n.processCrestFactor(this.#u,t,i),this.#o.applyCompressionToBuffer(this.#u,t,i),this.#n.applyBallistics(this.#u,t,i);for(let c=t;c<i;c++){let p=this.#u[c];this.#_>=p?this.#_=p:this.#_+=r.REDUCTION_DECAY_PER_SAMPLE}this.#S=this.#M(this.#u,t,i),this.#m&&(this.#a.process(this.#r,t,i),this.#l.process(this.#u,t,i));for(let c=t;c<i;c++)this.#u[c]=XS(this.#u[c]+this.#v+this.#S);for(let c=t;c<i;c++)this.#c[0][c]=s[c],this.#c[1][c]=u[c];for(let c=t;c<i;c++)s[c]*=this.#u[c],u[c]*=this.#u[c];for(let c=t;c<i;c++){let p=s[c]*this.#y+this.#c[0][c]*(1-this.#y),d=u[c]*this.#y+this.#c[1][c]*(1-this.#y),f=Math.max(Math.abs(p),Math.abs(d));this.#E<=f?this.#E=f:this.#E*=r.PEAK_DECAY_PER_SAMPLE,s[c]=p,u[c]=d}this.#i.process(s,u,t,i),this.#$=!0}#M(e,t,i){let n=0;for(let o=t;o<i;o++)n+=e[o];return this.#s.process(-n/(i-t)),this.#w?this.#s.getState():0}parameterChanged(e){e===this.parameterLookahead?this.#m=this.parameterLookahead.getValue():e===this.parameterAutomakeup?this.#w=this.parameterAutomakeup.getValue():e===this.parameterAutoattack?(this.#b=this.parameterAutoattack.getValue(),this.#n.setAutoAttack(this.#b),this.#b||this.#n.setAttack(this.#k*.001)):e===this.parameterAutorelease?(this.#A=this.parameterAutorelease.getValue(),this.#n.setAutoRelease(this.#A),this.#A||this.#n.setRelease(this.#g*.001)):e===this.parameterInputgain?this.#h.set(Te(this.parameterInputgain.getValue()),this.#$):e===this.parameterThreshold?(this.#N=this.parameterThreshold.getValue(),this.#o.setThreshold(this.#N)):e===this.parameterRatio?(this.#B=this.parameterRatio.getValue(),this.#o.setRatio(this.#B)):e===this.parameterKnee?(this.#P=this.parameterKnee.getValue(),this.#o.setKnee(this.#P)):e===this.parameterAttack?(this.#k=this.parameterAttack.getValue(),this.#b||this.#n.setAttack(this.#k*.001)):e===this.parameterRelease?(this.#g=this.parameterRelease.getValue(),this.#A||this.#n.setRelease(this.#g*.001)):e===this.parameterMakeup?this.#v=this.parameterMakeup.getValue():e===this.parameterMix&&(this.#y=this.parameterMix.getValue())}toString(){return`{${this.constructor.name} (${this.#e})}`}};var Ly=class r extends $e{static ID=0;#e=r.ID++;#t;#r;#i;#n;parameterCrusherRate;parameterBitDepth;parameterBoost;parameterMix;#o=g.None;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=new Lh(sampleRate),this.#n=this.own(new _e(e.broadcaster,t.address));let{crush:i,bits:n,boost:o,mix:a}=t.namedParameter;this.parameterCrusherRate=this.own(this.bindParameter(i)),this.parameterBitDepth=this.own(this.bindParameter(n)),this.parameterBoost=this.own(this.bindParameter(o)),this.parameterMix=this.own(this.bindParameter(a)),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.reset(),this.#n.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#o.isEmpty())return;let n=this.#o.unwrap();this.#i.process(n.channels(),this.#r.channels(),t,i),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1),t,i)}parameterChanged(e){e===this.parameterCrusherRate?this.#i.setCrush(1-this.parameterCrusherRate.getValue()):e===this.parameterBitDepth?this.#i.setBitDepth(this.parameterBitDepth.getValue()):e===this.parameterBoost?this.#i.setBoost(this.parameterBoost.getValue()):e===this.parameterMix&&this.#i.setMix(this.parameterMix.getValue())}toString(){return`{${this.constructor.name} (${this.#e})`}};var L$=[2,4,8],eB=8,Ky=class r extends $e{static ID=0;#e=r.ID++;#t;#r;#i;#n;parameterDrive;parameterVolume;#o=g.None;#a=!1;#l;#s;#u;#c;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=[new Float32Array(128*eB),new Float32Array(128*eB)],this.#n=this.own(new _e(e.broadcaster,t.address));let{drive:i,volume:n}=t.namedParameter;this.parameterDrive=this.own(this.bindParameter(i)),this.parameterVolume=this.own(this.bindParameter(n)),this.ownAll(e.registerProcessor(this),t.box.overSampling.catchupAndSubscribe(o=>{let a=L$[o.getValue()];this.#l=new Yh(a),this.#u=Zt.linear(sampleRate*a),this.#u.set(Te(this.parameterDrive.getValue()),this.#a),this.#c=Zt.linear(sampleRate*a),this.#c.set(Te(this.parameterVolume.getValue()),this.#a),this.#s=a})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){console.debug("reset"),this.#a=!1,this.#n.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#o.isEmpty())return;this.#l.upsample(this.#o.unwrap().channels(),this.#i,t,i);let n=(i-t)*this.#s,[o,a]=this.#i;for(let s=0;s<n;s++){let u=this.#c.moveAndGet(),c=this.#u.moveAndGet();o[s]=kx(o[s]*c)*u,a[s]=kx(a[s]*c)*u}this.#l.downsample(this.#i,this.#r.channels(),t,i),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1),t,i),this.#a=!0}parameterChanged(e){e===this.parameterDrive?this.#u.set(Te(this.parameterDrive.getValue()),this.#a):e===this.parameterVolume&&this.#c.set(Te(this.parameterVolume.getValue()),this.#a)}toString(){return`{${this.constructor.name} (${this.#e})`}};var Wy=class extends $e{#e;#t;#r=[];#i;#n;#o=g.None;constructor(e,t){super(e),this.#e=t,this.#t=new ge,this.#i=[];let{midiDevice:i,box:n,parameters:o}=t;this.#n=n.channel.getValue(),this.ownAll(n.parameters.pointerHub.catchupAndSubscribe({onAdded:(({box:a})=>this.#i.push(this.bindParameter(o.parameterAt(Be(a,Ti).value.address)))),onRemoved:(({box:a})=>O.removeIf(this.#i,s=>s.address===Be(a,Ti).value.address))}),n.channel.subscribe(a=>{i.ifSome(s=>this.#r.forEach(u=>e.sendMIDIData(s.id.getValue(),it.noteOff(this.#n,u),s.delayInMs.getValue()))),this.#r.length=0,this.#n=a.getValue()}),e.registerProcessor(this)),this.readAllParameters()}get noteEventTarget(){return g.wrap(this)}introduceBlock({p0:e,p1:t,s0:i,flags:n,bpm:o}){if(this.#o.isEmpty())return;let{box:{channel:a,device:s}}=this.#e,u=s.targetVertex.match({none:()=>g.None,some:({box:p})=>g.wrap(Be(p,Ci))}),c=u.mapOr(p=>p.delayInMs.getValue(),0);for(let p of this.#o.unwrap().processNotes(e,t,n))if(p.pitch>=0&&p.pitch<=127){let d=i/sampleRate,f=Q.pulsesToSeconds(p.position-e,o),v=(d+f)*1e3+c,m=a.getValue();if(ve.isStart(p)){let y=Math.round(p.velocity*127);this.#r.push(p.pitch),u.ifSome(x=>this.context.sendMIDIData(x.id.getValue(),it.noteOn(m,p.pitch,y),v))}else if(ve.isStop(p)){let y=this.#r.indexOf(p.pitch);y>-1&&this.#r.splice(y,1),u.ifSome(x=>this.context.sendMIDIData(x.id.getValue(),it.noteOff(m,p.pitch),v))}}}setNoteEventSource(e){return this.#o=g.wrap(e),K.create(()=>this.#o=g.None)}get incoming(){return this}get outgoing(){return this}reset(){}get uuid(){return this.#e.uuid}get audioOutput(){return this.#t}get adapter(){return this.#e}handleEvent(e){}processAudio(e,t,i){}parameterChanged(e,t=0){let{box:{channel:i,device:n}}=this.#e;if(n.isEmpty())return;let{id:o,delayInMs:a}=Be(n.targetVertex.unwrap().box,Ci),s=t*1e3*a.getValue(),u=Be(e.adapter.field.box,Ti).controller.getValue(),c=Math.round(e.getValue()*127),p=it.control(i.getValue(),u,c);this.context.sendMIDIData(o.getValue(),p,s)}finishProcess(){}toString(){return"{MIDIOutputDeviceProcessor}"}};var Zy=class extends $r{#e;#t;#r;#i=g.None;#n;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Si(e.broadcaster,t.address)),this.#r=new Int32Array(1024),this.#n=0;let{magnetPosition:i,magnetStrength:n,randomSeed:o,randomAmount:a,offset:s,mix:u}=t.namedParameter;this.ownAll(this.bindParameter(i),this.bindParameter(n),this.bindParameter(o),this.bindParameter(a),this.bindParameter(s),this.bindParameter(u),e.broadcaster.broadcastIntegers(t.address.append(0),this.#r,()=>{this.#r[this.#n]=0,this.#n=0}),e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return D(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=g.wrap(e),K.create(()=>this.#i=g.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,i){if(!this.#i.isEmpty())for(let n of this.#i.unwrap().processNotes(e,t,i))if(ve.isStart(n)){this.#t.noteOn(n.pitch);let o=this.#e.computeVelocity(n.position,n.velocity);this.#r[this.#n++]=Math.round(n.velocity*127)|Math.round(o*127)<<8|65536,yield Dr.overwrite(n,{velocity:o})}else this.#t.noteOff(n.pitch),yield n}*iterateActiveNotesAt(e,t){if(!this.#i.isEmpty())for(let i of this.#i.unwrap().iterateActiveNotesAt(e,t))i.type==="note-event"&&(yield Dr.overwrite(i,{velocity:this.#e.computeVelocity(i.position,i.velocity)}))}reset(){this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Gy=class r extends $e{static ID=0;#e=r.ID++;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c;#d;#p;#h=g.None;#f=!0;#m=0;constructor(e,t){super(e),this.#t=t,this.#r=new ge,this.#i=this.own(new _e(e.broadcaster,t.address)),this.#n=new Kh,this.#o=new Mi(.003,sampleRate),this.#a=new Mi(.003,sampleRate);let{rate:i,depth:n,slope:o,symmetry:a,offset:s,channelOffset:u}=t.namedParameter;this.#l=this.bindParameter(i),this.#s=this.bindParameter(n),this.#u=this.bindParameter(o),this.#c=this.bindParameter(a),this.#d=this.bindParameter(s),this.#p=this.bindParameter(u),this.ownAll(e.broadcaster.broadcastFloat(t.address.append(0),()=>this.#m),e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#m=0,this.#f=!0,this.#i.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#h=g.wrap(e),{terminate:()=>this.#h=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio({p0:e,bpm:t,flags:i},n,o){if(this.#h.isEmpty())return;let a=this.#h.unwrap(),[s,u]=a.channels(),[c,p]=this.#r.channels();this.#f&&(this.#n.set(this.#s.getValue(),this.#u.getValue(),this.#c.getValue()),this.#f=!1);let{RateFractions:d}=Xi,f=Q.samplesToPulses(1,t,sampleRate),m=1/rr.toPPQN(d[this.#l.getValue()]),y=this.#d.getValue()/360,x=y+this.#p.getValue()/360;for(let $=n;$<o;$++){let I=(e+$*f)*m+y,T=(e+$*f)*m+x;c[$]=s[$]*this.#o.process(this.#n.compute(I-Math.floor(I))),p[$]=u[$]*this.#a.process(this.#n.compute(T-Math.floor(T)))}this.#i.process(c,p),nt.every(i,5)&&(this.#m=(e+(o-n)*f)*m)}parameterChanged(e){(e===this.#s||e===this.#u||e===this.#c)&&(this.#f=!0)}toString(){return`{${this.constructor.name} (${this.#e})`}};var qy=class{#e;#t=[];#r;#i;#n;#o=0;#a=0;#l=0;#s=0;#u=0;#c=0;#d=.9999;#p=.75;#h=.625;#f=.5;#m=.7;#w=.5;#b=.005;#A=.5;#N=.7;#B=.3;#P=.6;constructor(e){this.#e=e,this.#n=e+1,this.#r=new Float32Array(this.#n),[.004771345,.003595309,.012734787,.009307483,.022579886,.149625349,.060481839,.1249958,.030509727,.141695508,.089244313,.106280031].forEach(n=>this.#k(n));let i=[.008937872,.099929438,.064278754,.067067639,.066866033,.006283391,.035818689,.011861161,.121870905,.041262054,.08981553,.070931756,.011256342,.004065724];this.#i=Int16Array.from(i,n=>Math.round(n*e))}#k(e){let t=Math.round(e*this.#e),i=2**Math.ceil(Math.log2(t));this.#t.push([new Float32Array(i),t-1,0,i-1])}#g(e,t){return this.#t[e][0][this.#t[e][1]]=t}#v(e){return this.#t[e][0][this.#t[e][2]]}#y(e,t){let i=this.#t[e];return i[0][i[2]+t&i[3]]}#S(e,t){let i=this.#t[e],n=t-~~t,o=~~t+i[2]-1,a=i[3],s=i[0][o++&a],u=i[0][o++&a],c=i[0][o++&a],p=i[0][o&a],d=(3*(u-c)-s+p)*.5,f=2*c+s-(5*u+p)*.5,v=(c-s)*.5;return((d*n+f)*n+v)*n+u}set preDelayMs(e){this.#c=Math.floor(e/1e3*this.#e)}set bandwidth(e){this.#d=e*.9999}set inputDiffusion1(e){this.#p=e}set inputDiffusion2(e){this.#h=e}set decay(e){this.#f=e}set decayDiffusion1(e){this.#m=e*.999999}set decayDiffusion2(e){this.#w=e*.999999}set damping(e){this.#b=e}set excursionRate(e){this.#A=e*2}set excursionDepth(e){this.#N=e*2}set wetGain(e){this.#B=e}set dryGain(e){this.#P=e}reset(){this.#r.fill(0),this.#t.forEach(e=>e[0].fill(0)),this.#o=0,this.#a=0,this.#l=0,this.#s=0,this.#u=0}process(e,t,i,n){let o=this.#c,a=this.#d,s=this.#p,u=this.#h,c=this.#f,p=this.#m,d=this.#w,f=1-this.#b,v=this.#A/this.#e,m=this.#N*this.#e/1e3,y=this.#B*.6,x=this.#P,$=e[0],I=e[1],T=t[0],R=t[1];for(let L=i;L<n;L++){let ae=$[L],xe=I[L];this.#r[this.#o]=(ae+xe)*.5,T[L]=ae*x,R[L]=xe*x;let J=this.#r[(this.#n+this.#o-o)%this.#n];this.#a+=a*(J-this.#a);let oe=this.#g(0,this.#a-s*this.#v(0));oe=this.#g(1,s*(oe-this.#v(1))+this.#v(0)),oe=this.#g(2,s*oe+this.#v(1)-u*this.#v(2)),oe=this.#g(3,u*(oe-this.#v(3))+this.#v(2));let se=u*oe+this.#v(3),Le=m*(1+Math.cos(this.#u*6.28)),Ge=m*(1+Math.sin(this.#u*6.2847)),St=this.#g(4,se+c*this.#v(11)+p*this.#S(4,Le));this.#g(5,this.#S(4,Le)-p*St),this.#l+=f*(this.#v(5)-this.#l),St=this.#g(6,c*this.#l-d*this.#v(6)),this.#g(7,this.#v(6)+d*St),St=this.#g(8,se+c*this.#v(7)+p*this.#S(8,Ge)),this.#g(9,this.#S(8,Ge)-p*St),this.#s+=f*(this.#v(9)-this.#s),St=this.#g(10,c*this.#s-d*this.#v(10)),this.#g(11,this.#v(10)+d*St);let er=this.#y(9,this.#i[0])+this.#y(9,this.#i[1])-this.#y(10,this.#i[2])+this.#y(11,this.#i[3])-this.#y(5,this.#i[4])-this.#y(6,this.#i[5])-this.#y(7,this.#i[6]),qe=this.#y(5,this.#i[7])+this.#y(5,this.#i[8])-this.#y(6,this.#i[9])+this.#y(7,this.#i[10])-this.#y(9,this.#i[11])-this.#y(10,this.#i[12])-this.#y(11,this.#i[13]);T[L]+=er*y,R[L]+=qe*y,this.#u+=v,this.#o=(this.#o+1)%this.#n;for(let Ce=0;Ce<this.#t.length;Ce++){let Tt=this.#t[Ce];Tt[1]=Tt[1]+1&Tt[3],Tt[2]=Tt[2]+1&Tt[3]}}}};var Hy=class r extends $e{static ID=0;#e=r.ID++;#t;parameterPreDelay;parameterBandwidth;parameterInputDiffusion1;parameterInputDiffusion2;parameterDecay;parameterDecayDiffusion1;parameterDecayDiffusion2;parameterDamping;parameterExcursionRate;parameterExcursionDepth;parameterWet;parameterDry;#r;#i;#n;#o=g.None;constructor(e,t){super(e),this.#t=t,this.#i=new ge,this.#n=this.own(new _e(e.broadcaster,t.address)),this.#r=new qy(sampleRate);let{preDelay:i,bandwidth:n,inputDiffusion1:o,inputDiffusion2:a,decay:s,decayDiffusion1:u,decayDiffusion2:c,damping:p,excursionRate:d,excursionDepth:f,wet:v,dry:m}=t.namedParameter;this.parameterPreDelay=this.own(this.bindParameter(i)),this.parameterBandwidth=this.own(this.bindParameter(n)),this.parameterInputDiffusion1=this.own(this.bindParameter(o)),this.parameterInputDiffusion2=this.own(this.bindParameter(a)),this.parameterDecay=this.own(this.bindParameter(s)),this.parameterDecayDiffusion1=this.own(this.bindParameter(u)),this.parameterDecayDiffusion2=this.own(this.bindParameter(c)),this.parameterDamping=this.own(this.bindParameter(p)),this.parameterExcursionRate=this.own(this.bindParameter(d)),this.parameterExcursionDepth=this.own(this.bindParameter(f)),this.parameterWet=this.own(this.bindParameter(v)),this.parameterDry=this.own(this.bindParameter(m)),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.reset(),this.#i.clear(),this.#n.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#i}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio(e,t,i){if(this.#o.isEmpty())return;let n=this.#o.unwrap();this.#r.process(n.channels(),this.#i.channels(),t,i),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1),t,i)}parameterChanged(e){e===this.parameterPreDelay?this.#r.preDelayMs=this.parameterPreDelay.getValue():e===this.parameterBandwidth?this.#r.bandwidth=this.parameterBandwidth.getValue():e===this.parameterInputDiffusion1?this.#r.inputDiffusion1=this.parameterInputDiffusion1.getValue():e===this.parameterInputDiffusion2?this.#r.inputDiffusion2=this.parameterInputDiffusion2.getValue():e===this.parameterDecay?this.#r.decay=this.parameterDecay.getValue():e===this.parameterDecayDiffusion1?this.#r.decayDiffusion1=this.parameterDecayDiffusion1.getValue():e===this.parameterDecayDiffusion2?this.#r.decayDiffusion2=this.parameterDecayDiffusion2.getValue():e===this.parameterDamping?this.#r.damping=this.parameterDamping.getValue():e===this.parameterExcursionRate?this.#r.excursionRate=this.parameterExcursionRate.getValue():e===this.parameterExcursionDepth?this.#r.excursionDepth=this.parameterExcursionDepth.getValue():e===this.parameterWet?this.#r.wetGain=Te(this.parameterWet.getValue()):e===this.parameterDry&&(this.#r.dryGain=Te(this.parameterDry.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})}`}};var Q_;(e=>e.create=(t,i)=>i.accept({visitAudioBusBox:n=>new xc(t,t.boxAdapters.adapterFor(n,ur)),visitVaporisateurDeviceBox:n=>new dy(t,t.boxAdapters.adapterFor(n,Bu)),visitNanoDeviceBox:n=>new _y(t,t.boxAdapters.adapterFor(n,ku)),visitTapeDeviceBox:n=>new gy(t,t.boxAdapters.adapterFor(n,Su)),visitPlayfieldDeviceBox:n=>new ky(t,t.boxAdapters.adapterFor(n,la)),visitSoundfontDeviceBox:n=>new Ty(t,t.boxAdapters.adapterFor(n,ju)),visitMIDIOutputDeviceBox:n=>new Wy(t,t.boxAdapters.adapterFor(n,Hu))}))(Q_||={});var Y_;(e=>e.create=(t,i)=>Y(i.accept({visitUnknownMidiEffectDeviceBox:n=>new Dy(t,t.boxAdapters.adapterFor(n,Vu)),visitArpeggioDeviceBox:n=>new yy(t,t.boxAdapters.adapterFor(n,Gi)),visitPitchDeviceBox:n=>new xy(t,t.boxAdapters.adapterFor(n,Fu)),visitVelocityDeviceBox:n=>new Zy(t,t.boxAdapters.adapterFor(n,Ju)),visitZeitgeistDeviceBox:n=>new My(t,t.boxAdapters.adapterFor(n,Ru))}),`Could not create midi-effect for'${i.name}'`))(Y_||={});var Fh;(e=>e.create=(t,i)=>Y(i.accept({visitUnknownAudioEffectDeviceBox:n=>new _h(t,t.boxAdapters.adapterFor(n,Ou)),visitStereoToolDeviceBox:n=>new $y(t,t.boxAdapters.adapterFor(n,Cu)),visitCompressorDeviceBox:n=>new jy(t,t.boxAdapters.adapterFor(n,Lu)),visitDelayDeviceBox:n=>new oy(t,t.boxAdapters.adapterFor(n,ui)),visitDattorroReverbDeviceBox:n=>new Hy(t,t.boxAdapters.adapterFor(n,Qu)),visitTidalDeviceBox:n=>new Gy(t,t.boxAdapters.adapterFor(n,Xi)),visitCrusherDeviceBox:n=>new Ly(t,t.boxAdapters.adapterFor(n,Ku)),visitFoldDeviceBox:n=>new Ky(t,t.boxAdapters.adapterFor(n,Zu)),visitReverbDeviceBox:n=>new Ay(t,t.boxAdapters.adapterFor(n,au)),visitRevampDeviceBox:n=>new wy(t,t.boxAdapters.adapterFor(n,su)),visitModularDeviceBox:n=>new _h(t,t.boxAdapters.adapterFor(n,ra))}),`Could not create audio-effect for'${i.name}'`))(Fh||={});var Jy=class extends $e{#e;#t;#r;#i;#n;#o;#a=g.None;#l=!0;#s=!1;constructor(e,t){super(e),this.#e=t,this.#t=new ge,this.#r=Zt.linear(sampleRate),this.#i=Zt.linear(sampleRate),this.#n=this.own(this.bindParameter(t.sendGain)),this.#o=this.own(this.bindParameter(t.sendPan)),this.own(e.registerProcessor(this)),this.readAllParameters()}reset(){this.#t.clear()}get adapter(){return this.#e}setAudioSource(e){return this.#a=g.wrap(e),{terminate:()=>this.#a=g.None}}get audioOutput(){return this.#t}processAudio(e,t,i){if(this.#a.isEmpty())return;if(this.#l){let c=Te(this.#n.getValue()),p=this.#o.getValue();this.#r.set((1-Math.max(0,p))*c,this.#s),this.#i.set((1+Math.min(0,p))*c,this.#s),this.#l=!1}let n=this.#t.getChannel(0),o=this.#t.getChannel(1),a=this.#a.unwrap(),s=a.getChannel(0),u=a.getChannel(1);if(this.#r.isInterpolating()||this.#i.isInterpolating())for(let c=t;c<i;c++)n[c]=s[c]*this.#r.moveAndGet(),o[c]=u[c]*this.#i.moveAndGet();else{let c=this.#r.get(),p=this.#i.get();for(let d=t;d<i;d++)n[d]=s[d]*c,o[d]=u[d]*p}this.#s=!0}parameterChanged(e){this.#l=!0}};var Qy=class extends $e{#e;#t;#r;#i;#n;#o;#a;#l;#s=Zt.linear(sampleRate);#u=Zt.linear(sampleRate);#c=Zt.linear(sampleRate);#d=g.None;#p=!0;#h=!1;constructor(e,t){super(e),this.#e=t,this.#t=new ge,this.#r=[new Float32Array(128),new Float32Array(128)],this.#i=this.own(new _e(e.broadcaster,this.#e.address)),this.#n=this.own(this.bindParameter(this.#e.namedParameter.volume)),this.#o=this.own(this.bindParameter(this.#e.namedParameter.panning)),this.#a=this.own(this.bindParameter(this.#e.namedParameter.mute)),this.#l=this.own(this.bindParameter(this.#e.namedParameter.solo)),this.ownAll(e.registerProcessor(this),e.mixer.attachChannelStrip(this)),this.readAllParameters()}reset(){this.#i.clear(),this.#t.clear(),this.#r[0].fill(0),this.#r[1].fill(0),this.#h=!1}get isMute(){return this.#a.getValue()}get isSolo(){return this.#l.getValue()}get adapter(){return this.#e}get audioOutput(){return this.#t}handleEvent(e){}processAudio(e,t,i){if(this.#d.isEmpty())return;if(this.#p){let d=this.context.mixer;d.updateSolo();let f=this.isSolo||d.isVirtualSolo(this),v=this.isMute||d.hasChannelSolo()&&!f&&!this.#e.isOutput,m=Te(this.#n.getValue()),y=this.#o.getValue();this.#s.set((1-Math.max(0,y))*m,this.#h),this.#u.set((1+Math.min(0,y))*m,this.#h),this.#c.set(v?0:1,this.#h),this.#p=!1}let n=this.#d.unwrap(),[o,a]=n.channels(),[s,u]=this.#t.channels(),[c,p]=this.#r;if(this.#s.isInterpolating()||this.#u.isInterpolating()||this.#c.isInterpolating())for(let d=t;d<i;d++){let f=this.#c.moveAndGet(),v=o[d]*this.#s.moveAndGet(),m=a[d]*this.#u.moveAndGet();s[d]=v*f,u[d]=m*f,c[d]=v,p[d]=m}else{let d=this.#s.get(),f=this.#u.get(),v=this.#c.get();for(let m=t;m<i;m++){let y=o[m]*d,x=a[m]*f;c[m]=y,p[m]=x,s[m]=y*v,u[m]=x*v}}this.#i.process(c,p,t,i),this.#h=!0}finishProcess(){this.#t.assertSanity()}parameterChanged(e){e===this.#n?this.requestGainUpdate():e===this.#o?this.requestGainUpdate():e===this.#a?this.requestGainUpdate():e===this.#l&&this.context.mixer.onChannelStripSoloChanged(this)}requestGainUpdate(){this.#p=!0}requestSoloUpdate(){this.#p=!0}setAudioSource(e){return this.#d=g.wrap(e),{terminate:()=>this.#d=g.None}}toString(){return`{${this.constructor.name}}`}};var Yy=class{#e=new z;#t;#r;#i;#n;#o;#a;#l=[];#s=!1;constructor(e,t){this.#t=e,this.#r=t,this.#i=A.newSet(i=>i.adapter.uuid),this.#n=this.#e.own(new Qy(this.#t.context,this.#t.adapter)),this.#o=A.newSet(({device:i})=>i.uuid),this.#a=this.#e.own(new z),this.#e.ownAll(this.#t.adapter.audioEffects.catchupAndSubscribe({onAdd:i=>{this.invalidateWiring();let n=Fh.create(this.#t.context,i.box),o=this.#o.add({device:n,subscription:n.adapter().enabledField.subscribe(()=>this.invalidateWiring())});D(o,"Could not add.")},onRemove:i=>{this.invalidateWiring();let{device:n,subscription:o}=this.#o.removeByKey(i.uuid);o.terminate(),n.terminate()},onReorder:i=>this.invalidateWiring()}),this.#t.adapter.auxSends.catchupAndSubscribe({onAdd:i=>{this.invalidateWiring();let n=this.#i.add(new Jy(this.#t.context,i));D(n,"Could not add.")},onRemove:({uuid:i})=>{this.invalidateWiring(),this.#i.removeByKey(i).terminate()},onReorder:i=>{}}),this.#t.adapter.output.catchupAndSubscribe(i=>this.invalidateWiring()),this.#t.context.subscribeProcessPhase(i=>{i===0&&this.#s&&(this.#u(),this.#s=!1)}))}get channelStrip(){return this.#n}invalidateWiring(){this.#a.terminate(),this.#s=!0}terminate(){this.#e.terminate(),this.#o.forEach(({device:e})=>e.terminate()),this.#o.clear(),this.#l=[]}toString(){return`{${this.constructor.name}}`}#u(){let e=this.#t.adapter.isOutput,t=this.#t.context,i=this.#t.input(),n=this.#t.adapter.output.adapter.map(a=>t.getAudioUnit(a.deviceHost().uuid).inputAsAudioBus());if(i.isEmpty()||n.isEmpty()&&!e)return;let o=i.unwrap();if(this.#r.includeAudioEffects){O.replace(this.#l,this.#t.adapter.audioEffects.adapters().map(({uuid:a})=>this.#o.get(a).device));for(let a of this.#l)a.adapter().enabledField.getValue()&&(this.#a.own(a.setAudioSource(o.audioOutput)),this.#a.own(t.registerEdge(o.outgoing,a.incoming)),o=a)}if(this.#r.includeSends&&this.#i.forEach(a=>{let s=t.getAudioUnit(a.adapter.targetBus.deviceHost().uuid);this.#a.own(a.setAudioSource(o.audioOutput)),this.#a.own(s.inputAsAudioBus().addAudioSource(a.audioOutput)),this.#a.own(t.registerEdge(o.outgoing,a)),this.#a.own(t.registerEdge(a,s.inputAsAudioBus()))}),this.#a.own(this.#n.setAudioSource(o.audioOutput)),this.#a.own(t.registerEdge(o.outgoing,this.#n)),n.nonEmpty()&&!e){let a=n.unwrap();this.#a.own(a.addAudioSource(this.#n.audioOutput)),this.#a.own(t.registerEdge(this.#n,a))}}};var Xy=class{#e=new z;#t;#r;#i;#n;#o;constructor(e,t){this.#t=e,this.#r=t,this.#i=Hs.create(268431651),this.#n=new Set,this.#o=new tl,this.#e.ownAll(this.#t.subscribeProcessPhase(i=>{if(i===1)for(let n of this.#n)n.gate||this.#n.delete(n)}))}get uuid(){return this.#r.uuid}terminate(){this.#e.terminate()}pushRawNoteOn(e,t){this.#n.add({pitch:e,velocity:t,gate:!0,running:g.None})}pushRawNoteOff(e){for(let t of this.#n)if(t.running.isEmpty())this.#n.delete(t);else if(t.pitch===e){t.gate=!1;return}}*processNotes(e,t,i){let n=nt.every(i,5);if(this.#o.nonEmpty()&&(!n||nt.every(i,2)?yield*this.#u(e):yield*this.#c(e,t)),this.#n.size>0)for(let o of this.#n){if(o.running.isEmpty()){let{pitch:a,velocity:s}=o,u=Number.POSITIVE_INFINITY,c=ve.start(e,u,a,s);o.running=g.wrap(c),yield c}o.gate||(this.#n.delete(o),yield ve.stop(o.running.unwrap("raw note never started"),e))}if(n){let o=this.#r.tracks.collection.adapters().filter(a=>a.type===te.Notes&&a.enabled.getValue());for(let a of o)for(let{optClip:s,sectionFrom:u,sectionTo:c}of this.#t.clipSequencing.iterate(a.uuid,e,t))s.isEmpty()?yield*this.#l(a,u,c):yield*this.#a(s.unwrap(),u,c);yield*this.#c(e,t)}}*iterateActiveNotesAt(e,t){if(this.#n.size>0)for(let{pitch:i,velocity:n}of this.#n)yield{type:"note-event",position:e,duration:Number.POSITIVE_INFINITY,pitch:i,velocity:n,cent:0};t||(yield*this.#o.overlapping(e,ir.Comparator))}reset(){this.#o.clear(),this.#n.clear()}toString(){return`{${this.constructor.name}}`}*#a(e,t,i){if(e.optCollection.isEmpty())return;let n=e.optCollection.unwrap(),o=e.duration,a=Vn(t,o),s=a+o;i>s?(yield*this.#s(n,t,s,a),yield*this.#s(n,s,i,s)):yield*this.#s(n,t,i,a)}*#l(e,t,i){for(let n of e.regions.collection.iterateRange(t,i)){if(this.#t.ignoresRegion(n.address.uuid)||n.mute||!Me(n,Ko))continue;let o=n.optCollection;if(o.isEmpty())continue;let a=o.unwrap();for(let{resultStart:s,resultEnd:u,rawStart:c}of Wt.locateLoops(n,t,i))yield*this.#s(a,s,u,c)}}*#s(e,t,i,n){let o=t-n,a=i-n;for(let s of e.events.iterateRange(o-e.maxDuration,a)){if(!ir.isOfType(s))continue;let{position:u,duration:c,chance:p,playCount:d,playCurve:f}=s;if(!(p<100&&this.#i.nextDouble(0,100)>p)){if(d>1){let v=ir.inverseCurveFunc((o-u)/c,f),m=ir.inverseCurveFunc((a-u)/c,f),y=Math.floor(v*d),x=y/d;for(;x<m;){if(x>=v){let $=ir.curveFunc(x,f)*c;if($>=c)break;let I=ir.curveFunc(x+1/d,f)*c,T=ve.startWith(s,u+$+n,I-$);this.#o.addAndRetain({...T}),yield T}x=++y/d}}else if(o<=u&&u<a){let v=ve.startWith(s,u+n);this.#o.addAndRetain({...v}),yield v}}}}*#u(e){for(let t of this.#o.releaseAll())yield ve.stop(t,e)}*#c(e,t){for(let i of this.#o.releaseLinearCompleted(t)){let n=ce(i.position+i.duration,e,t);yield ve.stop(i,n)}}};var ex=class{#e=new z;#t;#r;#i;#n;#o=!1;constructor(e){this.#t=e,this.#r=this.#e.own(new Xy(this.#t.context,this.#t.adapter)),this.#i=A.newSet(({device:t})=>t.uuid),this.#n=this.#e.own(new z),this.#e.ownAll(this.#t.adapter.midiEffects.catchupAndSubscribe({onAdd:t=>{this.invalidateWiring();let i=Y_.create(this.#t.context,t.box),n=this.#i.add({device:i,subscription:i.adapter().enabledField.subscribe(()=>this.invalidateWiring())});D(n,"Could not add.")},onRemove:t=>{this.invalidateWiring();let{device:i,subscription:n}=this.#i.removeByKey(t.uuid);n.terminate(),i.terminate()},onReorder:t=>this.invalidateWiring()}),this.#t.context.subscribeProcessPhase(t=>{t===0&&this.#o&&(this.#a(),this.#o=!1)}))}get noteSequencer(){return this.#r}invalidateWiring(){this.#n.terminate(),this.#o=!0}terminate(){this.#e.terminate()}toString(){return`{${this.constructor.name}}`}#a(){let e=this.#t.input().flatMap(n=>n.noteEventTarget);if(e.isEmpty())return;let t=e.unwrap(),i=this.#r;this.#t.adapter.midiEffects.adapters().map(n=>this.#i.get(n.uuid).device).forEach(n=>{n.adapter().enabledField.getValue()&&(this.#n.ownAll(n.setNoteEventSource(i),this.#t.context.registerEdge(n,t.incoming)),i=n)}),this.#n.own(t.setNoteEventSource(i))}};var tx=class r{static ID=0;#e=r.ID++;#t=new z;#r;#i;#n;#o;#a=g.None;constructor(e,t,i){this.#r=e,this.#i=t,this.#n=this.#t.own(new ex(this)),this.#o=this.#t.own(new Yy(this,i)),this.#t.ownAll(this.#i.input.catchupAndSubscribe(n=>{this.#n.invalidateWiring(),this.#o.invalidateWiring(),this.#a.ifSome(o=>o.terminate()),this.#a=n.getValue().flatMap(o=>g.wrap(Q_.create(e,o.box.box)))}))}input(){return this.#a}inputAsAudioBus(){return Be(this.#a.unwrap("No input available"),xc)}audioOutput(){return this.#o.channelStrip.audioOutput}get midiDeviceChain(){return this.#n}get audioDeviceChain(){return this.#o}get context(){return this.#r}get adapter(){return this.#i}terminate(){console.debug(`terminate ${this}`),this.#t.terminate(),this.#a.ifSome(e=>e.terminate()),this.#a=g.None}toString(){return`{${this.constructor.name}(${this.#e})}`}};var rx=class{#e;#t;#r;#i=!1;constructor(){this.#e=A.newSet(e=>e.adapter.uuid),this.#t=new Set,this.#r=new Set}attachChannelStrip(e){return this.#e.add(e),K.many(e.adapter.input.subscribe(()=>this.#n()),e.adapter.output.subscribe(()=>this.#n()),{terminate:()=>{this.#t.delete(e),this.#e.removeByValue(e),this.#n()}})}onChannelStripSoloChanged(e){e.isSolo?this.#t.add(e):this.#t.delete(e),this.#n()}hasChannelSolo(){return this.#t.size>0}isVirtualSolo(e){return this.#r.has(e)}#n(){this.#i||(this.#i=!0,this.#e.forEach(e=>e.requestSoloUpdate()))}updateSolo(){if(!this.#i)return;this.#r.clear();let e=new Set,t=i=>{e.has(i)||(e.add(i),i.adapter.input.getValue().ifSome(n=>{n.type==="bus"&&n.box.input.pointerHub.filter(l.AudioOutput).map(o=>Y(o.box.accept({visitAudioUnitBox:({address:{uuid:a}})=>this.#e.get(a),visitAuxSendBox:({audioUnit:{targetVertex:a}})=>this.#e.get(a.unwrap().address.uuid)}),"Could not resolve channel-strip")).forEach(o=>{o.isSolo||this.#r.add(o),t(o)})}))};this.#e.forEach(i=>{i.isSolo&&t(i)}),this.#i=!1}};var _a;(function(r){r[r.Float=0]="Float",r[r.FloatArray=1]="FloatArray",r[r.Integer=2]="Integer",r[r.IntegerArray=3]="IntegerArray",r[r.ByteArray=4]="ByteArray"})(_a||(_a={}));var kh;(function(r){r[r.WRITE=0]="WRITE",r[r.READ=1]="READ"})(kh||(kh={}));var Ac;(function(r){r[r.ID=15793935]="ID",r[r.START=15790320]="START",r[r.END=986895]="END"})(Ac||(Ac={}));var ix=class r{static create(e,t){return new r(e.channel(t))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#n=Bt.create(0);#o=g.None;#a=g.None;#l=-1;#s=-1;#u=!1;#c=!1;constructor(e){this.#i=Ln.sender(e,({dispatchAndForget:t})=>new class{sendShareLock(i){t(this.sendShareLock,i)}sendUpdateData(i){t(this.sendUpdateData,i)}sendUpdateStructure(i){t(this.sendUpdateStructure,i)}})}flush(){let e=this.#d();if(e.nonEmpty()){this.#c||(this.#i.sendShareLock(this.#t),this.#c=!0),this.#i.sendUpdateStructure(e.unwrap());let t=this.#p();if(this.#n.remaining<t){let i=go(t),n=new SharedArrayBuffer(i);this.#n=Bt.use(n),this.#o=g.wrap(n),this.#i.sendUpdateData(n)}}this.#o.isEmpty()||Atomics.load(this.#r,0)===kh.WRITE&&(this.#h(this.#n),this.#n.position=0,Atomics.store(this.#r,0,kh.READ))}broadcastFloat(e,t){return this.#m(new class{type=_a.Float;address=e;capacity=8;put(i){i.writeFloat(t())}})}broadcastInteger(e,t){return this.#m(new class{type=_a.Integer;address=e;capacity=8;put(i){i.writeInt(t())}})}broadcastFloats(e,t,i,n){return this.#m(new class{type=_a.FloatArray;address=e;capacity=4+(t.byteLength<<2);put(o){_(i),o.writeInt(t.length);for(let a of t)o.writeFloat(a);_(n)}})}broadcastIntegers(e,t,i){return this.#m(new class{type=_a.IntegerArray;address=e;capacity=4+(t.byteLength<<2);put(n){i(),n.writeInt(t.length),t.forEach(o=>n.writeInt(o))}})}broadcastByteArray(e,t,i){return this.#m(new class{type=_a.ByteArray;address=e;capacity=4+t.byteLength;put(n){i(),n.writeInt(t.byteLength),n.writeBytes(t)}})}#d(){if(this.#u){try{this.#a=g.wrap(this.#b())}catch(e){throw e}this.#u=!1}if(this.#a.nonEmpty()){let e=this.#a;return this.#a=g.None,e}return g.None}#p(){return this.#s===-1&&(this.#s=this.#f()+12),this.#s}terminate(){O.clear(this.#e),this.#a=g.None,this.#u=!1,this.#s=0}#h(e){D(!this.#u&&this.#a.isEmpty(),"Cannot flush while update is available");let t=this.#p();D(e.remaining>=t,"Insufficient data"),e.writeInt(this.#l),e.writeInt(Ac.START);for(let i of this.#e)i.put(e);e.writeInt(Ac.END)}#f(){return this.#e.reduce((e,t)=>e+t.capacity,0)}#m(e){return this.#e.push(e),this.#w(),{terminate:()=>{O.removeOpt(this.#e,e),this.#w()}}}#w(){this.#s=-1,this.#u=!0}#b(){let e=Bt.create();e.writeInt(Ac.ID),e.writeInt(++this.#l),e.writeInt(this.#e.length);for(let{address:t,type:i}of this.#e)t.write(e),e.writeByte(i);return e.toArrayBuffer()}};var nx=class{#e;#t;#r=new ge;#i=[];constructor(e,t){this.#e=e,this.#t=t}process({blocks:e}){e.forEach(({p0:t,p1:i,bpm:n,s0:o,s1:a,flags:s})=>{if(this.#t.metronomeEnabled&&nt.every(s,1)){let[u,c]=this.#e.signature,p=Q.fromSignature(1,c);for(let d of nn.iterate(t,i,p)){D(t<=d&&d<i,()=>`${d} out of bounds (${t}, ${i})`);let f=Math.floor(Q.pulsesToSamples(d-t,n,sampleRate));this.#i.push(new X_(d,o+f,u,c))}}this.#r.clear(o,a);for(let u=this.#i.length-1;u>=0;u--)this.#i[u].processAdd(this.#r,o,a)&&this.#i.splice(u,1)})}get output(){return this.#r}},X_=class{#e;#t=0;#r=0;constructor(e,t,i,n){D(t>=0&&t<128,`${t} out of bounds`),this.#e=Q.toParts(e,i,n).beats===0?880:440,this.#r=t}processAdd(e,t,i){let[n,o]=e.channels(),a=Math.floor(.002*sampleRate),s=Math.floor(.05*sampleRate);for(let u=Math.max(this.#r,t);u<i;u++){let c=Math.min(this.#t/a,1-(this.#t-a)/s),p=Math.sin(this.#t/sampleRate*$i*this.#e)*.25*c*c;if(n[u]+=p,o[u]+=p,++this.#t>a+s)return!0}return this.#r=0,!1}};var ox=class{#e;#t;#r=!0;#i=!1;#n=null;#o=!1;#a=0;constructor(e,t){this.#e=e,this.#e.timelineBoxAdapter.markerTrack.subscribe(()=>this.#o=!0),this.#e.timelineBoxAdapter.box.bpm.subscribe(()=>this.#i=!0),this.#r=t?.pauseOnLoopDisabled??!1,this.#t=new qs}setCallback(e,t){return this.#t.add(e,t),K.create(()=>this.#t.remove(e,t))}reset(){this.#i=!1,this.#o=!1,this.#a=0,this.#n=null}process(e){let t=!1,{timeInfo:i,timelineBoxAdapter:{box:n,markerTrack:o}}=this.#e,a=n.bpm.getValue(),s=i.transporting;if(s){let u=[],c=i.position,p=0,d=0,f=i.getLeapStateAndReset();for(;p<128;){if(this.#o||f){this.#o=!1;let J=o.events.lowerEqual(c);(this.#n?.at(0)??null)!==J&&(this.#n=Z(J)?[J,0]:null,t=!0)}let v=128-p,m=c+Q.samplesToPulses(v,a,sampleRate),y=null,x=Number.POSITIVE_INFINITY;if(o.enabled){let J=Array.from(Je.take(o.events.iterateFrom(c),2));if(J.length>0){let[oe,se]=J;this.#n===null?oe.position>=c&&oe.position<m&&(y={type:"marker",prev:oe,next:se},x=oe.position):Z(se)&&se!==this.#n[0]&&oe.position<c&&se.position<m&&(y={type:"marker",prev:oe,next:se},x=se.position)}}let{isRecording:$,isCountingIn:I}=this.#e.timeInfo,{from:T,to:R,enabled:L}=n.loopArea;if(L.getValue()&&!($||I)||this.#r){let J=R.getValue();c<J&&m>J&&J<x&&(y={type:"loop",target:T.getValue()},x=J)}if(this.#t.keyCount()>0)for(let J of this.#t.keys())c<J&&m>J&&J<x&&(y={type:"callback",position:J,callbacks:this.#t.get(J)},x=J);let xe=!i.isCountingIn;if(y===null){let J=p+v;u.push({index:d++,p0:c,p1:m,s0:p,s1:J,bpm:a,flags:vc.create(s,f,xe,this.#i)}),f=!1,c=m,p=J}else{let J=()=>{if(x>c){let se=p+Q.pulsesToSamples(x-c,a,sampleRate)|0;se>p&&(u.push({index:d++,p0:c,p1:x,s0:p,s1:se,bpm:a,flags:vc.create(s,f,xe,this.#i)}),f=!1),c=x,p=se}},oe=()=>{if(p<128){let se=p+Q.pulsesToSamples(m-c,a,sampleRate)|0;u.push({index:d++,p0:c,p1:x,s0:p,s1:se,bpm:a,flags:vc.create(!1,!1,!1,this.#i)}),p=se}};switch(y.type){case"loop":{J(),this.#r?(this.#e.timeInfo.pause(),oe()):(c=y.target,f=!0);break}case"marker":{let{prev:se,next:Le}=y;!Z(this.#n)||this.#n[0]!==se?this.#n=[se,0]:++this.#n[1]<se.plays||se.plays===0?(J(),c=se.position,f=!0):this.#n=[Le,0],t=!0;break}case"callback":{J(),y.callbacks.forEach(se=>se());break}}}this.#i=!1}e({blocks:u}),i.advanceTo(c),this.#a=c}else{if(this.#o||i.getLeapStateAndReset()){this.#o=!1;let d=o.events.lowerEqual(i.position);d!==null&&this.#n?.at(0)!==d&&(this.#n=[d,0],t=!0)}let u=this.#a,c=u+Q.samplesToPulses(128,a,sampleRate),p={blocks:[{index:0,p0:u,p1:c,s0:0,s1:128,bpm:a,flags:vc.create(!1,!1,!1,!1)}]};e(p),this.#a=c}t&&this.#e.engineToClient.switchMarkerState(Z(this.#n)?[this.#n[0].uuid,this.#n[1]]:null)}};var eP=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchAudio(e).then(i=>this.#t=g.wrap(i))}peaks=g.None;#e={type:"idle"};#t=g.None;get data(){return this.#t}get state(){return this.#e}subscribe(e){return K.Empty}invalidate(){}toString(){return"{AudioLoaderWorklet}"}},ax=class{#e;#t;constructor(e){this.#e=e,this.#t=A.newSet(t=>t.uuid)}record(e){}getOrCreate(e){return this.#t.getOrCreate(e,t=>new eP(t,this.#e))}remove(e){}invalidate(e){}};var sx=class{constructor(e){this.uuid=e}waiting=g.None;playing=g.None},lx=class{#e;#t;#r=[];#i=[];#n=[];constructor(e){this.#e=e,this.#e.subscribeToAllUpdatesImmediate({onUpdate:t=>{if(t.type==="delete"){let i=t.uuid;this.#t.opt(i).ifSome(n=>{n.playing.ifSome(o=>this.#a(o.uuid)),n.playing=g.None,n.waiting=g.None}),this.#t.forEach(n=>{n.playing.nonEmpty()&&A.equals(n.playing.unwrap().uuid,i)&&(n.playing=g.None,this.#a(i));let o=n.waiting.flatMap(Pc);o.nonEmpty()&&A.equals(o.unwrap().uuid,i)&&(n.waiting=g.None)})}}}),this.#t=A.newSet(t=>t.uuid)}schedulePlay(e){e.trackBoxAdapter.ifSome(({uuid:t})=>{let i=this.#t.getOrCreate(t,o=>new sx(o));if(i.playing.nonEmpty()&&i.playing.unwrap()===e){console.debug(`${e} is already playing (ignore)`);return}let n=i.waiting.flatMap(o=>o);n.nonEmpty()&&(console.debug("obsolete",n.unwrap()),this.#n.push(n.unwrap().uuid),i.waiting=g.None),console.debug(`schedulePlay(${A.toString(i.uuid)} > ${e})`),O.removeOpt(this.#n,e.uuid),i.waiting=g.wrap(g.wrap(e))})}scheduleStop({uuid:e}){let t=this.#t.getOrCreate(e,n=>new sx(n)),i=t.waiting.flatMap(n=>n);i.nonEmpty()&&(console.debug("obsolete",i.unwrap()),this.#n.push(i.unwrap().uuid),t.waiting=g.None),t.playing.nonEmpty()&&(console.debug(`scheduleStop(${A.toString(e)})`),t.waiting=g.wrap(g.None))}reset(){this.#t.forEach(e=>{e.waiting.ifSome(t=>t.ifSome(i=>this.#n.push(i.uuid))),e.waiting=g.None,e.playing.ifSome(t=>this.#a(t.uuid)),e.playing=g.None}),this.#t.clear()}*iterate(e,t,i){let n=this.#t.getOrNull(e);if(n===null){yield{optClip:g.None,sectionFrom:t,sectionTo:i};return}if(n.waiting.nonEmpty()){let o=n.waiting.unwrap(),a=n.playing.mapOr(u=>u.duration,Q.Bar),s=Vn(i,a);s>=t?(t<s&&(yield{optClip:n.playing,sectionFrom:t,sectionTo:s}),n.waiting=g.None,n.playing.ifSome(u=>this.#a(u.uuid)),o.nonEmpty()?(n.playing=o,this.#o(o.unwrap().uuid)):n.playing=g.None,yield{optClip:n.playing,sectionFrom:s,sectionTo:i}):yield{optClip:n.playing,sectionFrom:t,sectionTo:i}}else if(n.playing.nonEmpty()){let o=n.playing.unwrap();if(o.box.triggerMode.loop.getValue())yield{optClip:n.playing,sectionFrom:t,sectionTo:i};else{let a=Vn(t,o.duration)+o.duration;a<=i?(yield{optClip:n.playing,sectionFrom:t,sectionTo:a},n.playing=g.None,this.#a(o.uuid),a<i&&(yield{optClip:g.None,sectionFrom:a,sectionTo:i})):yield{optClip:n.playing,sectionFrom:t,sectionTo:i}}}else yield{optClip:g.None,sectionFrom:t,sectionTo:i}}changes(){if(this.#r.length>0||this.#i.length>0||this.#n.length>0){let e=g.wrap({started:this.#r.slice(),stopped:this.#i.slice(),obsolete:this.#n.slice()});return this.#r.length=0,this.#i.length=0,this.#n.length=0,e}return g.None}terminate(){this.#t.clear(),this.#r.length=0,this.#i.length=0,this.#n.length=0}#o(e){this.#r.push(e)}#a(e){this.#i.push(e)}};var tP;(e=>e.Default={includeAudioEffects:!0,includeSends:!0})(tP||={});var rP=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchSoundfont(e).then(i=>this.#t=g.wrap(i))}peaks=g.None;#e={type:"idle"};#t=g.None;get soundfont(){return this.#t}get state(){return this.#e}subscribe(e){return K.Empty}invalidate(){}toString(){return"{SoundfontLoaderWorklet}"}},ux=class{#e;#t;constructor(e){this.#e=e,this.#t=A.newSet(t=>t.uuid)}getOrCreate(e){return this.#t.getOrCreate(e,t=>new rP(t,this.#e))}remove(e){}invalidate(e){}};var cx=class r extends Xt{static ClockRate=Q.fromSignature(1,96);#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=[],this.own(this.context.registerProcessor(this))}schedule(e){this.#t.push(e)}reset(){this.eventInput.clear()}process({blocks:e}){let t=this.#e.midiOutputDevices;if(t.length===0){this.#t.length=0;return}let i=t.filter(n=>n.sendTransportMessages.getValue()&&n.id.getValue()!=="");if(i.length===0){this.#t.length=0;return}i.forEach(n=>{let o=n.id.getValue(),a=n.delayInMs.getValue();this.#t.forEach(s=>this.context.sendMIDIData(o,s,a)),this.#t.length=0}),e.forEach(({p0:n,p1:o,s0:a,bpm:s,flags:u})=>{let c=a/sampleRate;if(nt.every(u,1))for(let p of nn.iterate(n,o,r.ClockRate)){let d=Q.pulsesToSeconds(p-n,s);i.forEach(f=>{let v=f.id.getValue(),m=f.delayInMs.getValue(),y=(c+d)*1e3+m;this.context.sendMIDIData(v,it.Clock,y)})}})}toString(){return`{${this.constructor.name}}`}};var dx=class{#e;#t;#r;#i;#n=new Map;#o=[];constructor(e,t){this.#e=e,this.#t=new Uint32Array(t,0,2),this.#r=new Uint32Array(t,8),this.#i=(this.#r.length>>1)-1}send(e,t,i){let n=this.#n.get(e);if(Ws(n)){if(n=this.#o.length,n>=64)return console.error(`Too many MIDI devices: ${n}, max is 64`),!1;this.#n.set(e,n),this.#o.push(e),this.#e.postMessage({registerDevice:e,id:n})}let o=Atomics.load(this.#t,0),a=o+1&this.#i;if(a===Atomics.load(this.#t,1))return!1;let s=t.length,u=t[0]??0,c=t[1]??0,p=t[2]??0,d=s<<30|n<<24|u<<16|c<<8|p,f=i|0,v=o<<1;return this.#r[v]=d,this.#r[v+1]=f,Atomics.store(this.#t,0,a),this.#e.postMessage(null),!0}};var K$=!1,px=class extends AudioWorkletProcessor{#e;#t;#r;#i;#n;#o;#a;#l;#s;#u;#c;#d;#p;#h;#f;#m;#w;#b;#A;#N;#B;#P;#k;#g;#v;#y;#S;#F;#E;#_=g.None;#$=g.None;#M=g.None;#I=g.None;#C=!1;#R=!0;#T=!1;#O=0;#D=0;#V=!0;#z=1;constructor({processorOptions:{syncStreamBuffer:e,controlFlagsBuffer:t,project:i,exportConfiguration:n,options:o}}){super();let{boxGraph:a,mandatoryBoxes:{rootBox:s,timelineBox:u}}=fa.decode(i);this.#e=new z,this.#t=_P.for(this.port),this.#r=a,this.#i=new cf,this.#S=new Int32Array(t),this.#n=Ln.sender(this.#t.channel("engine-to-client"),d=>new class{log(f){d.dispatchAndForget(this.log,f)}error(f){d.dispatchAndForget(this.error,f)}fetchAudio(f){return d.dispatchAndReturn(this.fetchAudio,f)}fetchSoundfont(f){return d.dispatchAndReturn(this.fetchSoundfont,f)}notifyClipSequenceChanges(f){d.dispatchAndForget(this.notifyClipSequenceChanges,f)}switchMarkerState(f){d.dispatchAndForget(this.switchMarkerState,f)}ready(){d.dispatchAndForget(this.ready)}}),this.#a=new ax(this.#n),this.#l=new ux(this.#n),this.#s=A.newSet(d=>d.adapter.uuid),this.#p=new Lg,this.#d=new ef(u.bpm),this.#o=this.#e.own(new Og(this)),this.#u=this.#o.adapterFor(s,Eu),this.#c=this.#o.adapterFor(u,En),this.#h=new Zh,this.#f=new Gh(this.#h),this.#m=new ee,this.#w=new rx,this.#k=new nx(this.#c,this.#i),this.#g=new cx(this,this.#u),this.#v=new ox(this,o),this.#E=A.newSet(d=>d),this.#y=Ys.writer(w1(),e,d=>{let{transporting:f,isCountingIn:v,isRecording:m,position:y}=this.#i,x=this.#c.box.signature.denominator.getValue();d.position=y,d.playbackTimestamp=this.#D,d.countInBeatsRemaining=v?(this.#O-y)/Q.fromSignature(1,x):0,d.isPlaying=f,d.isRecording=m,d.isCountingIn=v}),this.#b=this.#e.own(ix.create(this.#t,"engine-live-data")),this.#N=new iy(this),this.#B=this.#e.own(new _e(this.#b,Yu.PEAKS)),this.#P=new Ks;let c=new Float32Array(this.#P.numBins()),p=new Float32Array(this.#P.numBins());this.#e.own(this.#b.broadcastFloats(Yu.SPECTRUM,c,()=>{c.set(this.#P.bins()),this.#P.decay=!0})),this.#e.own(this.#b.broadcastFloats(Yu.WAVEFORM,p,()=>p.set(this.#P.waveform()))),this.#A=this.#e.own(new lx(this.#r)),this.#e.ownAll(PP(this.#r,this.#t.channel("engine-sync")),Ln.executor(this.#t.channel("engine-commands"),{play:()=>this.#U(),stop:d=>this.#j(d),setPosition:d=>this.#L(d),prepareRecordingState:d=>this.#K(d),stopRecording:()=>this.#W(),setMetronomeEnabled:d=>this.#i.metronomeEnabled=this.#T=d,setPlaybackTimestampEnabled:d=>this.#V=d,setCountInBarsTotal:d=>this.#z=d,queryLoadingComplete:()=>Promise.resolve(this.#r.boxes().every(d=>d.accept({visitAudioFileBox:f=>this.#a.getOrCreate(f.address.uuid).data.nonEmpty()&&f.pointerHub.nonEmpty()})??!0)),panic:()=>this.#C=!0,noteSignal:d=>{if(pa.isOn(d)){let{uuid:f,pitch:v,velocity:m}=d;this.optAudioUnit(f).ifSome(y=>y.midiDeviceChain.noteSequencer.pushRawNoteOn(v,m))}else if(pa.isOff(d)){let{uuid:f,pitch:v}=d;this.optAudioUnit(f).ifSome(m=>m.midiDeviceChain.noteSequencer.pushRawNoteOff(v))}},ignoreNoteRegion:d=>this.#E.add(d),scheduleClipPlay:d=>{d.forEach(f=>{let v=this.#r.findBox(f);if(v.isEmpty())console.warn(`Could not scheduleClipPlay. Cannot find clip: '${A.toString(f)}'`);else{let m=mm.for(this.#o,v.unwrap());this.#A.schedulePlay(m)}}),this.#i.transporting=!0,this.#g.schedule(it.Start)},scheduleClipStop:d=>{d.forEach(f=>{let v=this.#r.findBox(f);v.isEmpty()?console.warn(`Could not scheduleClipStop. Cannot find track: '${A.toString(f)}'`):this.#A.scheduleStop(this.#o.adapterFor(v.unwrap(),pt))})},setupMIDI:(d,f)=>{this.#I=g.wrap(new dx(d,f))},terminate:()=>{this.#M.ifSome(d=>d.terminate()),this.#M=g.None,this.#R=!1,this.#E.clear(),this.#e.terminate()}}),this.#u.audioUnits.catchupAndSubscribe({onAdd:d=>{let f=A.toString(d.uuid),v=Z(n?.[f])?n[f]:tP.Default,m=new tx(this,d,v),y=this.#s.add(m);if(D(y,`Could not add ${m}`),m.adapter.isOutput){D(this.#$.isEmpty(),"Output can only assigned once."),this.#$=g.wrap(m);return}},onRemove:({uuid:d})=>this.#s.removeByKey(d).terminate(),onReorder:ki})),this.#F=g.wrap(n).match({none:()=>O.empty(),some:d=>Object.keys(d).map(f=>this.#s.get(A.parse(f)))}),this.#n.ready(),console.log=(...d)=>this.#n.log(d.join(", "))}ignoresRegion(e){return this.#E.hasKey(e)}process(e,t){if(!this.#R)return!1;if(Atomics.load(this.#S,0)===1)return!0;try{return this.render(e,t)}catch(i){return console.debug(i),this.#R=!1,this.#n.error(i),this.terminate(),!1}}render(e,[t]){if(!this.#R)return!1;if(this.#C)return F("Manual Panic");let i=this.#i.metronomeEnabled;this.#m.notify(0),this.#_.isEmpty()&&(this.#f.update(),this.#_=g.wrap(this.#f.sorted().concat()),K$&&console.debug(`%cAudio-Graph%c
25
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let p of this.seen.entries()){let d=p[1];if(e===p[0]){a(p);continue}if(i.external){let v=i.external.registry.get(p[0])?.id;if(e!==p[0]&&v){a(p);continue}}if(this.metadataRegistry.get(p[0])?.id){a(p);continue}if(d.cycle){a(p);continue}if(d.count>1&&i.reused==="ref"){a(p);continue}}let s=(p,d)=>{let f=this.seen.get(p),v=f.def??f.schema,m={...v};if(f.ref===null)return;let y=f.ref;if(f.ref=null,y){s(y,d);let x=this.seen.get(y).schema;x.$ref&&(d.target==="draft-7"||d.target==="draft-4"||d.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(x)):(Object.assign(v,x),Object.assign(v,m))}f.isParent||this.override({zodSchema:p,jsonSchema:v,path:f.path??[]})};for(let p of[...this.seen.entries()].reverse())s(p[0],{target:this.target});let l={};if(this.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?l.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?l.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn(`Invalid target: ${this.target}`),i.external?.uri){let p=i.external.registry.get(e)?.id;if(!p)throw new Error("Schema is missing an `id` property");l.$id=i.external.uri(p)}Object.assign(l,n.def);let c=i.external?.defs??{};for(let p of this.seen.entries()){let d=p[1];d.def&&d.defId&&(c[d.defId]=d.def)}i.external||Object.keys(c).length>0&&(this.target==="draft-2020-12"?l.$defs=c:l.definitions=c);try{return JSON.parse(JSON.stringify(l))}catch{throw new Error("Error converting schema to JSON.")}}};function qA(r,e){if(r instanceof hc){let i=new Ah(e),n={};for(let s of r._idmap.entries()){let[l,c]=s;i.process(c)}let o={},a={registry:r,uri:e?.uri,defs:n};for(let s of r._idmap.entries()){let[l,c]=s;o[l]=i.emit(c,{...e,external:a})}if(Object.keys(n).length>0){let s=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[s]:n}}return{schemas:o}}let t=new Ah(e);return t.process(r),t.emit(r,e)}function gr(r,e){let t=e??{seen:new Set};if(t.seen.has(r))return!1;t.seen.add(r);let i=r._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return gr(i.element,t);if(i.type==="set")return gr(i.valueType,t);if(i.type==="lazy")return gr(i.getter(),t);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return gr(i.innerType,t);if(i.type==="intersection")return gr(i.left,t)||gr(i.right,t);if(i.type==="record"||i.type==="map")return gr(i.keyType,t)||gr(i.valueType,t);if(i.type==="pipe")return gr(i.in,t)||gr(i.out,t);if(i.type==="object"){for(let n in i.shape)if(gr(i.shape[n],t))return!0;return!1}if(i.type==="union"){for(let n of i.options)if(gr(n,t))return!0;return!1}if(i.type==="tuple"){for(let n of i.items)if(gr(n,t))return!0;return!!(i.rest&&gr(i.rest,t))}return!1}var eE={};var Jv={};ka(Jv,{ZodISODate:()=>Gv,ZodISODateTime:()=>Zv,ZodISODuration:()=>Hv,ZodISOTime:()=>qv,date:()=>JA,datetime:()=>HA,duration:()=>YA,time:()=>QA});var Zv=b("ZodISODateTime",(r,e)=>{o0.init(r,e),Qe.init(r,e)});function HA(r){return lA(Zv,r)}var Gv=b("ZodISODate",(r,e)=>{a0.init(r,e),Qe.init(r,e)});function JA(r){return uA(Gv,r)}var qv=b("ZodISOTime",(r,e)=>{s0.init(r,e),Qe.init(r,e)});function QA(r){return cA(qv,r)}var Hv=b("ZodISODuration",(r,e)=>{l0.init(r,e),Qe.init(r,e)});function YA(r){return dA(Hv,r)}var rE=(r,e)=>{Jp.init(r,e),r.name="ZodError",Object.defineProperties(r,{format:{value:t=>Yp(r,t)},flatten:{value:t=>Qp(r,t)},addIssue:{value:t=>{r.issues.push(t),r.message=JSON.stringify(r.issues,oc,2)}},addIssues:{value:t=>{r.issues.push(...t),r.message=JSON.stringify(r.issues,oc,2)}},isEmpty:{get(){return r.issues.length===0}}})},pk=b("ZodError",rE),$r=b("ZodError",rE,{Parent:Error});var XA=lc($r),e_=uc($r),t_=cc($r),r_=dc($r),i_=rv($r),n_=iv($r),o_=nv($r),a_=ov($r),s_=av($r),l_=sv($r),u_=lv($r),c_=uv($r);var Pe=b("ZodType",(r,e)=>(fe.init(r,e),r.def=e,r.type=e.type,Object.defineProperty(r,"_def",{value:e}),r.check=(...t)=>r.clone(L.mergeDefs(e,{checks:[...e.checks??[],...t.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]})),r.clone=(t,i)=>fr(r,t,i),r.brand=()=>r,r.register=(t,i)=>(t.add(r,i),r),r.parse=(t,i)=>XA(r,t,i,{callee:r.parse}),r.safeParse=(t,i)=>t_(r,t,i),r.parseAsync=async(t,i)=>e_(r,t,i,{callee:r.parseAsync}),r.safeParseAsync=async(t,i)=>r_(r,t,i),r.spa=r.safeParseAsync,r.encode=(t,i)=>i_(r,t,i),r.decode=(t,i)=>n_(r,t,i),r.encodeAsync=async(t,i)=>o_(r,t,i),r.decodeAsync=async(t,i)=>a_(r,t,i),r.safeEncode=(t,i)=>s_(r,t,i),r.safeDecode=(t,i)=>l_(r,t,i),r.safeEncodeAsync=async(t,i)=>u_(r,t,i),r.safeDecodeAsync=async(t,i)=>c_(r,t,i),r.refine=(t,i)=>r.check(LE(t,i)),r.superRefine=t=>r.check(KE(t)),r.overwrite=t=>r.check(Rn(t)),r.optional=()=>Yv(r),r.nullable=()=>Xv(r),r.nullish=()=>Yv(Xv(r)),r.nonoptional=t=>$E(r,t),r.array=()=>iy(r),r.or=t=>D_([r,t]),r.and=t=>vE(r,t),r.transform=t=>ey(r,T_(t)),r.default=t=>FE(r,t),r.prefault=t=>kE(r,t),r.catch=t=>IE(r,t),r.pipe=t=>ey(r,t),r.readonly=()=>RE(r),r.describe=t=>{let i=r.clone();return mr.add(i,{description:t}),i},Object.defineProperty(r,"description",{get(){return mr.get(r)?.description},configurable:!0}),r.meta=(...t)=>{if(t.length===0)return mr.get(r);let i=r.clone();return mr.add(i,t[0]),i},r.isOptional=()=>r.safeParse(void 0).success,r.isNullable=()=>r.safeParse(null).success,r)),h_=b("_ZodString",(r,e)=>{Ls.init(r,e),Pe.init(r,e);let t=r._zod.bag;r.format=t.format??null,r.minLength=t.minimum??null,r.maxLength=t.maximum??null,r.regex=(...i)=>r.check(ch(...i)),r.includes=(...i)=>r.check(hh(...i)),r.startsWith=(...i)=>r.check(fh(...i)),r.endsWith=(...i)=>r.check(mh(...i)),r.min=(...i)=>r.check(Sa(...i)),r.max=(...i)=>r.check(mc(...i)),r.length=(...i)=>r.check(gc(...i)),r.nonempty=(...i)=>r.check(Sa(1,...i)),r.lowercase=i=>r.check(dh(i)),r.uppercase=i=>r.check(ph(i)),r.trim=()=>r.check(yh()),r.normalize=(...i)=>r.check(vh(...i)),r.toLowerCase=()=>r.check(xh()),r.toUpperCase=()=>r.check(wh()),r.slugify=()=>r.check(bh())}),Ph=b("ZodString",(r,e)=>{Ls.init(r,e),h_.init(r,e),r.email=t=>r.check(Ev(f_,t)),r.url=t=>r.check(lh(ty,t)),r.jwt=t=>r.check(Wv(N_,t)),r.emoji=t=>r.check($v(m_,t)),r.guid=t=>r.check(sh(Qv,t)),r.uuid=t=>r.check(Bv(yo,t)),r.uuidv4=t=>r.check(Fv(yo,t)),r.uuidv6=t=>r.check(Nv(yo,t)),r.uuidv7=t=>r.check(kv(yo,t)),r.nanoid=t=>r.check(Mv(g_,t)),r.guid=t=>r.check(sh(Qv,t)),r.cuid=t=>r.check(Dv(v_,t)),r.cuid2=t=>r.check(Iv(y_,t)),r.ulid=t=>r.check(Cv(x_,t)),r.base64=t=>r.check(jv(E_,t)),r.base64url=t=>r.check(Lv(B_,t)),r.xid=t=>r.check(Tv(w_,t)),r.ksuid=t=>r.check(Rv(b_,t)),r.ipv4=t=>r.check(Ov(A_,t)),r.ipv6=t=>r.check(Vv(__,t)),r.cidrv4=t=>r.check(zv(P_,t)),r.cidrv6=t=>r.check(Uv(S_,t)),r.e164=t=>r.check(Kv(F_,t)),r.datetime=t=>r.check(HA(t)),r.date=t=>r.check(JA(t)),r.time=t=>r.check(QA(t)),r.duration=t=>r.check(YA(t))});function d_(r){return nA(Ph,r)}var Qe=b("ZodStringFormat",(r,e)=>{Ze.init(r,e),h_.init(r,e)}),f_=b("ZodEmail",(r,e)=>{Jb.init(r,e),Qe.init(r,e)});function fk(r){return Ev(f_,r)}var Qv=b("ZodGUID",(r,e)=>{qb.init(r,e),Qe.init(r,e)});function mk(r){return sh(Qv,r)}var yo=b("ZodUUID",(r,e)=>{Hb.init(r,e),Qe.init(r,e)});function gk(r){return Bv(yo,r)}function vk(r){return Fv(yo,r)}function yk(r){return Nv(yo,r)}function xk(r){return kv(yo,r)}var ty=b("ZodURL",(r,e)=>{Qb.init(r,e),Qe.init(r,e)});function wk(r){return lh(ty,r)}function bk(r){return lh(ty,{protocol:/^https?$/,hostname:Fi.domain,...L.normalizeParams(r)})}var m_=b("ZodEmoji",(r,e)=>{Yb.init(r,e),Qe.init(r,e)});function Ak(r){return $v(m_,r)}var g_=b("ZodNanoID",(r,e)=>{Xb.init(r,e),Qe.init(r,e)});function _k(r){return Mv(g_,r)}var v_=b("ZodCUID",(r,e)=>{e0.init(r,e),Qe.init(r,e)});function Pk(r){return Dv(v_,r)}var y_=b("ZodCUID2",(r,e)=>{t0.init(r,e),Qe.init(r,e)});function Sk(r){return Iv(y_,r)}var x_=b("ZodULID",(r,e)=>{r0.init(r,e),Qe.init(r,e)});function Ek(r){return Cv(x_,r)}var w_=b("ZodXID",(r,e)=>{i0.init(r,e),Qe.init(r,e)});function Bk(r){return Tv(w_,r)}var b_=b("ZodKSUID",(r,e)=>{n0.init(r,e),Qe.init(r,e)});function Fk(r){return Rv(b_,r)}var A_=b("ZodIPv4",(r,e)=>{u0.init(r,e),Qe.init(r,e)});function Nk(r){return Ov(A_,r)}var iE=b("ZodMAC",(r,e)=>{d0.init(r,e),Qe.init(r,e)});function kk(r){return aA(iE,r)}var __=b("ZodIPv6",(r,e)=>{c0.init(r,e),Qe.init(r,e)});function $k(r){return Vv(__,r)}var P_=b("ZodCIDRv4",(r,e)=>{p0.init(r,e),Qe.init(r,e)});function Mk(r){return zv(P_,r)}var S_=b("ZodCIDRv6",(r,e)=>{h0.init(r,e),Qe.init(r,e)});function Dk(r){return Uv(S_,r)}var E_=b("ZodBase64",(r,e)=>{m0.init(r,e),Qe.init(r,e)});function Ik(r){return jv(E_,r)}var B_=b("ZodBase64URL",(r,e)=>{g0.init(r,e),Qe.init(r,e)});function Ck(r){return Lv(B_,r)}var F_=b("ZodE164",(r,e)=>{v0.init(r,e),Qe.init(r,e)});function Tk(r){return Kv(F_,r)}var N_=b("ZodJWT",(r,e)=>{y0.init(r,e),Qe.init(r,e)});function Rk(r){return Wv(N_,r)}var Sh=b("ZodCustomStringFormat",(r,e)=>{x0.init(r,e),Qe.init(r,e)});function Ok(r,e,t={}){return vc(Sh,r,e,t)}function Vk(r){return vc(Sh,"hostname",Fi.hostname,r)}function zk(r){return vc(Sh,"hex",Fi.hex,r)}function Uk(r,e){let t=e?.enc??"hex",i=`${r}_${t}`,n=Fi[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return vc(Sh,i,n,e)}var Eh=b("ZodNumber",(r,e)=>{yv.init(r,e),Pe.init(r,e),r.gt=(i,n)=>r.check(go(i,n)),r.gte=(i,n)=>r.check(kr(i,n)),r.min=(i,n)=>r.check(kr(i,n)),r.lt=(i,n)=>r.check(mo(i,n)),r.lte=(i,n)=>r.check(Ni(i,n)),r.max=(i,n)=>r.check(Ni(i,n)),r.int=i=>r.check(p_(i)),r.safe=i=>r.check(p_(i)),r.positive=i=>r.check(go(0,i)),r.nonnegative=i=>r.check(kr(0,i)),r.negative=i=>r.check(mo(0,i)),r.nonpositive=i=>r.check(Ni(0,i)),r.multipleOf=(i,n)=>r.check(Ks(i,n)),r.step=(i,n)=>r.check(Ks(i,n)),r.finite=()=>r;let t=r._zod.bag;r.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,r.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,r.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),r.isFinite=!0,r.format=t.format??null});function nE(r){return pA(Eh,r)}var xc=b("ZodNumberFormat",(r,e)=>{w0.init(r,e),Eh.init(r,e)});function p_(r){return fA(xc,r)}function jk(r){return mA(xc,r)}function Lk(r){return gA(xc,r)}function Kk(r){return vA(xc,r)}function Wk(r){return yA(xc,r)}var Bh=b("ZodBoolean",(r,e)=>{rh.init(r,e),Pe.init(r,e)});function oE(r){return xA(Bh,r)}var Fh=b("ZodBigInt",(r,e)=>{xv.init(r,e),Pe.init(r,e),r.gte=(i,n)=>r.check(kr(i,n)),r.min=(i,n)=>r.check(kr(i,n)),r.gt=(i,n)=>r.check(go(i,n)),r.gte=(i,n)=>r.check(kr(i,n)),r.min=(i,n)=>r.check(kr(i,n)),r.lt=(i,n)=>r.check(mo(i,n)),r.lte=(i,n)=>r.check(Ni(i,n)),r.max=(i,n)=>r.check(Ni(i,n)),r.positive=i=>r.check(go(BigInt(0),i)),r.negative=i=>r.check(mo(BigInt(0),i)),r.nonpositive=i=>r.check(Ni(BigInt(0),i)),r.nonnegative=i=>r.check(kr(BigInt(0),i)),r.multipleOf=(i,n)=>r.check(Ks(i,n));let t=r._zod.bag;r.minValue=t.minimum??null,r.maxValue=t.maximum??null,r.format=t.format??null});function Zk(r){return bA(Fh,r)}var k_=b("ZodBigIntFormat",(r,e)=>{b0.init(r,e),Fh.init(r,e)});function Gk(r){return _A(k_,r)}function qk(r){return PA(k_,r)}var aE=b("ZodSymbol",(r,e)=>{A0.init(r,e),Pe.init(r,e)});function Hk(r){return SA(aE,r)}var sE=b("ZodUndefined",(r,e)=>{_0.init(r,e),Pe.init(r,e)});function Jk(r){return EA(sE,r)}var lE=b("ZodNull",(r,e)=>{P0.init(r,e),Pe.init(r,e)});function uE(r){return BA(lE,r)}var cE=b("ZodAny",(r,e)=>{S0.init(r,e),Pe.init(r,e)});function Qk(){return FA(cE)}var dE=b("ZodUnknown",(r,e)=>{E0.init(r,e),Pe.init(r,e)});function yc(){return NA(dE)}var pE=b("ZodNever",(r,e)=>{B0.init(r,e),Pe.init(r,e)});function $_(r){return kA(pE,r)}var hE=b("ZodVoid",(r,e)=>{F0.init(r,e),Pe.init(r,e)});function Yk(r){return $A(hE,r)}var ry=b("ZodDate",(r,e)=>{N0.init(r,e),Pe.init(r,e),r.min=(i,n)=>r.check(kr(i,n)),r.max=(i,n)=>r.check(Ni(i,n));let t=r._zod.bag;r.minDate=t.minimum?new Date(t.minimum):null,r.maxDate=t.maximum?new Date(t.maximum):null});function Xk(r){return MA(ry,r)}var fE=b("ZodArray",(r,e)=>{k0.init(r,e),Pe.init(r,e),r.element=e.element,r.min=(t,i)=>r.check(Sa(t,i)),r.nonempty=t=>r.check(Sa(1,t)),r.max=(t,i)=>r.check(mc(t,i)),r.length=(t,i)=>r.check(gc(t,i)),r.unwrap=()=>r.element});function iy(r,e){return zA(fE,r,e)}function e$(r){let e=r._zod.def.shape;return C_(Object.keys(e))}var ny=b("ZodObject",(r,e)=>{$0.init(r,e),Pe.init(r,e),L.defineLazy(r,"shape",()=>e.shape),r.keyof=()=>C_(Object.keys(r._zod.def.shape)),r.catchall=t=>r.clone({...r._zod.def,catchall:t}),r.passthrough=()=>r.clone({...r._zod.def,catchall:yc()}),r.loose=()=>r.clone({...r._zod.def,catchall:yc()}),r.strict=()=>r.clone({...r._zod.def,catchall:$_()}),r.strip=()=>r.clone({...r._zod.def,catchall:void 0}),r.extend=t=>L.extend(r,t),r.safeExtend=t=>L.safeExtend(r,t),r.merge=t=>L.merge(r,t),r.pick=t=>L.pick(r,t),r.omit=t=>L.omit(r,t),r.partial=(...t)=>L.partial(R_,r,t[0]),r.required=(...t)=>L.required(O_,r,t[0])});function t$(r,e){let t={type:"object",shape:r??{},...L.normalizeParams(e)};return new ny(t)}function r$(r,e){return new ny({type:"object",shape:r,catchall:$_(),...L.normalizeParams(e)})}function i$(r,e){return new ny({type:"object",shape:r,catchall:yc(),...L.normalizeParams(e)})}var M_=b("ZodUnion",(r,e)=>{wv.init(r,e),Pe.init(r,e),r.options=e.options});function D_(r,e){return new M_({type:"union",options:r,...L.normalizeParams(e)})}var mE=b("ZodDiscriminatedUnion",(r,e)=>{M_.init(r,e),M0.init(r,e)});function n$(r,e,t){return new mE({type:"union",options:e,discriminator:r,...L.normalizeParams(t)})}var gE=b("ZodIntersection",(r,e)=>{D0.init(r,e),Pe.init(r,e)});function vE(r,e){return new gE({type:"intersection",left:r,right:e})}var yE=b("ZodTuple",(r,e)=>{bv.init(r,e),Pe.init(r,e),r.rest=t=>r.clone({...r._zod.def,rest:t})});function xE(r,e,t){let i=e instanceof fe,n=i?t:e,o=i?e:null;return new yE({type:"tuple",items:r,rest:o,...L.normalizeParams(n)})}var I_=b("ZodRecord",(r,e)=>{I0.init(r,e),Pe.init(r,e),r.keyType=e.keyType,r.valueType=e.valueType});function wE(r,e,t){return new I_({type:"record",keyType:r,valueType:e,...L.normalizeParams(t)})}function o$(r,e,t){let i=fr(r);return i._zod.values=void 0,new I_({type:"record",keyType:i,valueType:e,...L.normalizeParams(t)})}var bE=b("ZodMap",(r,e)=>{C0.init(r,e),Pe.init(r,e),r.keyType=e.keyType,r.valueType=e.valueType});function a$(r,e,t){return new bE({type:"map",keyType:r,valueType:e,...L.normalizeParams(t)})}var AE=b("ZodSet",(r,e)=>{T0.init(r,e),Pe.init(r,e),r.min=(...t)=>r.check(Ws(...t)),r.nonempty=t=>r.check(Ws(1,t)),r.max=(...t)=>r.check(fc(...t)),r.size=(...t)=>r.check(uh(...t))});function s$(r,e){return new AE({type:"set",valueType:r,...L.normalizeParams(e)})}var _h=b("ZodEnum",(r,e)=>{R0.init(r,e),Pe.init(r,e),r.enum=e.entries,r.options=Object.values(e.entries);let t=new Set(Object.keys(e.entries));r.extract=(i,n)=>{let o={};for(let a of i)if(t.has(a))o[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new _h({...e,checks:[],...L.normalizeParams(n),entries:o})},r.exclude=(i,n)=>{let o={...e.entries};for(let a of i)if(t.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new _h({...e,checks:[],...L.normalizeParams(n),entries:o})}});function C_(r,e){let t=Array.isArray(r)?Object.fromEntries(r.map(i=>[i,i])):r;return new _h({type:"enum",entries:t,...L.normalizeParams(e)})}function l$(r,e){return new _h({type:"enum",entries:r,...L.normalizeParams(e)})}var _E=b("ZodLiteral",(r,e)=>{O0.init(r,e),Pe.init(r,e),r.values=new Set(e.values),Object.defineProperty(r,"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 u$(r,e){return new _E({type:"literal",values:Array.isArray(r)?r:[r],...L.normalizeParams(e)})}var PE=b("ZodFile",(r,e)=>{V0.init(r,e),Pe.init(r,e),r.min=(t,i)=>r.check(Ws(t,i)),r.max=(t,i)=>r.check(fc(t,i)),r.mime=(t,i)=>r.check(gh(Array.isArray(t)?t:[t],i))});function c$(r){return UA(PE,r)}var SE=b("ZodTransform",(r,e)=>{z0.init(r,e),Pe.init(r,e),r._zod.parse=(t,i)=>{if(i.direction==="backward")throw new xa(r.constructor.name);t.addIssue=o=>{if(typeof o=="string")t.issues.push(L.issue(o,t.value,e));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=t.value),a.inst??(a.inst=r),t.issues.push(L.issue(a))}};let n=e.transform(t.value,t);return n instanceof Promise?n.then(o=>(t.value=o,t)):(t.value=n,t)}});function T_(r){return new SE({type:"transform",transform:r})}var R_=b("ZodOptional",(r,e)=>{U0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType});function Yv(r){return new R_({type:"optional",innerType:r})}var EE=b("ZodNullable",(r,e)=>{j0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType});function Xv(r){return new EE({type:"nullable",innerType:r})}function d$(r){return Yv(Xv(r))}var BE=b("ZodDefault",(r,e)=>{L0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType,r.removeDefault=r.unwrap});function FE(r,e){return new BE({type:"default",innerType:r,get defaultValue(){return typeof e=="function"?e():L.shallowClone(e)}})}var NE=b("ZodPrefault",(r,e)=>{K0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType});function kE(r,e){return new NE({type:"prefault",innerType:r,get defaultValue(){return typeof e=="function"?e():L.shallowClone(e)}})}var O_=b("ZodNonOptional",(r,e)=>{W0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType});function $E(r,e){return new O_({type:"nonoptional",innerType:r,...L.normalizeParams(e)})}var ME=b("ZodSuccess",(r,e)=>{Z0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType});function p$(r){return new ME({type:"success",innerType:r})}var DE=b("ZodCatch",(r,e)=>{G0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType,r.removeCatch=r.unwrap});function IE(r,e){return new DE({type:"catch",innerType:r,catchValue:typeof e=="function"?e:()=>e})}var CE=b("ZodNaN",(r,e)=>{q0.init(r,e),Pe.init(r,e)});function h$(r){return IA(CE,r)}var V_=b("ZodPipe",(r,e)=>{H0.init(r,e),Pe.init(r,e),r.in=e.in,r.out=e.out});function ey(r,e){return new V_({type:"pipe",in:r,out:e})}var z_=b("ZodCodec",(r,e)=>{V_.init(r,e),ih.init(r,e)});function f$(r,e,t){return new z_({type:"pipe",in:r,out:e,transform:t.decode,reverseTransform:t.encode})}var TE=b("ZodReadonly",(r,e)=>{J0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType});function RE(r){return new TE({type:"readonly",innerType:r})}var OE=b("ZodTemplateLiteral",(r,e)=>{Q0.init(r,e),Pe.init(r,e)});function m$(r,e){return new OE({type:"template_literal",parts:r,...L.normalizeParams(e)})}var VE=b("ZodLazy",(r,e)=>{eA.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.getter()});function zE(r){return new VE({type:"lazy",getter:r})}var UE=b("ZodPromise",(r,e)=>{X0.init(r,e),Pe.init(r,e),r.unwrap=()=>r._zod.def.innerType});function g$(r){return new UE({type:"promise",innerType:r})}var jE=b("ZodFunction",(r,e)=>{Y0.init(r,e),Pe.init(r,e)});function v$(r){return new jE({type:"function",input:Array.isArray(r?.input)?xE(r?.input):r?.input??iy(yc()),output:r?.output??yc()})}var oy=b("ZodCustom",(r,e)=>{tA.init(r,e),Pe.init(r,e)});function y$(r){let e=new Je({check:"custom"});return e._zod.check=r,e}function x$(r,e){return jA(oy,r??(()=>!0),e)}function LE(r,e={}){return LA(oy,r,e)}function KE(r){return KA(r)}var w$=WA,b$=ZA;function A$(r,e={error:`Input not instance of ${r.name}`}){let t=new oy({type:"custom",check:"custom",fn:i=>i instanceof r,abort:!0,...L.normalizeParams(e)});return t._zod.bag.Class=r,t}var _$=(...r)=>GA({Codec:z_,Boolean:Bh,String:Ph},...r);function P$(r){let e=zE(()=>D_([d_(r),nE(),oE(),uE(),iy(e),wE(d_(),e)]));return e}function S$(r,e){return ey(T_(r),e)}var E$={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 B$(r){At({customError:r})}function F$(){return At().customError}var U_;U_||(U_={});var j_={};ka(j_,{bigint:()=>M$,boolean:()=>$$,date:()=>D$,number:()=>k$,string:()=>N$});function N$(r){return oA(Ph,r)}function k$(r){return hA(Eh,r)}function $$(r){return wA(Bh,r)}function M$(r){return AA(Fh,r)}function D$(r){return DA(ry,r)}At(Av());var WE=Nt.object({name:Nt.string(),bpm:Nt.number(),duration:Nt.number(),sample_rate:Nt.number(),origin:Nt.enum(["openDAW","recording","import"])});var cJ=WE.extend({uuid:A.zType(Nt)});var I$,C$,T$,R$,O$,V$;I$=new WeakMap,C$=new WeakMap,T$=new WeakMap,R$=new WeakMap,O$=new WeakMap,V$=new WeakMap;var wc=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},z$,U$,L_,K_,W_,j$,L$;U$=new WeakMap,L_=new WeakMap,K_=new WeakMap,W_=new WeakMap,j$=new WeakMap,z$=new WeakSet,L$=function(e){return e.pointerHub.catchupAndSubscribe({onAdded:t=>{let i=Ne(t.box,cn);I(i.isAttached(),"SelectionBox is not attached");let n=i.selectable.targetVertex.unwrap(()=>`SelectionBox has no target (${i.selectable.targetAddress.unwrapOrUndefined()?.toString()??"No address"})`),o={box:i,selectable:n};wc(this,W_,"f").proxy.onSelected(n),I(wc(this,L_,"f").add(o),"Could not add to entityMap"),I(wc(this,K_,"f").add(o),"Could not add to selectableMap")},onRemoved:t=>{let i=Ne(t.box,cn),n=wc(this,L_,"f").removeByKey(i.address.uuid);I(n.box===i,"Broken selection");let o=n.selectable;wc(this,W_,"f").proxy.onDeselected(o),wc(this,K_,"f").removeByKey(o.address)}},u.Selection)};var ZE=Nt.object({name:Nt.string(),size:Nt.number().int(),url:Nt.string(),license:Nt.string(),origin:Nt.enum(["openDAW","import"])});var SJ=ZE.extend({uuid:A.zType(Nt)});var GE;(function(r){r.cut=(e,t,i)=>{if(!(e.position>=t||t>=e.complete))if(Rw.isLoopableRegion(e)){let{position:n,complete:o,loopOffset:a,loopDuration:s}=e;e.duration=t-n,e.copyTo({position:t,duration:o-t,loopOffset:Dc(a+(t-n),s),consolidate:i})}else return F("Not yet implemented")},r.clip=(e,t,i)=>{if(Rw.isLoopableRegion(e)){let{position:n,complete:o,loopOffset:a,loopDuration:s}=e;if(o-i<=0)return F(`duration will zero or negative(${o-i})`);e.duration=t-n,e.copyTo({position:i,duration:o-i,loopOffset:Dc(a+(i-n),s)})}else return F("Not yet implemented")}})(GE||(GE={}));var bc;(e=>e.create=(t,i,n,o)=>0|(t?1:0)|(i?2:0)|(n?4:0)|(o?8:0))(bc||={});var Se=class r{static PEAK_DECAY=Math.exp(-1/(sampleRate*.25));static RMS_WINDOW=Math.floor(sampleRate*.1);#e;#t;#r;#i;#n;#o=0;#a=0;#u=0;#s=0;constructor(e,t){this.#e=e,this.#t=t,this.#r=new Float32Array(4),this.#i=R.create(()=>new sl(r.RMS_WINDOW),2),this.#n=this.#e.broadcastFloats(this.#t,this.#r,()=>{this.#r[0]=this.#o,this.#r[1]=this.#a,this.#r[2]=this.#u,this.#r[3]=this.#s})}clear(){this.#i[0].clear(),this.#i[1].clear(),this.#o=0,this.#a=0}process(e,t,i=0,n=128){let o=n-i,a=r.PEAK_DECAY**o,s=0,l=0;for(let c=i;c<n;c++){let p=Math.abs(e[c]),d=Math.abs(t[c]);p>s&&(s=p),d>l&&(l=d)}this.#o=Math.max(s,this.#o*a),this.#a=Math.max(l,this.#a*a),this.#u=this.#i[0].processBlock(e,i,n),this.#s=this.#i[1].processBlock(t,i,n)}processStereo([e,t],i=0,n=128){this.process(e,t,i,n)}terminate(){this.#n.terminate()}};var ay=class{#e=new U;#t;#r;#i;#n=g.None;#o;constructor(e,t){this.#t=e,this.#r=t,this.#i=new te,this.#o=this.#r.getValue(),this.#e.own(this.#r.subscribe(i=>{this.#o=i.getValue(),this.#i.notify(this)}))}get adapter(){return this.#r}get address(){return this.#r.address}subscribe(e){return this.#i.subscribe(e)}getValue(){return this.#o}getUnitValue(){return this.#r.valueMapping.x(this.#o)}onStartAutomation(){I(this.#n.isEmpty(),"Already broadcasting"),this.#n=g.wrap(this.#t.broadcaster.broadcastFloat(this.#r.address,()=>this.getUnitValue()))}updateAutomation(e){let t=this.#r.valueAt(e);return this.#o!==t?(this.#o=t,!0):!1}onStopAutomation(){I(this.#n.nonEmpty(),"Never started broadcasting"),this.#n.unwrap().terminate(),this.#n=g.None,this.#o=this.#r.getValue()}own(e){return this.#e.own(e)}ownAll(...e){this.#e.ownAll(...e)}spawn(){return this.#e.spawn()}terminate(){this.#e.terminate()}};var Ac=class{#e;constructor(){this.#e=new Wh}add(e,t){this.#e.add(e,t)}get(e){return this.#e.get(e)}forEach(e){return this.#e.forEach(e)}clear(){this.#e.clear()}};var tr=class{#e=new U;#t;#r;#i;#n;#o=g.None;constructor(e){this.#t=e,this.#r=new Ac,this.#i=[],this.#n=[]}parameterChanged(e,t){return F(`Got update event for ${e}, but has no parameter change method`)}get context(){return this.#t}get eventInput(){return this.#r}bindParameter(e){let t=new ay(this.#t,e);return t.ownAll(e.field.pointerHub.catchupAndSubscribe({onAdded:i=>{this.#o.isEmpty()&&(this.#o=g.wrap(this.#t.updateClock.addEventOutput(this.#r))),this.#n.push(t),t.onStartAutomation()},onRemoved:i=>{R.remove(this.#n,t),this.#n.length===0&&(this.#o.ifSome(n=>n.terminate()),this.#o=g.None),t.onStopAutomation()}},u.Automation),t.subscribe(()=>this.parameterChanged(t))),this.#i.push(t),t}updateParameters(e,t){this.#n.forEach(i=>{i.updateAutomation(e)&&this.parameterChanged(i,t)})}readAllParameters(){this.#i.forEach(e=>this.parameterChanged(e,0))}own(e){return this.#e.own(e)}ownAll(...e){return this.#e.ownAll(...e)}spawn(){return this.#e.spawn()}terminate(){this.#o.ifSome(e=>e.terminate()),this.#o=g.None,this.#i.length=0,this.#e.terminate()}toString(){return`{${this.constructor.name}}`}};var Nh;(e=>e.isOfType=t=>t.type==="update-event")(Nh||={});var sy=class extends tr{#e=[];constructor(e){super(e),this.own(this.context.registerProcessor(this))}reset(){this.eventInput.clear()}addEventOutput(e){return this.#e.push(e),{terminate:()=>R.remove(this.#e,e)}}process({blocks:e}){e.forEach(({p0:t,p1:i,flags:n},o)=>{if(rt.every(n,1))for(let a of on.iterate(t,i,af)){let s={type:"update-event",position:a};this.#e.forEach(l=>l.add(o,s))}})}toString(){return`{${this.constructor.name}}`}};var De=class extends tr{constructor(e){super(e)}process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:i,p0:n,s0:o,s1:a,bpm:s}=t,l=null,c=o;for(let p of this.eventInput.get(i)){let d=p.position-n,f=Math.abs(d)<1e-7?o:o+Math.floor(Q.pulsesToSamples(d,s,sampleRate));I(o<=f&&f<=a,()=>`${f} out of bounds. event: ${p.position} (${p.type}), p0: ${n}`),l?.forEach(v=>this.handleEvent(v)),l=null,c<f&&(this.processAudio(t,c,f),c=f),Nh.isOfType(p)?this.updateParameters(p.position,o/sampleRate+Q.pulsesToSeconds(p.position-n,s)):(l??=[]).push(p)}l?.forEach(p=>this.handleEvent(p)),l=null,c<a&&this.processAudio(t,c,a)}),this.eventInput.clear(),this.finishProcess()}introduceBlock(e){}handleEvent(e){return F(`${this} received an event but has no accepting method.`)}finishProcess(){}};var ly=class r{static#e=S.exponential(20/sampleRate,2e4/sampleRate);#t;#r;#i;#n;#o;feedback=.7;cross=0;wet=.75;dry=.75;#a=0;#u=0;#s=0;#l=0;#c=0;#d=!1;#p=!1;constructor(e,t){let i=wo(e);this.#t=i,this.#r=[new Float32Array(i),new Float32Array(i)],this.#i=[new Pt,new Pt],this.#n=new nn,this.#o=t}reset(){this.#u=0,this.#d&&(this.#i.forEach(e=>e.reset()),this.#r.forEach(e=>e.fill(0)),this.#d=!1,this.#p=!1),this.#m()}set offset(e){I(0<=e&&e<this.#t,"Out of bounds"),this.#l!==e&&(this.#l=e,this.#d?this.#y():this.#m())}get offset(){return this.#l}set filter(e){e===0?this.#n.identity():e>0?this.#n.setHighpassParams(r.#e.y(e)):e<0&&this.#n.setLowpassParams(r.#e.y(1+e))}process(e,t,i,n){this.#p?this.#f(e,t,i,n):this.#h(e,t,i,n),this.#d=!0}#h(e,t,i,n){let o=this.#t-1,a=this.#r,s=this.feedback,l=this.wet,c=this.dry,p=this.#u,d=p-Math.floor(this.#s);d<0&&(d+=this.#t);let f=e[0],v=e[1],m=t[0],y=t[1],x=this.#i[0],M=this.#i[1],D=a[0],O=a[1];for(let T=i;T<n;++T){let V=f[T],Y=v[T],ne=x.processFrame(this.#n,D[d]*.96),G=M.processFrame(this.#n,O[d]*.96),de=this.cross*(G-ne),oe=ne+de,Ie=G-de;D[p]=(V+oe)*s+1e-18-1e-18,O[p]=(Y+Ie)*s+1e-18-1e-18,m[T]=oe*l+V*c,y[T]=Ie*l+Y*c,d=++d&o,p=++p&o}this.#u=p}#f(e,t,i,n){let o=this.#t-1,a=this.#r,s=this.feedback,l=this.wet,c=this.dry,p=this.#u;for(let d=i;d<n;++d){0<this.#c?(this.#s+=this.#a,this.#c--):(this.#s=this.#l,this.#p=!1);let f=p-this.#s;f<0&&(f+=this.#t);let v=f|0,m=f-v,y=e[0][d],x=e[1][d],M=a[0][v],D=a[0][v],O=this.#i[0].processFrame(this.#n,M+m*(a[0][v+1&o]-M)),T=this.#i[1].processFrame(this.#n,D+m*(a[1][v+1&o]-D));a[0][p]=y+O*s+1e-18-1e-18,a[1][p]=x+O*s+1e-18-1e-18,t[0][d]=O*l+y*c,t[1][d]=T*l+x*c,p=++p&o}this.#u=p}#m(){this.#s=this.#l,this.#c=0,this.#p=!1}#y(){this.#l!==this.#s&&(this.#c=this.#o,this.#a=(this.#l-this.#s)/this.#c,this.#p=!0)}};var uy=class r extends De{static ID=0;#e=r.ID++;#t;parameterDelay;parameterFeedback;parameterCross;parameterFilter;parameterDry;parameterWet;#r;#i;#n;#o=g.None;#a=!0;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Se(e.broadcaster,t.address));let{delay:i,feedback:n,cross:o,filter:a,dry:s,wet:l}=t.namedParameter;this.parameterDelay=this.own(this.bindParameter(i)),this.parameterFeedback=this.own(this.bindParameter(n)),this.parameterCross=this.own(this.bindParameter(o)),this.parameterFilter=this.own(this.bindParameter(a)),this.parameterDry=this.own(this.bindParameter(s)),this.parameterWet=this.own(this.bindParameter(l));let c=Q.pulsesToSamples(ir.toPPQN(ui.OffsetFractions[0]),30,sampleRate),p=Math.floor(.5*sampleRate);this.#n=new ly(c,p),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#n.reset(),this.#i.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio({bpm:e,flags:t},i,n){if(this.#o.isEmpty())return;if(this.#a||rt.some(t,8)){let a=this.parameterDelay.getValue(),s=ir.toPPQN(ui.OffsetFractions[a]);this.#n.offset=Q.pulsesToSamples(s,e,sampleRate),this.#a=!1}let o=this.#o.unwrap();this.#n.process(o.channels(),this.#r.channels(),i,n),this.#i.process(this.#r.getChannel(0),this.#r.getChannel(1),i,n)}parameterChanged(e){e===this.parameterDelay?this.#a=!0:e===this.parameterFeedback?this.#n.feedback=this.parameterFeedback.getValue():e===this.parameterCross?this.#n.cross=this.parameterCross.getValue():e===this.parameterFilter?this.#n.filter=this.parameterFilter.getValue():e===this.parameterDry?this.#n.dry=Ve(this.parameterDry.getValue()):e===this.parameterWet&&(this.#n.wet=Ve(this.parameterWet.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})}`}};var kh=class r extends tr{static ID=0;#e=r.ID++;#t;#r;#i;#n=g.None;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Se(e.broadcaster,t.address)),this.own(e.registerProcessor(this))}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#n=g.wrap(e),{terminate:()=>this.#n=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}process(e){if(this.#n.isEmpty())return;let t=this.#n.unwrap(),[i,n]=t.channels(),[o,a]=this.#r.channels();for(let s=0;s<128;s++)o[s]=i[s],a[s]=n[s];this.#i.process(o,a)}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#e})`}};var _c=class r extends tr{static ID=0;#e=r.ID++;#t;#r;#i;#n;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Se(e.broadcaster,t.address)),this.#n=[],this.own(e.registerProcessor(this))}get noteEventTarget(){return g.None}get incoming(){return this}get outgoing(){return this}get uuid(){return this.#t.uuid}reset(){this.#i.clear(),this.#r.clear()}addAudioSource(e){return this.#n.push(e),{terminate:()=>{R.remove(this.#n,e),this.#r.clear()}}}get adapter(){return this.#t}get audioOutput(){return this.#r}process(e){this.#r.clear();let[t,i]=this.#r.channels();for(let n of this.#n){let[o,a]=n.channels();for(let s=0;s<128;s++)t[s]+=o[s],i[s]+=a[s]}this.#r.assertSanity(),this.#i.process(this.#r.getChannel(0),this.#r.getChannel(1))}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#e})}`}};var we;(s=>{s.Comparator=(l,c)=>{let p=l.position-c.position;return p!==0?p:l.type==="note-complete-event"?-1:c.type==="note-complete-event"?1:0},s.start=(l,c,p,d,f=0)=>({type:"note-event",position:l,duration:c,pitch:p,velocity:d,cent:f,id:++a}),s.startWith=(l,c,p)=>({type:"note-event",position:c??l.position,duration:p??l.duration,pitch:l.pitch,cent:l.cent,velocity:l.velocity,id:++a}),s.stop=({id:l,pitch:c},p)=>({type:"note-complete-event",position:p,pitch:c,id:l}),s.isStart=l=>l.type==="note-event"&&"id"in l&&typeof l.id=="number",s.isStop=l=>l.type==="note-complete-event";let a=0})(we||={});var On=class{#e=new U;#t;#r;#i;#n=g.None;constructor(e,t,i){this.#t=e,this.#r=this.#e.own(new Ei(t,i)),this.#i=new Array(16)}setNoteEventSource(e){return I(this.#n.isEmpty(),"NoteEventSource already set"),this.#n=g.wrap(e),this.#t.reset(),K.create(()=>{this.#n=g.None,this.#t.reset()})}introduceBlock({index:e,p0:t,p1:i,flags:n}){if(!this.#n.isEmpty()){for(let o of this.#n.unwrap().processNotes(t,i,n))this.#i.push(o);this.#i.sort(we.Comparator).forEach(o=>{o.pitch>=0&&o.pitch<=127&&(this.#t.eventInput.add(e,o),this.#o(o))}),this.#i.length=0}}clear(){}terminate(){this.#e.terminate()}#o(e){we.isStart(e)?this.#r.noteOn(e.pitch):we.isStop(e)&&this.#r.noteOff(e.pitch)}};var Z_;(e=>e.NotSet={start:()=>F("VoicingStrategy.start"),stop:()=>F("VoicingStrategy.stop"),forceStop:()=>ki,process:()=>F("VoicingStrategy.process"),reset:ki,processing:()=>R.empty()})(Z_||={});var cy=class{#e;#t=[];constructor(e=Z_.NotSet){this.#e=e}set strategy(e){this.#t.push(this.#e),this.#e.forceStop(),this.#e=e}get strategy(){return this.#e}start(e){this.#e.start(e)}stop(e){this.#e.stop(e)}process(e,t,i,n){this.#e.process(e,t,i,n);for(let o=this.#t.length-1;o>=0;o--)this.#t[o].process(e,t,i,n)&&this.#t.splice(o,1)}reset(){this.#t.forEach(e=>e.reset()),this.#t.length=0,this.#e.reset()}};var dy=class{#e;#t=[];#r=[];constructor(e){this.#e=e}start(e){let t=NaN;for(let o=0;o<this.#r.length;o++){let a=this.#r[o];if(!a.gate){t=a.currentFrequency,this.#r.splice(o,1);break}}let i=this.#e.computeFrequency(e),n=this.#e.create();isNaN(t)?n.start(e,i,1,0):(n.start(e,t,1,0),n.startGlide(i,this.#e.glideTime)),this.#r.push(n),this.#t.push(n)}stop(e){this.#t.find(t=>t.id===e)?.stop()}forceStop(){this.#t.forEach(e=>e.forceStop())}reset(){this.#t.length=0,this.#r.length=0}process(e,t,i,n){e.clear(i,n);for(let o=this.#t.length-1;o>=0;o--){let a=this.#t[o];a.process(e,t,i,n)&&(R.removeIf(this.#r,s=>s===a),this.#t.splice(o,1))}return this.#t.length===0}processing(){return this.#t}};var py=class{#e;#t=[];#r=[];#i=null;#n=null;constructor(e){this.#e=e}start(e){if(this.#r.push(e),Z(this.#i)&&this.#i.gate){this.#i.startGlide(this.#e.computeFrequency(e),this.#e.glideTime);return}Z(this.#n)&&this.#n.forceStop();let t=this.#e.create();t.start(e,this.#e.computeFrequency(e),1,0),this.#i=t,this.#n=t,this.#t.push(t)}stop(e){let t=this.#r.findIndex(i=>i.id===e);if(t!==-1&&(this.#r.splice(t,1),!!Z(this.#i))){if(t===this.#r.length){let i=this.#r.at(-1);if(Z(i)){this.#i.startGlide(this.#e.computeFrequency(i),this.#e.glideTime);return}}this.#r.length===0&&(this.#i.stop(),this.#i=null)}}forceStop(){this.#t.forEach(e=>e.forceStop())}reset(){this.#r.length=0,this.#t.length=0,this.#i=null,this.#n=null}process(e,t,i,n){e.clear(i,n);for(let o=this.#t.length-1;o>=0;o--){let a=this.#t[o];a.process(e,t,i,n)&&(this.#t.splice(o,1),a===this.#i&&(this.#i=null),a===this.#n&&(this.#n=null))}return this.#t.length===0}processing(){return this.#t}};var $h=class{#e;#t=[];#r=new al;#i;gate=!0;id=-1;constructor(e,t){this.#e=e,this.#i=t}get currentFrequency(){return this.#r.currentFrequency()}start(e,t,i,n){if(this.id=e.id,this.#r.init(t),this.#i===1){let o=this.#e();o.start(e,t,i,n),this.#t.push(o)}else for(let o=0;o<this.#i;++o){let a=o/(this.#i-1)*2-1,s=this.#e(),l=(1-Math.abs(n))*a+n;s.start(e,t,i/Math.sqrt(this.#i),l),this.#t.push(s)}}startGlide(e,t){this.#r.glideTo(e,t),this.#t.forEach(i=>i.startGlide(e,t))}process(e,t,i,n){this.#r.advance(t.bpm,i,n);for(let o=this.#t.length-1;o>=0;o--)this.#t[o].process(e,t,i,n)&&this.#t.splice(o,1);return this.#t.length===0}stop(){this.#t.forEach(e=>e.stop()),this.gate=!1}forceStop(){this.#t.forEach(e=>e.forceStop()),this.gate=!1}processing(){return this.#t}};var[qE,HE,G_,JE,QE,hy,YE,XE,fy]=fP(Float32Array,128),Mh=class{device;oscA;oscB;lfo;filter;env;glide;gainASmooth;gainBSmooth;gainVcaSmooth;#e=Da("NoteEvent not set");#t=1;#r=1;id=-1;phase=0;filter_keyboard_delta=0;constructor(e){this.device=e,this.oscA=new Uc(sampleRate),this.oscB=new Uc(sampleRate),this.lfo=new Xh(sampleRate),this.filter=new Zh($n.MIN_CUTOFF,$n.MAX_CUTOFF,sampleRate),this.filter.order=1,this.env=new il(sampleRate),this.env.set(this.device.env_attack,this.device.env_decay,this.device.env_sustain,this.device.env_release),this.env.gateOn(),this.glide=new al,this.gainASmooth=new Mi(.003,sampleRate),this.gainBSmooth=new Mi(.003,sampleRate),this.gainVcaSmooth=new Mi(.003,sampleRate)}start(e,t,i,n){this.#e=e,this.#t=i,this.#r=n,this.filter_keyboard_delta=ef.keyboardTracking(e.pitch,this.device.parameterFilterKeyboard.getValue()),this.glide.init(t)}stop(){this.env.gateOff()}forceStop(){this.env.forceStop()}startGlide(e,t){this.glide.glideTo(e,t)}get gate(){return this.env.gate}get currentFrequency(){return this.glide.currentFrequency()}process(e,{bpm:t},i,n){let{gainOscA:o,gainOscB:a,oscA_waveform:s,oscB_waveform:l,flt_cutoff:c,flt_resonance:p,flt_env_amount:d,flt_order:f,frequencyAMultiplier:v,frequencyBMultiplier:m,parameterLfoShape:y,parameterLfoRate:x,parameterLfoTargetTune:M,parameterLfoTargetCutoff:D,parameterLfoTargetVolume:O,parameterUnisonDetune:T,parameterUnisonStereo:V}=this.device,Y=nl(this.#e.velocity)*this.#t,ne=2**(this.#r*(T.getValue()/1200)),G=this.#r*V.getValue(),[de,oe]=Wn.panningToGains(G,an.Linear),[Ie,Ge]=e.channels();G_.fill(ne,i,n),this.glide.process(G_,t,i,n),this.lfo.fill(YE,y.getValue(),x.getValue(),i,n),this.env.process(hy,i,n);let Ue=M.getValue(),qe=D.getValue(),lt=O.getValue();for(let ve=i;ve<n;ve++){let Ce=YE[ve];XE[ve]=c+this.filter_keyboard_delta+hy[ve]*d+Ce*qe,hy[ve]*=Jr(Y+Ce*lt);let ye=G_[ve]*2**(Ce*Ue);JE[ve]=ye*v,QE[ve]=ye*m}this.oscA.generateFromFrequencies(qE,JE,s,i,n),this.oscB.generateFromFrequencies(HE,QE,l,i,n);for(let ve=i;ve<n;ve++)fy[ve]=qE[ve]*this.gainASmooth.process(o)+HE[ve]*this.gainBSmooth.process(a);this.filter.order=f,this.filter.process(fy,fy,XE,p,i,n);for(let ve=i;ve<n;ve++){let Ce=this.gainVcaSmooth.process(Jr(hy[ve])),ye=fy[ve]*Ce;if(Ie[ve]+=ye*de,Ge[ve]+=ye*oe,this.env.complete&&Ce<1e-4)return!0}return!1}};var my=class extends De{#e;#t;#r;#i;#n;#o;#a;#u;#s;#l;#c;#d;#p;#h;#f;#m;#y;#g;#A;#N;#B;#P;#k;#v;#x;#w;#E;#F;#S;#_;#$;#M;#I;gainOscA=1;gainOscB=1;frequencyAMultiplier=1;frequencyBMultiplier=1;env_attack=1;env_decay=1;env_sustain=1;env_release=1;oscA_waveform=We.sine;oscB_waveform=We.sine;flt_cutoff=1;flt_resonance=Math.SQRT1_2;flt_env_amount=0;flt_order=1;#C=0;constructor(e,t){super(e),this.#e=t,this.#t=new cy,this.#r=new On(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new xe,this.#n=new nf(sampleRate),this.#o=this.own(new Se(e.broadcaster,t.address));let{namedParameter:i}=this.#e,{oscillators:n}=i;this.#a=this.own(this.bindParameter(n[0].waveform)),this.#u=this.own(this.bindParameter(n[0].octave)),this.#s=this.own(this.bindParameter(n[0].tune)),this.#l=this.own(this.bindParameter(n[0].volume)),this.#c=this.own(this.bindParameter(n[1].waveform)),this.#d=this.own(this.bindParameter(n[1].octave)),this.#p=this.own(this.bindParameter(n[1].tune)),this.#h=this.own(this.bindParameter(n[1].volume)),this.#f=this.own(this.bindParameter(i.attack)),this.#m=this.own(this.bindParameter(i.decay)),this.#y=this.own(this.bindParameter(i.sustain)),this.#g=this.own(this.bindParameter(i.release)),this.#A=this.own(this.bindParameter(i.cutoff)),this.#N=this.own(this.bindParameter(i.resonance)),this.#B=this.own(this.bindParameter(i.filterEnvelope)),this.#P=this.own(this.bindParameter(i.filterOrder)),this.#k=this.own(this.bindParameter(i.filterKeyboard)),this.#v=this.own(this.bindParameter(i.glideTime)),this.#x=this.own(this.bindParameter(i.voicingMode)),this.#w=this.own(this.bindParameter(i.unisonCount)),this.#E=this.own(this.bindParameter(i.unisonDetune)),this.#F=this.own(this.bindParameter(i.unisonStereo)),this.#S=this.own(this.bindParameter(i.lfoWaveform)),this.#_=this.own(this.bindParameter(i.lfoRate)),this.#$=this.own(this.bindParameter(i.lfoTargetTune)),this.#M=this.own(this.bindParameter(i.lfoTargetCutoff)),this.#I=this.own(this.bindParameter(i.lfoTargetVolume));let o=new Float32Array(32);this.ownAll(e.broadcaster.broadcastFloats(t.address.append(0),o,()=>{let a=0;this.#t.strategy.processing().forEach(s=>{let c=Ne(s,$h).processing().at(0);c instanceof Mh&&(o[a++]=c.env.phase),o.length-1}),o[a]=-1}),e.registerProcessor(this)),this.readAllParameters()}computeFrequency(e){return Oc(e.pitch+e.cent/100,440)}get glideTime(){return this.#C}get parameterFilterKeyboard(){return this.#k}get parameterLfoShape(){return this.#S}get parameterLfoRate(){return this.#_}get parameterLfoTargetTune(){return this.#$}get parameterLfoTargetCutoff(){return this.#M}get parameterLfoTargetVolume(){return this.#I}get parameterUnisonDetune(){return this.#E}get parameterUnisonStereo(){return this.#F}create(){return new $h(()=>new Mh(this),this.#w.getValue())}get noteEventTarget(){return g.wrap(this)}introduceBlock(e){this.#r.introduceBlock(e)}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#o.clear(),this.#t.reset(),this.#i.clear(),this.eventInput.clear()}get uuid(){return this.#e.uuid}get audioOutput(){return this.#i}get adapter(){return this.#e}handleEvent(e){we.isStart(e)?this.#t.start(e):we.isStop(e)&&this.#t.stop(e.id)}processAudio(e,t,i){this.#t.process(this.#i,e,t,i),this.#n.replace(this.#i,t,i)}parameterChanged(e){if(e===this.#l)this.gainOscA=Ve(this.#l.getValue());else if(e===this.#h)this.gainOscB=Ve(this.#h.getValue());else if(e===this.#u||e===this.#s)this.frequencyAMultiplier=2**(this.#u.getValue()+this.#s.getValue()/1200);else if(e===this.#d||e===this.#p)this.frequencyBMultiplier=2**(this.#d.getValue()+this.#p.getValue()/1200);else if(e===this.#f)this.env_attack=this.#f.getValue();else if(e===this.#m)this.env_decay=this.#m.getValue();else if(e===this.#y)this.env_sustain=this.#y.getValue();else if(e===this.#g)this.env_release=this.#g.getValue();else if(e===this.#a)this.oscA_waveform=Hr(this.#a.getValue(),We);else if(e===this.#c)this.oscB_waveform=Hr(this.#c.getValue(),We);else if(e===this.#A)this.flt_cutoff=this.#A.getUnitValue();else if(e===this.#N)this.flt_resonance=this.#N.getValue();else if(e===this.#B)this.flt_env_amount=this.#B.getValue();else if(e===this.#P)this.flt_order=this.#P.getValue();else if(e===this.#v)this.#C=this.#v.getValue()*Q.Bar;else if(e===this.#x){let t=this.#x.getValue();switch(t){case un.Monophonic:{this.#t.strategy=new py(this);return}case un.Polyphonic:{this.#t.strategy=new dy(this);return}default:return F(`Unknown VoicingMode '${t}'`)}}}finishProcess(){this.#i.assertSanity(),this.#o.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{VaporisateurDevice}"}};var Ba=class{#e;#t;#r;#i=0;#n=1;#o;#a=0;#u;#s;#l=0;constructor(e,t,i,n,o=0,a=0){this.#e=e,this.#t=t,this.#r=i,this.#u=n,this.#o=o,this.#s=a,this.#o>=t.numberOfFrames&&(this.#i=2)}get readPosition(){return this.#o}done(){return this.#i===2}isFadingOut(){return this.#i===0&&this.#n<0}startFadeOut(e){this.#i!==2&&!(this.#i===0&&this.#n<0)&&(this.#i=0,this.#n=-1,this.#a=0,this.#l=e)}setPlaybackRate(e){this.#u=e}process(e,t){let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],c=this.#r,p=this.#u,d=a-c*p,f=this.#s,v=this.#l,m=this.#i,y=this.#n,x=this.#o,M=this.#a;for(let D=0;D<t&&m!==2;D++){if(D<f)continue;let O=e+D,T;if(m===0&&y>0)T=M/c,++M>=c&&(m=1,M=0,y=0);else if(m===0&&y<0){if(D<v)T=1;else if(T=1-M/c,++M>=c){m=2;break}}else T=1;let V=x|0;if(V>=0&&V<a-1){let Y=x-V,ne=s[V],G=l[V];i[O]+=(ne+Y*(s[V+1]-ne))*T,n[O]+=(G+Y*(l[V+1]-G))*T}x+=p,m===1&&x>=d&&(m=0,y=-1,M=0)}this.#i=m,this.#n=y,this.#o=x,this.#a=M,this.#s=0,this.#l=0}};var Pc=class{#e;#t;#r;#i;#n;#o;#a=1;#u=0;#s=0;#l=0;#c=0;#d=0;constructor(e,t,i,n,o,a,s){this.#e=e,this.#t=t,this.#r=o,this.#o=n,this.#i=Math.round(.02*s),this.#n=1/this.#i,this.#l=i,this.#c=a,this.#d=0,i>0?(this.#a=0,this.#u=1,this.#s=0):(this.#a=1,this.#u=0,this.#s=0)}done(){return this.#a===2}isFadingOut(){return this.#a===0&&this.#u<0}readPosition(){return this.#l}segmentEnd(){return this.#o}setSegmentEnd(e){this.#o=e}startFadeOut(e){if(this.#a!==2&&!(this.#a===0&&this.#u<0)){if(this.#a===0&&this.#u>0){let t=this.#s*this.#n;this.#s=this.#i*(1-t)}else this.#s=0;this.#a=0,this.#u=-1,this.#d=e}}process(e,t){if(this.#a===2)return;let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],c=this.#o,p=this.#i,d=this.#n,f=this.#r,v=this.#d,m=this.#a,y=this.#u,x=this.#s,M=this.#l;for(let D=this.#c;D<t&&m!==2;D++){let O=e+D,T;if(m===0){if(y>0)T=x*d,x+=1,x>=p&&(m=1,x=0,y=0);else if(D<v)T=1;else if(T=1-x*d,x+=1,x>=p){m=2;break}}else T=1;let V=M|0;if(V>=0&&V<a-1){let Y=M-V,ne=s[V],G=l[V];i[O]+=(ne+Y*(s[V+1]-ne))*T,n[O]+=(G+Y*(l[V+1]-G))*T}M+=f}this.#a=m,this.#u=y,this.#s=x,this.#l=M,this.#c=0,this.#d=0}};var gy=class{#e;#t;#r;#i;#n;#o;#a;#u;#s;#l;#c=1;#d=0;#p=0;#h=0;#f=0;#m=0;#y=0;#g=0;constructor(e,t,i,n,o,a,s,l){this.#e=e,this.#t=t,this.#r=o,this.#l=n;let c=.006*s,p=.006*s;this.#i=i+c,this.#n=n-p,this.#o=Math.round(.02*s),this.#a=1/this.#o,this.#u=Math.round(.005*s),this.#s=1/this.#u,this.#h=l??i,this.#y=a,this.#g=0,this.#f=0,this.#m=0,l!==void 0||i>0?(this.#c=0,this.#d=1,this.#p=0):(this.#c=1,this.#d=0,this.#p=0),this.#i>=this.#n&&(this.#c=2)}done(){return this.#c===2}isFadingOut(){return this.#c===0&&this.#d<0}readPosition(){return this.#h}segmentEnd(){return this.#l}setSegmentEnd(e){this.#l=e}startFadeOut(e){if(this.#c!==2&&!(this.#c===0&&this.#d<0)){if(this.#c===0&&this.#d>0){let t=this.#p*this.#a;this.#p=this.#o*(1-t)}else this.#p=0;this.#c=0,this.#d=-1,this.#g=e}}process(e,t){if(this.#c===2)return;let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],c=this.#i,d=this.#n-this.#u,f=this.#o,v=this.#a,m=this.#u,y=this.#s,x=this.#r,M=this.#g,D=this.#c,O=this.#d,T=this.#p,V=this.#h,Y=this.#f,ne=this.#m;for(let G=this.#y;G<t&&D!==2;G++){let de=e+G,oe;if(D===0){if(O>0)oe=T*v,T+=1,T>=f&&(D=1,T=0,O=0);else if(G<M)oe=1;else if(oe=1-T*v,T+=1,T>=f){D=2;break}}else oe=1;let Ie=0,Ge=0,Ue=V|0;if(Ue>=0&&Ue<a-1){let qe=V-Ue,lt=s[Ue],ve=l[Ue];Ie=lt+qe*(s[Ue+1]-lt),Ge=ve+qe*(l[Ue+1]-ve)}if(Y===0&&V>=d&&(Y=1,ne=c),Y>0){let qe=ne|0;if(qe>=0&&qe<a-1){let lt=ne-qe,ve=s[qe],Ce=l[qe],ye=ve+lt*(s[qe+1]-ve),Vn=Ce+lt*(l[qe+1]-Ce),vr=Y*y;Ie=Ie*(1-vr)+ye*vr,Ge=Ge*(1-vr)+Vn*vr}ne+=x,Y+=1,Y>=m&&(V=ne,Y=0)}i[de]+=Ie*oe,n[de]+=Ge*oe,V+=x}this.#c=D,this.#d=O,this.#p=T,this.#h=V,this.#f=Y,this.#m=ne,this.#y=0,this.#g=0}};var Dh=class{#e;#t;#r;#i;#n;#o;#a;#u;#s;#l=1;#c=0;#d=0;#p=0;#h=1;#f=0;#m=0;#y=0;#g=0;constructor(e,t,i,n,o,a,s,l){this.#e=e,this.#t=t,this.#r=o,this.#s=n;let c=.006*s,p=.006*s;this.#i=i+c,this.#n=n-p,this.#o=Math.round(.02*s),this.#a=1/this.#o,this.#u=Math.round(.005*s),this.#p=l?.position??i,this.#h=l?.direction??1,this.#y=a,this.#g=0,this.#f=0,this.#m=0,l!==void 0||i>0?(this.#l=0,this.#c=1,this.#d=0):(this.#l=1,this.#c=0,this.#d=0),this.#i>=this.#n&&(this.#l=2)}done(){return this.#l===2}isFadingOut(){return this.#l===0&&this.#c<0}readPosition(){return this.#p}segmentEnd(){return this.#s}setSegmentEnd(e){this.#s=e}startFadeOut(e){if(this.#l!==2&&!(this.#l===0&&this.#c<0)){if(this.#l===0&&this.#c>0){let t=this.#d*this.#a;this.#d=this.#o*(1-t)}else this.#d=0;this.#l=0,this.#c=-1,this.#g=e}}process(e,t){if(this.#l===2)return;let[i,n]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],c=this.#i,p=this.#n,d=p-this.#u,f=c+this.#u,v=this.#o,m=this.#a,y=this.#u,x=this.#r,M=this.#g,D=this.#l,O=this.#c,T=this.#d,V=this.#p,Y=this.#h,ne=this.#f,G=this.#m;for(let de=this.#y;de<t&&D!==2;de++){let oe=e+de,Ie;if(D===0){if(O>0)Ie=T*m,T+=1,T>=v&&(D=1,T=0,O=0);else if(de<M)Ie=1;else if(Ie=1-T*m,T+=1,T>=v){D=2;break}}else Ie=1;let Ge=0,Ue=0,qe=V|0;if(qe>=0&&qe<a-1){let lt=V-qe,ve=s[qe],Ce=l[qe];Ge=ve+lt*(s[qe+1]-ve),Ue=Ce+lt*(l[qe+1]-Ce)}if(ne===0&&(Y>0&&V>=d?(ne=1,G=p):Y<0&&V<=f&&(ne=1,G=c)),ne>0){let lt=G|0;if(lt>=0&&lt<a-1){let ve=G-lt,Ce=s[lt],ye=l[lt],Vn=Ce+ve*(s[lt+1]-Ce),vr=ye+ve*(l[lt+1]-ye),Gs=ne/y,Na=Math.cos(Gs*Math.PI*.5),Fc=Math.sin(Gs*Math.PI*.5);Ge=Ge*Na+Vn*Fc,Ue=Ue*Na+vr*Fc}G-=Y*x,ne+=1,ne>=y&&(V=G,Y=-Y,ne=0)}i[oe]+=Ge*Ie,n[oe]+=Ue*Ie,V+=Y*x}this.#l=D,this.#c=O,this.#d=T,this.#p=V,this.#h=Y,this.#f=ne,this.#m=G,this.#y=0,this.#g=0}};var vy=class{#e=[];#t=-1;#r=0;get voiceCount(){return this.#e.length}reset(){for(let e of this.#e)e.startFadeOut(0);this.#t=-1,this.#r=0}process(e,t,i,n,o,a,s){let{p0:l,p1:c,s0:p,s1:d,bpm:f,flags:v}=a,m=n.warpMarkers,y=n.transientPlayMode,x=n.playbackRate,{sampleRate:M,numberOfFrames:D}=t,O=D/M;rt.some(v,2)&&this.reset();let T=d-p,V=c-l,Y=(s.resultStart-l)/V,ne=(s.resultEnd-l)/V,G=p+T*Y|0,oe=(p+T*ne|0)-G,Ie=m.first(),Ge=m.last();if(Ie===null||Ge===null)return;let Ue=s.resultStart-s.rawStart;if(Ue<Ie.position||Ue>=Ge.position)return;let qe=Ue+V,lt=this.#o(qe,m);if(lt===null)return;let ve=lt+o;if(ve<0||ve>=O)return;let Ce=i.floorLastIndex(ve);if(Ce<this.#t&&this.reset(),Ce!==this.#t&&Ce>=0){let ye=i.optAt(Ce);ye!==null&&(this.#i(e,t,i,m,y,x,o,f,M,Ce,ye.position,Ue,V,oe),this.#t=Ce)}for(let ye of this.#e)if(ye instanceof Pc&&!ye.done()&&!ye.isFadingOut()){let Vn=ye.readPosition(),vr=ye.segmentEnd();if(Vn>=vr){ye.startFadeOut(0);continue}if(y!==Bo.Once){let Na=this.#n(i,this.#t,t);if(Na!==null){let{startSamples:Fc,endSamples:aP,hasNext:nB,nextTransientFileSeconds:oB}=Na,sP=aP-Fc,Rh;if(nB){let Nc=i.optAt(this.#t);if(Nc!==null){let aB=Nc.position-o,sB=this.#a(aB,m),lB=oB-o,uB=this.#a(lB,m)-sB;Rh=Q.pulsesToSeconds(uB,f)*M}else Rh=Number.POSITIVE_INFINITY}else Rh=Number.POSITIVE_INFINITY;let lP=Rh*x,uP=sP/lP;if(!(uP>=.99&&uP<=1.01)&&lP>sP){ye.startFadeOut(0);let Nc=this.#u(e,t,Fc,aP,x,0,M,y,!0,Vn);Nc!==null&&this.#e.push(Nc);continue}}}let Gs=(vr-Vn)/x;if(Gs<oe){let Na=Math.max(0,Math.floor(Gs));ye.startFadeOut(Na)}}for(let ye of this.#e)ye.process(G,oe);for(let ye=this.#e.length-1;ye>=0;ye--)this.#e[ye].done()&&this.#e.splice(ye,1)}#i(e,t,i,n,o,a,s,l,c,p,d,f,v,m){let y=this.#n(i,p,t);if(y===null)return;let{startSamples:x,endSamples:M,hasNext:D,nextTransientFileSeconds:O}=y,T=M-x,V=d-s,Y=this.#a(V,n),ne=Y-f,G=Math.max(0,Math.min(m-1,Math.round(ne/v*m))),de;if(D){let ye=O-s,vr=this.#a(ye,n)-Y;de=Q.pulsesToSeconds(vr,l)*c}else de=Number.POSITIVE_INFINITY;let oe=de*a,Ie=.02*c,Ge=!1,Ue=null;for(let ye of this.#e){if(ye.done()||!(ye instanceof Pc))continue;let vr=ye.readPosition()-x;if(Math.abs(vr)<Ie){this.#r+=vr,Math.abs(this.#r)<Ie?(Ge=!0,Ue=ye,ye.setSegmentEnd(M)):this.#r=0;break}}if(Ge){for(let ye of this.#e)ye!==Ue&&!ye.done()&&ye.startFadeOut(G);return}for(let ye of this.#e)ye.done()||ye.startFadeOut(G);let qe=T/oe,ve=!(qe>=.99&&qe<=1.01)&&oe>T,Ce=this.#u(e,t,x,M,a,G,c,o,ve);Ce!==null&&this.#e.push(Ce),this.#r=0}#n(e,t,i){let n=e.optAt(t);if(n===null)return null;let o=e.optAt(t+1);return{startSamples:n.position*i.sampleRate,endSamples:o!==null?o.position*i.sampleRate:i.numberOfFrames,hasNext:o!==null,nextTransientFileSeconds:o!==null?o.position:Number.POSITIVE_INFINITY}}#o(e,t){for(let i=0;i<t.length()-1;i++){let n=t.optAt(i),o=t.optAt(i+1);if(!(n===null||o===null)&&e>=n.position&&e<o.position){let a=(e-n.position)/(o.position-n.position);return n.seconds+a*(o.seconds-n.seconds)}}return null}#a(e,t){for(let n=0;n<t.length()-1;n++){let o=t.optAt(n),a=t.optAt(n+1);if(!(o===null||a===null)&&e>=o.seconds&&e<a.seconds){let s=(e-o.seconds)/(a.seconds-o.seconds);return o.position+s*(a.position-o.position)}}let i=t.last();return i!==null&&e>=i.seconds?i.position:0}#u(e,t,i,n,o,a,s,l,c,p){return i>=n?null:l===Bo.Once||!c?new Pc(e,t,i,n,o,a,s):l===Bo.Repeat?new gy(e,t,i,n,o,a,s,p):p!==void 0?new Dh(e,t,i,n,o,a,s,{position:p,direction:1}):new Dh(e,t,i,n,o,a,s)}};var yy=class extends tr{#e;#t;#r;#i;constructor(e,t){super(e),this.#e=t,this.#t=new xe(2),this.#r=this.own(new Se(e.broadcaster,t.address)),this.#i=A.newSet(({adapter:{uuid:i}})=>i),this.ownAll(this.#e.deviceHost().audioUnitBoxAdapter().tracks.catchupAndSubscribe({onAdd:i=>this.#i.add({adapter:i,voices:[],sequencer:new vy}),onRemove:i=>this.#i.removeByKey(i.uuid),onReorder:i=>{}}),e.registerProcessor(this))}get noteEventTarget(){return g.None}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#t}reset(){this.#r.clear(),this.#t.clear(),this.eventInput.clear(),this.#i.forEach(e=>{e.voices=[],e.sequencer.reset()})}process({blocks:e}){this.#t.clear(0,128),this.#i.forEach(n=>e.forEach(o=>this.#n(n,o))),this.#t.assertSanity();let[t,i]=this.#t.channels();this.#r.process(t,i)}parameterChanged(e){}#n(e,t){let{adapter:i}=e;if(i.type!==re.Audio||!i.enabled.getValue()){e.voices.forEach(l=>l.startFadeOut(0)),e.sequencer.reset();return}let{p0:n,p1:o,flags:a}=t;if(!rt.every(a,5))return;let s=this.context.clipSequencing.iterate(i.uuid,n,o);for(let{optClip:l,sectionFrom:c,sectionTo:p}of s)l.match({none:()=>{for(let d of i.regions.collection.iterateRange(n,o)){if(d.mute||!Te(d,Zo))continue;let f=d.file,v=f.getOrCreateLoader().data;if(v.isEmpty())return;let m=d.waveformOffset.getValue(),y=d.asPlayModeTimeStretch;if(y.nonEmpty()){let x=f.transients;if(x.length()<2)return;for(let M of Gt.locateLoops(d,n,o)){let D=y.unwrap();this.#u(e,t,M,v.unwrap(),D,x,m)}}else for(let x of Gt.locateLoops(d,n,o))this.#o(e,t,x,d,v.unwrap())}},some:d=>{if(!Te(d,to))return;let f=d.file,v=f.getOrCreateLoader().data;if(v.isEmpty())return;let m=d.asPlayModeTimeStretch;if(m.nonEmpty()){let y=m.unwrap(),x=f.transients;if(x.length()<2)return;for(let M of Gt.locateLoops({position:0,loopDuration:d.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},c,p))this.#u(e,t,M,v.unwrap(),y,x,d.waveformOffset.getValue())}else for(let y of Gt.locateLoops({position:0,loopDuration:d.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},c,p))this.#o(e,t,y,d,v.unwrap())}})}#o(e,t,i,n,o){let{p0:a,p1:s,s0:l,s1:c,flags:p}=t,d=c-l,f=s-a,v=(i.resultStart-a)/f,m=(i.resultEnd-a)/f,y=l+d*v,x=l+d*m,M=x-y|0,D=n.waveformOffset.getValue();I(l<=y&&x<=c,()=>`Out of bounds ${y}, ${x}`),rt.some(p,2)&&(e.voices.forEach(T=>T.startFadeOut(0)),e.sequencer.reset());let O=n.asPlayModePitchStretch;if(O.isEmpty()||n.observableOptPlayMode.isEmpty()){let T=o.numberOfFrames,Y=(i.resultEndValue-i.resultStartValue)*T,ne=(i.resultEnd-i.resultStart)/f*d,G=Y/ne,de=i.resultStartValue*o.numberOfFrames+D*o.sampleRate;this.#a(e,o,G,de,0)}else{let V=O.unwrap().warpMarkers,Y=V.first(),ne=V.last();if(Y===null||ne===null){e.voices.forEach(Ge=>Ge.startFadeOut(0));return}let G=i.resultStart-i.rawStart;if(G<Y.position||G>=ne.position){e.voices.forEach(Ge=>Ge.startFadeOut(0));return}let de=this.#l(G,i.resultStartValue,V),oe=this.#s(G,V,o.sampleRate,f,d),Ie=(de+D)*o.sampleRate;this.#a(e,o,oe,Ie,0)}for(let T of e.voices)T.process(y|0,M);e.voices=e.voices.filter(T=>!T.done())}#a(e,t,i,n,o){let a=Math.round(.02*t.sampleRate);if(e.voices.length===0)e.voices.push(new Ba(this.#t,t,a,i,n,o));else{let s=!1;for(let l of e.voices)if(l instanceof Ba){if(l.isFadingOut())continue;Math.abs(l.readPosition-n)>a?l.startFadeOut(o):(l.setPlaybackRate(i),s=!0)}else l.startFadeOut(o);s||e.voices.push(new Ba(this.#t,t,a,i,n,o))}}#u(e,t,i,n,o,a,s){for(let l of e.voices)l instanceof Ba&&l.startFadeOut(0);e.sequencer.process(this.#t,n,a,o,s,t,i),e.voices=e.voices.filter(l=>l instanceof Ba&&!l.done())}#s(e,t,i,n,o){let a=t.floorLastIndex(e),s=t.optAt(a),l=t.optAt(a+1);if(s===null||l===null)return 1;let c=l.position-s.position,f=(l.seconds-s.seconds)*i/c,v=o/n;return f/v}#l(e,t,i){let n=i.floorLastIndex(e),o=i.optAt(n),a=i.optAt(n+1);if(o===null||a===null)return t;let s=(e-o.position)/(a.position-o.position);return o.seconds+s*(a.seconds-o.seconds)}};var Mr=class extends tr{process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:i,p0:n,p1:o,s0:a,bpm:s}=t,l=null,c=n;for(let p of this.eventInput.get(i))l?.forEach(d=>this.handleEvent(t,d)),l=null,c<p.position&&(this.processEvents(t,c,p.position),c=p.position),Nh.isOfType(p)?this.updateParameters(p.position,a/sampleRate+Q.pulsesToSeconds(p.position-n,s)):(l??=[]).push(p);l?.forEach(p=>this.handleEvent(t,p)),l=null,c<o&&this.processEvents(t,c,o)}),this.eventInput.clear()}introduceBlock(e){}};var Sc;(t=>(t.create=()=>({mult:1,add:0}),t.apply=(i,n)=>n*i.mult+i.add))(Sc||={});var xy=Object.freeze([{name:"up",run:(r,e,t,i,n,o)=>{let a=r.length,s=a*e,l=t%a,c=Math.floor(t%s/a),p=r[l];return we.start(i,n,p.pitch+c*12,Sc.apply(o,p.velocity))}},{name:"down",run:(r,e,t,i,n,o)=>{let a=r.length,s=a*e,l=a-1-t%a,c=e-1-Math.floor(t%s/a),p=r[l];return we.start(i,n,p.pitch+c*12,Sc.apply(o,p.velocity))}},{name:"up-down",run:(r,e,t,i,n,o)=>{let a=r.length,s=a*e,l=Math.max(1,s*2-2),c=t%l,p=c<s?c:l-c,d=p%a,f=Math.floor(p/a),v=r[d];return we.start(i,n,v.pitch+f*12,Sc.apply(o,v.velocity))}}]);var wy=class extends Mr{#e;#t;#r;#i;#n;#o;#a;#u;#s;#l=Sc.create();#c=g.None;#d=xy[0];#p=NaN;#h=1;#f=1;#m=1;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new ol,this.#i=this.own(this.bindParameter(t.namedParameter.modeIndex)),this.#n=this.own(this.bindParameter(t.namedParameter.rate)),this.#o=this.own(this.bindParameter(t.namedParameter.gate)),this.#a=this.own(this.bindParameter(t.namedParameter.repeat)),this.#u=this.own(this.bindParameter(t.namedParameter.numOctaves)),this.#s=this.own(this.bindParameter(t.namedParameter.velocity)),this.ownAll(e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}get noteEventTarget(){return g.wrap(this)}setNoteEventSource(e){return I(this.#c.isEmpty(),"NoteEventSource already set"),this.#c=g.wrap(e),K.create(()=>this.#c=g.None)}*processNotes(e,t,i){if(this.#r.nonEmpty())if(rt.every(i,2))for(let o of this.#r.releaseAll())yield we.stop(o,e);else for(let o of this.#r.releaseLinearCompleted(t))yield we.stop(o,o.position+o.duration);if(this.#c.nonEmpty()){let n=this.#c.unwrap();for(let a of n.processNotes(e,t,i));let o=!rt.every(i,1);for(let{position:a,index:s}of on.iterateWithIndex(e,t,this.#p)){let l=Array.from(n.iterateActiveNotesAt(a,o));if(l.length===0)continue;let c=Math.floor(s/this.#f),p=Math.max(1,Math.floor(this.#p*this.#h)),d=this.#d.run(l,this.#m,c,a,p,this.#l);this.#r.addAndRetain({...d}),yield d}for(let a of this.#r.releaseLinearCompleted(t))yield we.stop(a,a.position+a.duration)}}*iterateActiveNotesAt(e,t){this.#c.isEmpty()||t||(yield*this.#r.overlapping(e,nr.Comparator))}reset(){this.#t.length=0,this.#r.clear(),this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){if(e===this.#i)this.#d=xy.at(this.#i.getValue())??xy[0];else if(e===this.#n)this.#p=ir.toPPQN(Gi.RateFractions[this.#n.getValue()]);else if(e===this.#o)this.#h=this.#o.getValue();else if(e===this.#a)this.#f=this.#a.getValue();else if(e===this.#u)this.#m=this.#u.getValue();else if(e===this.#s){let t=this.#s.getValue();t<=0?(this.#l.add=1+t,this.#l.mult=0):(this.#l.add=1-t,this.#l.mult=t)}}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var by=class extends Mr{#e;#t;#r;#i;#n;#o=g.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Ei(e.broadcaster,t.address)),this.#r=this.own(this.bindParameter(t.namedParameter.octaves)),this.#i=this.own(this.bindParameter(t.namedParameter.semiTones)),this.#n=this.own(this.bindParameter(t.namedParameter.cent)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return I(this.#o.isEmpty(),"NoteEventSource already set"),this.#o=g.wrap(e),K.create(()=>this.#o=g.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,i){if(!this.#o.isEmpty())for(let n of this.#o.unwrap().processNotes(e,t,i))if(we.isStart(n)){this.#t.noteOn(n.pitch);let{cent:o,octaves:a,semiTones:s}=this.#e.namedParameter;yield Dr.overwrite(n,{pitch:n.pitch+a.valueAt(n.position)*12+s.valueAt(n.position),cent:n.cent+o.valueAt(n.position)})}else this.#t.noteOff(n.pitch),yield n}*iterateActiveNotesAt(e,t){if(!this.#o.isEmpty()){for(let i of this.#o.unwrap().iterateActiveNotesAt(e,t))if(i.type==="note-event"){let{cent:n,octaves:o,semiTones:a}=this.#e.namedParameter;yield Dr.overwrite(i,{pitch:i.pitch+o.valueAt(i.position)*12+a.valueAt(i.position),cent:i.cent+n.valueAt(i.position)})}}}reset(){this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Ay=class r extends De{static ID=0;#e=r.ID++;#t;#r;#i;#n;#o;#a;#u;#s;#l;#c;#d;#p;#h;#f;#m;#y;#g;#A;#N;#B;#P;#k;#v;#x;#w;#E;#F;#S;#_;#$;#M;#I;#C;#R;#T;#O;#D=g.None;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Se(e.broadcaster,t.address)),this.#n=new qs,this.#o=new Float32Array(this.#n.numBins()),this.#a=R.create(()=>new nn,7),this.#u=[new Ao(4),new Ao(4)],this.#s=[new Ao(4),new Ao(4)],this.#l=[this.#s,[new Pt,new Pt],[new Pt,new Pt],[new Pt,new Pt],[new Pt,new Pt],[new Pt,new Pt],this.#u],this.#c=R.create(()=>!0,7);let i=this.#t.namedParameter;this.#d=this.own(this.bindParameter(i.highPass.enabled)),this.#h=this.own(this.bindParameter(i.highPass.q)),this.#p=this.own(this.bindParameter(i.highPass.frequency)),this.#f=this.own(this.bindParameter(i.highPass.order)),this.#m=this.own(this.bindParameter(i.lowShelf.enabled)),this.#y=this.own(this.bindParameter(i.lowShelf.frequency)),this.#g=this.own(this.bindParameter(i.lowShelf.gain)),this.#A=this.own(this.bindParameter(i.lowBell.enabled)),this.#N=this.own(this.bindParameter(i.lowBell.frequency)),this.#B=this.own(this.bindParameter(i.lowBell.gain)),this.#P=this.own(this.bindParameter(i.lowBell.q)),this.#k=this.own(this.bindParameter(i.midBell.enabled)),this.#v=this.own(this.bindParameter(i.midBell.frequency)),this.#x=this.own(this.bindParameter(i.midBell.gain)),this.#w=this.own(this.bindParameter(i.midBell.q)),this.#E=this.own(this.bindParameter(i.highBell.enabled)),this.#F=this.own(this.bindParameter(i.highBell.frequency)),this.#S=this.own(this.bindParameter(i.highBell.gain)),this.#_=this.own(this.bindParameter(i.highBell.q)),this.#$=this.own(this.bindParameter(i.highShelf.enabled)),this.#M=this.own(this.bindParameter(i.highShelf.frequency)),this.#I=this.own(this.bindParameter(i.highShelf.gain)),this.#C=this.own(this.bindParameter(i.lowPass.enabled)),this.#R=this.own(this.bindParameter(i.lowPass.frequency)),this.#T=this.own(this.bindParameter(i.lowPass.q)),this.#O=this.own(this.bindParameter(i.lowPass.order)),this.ownAll(e.registerProcessor(this),e.broadcaster.broadcastFloats(t.spectrum,this.#o,()=>{this.#o.set(this.#n.bins()),this.#n.decay=!0})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#r.clear(),this.#l.forEach(e=>e.forEach(t=>t.reset())),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#D=g.wrap(e),{terminate:()=>this.#D=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#D.isEmpty())return;let[n,o]=this.#r.channels(),a=this.#D.unwrap();if(this.#c.some(s=>s)){let[s,l]=a.channels();this.#a.forEach((c,p)=>{if(this.#c[p]){let[d,f]=this.#l[p];d.process(c,s,n,t,i),f.process(c,l,o,t,i),s=n,l=o}})}else{let[s,l]=a.channels();for(let c=t;c<i;c++)n[c]=s[c],o[c]=l[c]}this.#i.process(n,o,t,i),this.#n.process(n,o,t,i)}parameterChanged(e){if(e===this.#O){let i=this.#O.getValue()+1;this.#u[0].order=i,this.#u[1].order=i}else if(e===this.#f){let i=this.#f.getValue()+1;this.#s[0].order=i,this.#s[1].order=i}else if(e===this.#p||e===this.#h){let t=this.#p.getValue(),i=this.#h.getValue();this.#a[0].setHighpassParams(t/sampleRate,i)}else if(e===this.#y||e===this.#g){let t=this.#y.getValue(),i=this.#g.getValue();this.#a[1].setLowShelfParams(t/sampleRate,i)}else if(e===this.#N||e===this.#B||e===this.#P){let t=this.#N.getValue(),i=this.#B.getValue(),n=this.#P.getValue();this.#a[2].setPeakingParams(t/sampleRate,n,i)}else if(e===this.#v||e===this.#x||e===this.#w){let t=this.#v.getValue(),i=this.#x.getValue(),n=this.#w.getValue();this.#a[3].setPeakingParams(t/sampleRate,n,i)}else if(e===this.#F||e===this.#S||e===this.#_){let t=this.#F.getValue(),i=this.#S.getValue(),n=this.#_.getValue();this.#a[4].setPeakingParams(t/sampleRate,n,i)}else if(e===this.#M||e===this.#I){let t=this.#M.getValue(),i=this.#I.getValue();this.#a[5].setHighShelfParams(t/sampleRate,i)}else if(e===this.#R||e===this.#T){let t=this.#R.getValue(),i=this.#T.getValue();this.#a[6].setLowpassParams(t/sampleRate,i)}else e===this.#d?this.#c[0]=this.#d.getValue():e===this.#m?this.#c[1]=this.#m.getValue():e===this.#A?this.#c[2]=this.#A.getValue():e===this.#k?this.#c[3]=this.#k.getValue():e===this.#E?this.#c[4]=this.#E.getValue():e===this.#$?this.#c[5]=this.#$.getValue():e===this.#C&&(this.#c[6]=this.#C.getValue())}toString(){return`{${this.constructor.name} (${this.#e})`}};var _y=class{roomSize;damp;predelayInSamples;wetGain;dryGain;#e=new Float32Array(2048);#t=new Float32Array(2048);#r=new Float32Array(2048);#i=new Float32Array(2048);#n=new Float32Array(2048);#o=new Float32Array(2048);#a=new Float32Array(2048);#u=new Float32Array(2048);#s=new Float32Array(1024);#l=new Float32Array(512);#c=new Float32Array(512);#d=new Float32Array(256);#p=new Float32Array(2048);#h=new Float32Array(2048);#f=new Float32Array(2048);#m=new Float32Array(2048);#y=new Float32Array(2048);#g=new Float32Array(2048);#A=new Float32Array(2048);#N=new Float32Array(2048);#B=new Float32Array(1024);#P=new Float32Array(512);#k=new Float32Array(512);#v=new Float32Array(256);#x;#w;#E=0;#F=0;#S=0;#_=0;#$=0;#M=0;#I=0;#C=0;#R=0;#T=0;#O=0;#D=0;#V=0;#z=0;#U=0;#j=0;#L=0;#K=0;#W=0;#Z=0;#q=0;#H=0;#J=0;#Q=0;#Y=0;#X=0;#ee=0;#te=0;#re=0;#ie=0;#ne=0;#oe=0;#ae=0;#se=0;#le=0;#ue=0;#ce=0;#de=0;#pe=0;#he=0;#b=0;#G=0;constructor(e=.5){this.#x=wo(Math.ceil(e*sampleRate)),this.#w=new Float32Array(this.#x<<1),this.damp=0,this.roomSize=.5,this.wetGain=.3333,this.dryGain=1-this.wetGain,this.#b=0,this.#G=0,this.predelayInSamples=.008*sampleRate,this.clearHistory()}clear(){this.#b=0,this.#G=0,this.clearHistory(),this.clearBuffers()}process(e,t,i,n){let[o,a]=t.channels(),[s,l]=e.channels(),c=.4*this.damp,p=1-c,d=.7+.28*this.roomSize;for(let f=i;f<n;++f){let v=o[f],m=a[f],y=this.#G-this.predelayInSamples;y<0&&(y+=this.#x);let x;x=y<<1;let M=.01,D=this.#w[x]*M,O=this.#w[x+1]*M;x=this.#G<<1,this.#w[x]=v,this.#w[x+1]=m,this.#G=this.#G+1&this.#x-1;let T=this.#b&2047;this.#E=p*this.#F+c*this.#E,this.#e[T]=D+d*this.#E,this.#F=this.#e[this.#b-1617&2047],this.#S=p*this.#_+c*this.#S,this.#t[T]=D+d*this.#S,this.#_=this.#t[this.#b-1557&2047],this.#$=p*this.#M+c*this.#$,this.#r[T]=D+d*this.#$,this.#M=this.#r[this.#b-1491&2047],this.#I=p*this.#C+c*this.#I,this.#i[T]=D+d*this.#I,this.#C=this.#i[this.#b-1422&2047],this.#R=p*this.#T+c*this.#R,this.#n[T]=D+d*this.#R,this.#T=this.#n[this.#b-1356&2047],this.#O=p*this.#D+c*this.#O,this.#o[T]=D+d*this.#O,this.#D=this.#o[this.#b-1277&2047],this.#V=p*this.#z+c*this.#V,this.#a[T]=D+d*this.#V,this.#z=this.#a[this.#b-1188&2047],this.#U=p*this.#j+c*this.#U,this.#u[T]=D+d*this.#U,this.#j=this.#u[this.#b-1116&2047];let V=this.#j+this.#z+this.#D+this.#T+this.#C+this.#M+this.#_+this.#F,Y=this.#L-V,ne=this.#K-Y,G=this.#W-ne;this.#s[this.#b&1023]=V+.5*this.#L,this.#L=this.#s[this.#b-556&1023],this.#l[this.#b&511]=Y+.5*this.#K,this.#K=this.#l[this.#b-441&511],this.#c[this.#b&511]=ne+.5*this.#W,this.#W=this.#c[this.#b-341&511],this.#d[this.#b&255]=G+.5*this.#Z,this.#Z=this.#d[this.#b-225&255],s[f]=this.dryGain*v+this.wetGain*(this.#Z-G),this.#q=p*this.#H+c*this.#q,this.#p[T]=O+d*this.#q,this.#H=this.#p[this.#b-1640&2047],this.#J=p*this.#Q+c*this.#J,this.#h[T]=O+d*this.#J,this.#Q=this.#h[this.#b-1580&2047],this.#Y=p*this.#X+c*this.#Y,this.#f[T]=O+d*this.#Y,this.#X=this.#f[this.#b-1514&2047],this.#ee=p*this.#te+c*this.#ee,this.#m[T]=O+d*this.#ee,this.#te=this.#m[this.#b-1445&2047],this.#re=p*this.#ie+c*this.#re,this.#y[T]=O+d*this.#re,this.#ie=this.#y[this.#b-1379&2047],this.#ne=p*this.#oe+c*this.#ne,this.#g[T]=O+d*this.#ne,this.#oe=this.#g[this.#b-1300&2047],this.#ae=p*this.#se+c*this.#ae,this.#A[T]=O+d*this.#ae,this.#se=this.#A[this.#b-1211&2047],this.#le=p*this.#ue+c*this.#le,this.#N[T]=O+d*this.#le,this.#ue=this.#N[this.#b-1139&2047];let de=this.#ue+this.#se+this.#oe+this.#ie+this.#te+this.#X+this.#Q+this.#H,oe=this.#ce-de,Ie=this.#de-oe,Ge=this.#pe-Ie;this.#B[this.#b&1023]=de+.5*this.#ce,this.#ce=this.#B[this.#b-579&1023],this.#P[this.#b&511]=oe+.5*this.#de,this.#de=this.#P[this.#b-464&511],this.#k[this.#b&511]=Ie+.5*this.#pe,this.#pe=this.#k[this.#b-364&511],this.#v[this.#b&255]=Ge+.5*this.#he,this.#he=this.#v[this.#b-248&255],l[f]=this.dryGain*m+this.wetGain*(this.#he-Ge),this.#b++}}clearBuffers(){this.#e.fill(0),this.#t.fill(0),this.#r.fill(0),this.#i.fill(0),this.#n.fill(0),this.#o.fill(0),this.#a.fill(0),this.#u.fill(0),this.#s.fill(0),this.#l.fill(0),this.#c.fill(0),this.#d.fill(0),this.#p.fill(0),this.#h.fill(0),this.#f.fill(0),this.#m.fill(0),this.#y.fill(0),this.#g.fill(0),this.#A.fill(0),this.#N.fill(0),this.#B.fill(0),this.#P.fill(0),this.#k.fill(0),this.#v.fill(0),this.#w.fill(0)}clearHistory(){this.#E=0,this.#F=0,this.#S=0,this.#_=0,this.#$=0,this.#M=0,this.#I=0,this.#C=0,this.#R=0,this.#T=0,this.#O=0,this.#D=0,this.#V=0,this.#z=0,this.#U=0,this.#j=0,this.#L=0,this.#K=0,this.#W=0,this.#Z=0,this.#q=0,this.#H=0,this.#J=0,this.#Q=0,this.#Y=0,this.#X=0,this.#ee=0,this.#te=0,this.#re=0,this.#ie=0,this.#ne=0,this.#oe=0,this.#ae=0,this.#se=0,this.#le=0,this.#ue=0,this.#ce=0,this.#de=0,this.#pe=0,this.#he=0}};var Py=class r extends De{static ID=0;#e=r.ID++;#t;#r;#i;#n;#o;#a;#u;#s;#l;#c=g.None;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Se(e.broadcaster,t.address)),this.#n=new _y;let{decay:i,preDelay:n,damp:o,wet:a,dry:s}=this.#t.namedParameter;this.#o=this.own(this.bindParameter(i)),this.#a=this.own(this.bindParameter(n)),this.#u=this.own(this.bindParameter(o)),this.#s=this.own(this.bindParameter(a)),this.#l=this.own(this.bindParameter(s)),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#n.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#c=g.wrap(e),{terminate:()=>this.#c=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#c.isEmpty())return;this.#n.process(this.#r,this.#c.unwrap(),t,i);let[n,o]=this.#r.channels();this.#i.process(n,o,t,i)}parameterChanged(e){this.#o===e?this.#n.roomSize=this.#o.getValue():this.#a===e?this.#n.predelayInSamples=Math.ceil(this.#a.getValue()*sampleRate):this.#u===e?this.#n.damp=this.#u.getValue():this.#s===e?this.#n.wetGain=Ve(this.#s.getValue()):this.#l===e&&(this.#n.dryGain=Ve(this.#l.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})`}};var Sy=class extends De{#e;#t;#r;#i;#n;#o;#a;gain=1;release=1;loader=g.None;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new xe,this.#i=new On(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#n=this.own(new Se(e.broadcaster,t.address)),this.#o=this.own(this.bindParameter(this.#e.namedParameter.volume)),this.#a=this.own(this.bindParameter(this.#e.namedParameter.release)),this.ownAll(e.registerProcessor(this),t.box.file.catchupAndSubscribe(i=>this.loader=i.targetVertex.map(({box:n})=>e.sampleManager.getOrCreate(n.address.uuid)))),this.readAllParameters()}get noteEventTarget(){return g.wrap(this)}introduceBlock(e){this.#i.introduceBlock(e)}setNoteEventSource(e){return this.#i.setNoteEventSource(e)}get incoming(){return this}get outgoing(){return this}reset(){this.#t.length=0,this.#r.clear(),this.eventInput.clear(),this.#i.clear(),this.#n.clear()}get uuid(){return this.#e.uuid}get audioOutput(){return this.#r}get adapter(){return this.#e}handleEvent(e){we.isStart(e)?this.#t.push(new X_(this,e)):we.isStop(e)&&this.#t.find(t=>t.event().id===e.id)?.stop()}processAudio(e,t,i){this.#r.clear(t,i);for(let n=this.#t.length-1;n>=0;n--)this.#t[n].processAdd(this.#r,t,i)&&this.#t.splice(n,1)}parameterChanged(e){e===this.#o?this.gain=Ve(this.#o.getValue()):e===this.#a&&(this.release=this.#a.getValue()*sampleRate)}finishProcess(){this.#r.assertSanity(),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1))}toString(){return"{NanoDevice}"}},X_=class{#e;#t;#r=1;#i=0;#n=.003*sampleRate|0;#o=0;#a=Number.POSITIVE_INFINITY;constructor(e,t){this.#e=e,this.#t=t,this.#r=Math.pow(2,(t.pitch+t.cent/100)/12-5)}event(){return this.#t}stop(){this.#a=this.#o}processAdd(e,t,i){let n=this.#e.loader;if(n.isEmpty())return!0;let o=n.unwrap();return o.data.isEmpty()?!0:this.processSimple(e.channels(),o.data.unwrap(),t,i)}processSimple(e,t,i,n){let[o,a]=e,s=t.frames[0],l=t.frames[1]??s,c=t.numberOfFrames,p=t.sampleRate/sampleRate,d=this.#e.gain*this.#t.velocity,f=this.#e.release,v=1/f;for(let m=i;m<n;m++){let y=this.#i|0;if(y>=c-1)return!0;let x=this.#i-y,M=this.#o<this.#n?this.#o/this.#n:1,D=(Math.min(1-(this.#o-this.#a)*v,1)*M)**2,O=s[y]*(1-x)+s[y+1]*x,T=l[y]*(1-x)+l[y+1]*x;if(o[m]+=O*d*D,a[m]+=T*d*D,this.#i+=this.#r*p,++this.#o-this.#a>f)return!0}return!1}};var Ey=class extends Mr{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=new On(this,e.broadcaster,t.adapter.audioUnitBoxAdapter().address),this.own(e.registerProcessor(this)),this.readAllParameters()}introduceBlock(e){this.#t.introduceBlock(e)}setNoteEventSource(e){return this.#t.setNoteEventSource(e)}reset(){this.eventInput.clear(),this.#t.clear()}processEvents(e,t,i){}handleEvent({index:e},t){we.isStart(t)?this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:i})=>i.add(e,t)):we.isStop(t)&&this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:i})=>i.add(e,t))}toString(){return"{PlayfieldSequencer}"}};var By=class extends De{#e;#t;#r;#i;#n;constructor(e,t){super(e),this.#e=t,this.#t=new xe,this.#r=this.own(new Se(e.broadcaster,t.adapter.address)),this.#i=[],this.#n=new Ac,this.own(e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}setAudioSource(e){return this.#i.push(e),{terminate:()=>{R.remove(this.#i,e),this.#t.clear()}}}get audioOutput(){return this.#t}get eventInput(){return this.#n}processAudio(e,t,i){}reset(){this.#r.clear()}finishProcess(){this.#t.clear();let[e,t]=this.#t.channels();for(let i of this.#i){let[n,o]=i.channels();for(let a=0;a<128;a++)e[a]+=n[a],t[a]+=o[a]}this.#t.assertSanity(),this.#r.process(this.#t.getChannel(0),this.#t.getChannel(1))}toString(){return"{PlayfieldMixProcessor}"}};var Fy=class r{static create(e,t,i,n){return new r(e,t,i,n)}#e=new U;#t;#r;#i=[];#n=!0;constructor(e,t,i,n){this.#t=A.newSet(({device:o})=>o.uuid),this.#r=this.#e.own(new U),this.#e.ownAll(t.catchupAndSubscribe({onAdd:o=>{this.invalidateWiring();let a=Ih.create(e,o.box),s=this.#t.add({device:a,subscription:a.adapter().enabledField.subscribe(()=>this.invalidateWiring())});I(s,"Could not add.")},onRemove:o=>{this.invalidateWiring();let{device:a,subscription:s}=this.#t.removeByKey(o.uuid);s.terminate(),a.terminate()},onReorder:o=>this.invalidateWiring()}),e.subscribeProcessPhase(o=>{if(o===0&&this.#n){let a=i;R.replace(this.#i,t.adapters().map(({uuid:s})=>this.#t.get(s).device));for(let s of this.#i)s.adapter().enabledField.getValue()&&(this.#r.own(s.setAudioSource(a.audioOutput)),this.#r.own(e.registerEdge(a.outgoing,s.incoming)),a=s);this.#r.own(n.setAudioSource(a.audioOutput)),this.#r.own(e.registerEdge(a.outgoing,n.incoming)),this.#n=!1}}))}invalidateWiring(){this.#r.terminate(),this.#n=!0}terminate(){this.#e.terminate(),this.#t.forEach(({device:e})=>e.terminate()),this.#t.clear(),this.#i=[]}toString(){return`{${this.constructor.name}}`}};var Ch=Math.floor(.005*sampleRate),ky=class{#e;#t;#r;#i;#n;#o;#a=0;#u=Number.POSITIVE_INFINITY;#s;#l;#c;#d;#p;#h;#f=!0;#m=!1;constructor(e,t,i,n){this.#e=e,this.#t=t,this.#i=i,this.#r=n,this.#n=e.gate,this.#o=nl(this.#r.velocity);let{attack:o,release:a,sampleStart:s,sampleEnd:l}=this.#t;this.#s=o.getValue()*sampleRate,this.#l=a.getValue()*sampleRate,this.#c=(i.numberOfFrames-1)*s.getValue(),this.#d=(i.numberOfFrames-1)*l.getValue(),this.#p=this.#c,this.#h=0}get sample(){return this.#e}get event(){return this.#r}get position(){return this.#p}get envelope(){return this.#h}release(e=!1){this.#f&&(e?(this.#l=Ch,this.#y(),this.#f=!1):this.#n!==Tn.Off&&this.#y())}processAdd(e,t,i){let[n,o]=e,{frames:a,numberOfFrames:s}=this.#i,l=a[0],c=a[1]??l,{pitch:p}=this.#t,d=this.#d-this.#c,f=Math.sign(d),v=this.#i.sampleRate/sampleRate*f*2**(p.getValue()/1200),m=0;for(let y=t;y<i;y++){let x=this.#p|0,M=this.#p-x,D=l[x]*(1-M)+(l[x+1]??0)*M,O=c[x]*(1-M)+(c[x+1]??0)*M;if(m=Math.min(this.#a/this.#s,1-(this.#a-(this.#u+this.#s))/this.#l,1),this.#p+=v,f>0){if(this.#n===Tn.Off){if(this.#p>=s)return!0;!this.#m&&this.#p>=this.#d&&this.#y()}else if(this.#n===Tn.On){if(this.#p>=this.#d-Ch){if(this.#p>=this.#d)return!0;m*=(this.#d-this.#p)/Ch}}else if(this.#n===Tn.Loop)for(;this.#p>=this.#d;)this.#p-=d}else if(f<0){if(this.#n===Tn.Off){if(this.#p<=0)return!0;!this.#m&&this.#p<=this.#d&&this.#y()}else if(this.#n===Tn.On){if(this.#p<=this.#d+Ch){if(this.#p<=this.#d)return!0;m*=(this.#d-this.#p)/Ch}}else if(this.#n===Tn.Loop)for(;this.#p<=this.#d;)this.#p-=d}if(++this.#a-this.#u>this.#s+this.#l)return!0;m*=this.#o*m,n[y]+=D*m,o[y]+=O*m}return this.#h=m,!1}toString(){return"{PlayfieldSampleVoice}"}#y(){this.#m||(this.#m=!0,this.#u=this.#a<this.#s?this.#a-this.#s:this.#a)}};var $y=class extends De{#e;#t;#r;#i;#n;#o;constructor(e,t,i,n){super(e),this.#e=t,this.#t=i,this.#r=[],this.#i=new xe,this.#n=this.own(new Se(e.broadcaster,i.peakAddress));let{sampleStart:o,sampleEnd:a,attack:s,release:l,pitch:c}=i.namedParameter;this.#o=Object.freeze({sampleStart:this.own(this.bindParameter(o)),sampleEnd:this.own(this.bindParameter(a)),attack:this.own(this.bindParameter(s)),release:this.own(this.bindParameter(l)),pitch:this.own(this.bindParameter(c))});let p=new Float32Array(16);this.ownAll(Fy.create(e,i.audioEffects,this,n),e.broadcaster.broadcastFloats(i.address,p,()=>{let d=this.#r.length<p.length?this.#r:this.#r.slice(0,p.length);d.forEach(({position:f},v)=>p[v]=f),p[d.length]=-1}),e.registerProcessor(this)),this.readAllParameters()}get uuid(){return this.#t.uuid}get incoming(){return this}get outgoing(){return this}get audioOutput(){return this.#i}get adapter(){return this.#t}handleEvent(e){if(we.isStart(e)){let t=this.#t.file().flatMap(p=>p.getOrCreateLoader().data);if(t.isEmpty())return;let{mute:i,solo:n,polyphone:o,exclude:a}=this.#t.namedParameter,s=i.getValue(),l=n.getValue();if(s||this.#e.hasSolo()&&!l)return;o.getValue()||this.#r.forEach(p=>p.release(!0)),a.getValue()&&this.#e.stopExcludeOthers(this.#t),this.#r.push(new ky(this.#t,this.#o,t.unwrap(),e))}else we.isStop(e)&&this.#r.find(t=>t.event.id===e.id)?.release()}processAudio(e,t,i){this.#i.clear(t,i);for(let n=this.#r.length-1;n>=0;n--)this.#r[n].processAdd(this.#i.channels(),t,i)&&this.#r.splice(n,1)}forceStop(){this.#r.forEach(e=>e.release(!0))}parameterChanged(e){}reset(){this.#r.length=0,this.#i.clear(),this.#n.clear()}finishProcess(){this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return`{PlayfieldSampleProcessor note: ${this.#t.indexField.getValue()}}`}};var My=class{#e=new U;#t;#r;#i;#n;constructor(e,t){this.#t=t,this.#r=this.#e.own(new Ey(e,this)),this.#i=this.#e.own(new By(e,this)),this.#n=A.newSet(i=>i.uuid),this.#e.ownAll(t.samples.catchupAndSubscribe({onAdd:i=>{let n=new $y(e,this,i,this.#i);this.#n.add({uuid:i.uuid,processor:n,terminable:e.registerEdge(this.#r,n)}),e.sampleManager.getOrCreate(i.fileUUID())},onRemove:i=>{let{terminable:n,processor:o}=this.#n.removeByKey(i.uuid);n.terminate(),o.terminate()},onReorder:i=>{}}),{terminate:()=>{this.#n.forEach(({terminable:i,processor:n})=>{i.terminate(),n.terminate()}),this.#n.clear()}})}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get noteEventTarget(){return g.wrap(this)}get incoming(){return this.#r}get outgoing(){return this.#i}optSampleProcessor(e){return this.#t.samples.getAdapterByIndex(e).flatMap(t=>this.#n.opt(t.uuid)).map(t=>t.processor)}hasSolo(){return this.#t.samples.adapters().some(e=>e.namedParameter.solo.getValue())}stopExcludeOthers(e){for(let t of this.#t.samples.adapters())t.exclude&&t!==e&&this.#n.opt(t.uuid).ifSome(({processor:i})=>i.forceStop())}get uuid(){return this.#t.uuid}get adapter(){return this.#t}get audioOutput(){return this.#i.audioOutput}parameterChanged(e){}terminate(){this.#e.terminate()}toString(){return"{PlayfieldDeviceProcessor}"}};var Dy=class extends De{#e;#t;#r;#i=qt.stereoMatrix(sampleRate);#n={gain:0,panning:0,stereo:0,invertL:!1,invertR:!1,swap:!1};#o;#a;#u;#s;#l;#c;#d=g.None;#p=an.Linear;#h=!0;#f=!1;constructor(e,t){super(e),this.#e=t,this.#t=new xe,this.#r=this.own(new Se(e.broadcaster,t.address)),this.#o=this.own(this.bindParameter(t.namedParameter.volume)),this.#a=this.own(this.bindParameter(t.namedParameter.panning)),this.#u=this.own(this.bindParameter(t.namedParameter.stereo)),this.#s=this.own(this.bindParameter(t.namedParameter.invertL)),this.#l=this.own(this.bindParameter(t.namedParameter.invertR)),this.#c=this.own(this.bindParameter(t.namedParameter.swap)),this.ownAll(t.box.panningMixing.catchupAndSubscribe(i=>{this.#p=i.getValue(),this.#h=!0}),e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#t.clear(),this.eventInput.clear(),this.#f=!1}get uuid(){return this.#e.uuid}get audioOutput(){return this.#t}setAudioSource(e){return this.#d=g.wrap(e),{terminate:()=>this.#d=g.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}processAudio(e,t,i){if(this.#d.isEmpty())return;this.#h&&(this.#i.update(this.#n,this.#p,this.#f),this.#h=!1);let n=this.#d.unwrap().channels(),o=this.#t.channels();this.#i.processFrames(n,o,t,i),this.#r.processStereo(o,t,i),this.#f=!0}parameterChanged(e){switch(e){case this.#o:this.#n.gain=Ve(this.#o.getValue()),this.#h=!0;return;case this.#a:this.#n.panning=this.#a.getValue(),this.#h=!0;return;case this.#u:this.#n.stereo=this.#u.getValue(),this.#h=!0;return;case this.#s:this.#n.invertL=this.#s.getValue(),this.#h=!0;return;case this.#l:this.#n.invertR=this.#l.getValue(),this.#h=!0;return;case this.#c:this.#n.swap=this.#c.getValue(),this.#h=!0;return}}toString(){return`{${this.constructor.name}}`}};var Iy=class extends Mr{#e;#t;#r=g.None;#i=g.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Ei(e.broadcaster,t.address)),this.ownAll(t.box.groove.catchupAndSubscribe(i=>{this.#r.ifSome(n=>n.terminate()),this.#r=g.wrap(i.targetVertex.isEmpty()?null:e.boxAdapters.adapterFor(i.targetVertex.unwrap().box,Rs.checkType))}),K.create(()=>{this.#r.ifSome(i=>i.terminate()),this.#r=g.None}),e.registerProcessor(this))}get uuid(){return this.#e.uuid}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}setNoteEventSource(e){return I(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=g.wrap(e),K.create(()=>this.#i=g.None)}*processNotes(e,t,i){if(this.#i.isEmpty())return;let n=this.#i.unwrap(),o=this.#r.mapOr($c,zc.Identity);for(let a of n.processNotes(o.unwarp(e),o.unwarp(t),i))we.isStart(a)?this.#t.noteOn(a.pitch):this.#t.noteOff(a.pitch),yield Dr.overwrite(a,{position:le(o.warp(a.position),e,t)})}*iterateActiveNotesAt(e,t){if(this.#i.isEmpty())return;let i=this.#i.unwrap(),n=this.#r.mapOr($c,zc.Identity);for(let o of i.iterateActiveNotesAt(n.unwarp(e),t))yield Dr.overwrite(o,{position:n.warp(o.position)})}reset(){this.eventInput.clear()}parameterChanged(e){}handleEvent(e,t){}processEvents(e,t,i){}};var Cy=class extends Mr{#e;#t;#r=g.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Ei(e.broadcaster,t.address)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return I(this.#r.isEmpty(),"NoteEventSource already set"),this.#r=g.wrap(e),K.create(()=>this.#r=g.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,i){if(!this.#r.isEmpty())for(let n of this.#r.unwrap().processNotes(e,t,i))yield n}*iterateActiveNotesAt(e,t){if(!this.#r.isEmpty())for(let i of this.#r.unwrap().iterateActiveNotesAt(e,t))yield i}reset(){this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Ty=(r,e)=>(r[e]??r[e.toString()])?.value,Ec=(r,e,t)=>Ty(e,t)??Ty(r,t),eB=new Float32Array(128),Ry=class{event;sampleData;envelope;#e;rootKey;sampleRate;loopStart;loopEnd;pan;shouldLoop;playbackPosition=0;isReleasing=!1;constructor(e,t,i,n){this.event=e;let o=t.generators,a=i?.generators,s=Ty(a,53)??0,l=i?.sample??n.samples[s];this.sampleData=l.data,this.rootKey=Ty(a,58)??l?.header.originalPitch??60,this.sampleRate=l?.header.sampleRate??sampleRate,this.loopStart=l?.header.startLoop??0,this.loopEnd=l?.header.endLoop??this.sampleData.length;let c=Ec(o,a,54)??0;this.shouldLoop=c===1||c===3,this.pan=(Ec(o,a,17)??0)/1e3;let p=Ec(o,a,34),d=Ec(o,a,36),f=Ec(o,a,37),v=Ec(o,a,38),m=Ma(p)?Math.pow(2,p/1200):.005,y=Ma(d)?Math.pow(2,d/1200):.005,x=1-(f??0)/1e3,M=Ma(v)?Math.pow(2,v/1200):.005;this.envelope=new il(sampleRate),this.envelope.set(m,y,x,M),this.envelope.gateOn(),this.#e=new Mi(.003,sampleRate)}release(){this.isReleasing=!0,this.envelope.gateOff()}processAdd(e,t,i){let o=Oc(this.event.pitch+this.event.cent/100,440)/Oc(this.rootKey,440)*(this.sampleRate/sampleRate),a=nl(this.event.velocity),s=Math.cos((this.pan+1)*Math.PI/4),l=Math.sin((this.pan+1)*Math.PI/4);this.envelope.process(eB,t,i);let c=e.getChannel(0),p=e.getChannel(1);for(let d=t;d<i;d++){let f=Math.floor(this.playbackPosition),m=this.#t(f)/32768*a*this.#e.process(eB[d]);if(c[d]+=m*s,p[d]+=m*l,this.playbackPosition+=o,this.shouldLoop)this.playbackPosition>=this.loopEnd&&this.loopEnd>this.loopStart&&(this.playbackPosition=this.loopStart+(this.playbackPosition-this.loopEnd));else if(this.playbackPosition>=this.sampleData.length-1)return!0}return this.envelope.complete&&this.#e.value<1e-4}#t(e){if(e>=this.sampleData.length-1)return this.sampleData[this.sampleData.length-1];let t=this.playbackPosition-e;return this.sampleData[e]*(1-t)+this.sampleData[e+1]*t}};var Oy=class extends De{#e;#t;#r;#i;#n;#o=g.None;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new On(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new xe,this.#n=this.own(new Se(e.broadcaster,t.address)),this.ownAll(e.registerProcessor(this),t.box.file.catchupAndSubscribe(i=>this.#o=i.targetVertex.map(({box:n})=>e.soundfontManager.getOrCreate(n.address.uuid))))}introduceBlock(e){this.#r.introduceBlock(e)}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get noteEventTarget(){return g.wrap(this)}get incoming(){return this}get outgoing(){return this}get uuid(){return this.#e.uuid}get audioOutput(){return this.#i}get adapter(){return this.#e}reset(){this.#r.clear(),this.#n.clear(),this.#t.length=0,this.#i.clear(),this.eventInput.clear()}handleEvent(e){let t=this.#o.flatMap(n=>n.soundfont);if(t.isEmpty())return;let i=t.unwrap();if(we.isStart(e)){let n=i.presets[this.#e.presetIndex]??i.presets[0];if(cP(n)){console.warn("No preset available");return}let o=0;for(let a of n.zones){let s=Math.round(e.velocity*127);if(this.#a(e.pitch,s,a)){let l=a.instrument.zones;for(let c=0;c<l.length;c++){let p=l[c];this.#a(e.pitch,s,p)&&(this.#t.push(new Ry(e,a,p,i)),o++)}}}}else we.isStop(e)&&this.#t.forEach(n=>{n.event.id===e.id&&n.release()})}processAudio(e,t,i){this.#i.clear(t,i);for(let n=this.#t.length-1;n>=0;n--)this.#t[n].processAdd(this.#i,t,i)&&this.#t.splice(n,1)}finishProcess(){this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{SoundfontDevice}"}#a(e,t,i){return this.#u(i.generators[44]?.range,t)&&this.#u(i.generators[43]?.range,e)}#u(e,t){return Hs(e)||t>=e.lo&&t<=e.hi}};var tB=r=>r>0?20*Math.log10(r):-100,rB=r=>Math.pow(10,r*.05);var Vy=class{#e=.08;#t=1;#r;#i;#n=0;#o=.14;#a=0;#u=.14;#s=0;#l=0;#c=0;constructor(e){this.#r=Math.exp(-1/(e*.2)),this.#i=1-this.#r}process(e,t,i){this.#s===0&&(this.#s=e[0]),this.#l===0&&(this.#l=e[0]),this.#a=0,this.#u=0;for(let o=t;o<i;++o){let a=e[o]*e[o];this.#s=Math.max(a,this.#r*this.#s+this.#i*a),this.#l=this.#r*this.#l+this.#i*a;let s=this.#s/this.#l;this.#c=s>0?s:0,this.#c>0&&(this.#n=2*(this.#e/this.#c),this.#o=2*(this.#t/this.#c)-this.#n,this.#a+=this.#n,this.#u+=this.#o)}let n=i-t;this.#a/=n,this.#u/=n}getAvgAttack(){return this.#a}getAvgRelease(){return this.#u}};var zy=class{#e=[];#t;#r;#i;#n=0;constructor(e,t,i,n){this.#i=n,this.#r=Math.floor(e*t),this.#t=i+this.#r;for(let o=0;o<n;o++)this.#e[o]=new Float32Array(this.#t);this.#n=0}process(e,t,i){if(this.#r===0)return;let n=(this.#n-this.#r+this.#t)%this.#t;for(let o=0;o<this.#i;o++){let a=e.getChannel(o),s=this.#n,l=n;for(let c=t;c<i;c++){let p=this.#e[o][l];this.#e[o][s]=a[c],a[c]=p,s=(s+1)%this.#t,l=(l+1)%this.#t}}this.#n=(this.#n+(i-t))%this.#t}};var Uy=class{#e=-20;#t=2;#r=6;#i=3;#n=-.5;setThreshold(e){this.#e=e}setRatio(e){this.#t!==e&&(this.#t=e,this.#t>23.9&&(this.#t=-1/0),this.#n=1/e-1)}setKnee(e){e!==this.#r&&(this.#r=e,this.#i=e/2)}applyCompression(e){let t=e-this.#e;return t<=-this.#i?0:t>-this.#i&&t<=this.#i?.5*this.#n*((t+this.#i)*(t+this.#i))/this.#r:this.#n*t}applyCompressionToBuffer(e,t,i){for(let n=t;n<i;++n){let o=Math.max(Math.abs(e[n]),1e-6),a=tB(o);e[n]=this.applyCompression(a)}}};var Zs=class{#e;#t=1;#r=0;#i=0;#n=!0;constructor(e){this.#e=e,this.#t=1,this.#r=1-this.#t}process(e){this.#n&&(this.#i=e,this.#n=!1),this.#i=this.#t*e+this.#r*this.#i}setAlpha(e){this.#t=e,this.#r=1-this.#t}setAlphaWithTime(e){this.#t=Math.exp(-1/(this.#e*e)),this.#r=1-this.#t}getState(){return this.#i}};var jy=class{#e;#t;#r;#i;#n=.01;#o=0;#a=.14;#u=0;#s=0;#l=0;#c=!1;#d=!1;constructor(e){this.#e=e,this.#t=new Vy(e),this.#r=new Zs(e),this.#i=new Zs(e),this.#o=Math.exp(-1/(e*this.#n)),this.#u=Math.exp(-1/(e*this.#a)),this.#s=0,this.#l=0}setAttack(e){e!==this.#n&&(this.#n=e,this.#o=Math.exp(-1/(this.#e*this.#n)))}setRelease(e){e!==this.#a&&(this.#a=e,this.#u=Math.exp(-1/(this.#e*this.#a)))}setAutoAttack(e){this.#c=e}setAutoRelease(e){this.#d=e}#p(e){return e<this.#s?this.#s=this.#o*this.#s+(1-this.#o)*e:this.#s=this.#u*this.#s+(1-this.#u)*e,this.#s}applyBallistics(e,t,i){for(let n=t;n<i;++n)e[n]=this.#p(e[n])}processCrestFactor(e,t,i){(this.#c||this.#d)&&(this.#t.process(e,t,i),this.#r.process(this.#t.getAvgAttack()),this.#i.process(this.#t.getAvgRelease()),this.#c&&this.setAttack(this.#r.getState()),this.#d&&this.setRelease(this.#i.getState()))}};var Ly=class{#e;#t;#r;#i=0;#n=0;constructor(e,t,i){this.#t=Math.floor(e*t),this.#r=i+this.#t,this.#e=new Float32Array(this.#r),this.#i=0}process(e,t,i){this.#o(e,t,i),this.#u(),this.#a(e,t,i)}#o(e,t,i){for(let n=t;n<i;n++)this.#e[this.#i]=e[n],this.#i=(this.#i+1)%this.#r;this.#n=i-t}#a(e,t,i){let n=this.#i-this.#n-this.#t;n<0&&(n+=this.#r);for(let o=t;o<i;o++)e[o]=this.#e[n],n=(n+1)%this.#r}#u(){let e=this.#i-1;e<0&&(e+=this.#r);let t=0,i=0;for(let o=0;o<this.#n;o++){let a=this.#e[e];a>t?(this.#e[e]=t,t+=i):(i=-a/this.#t,t=a+i),e=e-1,e<0&&(e+=this.#r)}let n=!1;for(let o=0;o<this.#t&&!n;o++){if(this.#e[e]>t)this.#e[e]=t,t+=i;else{n=!0;break}e=e-1,e<0&&(e+=this.#r)}}};var Ky=class r extends De{static PEAK_DECAY_PER_SAMPLE=Math.exp(-1/(sampleRate*.5));static REDUCTION_DECAY_PER_SAMPLE=128/sampleRate*.05;static ID=0;#e=r.ID++;#t;parameterLookahead;parameterAutomakeup;parameterAutoattack;parameterAutorelease;parameterInputgain;parameterThreshold;parameterRatio;parameterKnee;parameterAttack;parameterRelease;parameterMakeup;parameterMix;#r;#i;#n;#o;#a;#u;#s;#l;#c;#d=.005;#p;#h;#f=g.None;#m=!1;#y=!1;#g=!1;#A=!1;#N=-10;#B=2;#P=6;#k=2;#v=140;#x=0;#w=1;#E=0;#F=0;#S=0;#_=0;#$=!1;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Se(e.broadcaster,t.address)),this.#p=new Float32Array([Number.NEGATIVE_INFINITY,0,Number.NEGATIVE_INFINITY]),this.#h=qt.linear(sampleRate);let{lookahead:i,automakeup:n,autoattack:o,autorelease:a,inputgain:s,threshold:l,ratio:c,knee:p,attack:d,release:f,makeup:v,mix:m}=t.namedParameter;this.parameterLookahead=this.own(this.bindParameter(i)),this.parameterAutomakeup=this.own(this.bindParameter(n)),this.parameterAutoattack=this.own(this.bindParameter(o)),this.parameterAutorelease=this.own(this.bindParameter(a)),this.parameterInputgain=this.own(this.bindParameter(s)),this.parameterThreshold=this.own(this.bindParameter(l)),this.parameterRatio=this.own(this.bindParameter(c)),this.parameterKnee=this.own(this.bindParameter(p)),this.parameterAttack=this.own(this.bindParameter(d)),this.parameterRelease=this.own(this.bindParameter(f)),this.parameterMakeup=this.own(this.bindParameter(v)),this.parameterMix=this.own(this.bindParameter(m)),this.#n=new jy(sampleRate),this.#o=new Uy,this.#a=new zy(sampleRate,.005,128,2),this.#u=new Ly(sampleRate,this.#d,128),this.#s=new Zs(sampleRate),this.#s.setAlpha(.03),this.#l=new Float32Array(128),this.#c=[new Float32Array(128),new Float32Array(128)],this.ownAll(e.registerProcessor(this),e.broadcaster.broadcastFloats(t.address.append(0),this.#p,()=>{this.#p[0]=Nx(this.#F),this.#p[1]=this.#_,this.#p[2]=Nx(this.#S)})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#$=!1,this.#r.clear(),this.#i.clear(),this.eventInput.clear(),this.#l.fill(0),this.#c[0].fill(0),this.#c[1].fill(0),this.#E=0,this.#F=0,this.#S=0,this.#_=0}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#f=g.wrap(e),{terminate:()=>this.#f=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio(e,t,i){if(this.#f.isEmpty())return;let n=this.#f.unwrap(),o=n.getChannel(0),a=n.getChannel(1),s=this.#r.getChannel(0),l=this.#r.getChannel(1);for(let c=t;c<i;c++){let p=this.#h.moveAndGet(),d=s[c]=o[c]*p,f=l[c]=a[c]*p,v=Math.max(Math.abs(d),Math.abs(f));this.#F<=v?this.#F=v:this.#F*=r.PEAK_DECAY_PER_SAMPLE}this.#l.fill(0,t,i);for(let c=t;c<i;c++)this.#l[c]=Math.max(Math.abs(s[c]),Math.abs(l[c]));this.#n.processCrestFactor(this.#l,t,i),this.#o.applyCompressionToBuffer(this.#l,t,i),this.#n.applyBallistics(this.#l,t,i);for(let c=t;c<i;c++){let p=this.#l[c];this.#_>=p?this.#_=p:this.#_+=r.REDUCTION_DECAY_PER_SAMPLE}this.#E=this.#M(this.#l,t,i),this.#m&&(this.#a.process(this.#r,t,i),this.#u.process(this.#l,t,i));for(let c=t;c<i;c++)this.#l[c]=rB(this.#l[c]+this.#x+this.#E);for(let c=t;c<i;c++)this.#c[0][c]=s[c],this.#c[1][c]=l[c];for(let c=t;c<i;c++)s[c]*=this.#l[c],l[c]*=this.#l[c];for(let c=t;c<i;c++){let p=s[c]*this.#w+this.#c[0][c]*(1-this.#w),d=l[c]*this.#w+this.#c[1][c]*(1-this.#w),f=Math.max(Math.abs(p),Math.abs(d));this.#S<=f?this.#S=f:this.#S*=r.PEAK_DECAY_PER_SAMPLE,s[c]=p,l[c]=d}this.#i.process(s,l,t,i),this.#$=!0}#M(e,t,i){let n=0;for(let o=t;o<i;o++)n+=e[o];return this.#s.process(-n/(i-t)),this.#y?this.#s.getState():0}parameterChanged(e){e===this.parameterLookahead?this.#m=this.parameterLookahead.getValue():e===this.parameterAutomakeup?this.#y=this.parameterAutomakeup.getValue():e===this.parameterAutoattack?(this.#g=this.parameterAutoattack.getValue(),this.#n.setAutoAttack(this.#g),this.#g||this.#n.setAttack(this.#k*.001)):e===this.parameterAutorelease?(this.#A=this.parameterAutorelease.getValue(),this.#n.setAutoRelease(this.#A),this.#A||this.#n.setRelease(this.#v*.001)):e===this.parameterInputgain?this.#h.set(Ve(this.parameterInputgain.getValue()),this.#$):e===this.parameterThreshold?(this.#N=this.parameterThreshold.getValue(),this.#o.setThreshold(this.#N)):e===this.parameterRatio?(this.#B=this.parameterRatio.getValue(),this.#o.setRatio(this.#B)):e===this.parameterKnee?(this.#P=this.parameterKnee.getValue(),this.#o.setKnee(this.#P)):e===this.parameterAttack?(this.#k=this.parameterAttack.getValue(),this.#g||this.#n.setAttack(this.#k*.001)):e===this.parameterRelease?(this.#v=this.parameterRelease.getValue(),this.#A||this.#n.setRelease(this.#v*.001)):e===this.parameterMakeup?this.#x=this.parameterMakeup.getValue():e===this.parameterMix&&(this.#w=this.parameterMix.getValue())}toString(){return`{${this.constructor.name} (${this.#e})}`}};var Wy=class r extends De{static ID=0;#e=r.ID++;#t;#r;#i;#n;parameterCrusherRate;parameterBitDepth;parameterBoost;parameterMix;#o=g.None;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=new Gh(sampleRate),this.#n=this.own(new Se(e.broadcaster,t.address));let{crush:i,bits:n,boost:o,mix:a}=t.namedParameter;this.parameterCrusherRate=this.own(this.bindParameter(i)),this.parameterBitDepth=this.own(this.bindParameter(n)),this.parameterBoost=this.own(this.bindParameter(o)),this.parameterMix=this.own(this.bindParameter(a)),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.reset(),this.#n.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#o.isEmpty())return;let n=this.#o.unwrap();this.#i.process(n.channels(),this.#r.channels(),t,i),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1),t,i)}parameterChanged(e){e===this.parameterCrusherRate?this.#i.setCrush(1-this.parameterCrusherRate.getValue()):e===this.parameterBitDepth?this.#i.setBitDepth(this.parameterBitDepth.getValue()):e===this.parameterBoost?this.#i.setBoost(this.parameterBoost.getValue()):e===this.parameterMix&&this.#i.setMix(this.parameterMix.getValue())}toString(){return`{${this.constructor.name} (${this.#e})`}};var W$=[2,4,8],iB=8,Zy=class r extends De{static ID=0;#e=r.ID++;#t;#r;#i;#n;parameterDrive;parameterVolume;#o=g.None;#a=!1;#u;#s;#l;#c;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=[new Float32Array(128*iB),new Float32Array(128*iB)],this.#n=this.own(new Se(e.broadcaster,t.address));let{drive:i,volume:n}=t.namedParameter;this.parameterDrive=this.own(this.bindParameter(i)),this.parameterVolume=this.own(this.bindParameter(n)),this.ownAll(e.registerProcessor(this),t.box.overSampling.catchupAndSubscribe(o=>{let a=W$[o.getValue()];this.#u=new rf(a),this.#l=qt.linear(sampleRate*a),this.#l.set(Ve(this.parameterDrive.getValue()),this.#a),this.#c=qt.linear(sampleRate*a),this.#c.set(Ve(this.parameterVolume.getValue()),this.#a),this.#s=a})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){console.debug("reset"),this.#a=!1,this.#n.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,i){if(this.#o.isEmpty())return;this.#u.upsample(this.#o.unwrap().channels(),this.#i,t,i);let n=(i-t)*this.#s,[o,a]=this.#i;for(let s=0;s<n;s++){let l=this.#c.moveAndGet(),c=this.#l.moveAndGet();o[s]=kx(o[s]*c)*l,a[s]=kx(a[s]*c)*l}this.#u.downsample(this.#i,this.#r.channels(),t,i),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1),t,i),this.#a=!0}parameterChanged(e){e===this.parameterDrive?this.#l.set(Ve(this.parameterDrive.getValue()),this.#a):e===this.parameterVolume&&this.#c.set(Ve(this.parameterVolume.getValue()),this.#a)}toString(){return`{${this.constructor.name} (${this.#e})`}};var Gy=class extends De{#e;#t;#r=[];#i;#n;#o=g.None;constructor(e,t){super(e),this.#e=t,this.#t=new xe,this.#i=[];let{midiDevice:i,box:n,parameters:o}=t;this.#n=n.channel.getValue(),this.ownAll(n.parameters.pointerHub.catchupAndSubscribe({onAdded:({box:a})=>this.#i.push(this.bindParameter(o.parameterAt(Ne(a,Ti).value.address))),onRemoved:({box:a})=>R.removeIf(this.#i,s=>s.address===Ne(a,Ti).value.address)}),n.channel.subscribe(a=>{i.ifSome(s=>this.#r.forEach(l=>e.sendMIDIData(s.id.getValue(),st.noteOff(this.#n,l),s.delayInMs.getValue()))),this.#r.length=0,this.#n=a.getValue()}),e.registerProcessor(this)),this.readAllParameters()}get noteEventTarget(){return g.wrap(this)}introduceBlock({p0:e,p1:t,s0:i,flags:n,bpm:o}){if(this.#o.isEmpty())return;let{box:{channel:a,device:s}}=this.#e,l=s.targetVertex.match({none:()=>g.None,some:({box:p})=>g.wrap(Ne(p,Ci))}),c=l.mapOr(p=>p.delayInMs.getValue(),0);for(let p of this.#o.unwrap().processNotes(e,t,n))if(p.pitch>=0&&p.pitch<=127){let d=i/sampleRate,f=Q.pulsesToSeconds(p.position-e,o),v=(d+f)*1e3+c,m=a.getValue();if(we.isStart(p)){let y=Math.round(p.velocity*127);this.#r.push(p.pitch),l.ifSome(x=>this.context.sendMIDIData(x.id.getValue(),st.noteOn(m,p.pitch,y),v))}else if(we.isStop(p)){let y=this.#r.indexOf(p.pitch);y>-1&&this.#r.splice(y,1),l.ifSome(x=>this.context.sendMIDIData(x.id.getValue(),st.noteOff(m,p.pitch),v))}}}setNoteEventSource(e){return this.#o=g.wrap(e),K.create(()=>this.#o=g.None)}get incoming(){return this}get outgoing(){return this}reset(){}get uuid(){return this.#e.uuid}get audioOutput(){return this.#t}get adapter(){return this.#e}handleEvent(e){}processAudio(e,t,i){}parameterChanged(e,t=0){let{box:{channel:i,device:n}}=this.#e;if(n.isEmpty())return;let{id:o,delayInMs:a}=Ne(n.targetVertex.unwrap().box,Ci),s=t*1e3*a.getValue(),l=Ne(e.adapter.field.box,Ti).controller.getValue(),c=Math.round(e.getValue()*127),p=st.control(i.getValue(),l,c);this.context.sendMIDIData(o.getValue(),p,s)}finishProcess(){}toString(){return"{MIDIOutputDeviceProcessor}"}};var qy=class extends Mr{#e;#t;#r;#i=g.None;#n;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Ei(e.broadcaster,t.address)),this.#r=new Int32Array(1024),this.#n=0;let{magnetPosition:i,magnetStrength:n,randomSeed:o,randomAmount:a,offset:s,mix:l}=t.namedParameter;this.ownAll(this.bindParameter(i),this.bindParameter(n),this.bindParameter(o),this.bindParameter(a),this.bindParameter(s),this.bindParameter(l),e.broadcaster.broadcastIntegers(t.address.append(0),this.#r,()=>{this.#r[this.#n]=0,this.#n=0}),e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return I(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=g.wrap(e),K.create(()=>this.#i=g.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,i){if(!this.#i.isEmpty())for(let n of this.#i.unwrap().processNotes(e,t,i))if(we.isStart(n)){this.#t.noteOn(n.pitch);let o=this.#e.computeVelocity(n.position,n.velocity);this.#r[this.#n++]=Math.round(n.velocity*127)|Math.round(o*127)<<8|65536,yield Dr.overwrite(n,{velocity:o})}else this.#t.noteOff(n.pitch),yield n}*iterateActiveNotesAt(e,t){if(!this.#i.isEmpty())for(let i of this.#i.unwrap().iterateActiveNotesAt(e,t))i.type==="note-event"&&(yield Dr.overwrite(i,{velocity:this.#e.computeVelocity(i.position,i.velocity)}))}reset(){this.eventInput.clear()}processEvents(e,t,i){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Hy=class r extends De{static ID=0;#e=r.ID++;#t;#r;#i;#n;#o;#a;#u;#s;#l;#c;#d;#p;#h=g.None;#f=!0;#m=0;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Se(e.broadcaster,t.address)),this.#n=new qh,this.#o=new Mi(.003,sampleRate),this.#a=new Mi(.003,sampleRate);let{rate:i,depth:n,slope:o,symmetry:a,offset:s,channelOffset:l}=t.namedParameter;this.#u=this.bindParameter(i),this.#s=this.bindParameter(n),this.#l=this.bindParameter(o),this.#c=this.bindParameter(a),this.#d=this.bindParameter(s),this.#p=this.bindParameter(l),this.ownAll(e.broadcaster.broadcastFloat(t.address.append(0),()=>this.#m),e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#m=0,this.#f=!0,this.#i.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#h=g.wrap(e),{terminate:()=>this.#h=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio({p0:e,bpm:t,flags:i},n,o){if(this.#h.isEmpty())return;let a=this.#h.unwrap(),[s,l]=a.channels(),[c,p]=this.#r.channels();this.#f&&(this.#n.set(this.#s.getValue(),this.#l.getValue(),this.#c.getValue()),this.#f=!1);let{RateFractions:d}=Xi,f=Q.samplesToPulses(1,t,sampleRate),m=1/ir.toPPQN(d[this.#u.getValue()]),y=this.#d.getValue()/360,x=y+this.#p.getValue()/360;for(let M=n;M<o;M++){let D=(e+M*f)*m+y,O=(e+M*f)*m+x;c[M]=s[M]*this.#o.process(this.#n.compute(D-Math.floor(D))),p[M]=l[M]*this.#a.process(this.#n.compute(O-Math.floor(O)))}this.#i.process(c,p),rt.every(i,5)&&(this.#m=(e+(o-n)*f)*m)}parameterChanged(e){(e===this.#s||e===this.#l||e===this.#c)&&(this.#f=!0)}toString(){return`{${this.constructor.name} (${this.#e})`}};var Jy=class{#e;#t=[];#r;#i;#n;#o=0;#a=0;#u=0;#s=0;#l=0;#c=0;#d=.9999;#p=.75;#h=.625;#f=.5;#m=.7;#y=.5;#g=.005;#A=.5;#N=.7;#B=.3;#P=.6;constructor(e){this.#e=e,this.#n=e+1,this.#r=new Float32Array(this.#n),[.004771345,.003595309,.012734787,.009307483,.022579886,.149625349,.060481839,.1249958,.030509727,.141695508,.089244313,.106280031].forEach(n=>this.#k(n));let i=[.008937872,.099929438,.064278754,.067067639,.066866033,.006283391,.035818689,.011861161,.121870905,.041262054,.08981553,.070931756,.011256342,.004065724];this.#i=Int16Array.from(i,n=>Math.round(n*e))}#k(e){let t=Math.round(e*this.#e),i=2**Math.ceil(Math.log2(t));this.#t.push([new Float32Array(i),t-1,0,i-1])}#v(e,t){return this.#t[e][0][this.#t[e][1]]=t}#x(e){return this.#t[e][0][this.#t[e][2]]}#w(e,t){let i=this.#t[e];return i[0][i[2]+t&i[3]]}#E(e,t){let i=this.#t[e],n=t-~~t,o=~~t+i[2]-1,a=i[3],s=i[0][o++&a],l=i[0][o++&a],c=i[0][o++&a],p=i[0][o&a],d=(3*(l-c)-s+p)*.5,f=2*c+s-(5*l+p)*.5,v=(c-s)*.5;return((d*n+f)*n+v)*n+l}set preDelayMs(e){this.#c=Math.floor(e/1e3*this.#e)}set bandwidth(e){this.#d=e*.9999}set inputDiffusion1(e){this.#p=e}set inputDiffusion2(e){this.#h=e}set decay(e){this.#f=e}set decayDiffusion1(e){this.#m=e*.999999}set decayDiffusion2(e){this.#y=e*.999999}set damping(e){this.#g=e}set excursionRate(e){this.#A=e*2}set excursionDepth(e){this.#N=e*2}set wetGain(e){this.#B=e}set dryGain(e){this.#P=e}reset(){this.#r.fill(0),this.#t.forEach(e=>e[0].fill(0)),this.#o=0,this.#a=0,this.#u=0,this.#s=0,this.#l=0}process(e,t,i,n){let o=this.#c,a=this.#d,s=this.#p,l=this.#h,c=this.#f,p=this.#m,d=this.#y,f=1-this.#g,v=this.#A/this.#e,m=this.#N*this.#e/1e3,y=this.#B*.6,x=this.#P,M=e[0],D=e[1],O=t[0],T=t[1];for(let V=i;V<n;V++){let Y=M[V],ne=D[V];this.#r[this.#o]=(Y+ne)*.5,O[V]=Y*x,T[V]=ne*x;let G=this.#r[(this.#n+this.#o-o)%this.#n];this.#a+=a*(G-this.#a);let de=this.#v(0,this.#a-s*this.#x(0));de=this.#v(1,s*(de-this.#x(1))+this.#x(0)),de=this.#v(2,s*de+this.#x(1)-l*this.#x(2)),de=this.#v(3,l*(de-this.#x(3))+this.#x(2));let oe=l*de+this.#x(3),Ie=m*(1+Math.cos(this.#l*6.28)),Ge=m*(1+Math.sin(this.#l*6.2847)),Ue=this.#v(4,oe+c*this.#x(11)+p*this.#E(4,Ie));this.#v(5,this.#E(4,Ie)-p*Ue),this.#u+=f*(this.#x(5)-this.#u),Ue=this.#v(6,c*this.#u-d*this.#x(6)),this.#v(7,this.#x(6)+d*Ue),Ue=this.#v(8,oe+c*this.#x(7)+p*this.#E(8,Ge)),this.#v(9,this.#E(8,Ge)-p*Ue),this.#s+=f*(this.#x(9)-this.#s),Ue=this.#v(10,c*this.#s-d*this.#x(10)),this.#v(11,this.#x(10)+d*Ue);let qe=this.#w(9,this.#i[0])+this.#w(9,this.#i[1])-this.#w(10,this.#i[2])+this.#w(11,this.#i[3])-this.#w(5,this.#i[4])-this.#w(6,this.#i[5])-this.#w(7,this.#i[6]),lt=this.#w(5,this.#i[7])+this.#w(5,this.#i[8])-this.#w(6,this.#i[9])+this.#w(7,this.#i[10])-this.#w(9,this.#i[11])-this.#w(10,this.#i[12])-this.#w(11,this.#i[13]);O[V]+=qe*y,T[V]+=lt*y,this.#l+=v,this.#o=(this.#o+1)%this.#n;for(let ve=0;ve<this.#t.length;ve++){let Ce=this.#t[ve];Ce[1]=Ce[1]+1&Ce[3],Ce[2]=Ce[2]+1&Ce[3]}}}};var Qy=class r extends De{static ID=0;#e=r.ID++;#t;parameterPreDelay;parameterBandwidth;parameterInputDiffusion1;parameterInputDiffusion2;parameterDecay;parameterDecayDiffusion1;parameterDecayDiffusion2;parameterDamping;parameterExcursionRate;parameterExcursionDepth;parameterWet;parameterDry;#r;#i;#n;#o=g.None;constructor(e,t){super(e),this.#t=t,this.#i=new xe,this.#n=this.own(new Se(e.broadcaster,t.address)),this.#r=new Jy(sampleRate);let{preDelay:i,bandwidth:n,inputDiffusion1:o,inputDiffusion2:a,decay:s,decayDiffusion1:l,decayDiffusion2:c,damping:p,excursionRate:d,excursionDepth:f,wet:v,dry:m}=t.namedParameter;this.parameterPreDelay=this.own(this.bindParameter(i)),this.parameterBandwidth=this.own(this.bindParameter(n)),this.parameterInputDiffusion1=this.own(this.bindParameter(o)),this.parameterInputDiffusion2=this.own(this.bindParameter(a)),this.parameterDecay=this.own(this.bindParameter(s)),this.parameterDecayDiffusion1=this.own(this.bindParameter(l)),this.parameterDecayDiffusion2=this.own(this.bindParameter(c)),this.parameterDamping=this.own(this.bindParameter(p)),this.parameterExcursionRate=this.own(this.bindParameter(d)),this.parameterExcursionDepth=this.own(this.bindParameter(f)),this.parameterWet=this.own(this.bindParameter(v)),this.parameterDry=this.own(this.bindParameter(m)),this.own(e.registerProcessor(this)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.reset(),this.#i.clear(),this.#n.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#i}setAudioSource(e){return this.#o=g.wrap(e),{terminate:()=>this.#o=g.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio(e,t,i){if(this.#o.isEmpty())return;let n=this.#o.unwrap();this.#r.process(n.channels(),this.#i.channels(),t,i),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1),t,i)}parameterChanged(e){e===this.parameterPreDelay?this.#r.preDelayMs=this.parameterPreDelay.getValue():e===this.parameterBandwidth?this.#r.bandwidth=this.parameterBandwidth.getValue():e===this.parameterInputDiffusion1?this.#r.inputDiffusion1=this.parameterInputDiffusion1.getValue():e===this.parameterInputDiffusion2?this.#r.inputDiffusion2=this.parameterInputDiffusion2.getValue():e===this.parameterDecay?this.#r.decay=this.parameterDecay.getValue():e===this.parameterDecayDiffusion1?this.#r.decayDiffusion1=this.parameterDecayDiffusion1.getValue():e===this.parameterDecayDiffusion2?this.#r.decayDiffusion2=this.parameterDecayDiffusion2.getValue():e===this.parameterDamping?this.#r.damping=this.parameterDamping.getValue():e===this.parameterExcursionRate?this.#r.excursionRate=this.parameterExcursionRate.getValue():e===this.parameterExcursionDepth?this.#r.excursionDepth=this.parameterExcursionDepth.getValue():e===this.parameterWet?this.#r.wetGain=Ve(this.parameterWet.getValue()):e===this.parameterDry&&(this.#r.dryGain=Ve(this.parameterDry.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})}`}};var eP;(e=>e.create=(t,i)=>i.accept({visitAudioBusBox:n=>new _c(t,t.boxAdapters.adapterFor(n,cr)),visitVaporisateurDeviceBox:n=>new my(t,t.boxAdapters.adapterFor(n,$u)),visitNanoDeviceBox:n=>new Sy(t,t.boxAdapters.adapterFor(n,Iu)),visitTapeDeviceBox:n=>new yy(t,t.boxAdapters.adapterFor(n,ku)),visitPlayfieldDeviceBox:n=>new My(t,t.boxAdapters.adapterFor(n,da)),visitSoundfontDeviceBox:n=>new Oy(t,t.boxAdapters.adapterFor(n,Zu)),visitMIDIOutputDeviceBox:n=>new Gy(t,t.boxAdapters.adapterFor(n,Xu))}))(eP||={});var tP;(e=>e.create=(t,i)=>ee(i.accept({visitUnknownMidiEffectDeviceBox:n=>new Cy(t,t.boxAdapters.adapterFor(n,Lu)),visitArpeggioDeviceBox:n=>new wy(t,t.boxAdapters.adapterFor(n,Gi)),visitPitchDeviceBox:n=>new by(t,t.boxAdapters.adapterFor(n,Mu)),visitVelocityDeviceBox:n=>new qy(t,t.boxAdapters.adapterFor(n,ec)),visitZeitgeistDeviceBox:n=>new Iy(t,t.boxAdapters.adapterFor(n,Uu))}),`Could not create midi-effect for'${i.name}'`))(tP||={});var Ih;(e=>e.create=(t,i)=>ee(i.accept({visitUnknownAudioEffectDeviceBox:n=>new kh(t,t.boxAdapters.adapterFor(n,ju)),visitStereoToolDeviceBox:n=>new Dy(t,t.boxAdapters.adapterFor(n,Vu)),visitCompressorDeviceBox:n=>new Ky(t,t.boxAdapters.adapterFor(n,Gu)),visitDelayDeviceBox:n=>new uy(t,t.boxAdapters.adapterFor(n,ui)),visitDattorroReverbDeviceBox:n=>new Qy(t,t.boxAdapters.adapterFor(n,tc)),visitTidalDeviceBox:n=>new Hy(t,t.boxAdapters.adapterFor(n,Xi)),visitCrusherDeviceBox:n=>new Wy(t,t.boxAdapters.adapterFor(n,qu)),visitFoldDeviceBox:n=>new Zy(t,t.boxAdapters.adapterFor(n,Ju)),visitReverbDeviceBox:n=>new Py(t,t.boxAdapters.adapterFor(n,cu)),visitRevampDeviceBox:n=>new Ay(t,t.boxAdapters.adapterFor(n,du)),visitModularDeviceBox:n=>new kh(t,t.boxAdapters.adapterFor(n,oa))}),`Could not create audio-effect for'${i.name}'`))(Ih||={});var Yy=class extends De{#e;#t;#r;#i;#n;#o;#a=g.None;#u=!0;#s=!1;constructor(e,t){super(e),this.#e=t,this.#t=new xe,this.#r=qt.linear(sampleRate),this.#i=qt.linear(sampleRate),this.#n=this.own(this.bindParameter(t.sendGain)),this.#o=this.own(this.bindParameter(t.sendPan)),this.own(e.registerProcessor(this)),this.readAllParameters()}reset(){this.#t.clear()}get adapter(){return this.#e}setAudioSource(e){return this.#a=g.wrap(e),{terminate:()=>this.#a=g.None}}get audioOutput(){return this.#t}processAudio(e,t,i){if(this.#a.isEmpty())return;if(this.#u){let c=Ve(this.#n.getValue()),p=this.#o.getValue();this.#r.set((1-Math.max(0,p))*c,this.#s),this.#i.set((1+Math.min(0,p))*c,this.#s),this.#u=!1}let n=this.#t.getChannel(0),o=this.#t.getChannel(1),a=this.#a.unwrap(),s=a.getChannel(0),l=a.getChannel(1);if(this.#r.isInterpolating()||this.#i.isInterpolating())for(let c=t;c<i;c++)n[c]=s[c]*this.#r.moveAndGet(),o[c]=l[c]*this.#i.moveAndGet();else{let c=this.#r.get(),p=this.#i.get();for(let d=t;d<i;d++)n[d]=s[d]*c,o[d]=l[d]*p}this.#s=!0}parameterChanged(e){this.#u=!0}};var Xy=class extends De{#e;#t;#r;#i;#n;#o;#a;#u;#s=qt.linear(sampleRate);#l=qt.linear(sampleRate);#c=qt.linear(sampleRate);#d=g.None;#p=!0;#h=!1;constructor(e,t){super(e),this.#e=t,this.#t=new xe,this.#r=[new Float32Array(128),new Float32Array(128)],this.#i=this.own(new Se(e.broadcaster,this.#e.address)),this.#n=this.own(this.bindParameter(this.#e.namedParameter.volume)),this.#o=this.own(this.bindParameter(this.#e.namedParameter.panning)),this.#a=this.own(this.bindParameter(this.#e.namedParameter.mute)),this.#u=this.own(this.bindParameter(this.#e.namedParameter.solo)),this.ownAll(e.registerProcessor(this),e.mixer.attachChannelStrip(this)),this.readAllParameters()}reset(){this.#i.clear(),this.#t.clear(),this.#r[0].fill(0),this.#r[1].fill(0),this.#h=!1}get isMute(){return this.#a.getValue()}get isSolo(){return this.#u.getValue()}get adapter(){return this.#e}get audioOutput(){return this.#t}handleEvent(e){}processAudio(e,t,i){if(this.#d.isEmpty())return;if(this.#p){let d=this.context.mixer;d.updateSolo();let f=this.isSolo||d.isVirtualSolo(this),v=this.isMute||d.hasChannelSolo()&&!f&&!this.#e.isOutput,m=Ve(this.#n.getValue()),y=this.#o.getValue();this.#s.set((1-Math.max(0,y))*m,this.#h),this.#l.set((1+Math.min(0,y))*m,this.#h),this.#c.set(v?0:1,this.#h),this.#p=!1}let n=this.#d.unwrap(),[o,a]=n.channels(),[s,l]=this.#t.channels(),[c,p]=this.#r;if(this.#s.isInterpolating()||this.#l.isInterpolating()||this.#c.isInterpolating())for(let d=t;d<i;d++){let f=this.#c.moveAndGet(),v=o[d]*this.#s.moveAndGet(),m=a[d]*this.#l.moveAndGet();s[d]=v*f,l[d]=m*f,c[d]=v,p[d]=m}else{let d=this.#s.get(),f=this.#l.get(),v=this.#c.get();for(let m=t;m<i;m++){let y=o[m]*d,x=a[m]*f;c[m]=y,p[m]=x,s[m]=y*v,l[m]=x*v}}this.#i.process(c,p,t,i),this.#h=!0}finishProcess(){this.#t.assertSanity()}parameterChanged(e){e===this.#n?this.requestGainUpdate():e===this.#o?this.requestGainUpdate():e===this.#a?this.requestGainUpdate():e===this.#u&&this.context.mixer.onChannelStripSoloChanged(this)}requestGainUpdate(){this.#p=!0}requestSoloUpdate(){this.#p=!0}setAudioSource(e){return this.#d=g.wrap(e),{terminate:()=>this.#d=g.None}}toString(){return`{${this.constructor.name}}`}};var ex=class{#e=new U;#t;#r;#i;#n;#o;#a;#u=[];#s=!1;constructor(e,t){this.#t=e,this.#r=t,this.#i=A.newSet(i=>i.adapter.uuid),this.#n=this.#e.own(new Xy(this.#t.context,this.#t.adapter)),this.#o=A.newSet(({device:i})=>i.uuid),this.#a=this.#e.own(new U),this.#e.ownAll(this.#t.adapter.audioEffects.catchupAndSubscribe({onAdd:i=>{this.invalidateWiring();let n=Ih.create(this.#t.context,i.box),o=this.#o.add({device:n,subscription:n.adapter().enabledField.subscribe(()=>this.invalidateWiring())});I(o,"Could not add.")},onRemove:i=>{this.invalidateWiring();let{device:n,subscription:o}=this.#o.removeByKey(i.uuid);o.terminate(),n.terminate()},onReorder:i=>this.invalidateWiring()}),this.#t.adapter.auxSends.catchupAndSubscribe({onAdd:i=>{this.invalidateWiring();let n=this.#i.add(new Yy(this.#t.context,i));I(n,"Could not add.")},onRemove:({uuid:i})=>{this.invalidateWiring(),this.#i.removeByKey(i).terminate()},onReorder:i=>{}}),this.#t.adapter.output.catchupAndSubscribe(i=>this.invalidateWiring()),this.#t.context.subscribeProcessPhase(i=>{i===0&&this.#s&&(this.#l(),this.#s=!1)}))}get channelStrip(){return this.#n}invalidateWiring(){this.#a.terminate(),this.#s=!0}terminate(){this.#e.terminate(),this.#o.forEach(({device:e})=>e.terminate()),this.#o.clear(),this.#u=[]}toString(){return`{${this.constructor.name}}`}#l(){let e=this.#t.adapter.isOutput,t=this.#t.context,i=this.#t.input(),n=this.#t.adapter.output.adapter.map(a=>t.getAudioUnit(a.deviceHost().uuid).inputAsAudioBus());if(i.isEmpty()||n.isEmpty()&&!e)return;let o=i.unwrap();if(this.#r.includeAudioEffects){R.replace(this.#u,this.#t.adapter.audioEffects.adapters().map(({uuid:a})=>this.#o.get(a).device));for(let a of this.#u)a.adapter().enabledField.getValue()&&(this.#a.own(a.setAudioSource(o.audioOutput)),this.#a.own(t.registerEdge(o.outgoing,a.incoming)),o=a)}if(this.#r.includeSends&&this.#i.forEach(a=>{let s=t.getAudioUnit(a.adapter.targetBus.deviceHost().uuid);this.#a.own(a.setAudioSource(o.audioOutput)),this.#a.own(s.inputAsAudioBus().addAudioSource(a.audioOutput)),this.#a.own(t.registerEdge(o.outgoing,a)),this.#a.own(t.registerEdge(a,s.inputAsAudioBus()))}),this.#a.own(this.#n.setAudioSource(o.audioOutput)),this.#a.own(t.registerEdge(o.outgoing,this.#n)),n.nonEmpty()&&!e){let a=n.unwrap();this.#a.own(a.addAudioSource(this.#n.audioOutput)),this.#a.own(t.registerEdge(this.#n,a))}}};var tx=class{#e=new U;#t;#r;#i;#n;#o;constructor(e,t){this.#t=e,this.#r=t,this.#i=Xs.create(268431651),this.#n=new Set,this.#o=new ol,this.#e.ownAll(this.#t.subscribeProcessPhase(i=>{if(i===1)for(let n of this.#n)n.gate||this.#n.delete(n)}))}get uuid(){return this.#r.uuid}terminate(){this.#e.terminate()}pushRawNoteOn(e,t){this.#n.add({pitch:e,velocity:t,gate:!0,running:g.None})}pushRawNoteOff(e){for(let t of this.#n)if(t.running.isEmpty())this.#n.delete(t);else if(t.pitch===e){t.gate=!1;return}}*processNotes(e,t,i){let n=rt.every(i,5);if(this.#o.nonEmpty()&&(!n||rt.every(i,2)?yield*this.#l(e):yield*this.#c(e,t)),this.#n.size>0)for(let o of this.#n){if(o.running.isEmpty()){let{pitch:a,velocity:s}=o,l=Number.POSITIVE_INFINITY,c=we.start(e,l,a,s);o.running=g.wrap(c),yield c}o.gate||(this.#n.delete(o),yield we.stop(o.running.unwrap("raw note never started"),e))}if(n){let o=this.#r.tracks.collection.adapters().filter(a=>a.type===re.Notes&&a.enabled.getValue());for(let a of o)for(let{optClip:s,sectionFrom:l,sectionTo:c}of this.#t.clipSequencing.iterate(a.uuid,e,t))s.isEmpty()?yield*this.#u(a,l,c):yield*this.#a(s.unwrap(),l,c);yield*this.#c(e,t)}}*iterateActiveNotesAt(e,t){if(this.#n.size>0)for(let{pitch:i,velocity:n}of this.#n)yield{type:"note-event",position:e,duration:Number.POSITIVE_INFINITY,pitch:i,velocity:n,cent:0};t||(yield*this.#o.overlapping(e,nr.Comparator))}reset(){this.#o.clear(),this.#n.clear()}toString(){return`{${this.constructor.name}}`}*#a(e,t,i){if(e.optCollection.isEmpty())return;let n=e.optCollection.unwrap(),o=e.duration,a=jn(t,o),s=a+o;i>s?(yield*this.#s(n,t,s,a),yield*this.#s(n,s,i,s)):yield*this.#s(n,t,i,a)}*#u(e,t,i){for(let n of e.regions.collection.iterateRange(t,i)){if(this.#t.ignoresRegion(n.address.uuid)||n.mute||!Te(n,Go))continue;let o=n.optCollection;if(o.isEmpty())continue;let a=o.unwrap();for(let{resultStart:s,resultEnd:l,rawStart:c}of Gt.locateLoops(n,t,i))yield*this.#s(a,s,l,c)}}*#s(e,t,i,n){let o=t-n,a=i-n;for(let s of e.events.iterateRange(o-e.maxDuration,a)){if(!nr.isOfType(s))continue;let{position:l,duration:c,chance:p,playCount:d,playCurve:f}=s;if(!(p<100&&this.#i.nextDouble(0,100)>p)){if(d>1){let v=nr.inverseCurveFunc((o-l)/c,f),m=nr.inverseCurveFunc((a-l)/c,f),y=Math.floor(v*d),x=y/d;for(;x<m;){if(x>=v){let M=nr.curveFunc(x,f)*c;if(M>=c)break;let D=nr.curveFunc(x+1/d,f)*c,O=we.startWith(s,l+M+n,D-M);this.#o.addAndRetain({...O}),yield O}x=++y/d}}else if(o<=l&&l<a){let v=we.startWith(s,l+n);this.#o.addAndRetain({...v}),yield v}}}}*#l(e){for(let t of this.#o.releaseAll())yield we.stop(t,e)}*#c(e,t){for(let i of this.#o.releaseLinearCompleted(t)){let n=le(i.position+i.duration,e,t);yield we.stop(i,n)}}};var rx=class{#e=new U;#t;#r;#i;#n;#o=!1;constructor(e){this.#t=e,this.#r=this.#e.own(new tx(this.#t.context,this.#t.adapter)),this.#i=A.newSet(({device:t})=>t.uuid),this.#n=this.#e.own(new U),this.#e.ownAll(this.#t.adapter.midiEffects.catchupAndSubscribe({onAdd:t=>{this.invalidateWiring();let i=tP.create(this.#t.context,t.box),n=this.#i.add({device:i,subscription:i.adapter().enabledField.subscribe(()=>this.invalidateWiring())});I(n,"Could not add.")},onRemove:t=>{this.invalidateWiring();let{device:i,subscription:n}=this.#i.removeByKey(t.uuid);n.terminate(),i.terminate()},onReorder:t=>this.invalidateWiring()}),this.#t.context.subscribeProcessPhase(t=>{t===0&&this.#o&&(this.#a(),this.#o=!1)}))}get noteSequencer(){return this.#r}invalidateWiring(){this.#n.terminate(),this.#o=!0}terminate(){this.#e.terminate()}toString(){return`{${this.constructor.name}}`}#a(){let e=this.#t.input().flatMap(n=>n.noteEventTarget);if(e.isEmpty())return;let t=e.unwrap(),i=this.#r;this.#t.adapter.midiEffects.adapters().map(n=>this.#i.get(n.uuid).device).forEach(n=>{n.adapter().enabledField.getValue()&&(this.#n.ownAll(n.setNoteEventSource(i),this.#t.context.registerEdge(n,t.incoming)),i=n)}),this.#n.own(t.setNoteEventSource(i))}};var ix=class r{static ID=0;#e=r.ID++;#t=new U;#r;#i;#n;#o;#a=g.None;constructor(e,t,i){this.#r=e,this.#i=t,this.#n=this.#t.own(new rx(this)),this.#o=this.#t.own(new ex(this,i)),this.#t.ownAll(this.#i.input.catchupAndSubscribe(n=>{this.#n.invalidateWiring(),this.#o.invalidateWiring(),this.#a.ifSome(o=>o.terminate()),this.#a=n.getValue().flatMap(o=>g.wrap(eP.create(e,o.box.box)))}))}input(){return this.#a}inputAsAudioBus(){return Ne(this.#a.unwrap("No input available"),_c)}audioOutput(){return this.#o.channelStrip.audioOutput}get midiDeviceChain(){return this.#n}get audioDeviceChain(){return this.#o}get context(){return this.#r}get adapter(){return this.#i}terminate(){console.debug(`terminate ${this}`),this.#t.terminate(),this.#a.ifSome(e=>e.terminate()),this.#a=g.None}toString(){return`{${this.constructor.name}(${this.#e})}`}};var nx=class{#e;#t;#r;#i=!1;constructor(){this.#e=A.newSet(e=>e.adapter.uuid),this.#t=new Set,this.#r=new Set}attachChannelStrip(e){return this.#e.add(e),K.many(e.adapter.input.subscribe(()=>this.#n()),e.adapter.output.subscribe(()=>this.#n()),{terminate:()=>{this.#t.delete(e),this.#e.removeByValue(e),this.#n()}})}onChannelStripSoloChanged(e){e.isSolo?this.#t.add(e):this.#t.delete(e),this.#n()}hasChannelSolo(){return this.#t.size>0}isVirtualSolo(e){return this.#r.has(e)}#n(){this.#i||(this.#i=!0,this.#e.forEach(e=>e.requestSoloUpdate()))}updateSolo(){if(!this.#i)return;this.#r.clear();let e=new Set,t=i=>{e.has(i)||(e.add(i),i.adapter.input.getValue().ifSome(n=>{n.type==="bus"&&n.box.input.pointerHub.filter(u.AudioOutput).map(o=>ee(o.box.accept({visitAudioUnitBox:({address:{uuid:a}})=>this.#e.get(a),visitAuxSendBox:({audioUnit:{targetVertex:a}})=>this.#e.get(a.unwrap().address.uuid)}),"Could not resolve channel-strip")).forEach(o=>{o.isSolo||this.#r.add(o),t(o)})}))};this.#e.forEach(i=>{i.isSolo&&t(i)}),this.#i=!1}};var Fa;(function(r){r[r.Float=0]="Float",r[r.FloatArray=1]="FloatArray",r[r.Integer=2]="Integer",r[r.IntegerArray=3]="IntegerArray",r[r.ByteArray=4]="ByteArray"})(Fa||(Fa={}));var Th;(function(r){r[r.WRITE=0]="WRITE",r[r.READ=1]="READ"})(Th||(Th={}));var Bc;(function(r){r[r.ID=15793935]="ID",r[r.START=15790320]="START",r[r.END=986895]="END"})(Bc||(Bc={}));var ox=class r{static create(e,t){return new r(e.channel(t))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#n=kt.create(0);#o=g.None;#a=g.None;#u=-1;#s=-1;#l=!1;#c=!1;constructor(e){this.#i=Zn.sender(e,({dispatchAndForget:t})=>new class{sendShareLock(i){t(this.sendShareLock,i)}sendUpdateData(i){t(this.sendUpdateData,i)}sendUpdateStructure(i){t(this.sendUpdateStructure,i)}})}flush(){let e=this.#d();if(e.nonEmpty()){this.#c||(this.#i.sendShareLock(this.#t),this.#c=!0),this.#i.sendUpdateStructure(e.unwrap());let t=this.#p();if(this.#n.remaining<t){let i=wo(t),n=new SharedArrayBuffer(i);this.#n=kt.use(n),this.#o=g.wrap(n),this.#i.sendUpdateData(n)}}this.#o.isEmpty()||Atomics.load(this.#r,0)===Th.WRITE&&(this.#h(this.#n),this.#n.position=0,Atomics.store(this.#r,0,Th.READ))}broadcastFloat(e,t){return this.#m(new class{type=Fa.Float;address=e;capacity=8;put(i){i.writeFloat(t())}})}broadcastInteger(e,t){return this.#m(new class{type=Fa.Integer;address=e;capacity=8;put(i){i.writeInt(t())}})}broadcastFloats(e,t,i,n){return this.#m(new class{type=Fa.FloatArray;address=e;capacity=4+(t.byteLength<<2);put(o){_(i),o.writeInt(t.length);for(let a of t)o.writeFloat(a);_(n)}})}broadcastIntegers(e,t,i){return this.#m(new class{type=Fa.IntegerArray;address=e;capacity=4+(t.byteLength<<2);put(n){i(),n.writeInt(t.length),t.forEach(o=>n.writeInt(o))}})}broadcastByteArray(e,t,i){return this.#m(new class{type=Fa.ByteArray;address=e;capacity=4+t.byteLength;put(n){i(),n.writeInt(t.byteLength),n.writeBytes(t)}})}#d(){if(this.#l){try{this.#a=g.wrap(this.#g())}catch(e){throw e}this.#l=!1}if(this.#a.nonEmpty()){let e=this.#a;return this.#a=g.None,e}return g.None}#p(){return this.#s===-1&&(this.#s=this.#f()+12),this.#s}terminate(){R.clear(this.#e),this.#a=g.None,this.#l=!1,this.#s=0}#h(e){I(!this.#l&&this.#a.isEmpty(),"Cannot flush while update is available");let t=this.#p();I(e.remaining>=t,"Insufficient data"),e.writeInt(this.#u),e.writeInt(Bc.START);for(let i of this.#e)i.put(e);e.writeInt(Bc.END)}#f(){return this.#e.reduce((e,t)=>e+t.capacity,0)}#m(e){return this.#e.push(e),this.#y(),{terminate:()=>{R.removeOpt(this.#e,e),this.#y()}}}#y(){this.#s=-1,this.#l=!0}#g(){let e=kt.create();e.writeInt(Bc.ID),e.writeInt(++this.#u),e.writeInt(this.#e.length);for(let{address:t,type:i}of this.#e)t.write(e),e.writeByte(i);return e.toArrayBuffer()}};var ax=class{#e;#t;#r=new xe;#i=[];constructor(e,t){this.#e=e,this.#t=t}process({blocks:e}){e.forEach(({p0:t,p1:i,bpm:n,s0:o,s1:a,flags:s})=>{if(this.#t.metronomeEnabled&&rt.every(s,1)){let[l,c]=this.#e.signature,p=Q.fromSignature(1,c);for(let d of on.iterate(t,i,p)){I(t<=d&&d<i,()=>`${d} out of bounds (${t}, ${i})`);let f=Math.floor(Q.pulsesToSamples(d-t,n,sampleRate));this.#i.push(new rP(d,o+f,l,c))}}this.#r.clear(o,a);for(let l=this.#i.length-1;l>=0;l--)this.#i[l].processAdd(this.#r,o,a)&&this.#i.splice(l,1)})}get output(){return this.#r}},rP=class{#e;#t=0;#r=0;constructor(e,t,i,n){I(t>=0&&t<128,`${t} out of bounds`),this.#e=Q.toParts(e,i,n).beats===0?880:440,this.#r=t}processAdd(e,t,i){let[n,o]=e.channels(),a=Math.floor(.002*sampleRate),s=Math.floor(.05*sampleRate);for(let l=Math.max(this.#r,t);l<i;l++){let c=Math.min(this.#t/a,1-(this.#t-a)/s),p=Math.sin(this.#t/sampleRate*$i*this.#e)*.25*c*c;if(n[l]+=p,o[l]+=p,++this.#t>a+s)return!0}return this.#r=0,!1}};var sx=class{#e;#t;#r=!0;#i=!1;#n=null;#o=!1;#a=0;constructor(e,t){this.#e=e,this.#e.timelineBoxAdapter.markerTrack.subscribe(()=>this.#o=!0),this.#e.timelineBoxAdapter.box.bpm.subscribe(()=>this.#i=!0),this.#r=t?.pauseOnLoopDisabled??!1,this.#t=new Ys}setCallback(e,t){return this.#t.add(e,t),K.create(()=>this.#t.remove(e,t))}reset(){this.#i=!1,this.#o=!1,this.#a=0,this.#n=null}process(e){let t=!1,{timeInfo:i,timelineBoxAdapter:{box:n,markerTrack:o}}=this.#e,a=n.bpm.getValue(),s=i.transporting;if(s){let l=[],c=i.position,p=0,d=0,f=i.getLeapStateAndReset();for(;p<128;){if(this.#o||f){this.#o=!1;let G=o.events.lowerEqual(c);(this.#n?.at(0)??null)!==G&&(this.#n=Z(G)?[G,0]:null,t=!0)}let v=128-p,m=c+Q.samplesToPulses(v,a,sampleRate),y=null,x=Number.POSITIVE_INFINITY;if(o.enabled){let G=Array.from(Xe.take(o.events.iterateFrom(c),2));if(G.length>0){let[de,oe]=G;this.#n===null?de.position>=c&&de.position<m&&(y={type:"marker",prev:de,next:oe},x=de.position):Z(oe)&&oe!==this.#n[0]&&de.position<c&&oe.position<m&&(y={type:"marker",prev:de,next:oe},x=oe.position)}}let{isRecording:M,isCountingIn:D}=this.#e.timeInfo,{from:O,to:T,enabled:V}=n.loopArea;if(V.getValue()&&!(M||D)||this.#r){let G=T.getValue();c<G&&m>G&&G<x&&(y={type:"loop",target:O.getValue()},x=G)}if(this.#t.keyCount()>0)for(let G of this.#t.keys())c<G&&m>G&&G<x&&(y={type:"callback",position:G,callbacks:this.#t.get(G)},x=G);let ne=!i.isCountingIn;if(y===null){let G=p+v;l.push({index:d++,p0:c,p1:m,s0:p,s1:G,bpm:a,flags:bc.create(s,f,ne,this.#i)}),f=!1,c=m,p=G}else{let G=()=>{if(x>c){let oe=p+Q.pulsesToSamples(x-c,a,sampleRate)|0;oe>p&&(l.push({index:d++,p0:c,p1:x,s0:p,s1:oe,bpm:a,flags:bc.create(s,f,ne,this.#i)}),f=!1),c=x,p=oe}},de=()=>{if(p<128){let oe=p+Q.pulsesToSamples(m-c,a,sampleRate)|0;l.push({index:d++,p0:c,p1:x,s0:p,s1:oe,bpm:a,flags:bc.create(!1,!1,!1,this.#i)}),p=oe}};switch(y.type){case"loop":{G(),this.#r?(this.#e.timeInfo.pause(),de()):(c=y.target,f=!0);break}case"marker":{let{prev:oe,next:Ie}=y;!Z(this.#n)||this.#n[0]!==oe?this.#n=[oe,0]:++this.#n[1]<oe.plays||oe.plays===0?(G(),c=oe.position,f=!0):this.#n=[Ie,0],t=!0;break}case"callback":{G(),y.callbacks.forEach(oe=>oe());break}}}this.#i=!1}e({blocks:l}),i.advanceTo(c),this.#a=c}else{if(this.#o||i.getLeapStateAndReset()){this.#o=!1;let d=o.events.lowerEqual(i.position);d!==null&&this.#n?.at(0)!==d&&(this.#n=[d,0],t=!0)}let l=this.#a,c=l+Q.samplesToPulses(128,a,sampleRate),p={blocks:[{index:0,p0:l,p1:c,s0:0,s1:128,bpm:a,flags:bc.create(!1,!1,!1,!1)}]};e(p),this.#a=c}t&&this.#e.engineToClient.switchMarkerState(Z(this.#n)?[this.#n[0].uuid,this.#n[1]]:null)}};var iP=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchAudio(e).then(i=>this.#t=g.wrap(i))}peaks=g.None;#e={type:"idle"};#t=g.None;get data(){return this.#t}get state(){return this.#e}subscribe(e){return K.Empty}invalidate(){}toString(){return"{AudioLoaderWorklet}"}},lx=class{#e;#t;constructor(e){this.#e=e,this.#t=A.newSet(t=>t.uuid)}record(e){}getOrCreate(e){return this.#t.getOrCreate(e,t=>new iP(t,this.#e))}remove(e){}invalidate(e){}};var ux=class{constructor(e){this.uuid=e}waiting=g.None;playing=g.None},cx=class{#e;#t;#r=[];#i=[];#n=[];constructor(e){this.#e=e,this.#e.subscribeToAllUpdatesImmediate({onUpdate:t=>{if(t.type==="delete"){let i=t.uuid;this.#t.opt(i).ifSome(n=>{n.playing.ifSome(o=>this.#a(o.uuid)),n.playing=g.None,n.waiting=g.None}),this.#t.forEach(n=>{n.playing.nonEmpty()&&A.equals(n.playing.unwrap().uuid,i)&&(n.playing=g.None,this.#a(i));let o=n.waiting.flatMap($c);o.nonEmpty()&&A.equals(o.unwrap().uuid,i)&&(n.waiting=g.None)})}}}),this.#t=A.newSet(t=>t.uuid)}schedulePlay(e){e.trackBoxAdapter.ifSome(({uuid:t})=>{let i=this.#t.getOrCreate(t,o=>new ux(o));if(i.playing.nonEmpty()&&i.playing.unwrap()===e){console.debug(`${e} is already playing (ignore)`);return}let n=i.waiting.flatMap(o=>o);n.nonEmpty()&&(console.debug("obsolete",n.unwrap()),this.#n.push(n.unwrap().uuid),i.waiting=g.None),console.debug(`schedulePlay(${A.toString(i.uuid)} > ${e})`),R.removeOpt(this.#n,e.uuid),i.waiting=g.wrap(g.wrap(e))})}scheduleStop({uuid:e}){let t=this.#t.getOrCreate(e,n=>new ux(n)),i=t.waiting.flatMap(n=>n);i.nonEmpty()&&(console.debug("obsolete",i.unwrap()),this.#n.push(i.unwrap().uuid),t.waiting=g.None),t.playing.nonEmpty()&&(console.debug(`scheduleStop(${A.toString(e)})`),t.waiting=g.wrap(g.None))}reset(){this.#t.forEach(e=>{e.waiting.ifSome(t=>t.ifSome(i=>this.#n.push(i.uuid))),e.waiting=g.None,e.playing.ifSome(t=>this.#a(t.uuid)),e.playing=g.None}),this.#t.clear()}*iterate(e,t,i){let n=this.#t.getOrNull(e);if(n===null){yield{optClip:g.None,sectionFrom:t,sectionTo:i};return}if(n.waiting.nonEmpty()){let o=n.waiting.unwrap(),a=n.playing.mapOr(l=>l.duration,Q.Bar),s=jn(i,a);s>=t?(t<s&&(yield{optClip:n.playing,sectionFrom:t,sectionTo:s}),n.waiting=g.None,n.playing.ifSome(l=>this.#a(l.uuid)),o.nonEmpty()?(n.playing=o,this.#o(o.unwrap().uuid)):n.playing=g.None,yield{optClip:n.playing,sectionFrom:s,sectionTo:i}):yield{optClip:n.playing,sectionFrom:t,sectionTo:i}}else if(n.playing.nonEmpty()){let o=n.playing.unwrap();if(o.box.triggerMode.loop.getValue())yield{optClip:n.playing,sectionFrom:t,sectionTo:i};else{let a=jn(t,o.duration)+o.duration;a<=i?(yield{optClip:n.playing,sectionFrom:t,sectionTo:a},n.playing=g.None,this.#a(o.uuid),a<i&&(yield{optClip:g.None,sectionFrom:a,sectionTo:i})):yield{optClip:n.playing,sectionFrom:t,sectionTo:i}}}else yield{optClip:g.None,sectionFrom:t,sectionTo:i}}changes(){if(this.#r.length>0||this.#i.length>0||this.#n.length>0){let e=g.wrap({started:this.#r.slice(),stopped:this.#i.slice(),obsolete:this.#n.slice()});return this.#r.length=0,this.#i.length=0,this.#n.length=0,e}return g.None}terminate(){this.#t.clear(),this.#r.length=0,this.#i.length=0,this.#n.length=0}#o(e){this.#r.push(e)}#a(e){this.#i.push(e)}};var nP;(e=>e.Default={includeAudioEffects:!0,includeSends:!0})(nP||={});var oP=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchSoundfont(e).then(i=>this.#t=g.wrap(i))}peaks=g.None;#e={type:"idle"};#t=g.None;get soundfont(){return this.#t}get state(){return this.#e}subscribe(e){return K.Empty}invalidate(){}toString(){return"{SoundfontLoaderWorklet}"}},dx=class{#e;#t;constructor(e){this.#e=e,this.#t=A.newSet(t=>t.uuid)}getOrCreate(e){return this.#t.getOrCreate(e,t=>new oP(t,this.#e))}remove(e){}invalidate(e){}};var px=class r extends tr{static ClockRate=Q.fromSignature(1,24*4);#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=[],this.own(this.context.registerProcessor(this))}schedule(e){this.#t.push(e)}reset(){this.eventInput.clear()}process({blocks:e}){let t=this.#e.midiOutputDevices;if(t.length===0){this.#t.length=0;return}let i=t.filter(n=>n.sendTransportMessages.getValue()&&n.id.getValue()!=="");if(i.length===0){this.#t.length=0;return}i.forEach(n=>{let o=n.id.getValue(),a=n.delayInMs.getValue();this.#t.forEach(s=>this.context.sendMIDIData(o,s,a)),this.#t.length=0}),e.forEach(({p0:n,p1:o,s0:a,bpm:s,flags:l})=>{let c=a/sampleRate;if(rt.every(l,1))for(let p of on.iterate(n,o,r.ClockRate)){let d=Q.pulsesToSeconds(p-n,s);i.forEach(f=>{let v=f.id.getValue(),m=f.delayInMs.getValue(),y=(c+d)*1e3+m;this.context.sendMIDIData(v,st.Clock,y)})}})}toString(){return`{${this.constructor.name}}`}};var hx=class{#e;#t;#r;#i;#n=new Map;#o=[];constructor(e,t){this.#e=e,this.#t=new Uint32Array(t,0,2),this.#r=new Uint32Array(t,8),this.#i=(this.#r.length>>1)-1}send(e,t,i){let n=this.#n.get(e);if(Hs(n)){if(n=this.#o.length,n>=64)return console.error(`Too many MIDI devices: ${n}, max is 64`),!1;this.#n.set(e,n),this.#o.push(e),this.#e.postMessage({registerDevice:e,id:n})}let o=Atomics.load(this.#t,0),a=o+1&this.#i;if(a===Atomics.load(this.#t,1))return!1;let s=t.length,l=t[0]??0,c=t[1]??0,p=t[2]??0,d=s<<30|n<<24|l<<16|c<<8|p,f=i|0,v=o<<1;return this.#r[v]=d,this.#r[v+1]=f,Atomics.store(this.#t,0,a),this.#e.postMessage(null),!0}};var Z$=!1,fx=class extends AudioWorkletProcessor{#e;#t;#r;#i;#n;#o;#a;#u;#s;#l;#c;#d;#p;#h;#f;#m;#y;#g;#A;#N;#B;#P;#k;#v;#x;#w;#E;#F;#S;#_=g.None;#$=g.None;#M=g.None;#I=g.None;#C=!1;#R=!0;#T=!1;#O=0;#D=0;#V=!0;#z=1;constructor({processorOptions:{syncStreamBuffer:e,controlFlagsBuffer:t,project:i,exportConfiguration:n,options:o}}){super();let{boxGraph:a,mandatoryBoxes:{rootBox:s,timelineBox:l}}=va.decode(i);this.#e=new U,this.#t=EP.for(this.port),this.#r=a,this.#i=new ff,this.#E=new Int32Array(t),this.#n=Zn.sender(this.#t.channel("engine-to-client"),d=>new class{log(f){d.dispatchAndForget(this.log,f)}error(f){d.dispatchAndForget(this.error,f)}fetchAudio(f){return d.dispatchAndReturn(this.fetchAudio,f)}fetchSoundfont(f){return d.dispatchAndReturn(this.fetchSoundfont,f)}notifyClipSequenceChanges(f){d.dispatchAndForget(this.notifyClipSequenceChanges,f)}switchMarkerState(f){d.dispatchAndForget(this.switchMarkerState,f)}ready(){d.dispatchAndForget(this.ready)}}),this.#a=new lx(this.#n),this.#u=new dx(this.#n),this.#s=A.newSet(d=>d.adapter.uuid),this.#p=new Gg,this.#d=new of(l.bpm),this.#o=this.#e.own(new jg(this)),this.#l=this.#o.adapterFor(s,Nu),this.#c=this.#o.adapterFor(l,Bn),this.#h=new Jh,this.#f=new Qh(this.#h),this.#m=new te,this.#y=new nx,this.#k=new ax(this.#c,this.#i),this.#v=new px(this,this.#l),this.#x=new sx(this,o),this.#S=A.newSet(d=>d),this.#w=rl.writer(_1(),e,d=>{let{transporting:f,isCountingIn:v,isRecording:m,position:y}=this.#i,x=this.#c.box.signature.denominator.getValue();d.position=y,d.playbackTimestamp=this.#D,d.countInBeatsRemaining=v?(this.#O-y)/Q.fromSignature(1,x):0,d.isPlaying=f,d.isRecording=m,d.isCountingIn=v}),this.#g=this.#e.own(ox.create(this.#t,"engine-live-data")),this.#N=new sy(this),this.#B=this.#e.own(new Se(this.#g,rc.PEAKS)),this.#P=new qs;let c=new Float32Array(this.#P.numBins()),p=new Float32Array(this.#P.numBins());this.#e.own(this.#g.broadcastFloats(rc.SPECTRUM,c,()=>{c.set(this.#P.bins()),this.#P.decay=!0})),this.#e.own(this.#g.broadcastFloats(rc.WAVEFORM,p,()=>p.set(this.#P.waveform()))),this.#A=this.#e.own(new cx(this.#r)),this.#e.ownAll(BP(this.#r,this.#t.channel("engine-sync")),Zn.executor(this.#t.channel("engine-commands"),{play:()=>this.#U(),stop:d=>this.#j(d),setPosition:d=>this.#L(d),prepareRecordingState:d=>this.#K(d),stopRecording:()=>this.#W(),setMetronomeEnabled:d=>this.#i.metronomeEnabled=this.#T=d,setPlaybackTimestampEnabled:d=>this.#V=d,setCountInBarsTotal:d=>this.#z=d,queryLoadingComplete:()=>Promise.resolve(this.#r.boxes().every(d=>d.accept({visitAudioFileBox:f=>this.#a.getOrCreate(f.address.uuid).data.nonEmpty()&&f.pointerHub.nonEmpty()})??!0)),panic:()=>this.#C=!0,noteSignal:d=>{if(ma.isOn(d)){let{uuid:f,pitch:v,velocity:m}=d;this.optAudioUnit(f).ifSome(y=>y.midiDeviceChain.noteSequencer.pushRawNoteOn(v,m))}else if(ma.isOff(d)){let{uuid:f,pitch:v}=d;this.optAudioUnit(f).ifSome(m=>m.midiDeviceChain.noteSequencer.pushRawNoteOff(v))}},ignoreNoteRegion:d=>this.#S.add(d),scheduleClipPlay:d=>{d.forEach(f=>{let v=this.#r.findBox(f);if(v.isEmpty())console.warn(`Could not scheduleClipPlay. Cannot find clip: '${A.toString(f)}'`);else{let m=xm.for(this.#o,v.unwrap());this.#A.schedulePlay(m)}}),this.#i.transporting=!0,this.#v.schedule(st.Start)},scheduleClipStop:d=>{d.forEach(f=>{let v=this.#r.findBox(f);v.isEmpty()?console.warn(`Could not scheduleClipStop. Cannot find track: '${A.toString(f)}'`):this.#A.scheduleStop(this.#o.adapterFor(v.unwrap(),gt))})},setupMIDI:(d,f)=>{this.#I=g.wrap(new hx(d,f))},terminate:()=>{this.#M.ifSome(d=>d.terminate()),this.#M=g.None,this.#R=!1,this.#S.clear(),this.#e.terminate()}}),this.#l.audioUnits.catchupAndSubscribe({onAdd:d=>{let f=A.toString(d.uuid),v=Z(n?.[f])?n[f]:nP.Default,m=new ix(this,d,v),y=this.#s.add(m);if(I(y,`Could not add ${m}`),m.adapter.isOutput){I(this.#$.isEmpty(),"Output can only assigned once."),this.#$=g.wrap(m);return}},onRemove:({uuid:d})=>this.#s.removeByKey(d).terminate(),onReorder:ki})),this.#F=g.wrap(n).match({none:()=>R.empty(),some:d=>Object.keys(d).map(f=>this.#s.get(A.parse(f)))}),this.#n.ready(),console.log=(...d)=>this.#n.log(d.join(", "))}ignoresRegion(e){return this.#S.hasKey(e)}process(e,t){if(!this.#R)return!1;if(Atomics.load(this.#E,0)===1)return!0;try{return this.render(e,t)}catch(i){return console.debug(i),this.#R=!1,this.#n.error(i),this.terminate(),!1}}render(e,[t]){if(!this.#R)return!1;if(this.#C)return F("Manual Panic");let i=this.#i.metronomeEnabled;this.#m.notify(0),this.#_.isEmpty()&&(this.#f.update(),this.#_=g.wrap(this.#f.sorted().concat()),Z$&&console.debug(`%cAudio-Graph%c
26
26
  ${this.#_.unwrap().map((o,a)=>`${a+1}: ${o}`).join(`
27
- `)}`,"color: hsl(200, 83%, 60%)","color: inherit"));let n=this.#_.unwrap();return this.#v.process(o=>{n.forEach(a=>a.process(o)),i&&this.#k.process(o)}),this.#F.length===0?(this.#$.unwrap().audioOutput().replaceInto(t),i&&this.#k.output.mixInto(t),this.#B.process(t[0],t[1]),this.#P.process(t[0],t[1],0,128)):this.#F.forEach((o,a)=>{let[s,u]=o.audioOutput().channels();t[a*2].set(s),t[a*2+1].set(u)}),this.#m.notify(1),this.#A.changes().ifSome(o=>this.#n.notifyClipSequenceChanges(o)),this.#y.tryWrite(),this.#b.flush(),!0}getAudioUnit(e){return this.#s.get(e)}optAudioUnit(e){return this.#s.opt(e)}subscribeProcessPhase(e){return this.#m.subscribe(e)}registerProcessor(e){return this.#h.addVertex(e),this.#_=g.None,{terminate:()=>{this.#h.removeVertex(e),this.#_=g.None}}}registerEdge(e,t){return this.#h.addEdge([e,t]),this.#_=g.None,{terminate:()=>{this.#h.removeEdge([e,t]),this.#_=g.None}}}get boxGraph(){return this.#r}get boxAdapters(){return this.#o}get sampleManager(){return this.#a}get soundfontManager(){return this.#l}get rootBoxAdapter(){return this.#u}get timelineBoxAdapter(){return this.#c}get signatureDuration(){return this.timelineBoxAdapter.signatureDuration}get tempoMap(){return this.#d}get liveStreamBroadcaster(){return this.#b}get liveStreamReceiver(){return F("Only available in main thread")}get parameterFieldAdapters(){return this.#p}get clipSequencing(){return this.#A}get broadcaster(){return this.#b}get updateClock(){return this.#N}get timeInfo(){return this.#i}get mixer(){return this.#w}get engineToClient(){return this.#n}get isMainThread(){return!1}get isAudioContext(){return!0}sendMIDIData(e,t,i){this.#I.ifSome(n=>n.send(e,t,i))}terminate(){console.trace(`terminate: ${this}`),this.#e.terminate(),this.#s.forEach(e=>e.terminate()),this.#s.clear()}#U(){this.#V&&(this.#i.position=this.#D,this.#g.schedule(it.positionInPPQN(this.#i.position))),this.#i.transporting=!0,this.#g.schedule(it.Start)}#j(e){(this.#i.isRecording||this.#i.isCountingIn)&&(this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.position=this.#V?this.#D:0,this.#g.schedule(it.positionInPPQN(this.#i.position)));let t=this.#i.transporting;this.#i.transporting=!1,this.#i.metronomeEnabled=this.#T,this.#E.clear(),(e||!t)&&this.#Z(),this.#g.schedule(it.Stop)}#L(e){this.#i.isRecording||(this.#i.position=this.#D=e,this.#g.schedule(it.positionInPPQN(this.#i.position)))}#K(e){if(!(this.#i.isRecording||this.#i.isCountingIn))if(!this.#i.transporting&&e){let t=this.#i.position,[i,n]=this.#c.signature;this.#O=Vn(t,Q.fromSignature(i,n)),this.#i.isCountingIn=!0,this.#i.metronomeEnabled=!0,this.#i.transporting=!0,this.#i.position=this.#O-Q.fromSignature(this.#z*i,n);let o=this.#v.setCallback(this.#O,()=>{this.#i.isCountingIn=!1,this.#i.isRecording=!0,this.#i.metronomeEnabled=this.#T,o.terminate()});this.#g.schedule(it.positionInPPQN(this.#i.position))}else this.#i.transporting=!0,this.#i.isRecording=!0,this.#g.schedule(it.Start)}#W(){!this.#i.isRecording&&!this.#i.isCountingIn||(this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.metronomeEnabled=this.#T,this.#i.transporting=!1,this.#E.clear(),this.#g.schedule(it.Stop))}#Z(){this.#D=0,this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.metronomeEnabled=this.#T,this.#i.position=0,this.#i.transporting=!1,this.#v.reset(),this.#A.reset(),this.#f.sorted().forEach(e=>e.reset()),this.#B.clear()}};var hx=class extends AudioWorkletProcessor{#e;constructor({processorOptions:e}){super(),this.#e=Wg.writer(e)}process(e){return this.#e.write(e[0]),!0}};registerProcessor("meter-processor",nf);registerProcessor("engine-processor",px);registerProcessor("recording-processor",hx);
27
+ `)}`,"color: hsl(200, 83%, 60%)","color: inherit"));let n=this.#_.unwrap();return this.#x.process(o=>{n.forEach(a=>a.process(o)),i&&this.#k.process(o)}),this.#F.length===0?(this.#$.unwrap().audioOutput().replaceInto(t),i&&this.#k.output.mixInto(t),this.#B.process(t[0],t[1]),this.#P.process(t[0],t[1],0,128)):this.#F.forEach((o,a)=>{let[s,l]=o.audioOutput().channels();t[a*2].set(s),t[a*2+1].set(l)}),this.#m.notify(1),this.#A.changes().ifSome(o=>this.#n.notifyClipSequenceChanges(o)),this.#w.tryWrite(),this.#g.flush(),!0}getAudioUnit(e){return this.#s.get(e)}optAudioUnit(e){return this.#s.opt(e)}subscribeProcessPhase(e){return this.#m.subscribe(e)}registerProcessor(e){return this.#h.addVertex(e),this.#_=g.None,{terminate:()=>{this.#h.removeVertex(e),this.#_=g.None}}}registerEdge(e,t){return this.#h.addEdge([e,t]),this.#_=g.None,{terminate:()=>{this.#h.removeEdge([e,t]),this.#_=g.None}}}get boxGraph(){return this.#r}get boxAdapters(){return this.#o}get sampleManager(){return this.#a}get soundfontManager(){return this.#u}get rootBoxAdapter(){return this.#l}get timelineBoxAdapter(){return this.#c}get signatureDuration(){return this.timelineBoxAdapter.signatureDuration}get tempoMap(){return this.#d}get liveStreamBroadcaster(){return this.#g}get liveStreamReceiver(){return F("Only available in main thread")}get parameterFieldAdapters(){return this.#p}get clipSequencing(){return this.#A}get broadcaster(){return this.#g}get updateClock(){return this.#N}get timeInfo(){return this.#i}get mixer(){return this.#y}get engineToClient(){return this.#n}get isMainThread(){return!1}get isAudioContext(){return!0}sendMIDIData(e,t,i){this.#I.ifSome(n=>n.send(e,t,i))}terminate(){console.trace(`terminate: ${this}`),this.#e.terminate(),this.#s.forEach(e=>e.terminate()),this.#s.clear()}#U(){this.#V&&(this.#i.position=this.#D,this.#v.schedule(st.positionInPPQN(this.#i.position))),this.#i.transporting=!0,this.#v.schedule(st.Start)}#j(e){(this.#i.isRecording||this.#i.isCountingIn)&&(this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.position=this.#V?this.#D:0,this.#v.schedule(st.positionInPPQN(this.#i.position)));let t=this.#i.transporting;this.#i.transporting=!1,this.#i.metronomeEnabled=this.#T,this.#S.clear(),(e||!t)&&this.#Z(),this.#v.schedule(st.Stop)}#L(e){this.#i.isRecording||(this.#i.position=this.#D=e,this.#v.schedule(st.positionInPPQN(this.#i.position)))}#K(e){if(!(this.#i.isRecording||this.#i.isCountingIn))if(!this.#i.transporting&&e){let t=this.#i.position,[i,n]=this.#c.signature;this.#O=jn(t,Q.fromSignature(i,n)),this.#i.isCountingIn=!0,this.#i.metronomeEnabled=!0,this.#i.transporting=!0,this.#i.position=this.#O-Q.fromSignature(this.#z*i,n);let o=this.#x.setCallback(this.#O,()=>{this.#i.isCountingIn=!1,this.#i.isRecording=!0,this.#i.metronomeEnabled=this.#T,o.terminate()});this.#v.schedule(st.positionInPPQN(this.#i.position))}else this.#i.transporting=!0,this.#i.isRecording=!0,this.#v.schedule(st.Start)}#W(){!this.#i.isRecording&&!this.#i.isCountingIn||(this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.metronomeEnabled=this.#T,this.#i.transporting=!1,this.#S.clear(),this.#v.schedule(st.Stop))}#Z(){this.#D=0,this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.metronomeEnabled=this.#T,this.#i.position=0,this.#i.transporting=!1,this.#x.reset(),this.#A.reset(),this.#f.sorted().forEach(e=>e.reset()),this.#B.clear()}};var mx=class extends AudioWorkletProcessor{#e;constructor({processorOptions:e}){super(),this.#e=Hg.writer(e)}process(e){return this.#e.write(e[0]),!0}};registerProcessor("meter-processor",lf);registerProcessor("engine-processor",fx);registerProcessor("recording-processor",mx);
28
28
  //# sourceMappingURL=processors.js.map