@opendaw/studio-core 0.0.85 → 0.0.86

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.
Files changed (62) hide show
  1. package/dist/EffectBox.d.ts +2 -2
  2. package/dist/EffectBox.d.ts.map +1 -1
  3. package/dist/EffectFactories.d.ts +3 -0
  4. package/dist/EffectFactories.d.ts.map +1 -1
  5. package/dist/EffectFactories.js +30 -3
  6. package/dist/EffectFactory.d.ts +2 -7
  7. package/dist/EffectFactory.d.ts.map +1 -1
  8. package/dist/Engine.d.ts +3 -5
  9. package/dist/Engine.d.ts.map +1 -1
  10. package/dist/EngineFacade.d.ts +3 -5
  11. package/dist/EngineFacade.d.ts.map +1 -1
  12. package/dist/EngineFacade.js +10 -9
  13. package/dist/EngineWorklet.d.ts +2 -4
  14. package/dist/EngineWorklet.d.ts.map +1 -1
  15. package/dist/EngineWorklet.js +6 -18
  16. package/dist/RecordingWorklet.d.ts.map +1 -1
  17. package/dist/RecordingWorklet.js +7 -10
  18. package/dist/StudioPreferences.d.ts +21 -0
  19. package/dist/StudioPreferences.d.ts.map +1 -0
  20. package/dist/StudioPreferences.js +3 -0
  21. package/dist/StudioSettings.d.ts +24 -0
  22. package/dist/StudioSettings.d.ts.map +1 -0
  23. package/dist/StudioSettings.js +22 -0
  24. package/dist/WavFile.js +4 -3
  25. package/dist/capture/CaptureAudio.js +5 -5
  26. package/dist/dawproject/DawProjectExporter.test.js +1 -0
  27. package/dist/index.d.ts +2 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +2 -1
  30. package/dist/processors.js +35 -18
  31. package/dist/processors.js.map +4 -4
  32. package/dist/project/Project.d.ts.map +1 -1
  33. package/dist/project/Project.js +39 -18
  34. package/dist/project/ProjectMigration.d.ts.map +1 -1
  35. package/dist/project/ProjectMigration.js +41 -1
  36. package/dist/samples/DefaultSampleLoader.d.ts +5 -3
  37. package/dist/samples/DefaultSampleLoader.d.ts.map +1 -1
  38. package/dist/samples/DefaultSampleLoader.js +21 -82
  39. package/dist/samples/{DefaultSampleLoaderManager.d.ts → GlobalSampleLoaderManager.d.ts} +4 -3
  40. package/dist/samples/GlobalSampleLoaderManager.d.ts.map +1 -0
  41. package/dist/samples/GlobalSampleLoaderManager.js +146 -0
  42. package/dist/samples/OpenSampleAPI.d.ts +1 -2
  43. package/dist/samples/OpenSampleAPI.d.ts.map +1 -1
  44. package/dist/samples/OpenSampleAPI.js +22 -26
  45. package/dist/samples/SampleAPI.d.ts +1 -1
  46. package/dist/samples/SampleAPI.d.ts.map +1 -1
  47. package/dist/samples/SampleService.d.ts.map +1 -1
  48. package/dist/samples/SampleService.js +5 -7
  49. package/dist/samples/SampleStorage.d.ts +0 -1
  50. package/dist/samples/SampleStorage.d.ts.map +1 -1
  51. package/dist/samples/SampleStorage.js +0 -1
  52. package/dist/samples/index.d.ts +1 -1
  53. package/dist/samples/index.d.ts.map +1 -1
  54. package/dist/samples/index.js +1 -1
  55. package/dist/workers-main.js +1 -1
  56. package/dist/workers-main.js.map +3 -3
  57. package/package.json +15 -15
  58. package/dist/Preferences.d.ts +0 -32
  59. package/dist/Preferences.d.ts.map +0 -1
  60. package/dist/Preferences.js +0 -52
  61. package/dist/samples/DefaultSampleLoaderManager.d.ts.map +0 -1
  62. package/dist/samples/DefaultSampleLoaderManager.js +0 -35
@@ -1,28 +1,45 @@
1
- var cI=Object.defineProperty;var tn=(r,e)=>{for(var t in e)cI(r,t,{get:e[t],enumerable:!0})};var Bl=class r{static DEFAULT_SIZE=512;static DECAY=.9;#e;#t;#r;#i;#o;#n;#s;#l;#u=0;decay=!1;constructor(e=r.DEFAULT_SIZE){this.#e=e<<1,this.#r=new Cf(this.#e),this.#i=new Float32Array(this.#e),this.#o=new Float32Array(this.#e),this.#n=Pd.create(Pd.Type.Blackman,this.#e),this.#t=e,this.#s=new Float32Array(e),this.#l=new Float32Array(e)}clear(){this.#s.fill(0),this.#i.fill(0),this.#l.fill(0),this.#u=0}reset(){this.#u=0}numBins(){return this.#t}bins(){return this.#s}waveform(){return this.#l}process(e,t,o,i){for(let n=o;n<i;++n)this.#i[this.#u]=e[n]+t[n],++this.#u===this.#e&&this.#a()}#a(){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.#n[t];this.#r.process(this.#i,this.#o);let e=1/this.#t;for(let t=0;t<this.#t;++t){let o=this.#i[t],i=this.#o[t],n=Math.sqrt(o*o+i*i)*e;this.#s[t]<n?this.#s[t]=n:this.decay&&(this.#s[t]*=r.DECAY)}this.#u=0,this.#o.fill(0),this.decay=!1}};var Sd=r=>r,G=r=>r!=null,mo=r=>r===null,vt=r=>r!==null,Fl=r=>r===void 0,Js=r=>r!==void 0,Tf=r=>r==null,Hb=(r,e)=>r!=null?e(r):void 0,oe=(r,e="asDefined failed")=>r??F(go(e)),Te=(r,e)=>r instanceof e,Ie=(r,e)=>r instanceof e?r:F(`${r} is not instance of ${e}`),Jb=(r,e)=>{r instanceof e||F(`${r} is not instance of ${e}`)};var go=r=>r instanceof Function?r():r;var _=(r,...e)=>r?.apply(null,e),Rf=r=>G(r)&&typeof r=="object";var Of=r=>{throw new Error(`Unhandled ${r}`)},F=r=>{throw typeof r=="string"?new Error(r):r},M=(r,e)=>r?void 0:F(go(e));var Qs=r=>new Proxy({},{get(){return F(r)}});var Gb=class{value;status="success";constructor(e){this.value=e}error=Qs("Cannot access error when succeeded")},qb=class{error;status="failure";constructor(e){this.error=e}value=Qs("Cannot access value when failed")},rn=r=>{try{return new Gb(r())}catch(e){return new qb(e)}};var ui=(r,e)=>Object.keys(e).length===0?F("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(i=>isNaN(Number(i))).map(i=>e[i]).includes(r)?r:F(`Invalid enum value: ${String(r)}`),on=()=>{};var Qb;(function(r){r[r.Ascending=1]="Ascending",r[r.Descending=-1]="Descending"})(Qb||(Qb={}));var T=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 o=0;o<e.length;)t(e[o])?e.splice(o,1):o++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,t)=>oe(e.at(0),t);static getLast=(e,t)=>oe(e.at(-1),t);static getPrev=(e,t)=>{let o=e.indexOf(t);return o===-1?F(`${t} not found in ${e}`):oe(e.at((o-1)%e.length),"Internal Error")};static getNext=(e,t)=>{let o=e.indexOf(t);return o===-1?F(`${t} not found in ${e}`):oe(e.at((o+1)%e.length),"Internal Error")};static removeLast=(e,t)=>oe(e.pop(),t);static create=(e,t)=>{let o=new Array(t);for(let i=0;i<t;i++)o[i]=e(i);return o};static equals=(e,t)=>{if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0};static satisfy=(e,t)=>{if(e.length<2)return!0;let o=e[0];for(let i=1;i<e.length;i++)if(!t(o,e[i]))return!1;return!0};static remove=(e,t)=>{let o=e.indexOf(t);if(o===-1)return F(`${t} not found in ${e}`);e.splice(o,1)};static removeIf=(e,t)=>{for(let o=e.length-1;o>=0;o--)t(e[o])&&e.splice(o,1)};static removeOpt=(e,t)=>{let o=e.indexOf(t);return o===-1?!1:(e.splice(o,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let t=0,o=new Set;for(let i of e)o.has(i)||(o.add(i),e[t++]=i);return e.length=t,e};static removeDuplicateKeys=(e,t)=>{let o=0,i=new Set;for(let n of e){let s=n[t];i.has(s)||(i.add(s),e[o++]=n)}return e.length=o,e};static subtract(e,t,o){return e.filter(i=>!t.some(n=>o(i,n)))}static intersect(e,t,o){return e.filter(i=>t.some(n=>o(i,n)))}static merge(e,t,o){return[...e.filter(i=>!t.some(n=>o(i,n))),...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 o=0;o<=t;o++)yield{value:e[o],isFirst:o===0,isLast:o===t}}static*iterateAdjacent(e){if(!(e.length<=1))for(let t=1,o=e[0];t<e.length;t++){let i=e[t];yield[o,i],o=i}}static isSorted(e,t=Qb.Ascending){if(e.length<2)return!0;let o=e[0];for(let i=1;i<e.length;i++){let n=e[i];if(Math.sign(o-n)===t)return!1;o=n}return!0}static toRecord(e,t){return e.reduce((o,i)=>(o[t(i)]=i,o),{})}static concatArrayBuffers(e,t){let o=new ArrayBuffer(e.byteLength+t.byteLength),i=new Uint8Array(o);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(t),e.byteLength),o}};var m;(function(r){r.wrap=t=>G(t)?new e(t):r.None,r.from=t=>r.wrap(t()),r.tryCatch=t=>{try{return r.wrap(t())}catch{return r.None}},r.execute=(t,...o)=>r.wrap(t?.apply(null,o)),r.async=t=>t.then(o=>r.wrap(o),()=>r.None);class e{#e;constructor(o){this.#e=oe(o)}unwrap(){return this.#e}unwrapOrElse(o){return this.#e}unwrapOrNull(){return this.#e}unwrapOrUndefined(){return this.#e}contains(o){return o===this.#e}match(o){return o.some(this.#e)}ifSome(o){return o(this.#e)}ifAbsent(o){}isEmpty(){return!1}nonEmpty(){return!0}map(o){return r.wrap(o(this.#e))}mapOr(o,i){return o(this.#e)}flatMap(o){return o(this.#e)}equals(o){return this.unwrapOrNull()===o.unwrapOrNull()}assert(o){return this}toString(){return`{Option.Some(${this.#e})}`}get[Symbol.toStringTag](){return this.toString()}}r.Some=e,r.None=new class{unwrap=t=>F(G(t)?go(t):"unwrap failed");unwrapOrElse=t=>go(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,o)=>go(o);flatMap=t=>r.None;equals=t=>t.isEmpty();assert=t=>F(go(t)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(m||(m={}));var vo;(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=()=>m.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(o){return r.err(o)}};mapOr=(t,o)=>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=()=>m.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=()=>m.None;failureReason=()=>this.reason;isFailure=()=>!0;isSuccess=()=>!1;result=()=>F(`'${this.reason}'`);map=()=>this;mapOr=(t,o)=>go(o);unwrapOrElse=t=>go(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)})(vo||(vo={}));var tt;(function(r){r.exact=(e,t,o)=>{let i=0,n=e.length-1;for(;i<=n;){let s=i+n>>>1,a=o(e[s],t);if(a===0)return s;a<0?i=s+1:n=s-1}return-1},r.exactMapped=(e,t,o,i)=>{let n=0,s=e.length-1;for(;n<=s;){let a=n+s>>>1,l=o(i(e[a]),t);if(l===0)return a;l<0?n=a+1:s=a-1}return-1},r.leftMost=(e,t,o)=>{let i=0,n=e.length;for(;i<n;){let s=i+n>>>1;o(e[s],t)<0?i=s+1:n=s}return i},r.rightMost=(e,t,o)=>{let i=0,n=e.length;for(;i<n;){let s=i+n>>>1;o(e[s],t)<=0?i=s+1:n=s}return n-1},r.stableInsert=(e,t,o)=>{let i=0,n=e.length;for(;i<n;){let s=i+n>>>1;o(e[s],t)<0?i=s+1:n=s}for(;i<e.length&&o(e[i],t)===0;)i++;return i},r.leftMostMapped=(e,t,o,i)=>{let n=0,s=e.length;for(;n<s;){let a=n+s>>>1;o(i(e[a]),t)<0?n=a+1:s=a}return n},r.rightMostMapped=(e,t,o,i)=>{let n=0,s=e.length;for(;n<s;){let a=n+s>>>1;o(i(e[a]),t)<=0?n=a+1:s=a}return s-1},r.rangeMapped=(e,t,o,i)=>[r.leftMostMapped(e,t,o,i),r.rightMostMapped(e,t,o,i)]})(tt||(tt={}));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,o=1<<e-(t<<5);return(this.#t[t]&o)!==0}setBit(e,t){let o=e>>>5,i=1<<e-(o<<5),n=this.#t[o],s=t?n|i:n&~i;return s===n?!1:(this.#t[o]=s,!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),o=!1;for(let i=0;i<t.length;i++)this.#t[i]!==t[i]&&(this.#t[i]=t[i],o=!0);return o}toString(){let e="";for(let t of T.iterateReverse(this.#t))e+=t.toString(2).padStart(32,"0");return e.substring(e.length-this.#e)}clear(){this.#t.fill(0)}};var Vf=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 Bt=class r{static parseCssRgbOrRgba(e){let t=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(G(t)&&t.every(o=>!isNaN(o))){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,o){let i=l=>(l+e/30)%12,n=t*Math.min(o,1-o),s=l=>o-n*Math.max(-1,Math.min(i(l)-3,Math.min(9-i(l),1))),a=l=>Math.round(l*255).toString(16).padStart(2,"0");return`#${a(s(0))}${a(s(8))}${a(s(4))}`}static hexToHsl(e){let t=e.startsWith("#")?e.slice(1):e,o=parseInt(t.slice(0,2),16)/255,i=parseInt(t.slice(2,4),16)/255,n=parseInt(t.slice(4,6),16)/255,s=Math.max(o,i,n),a=Math.min(o,i,n),l=(s+a)/2,u=0,d=0;if(s!==a){let p=s-a;switch(d=l>.5?p/(2-s-a):p/(s+a),s){case o:u=((i-n)/p+(i<n?6:0))*60;break;case i:u=((n-o)/p+2)*60;break;case n:u=((o-i)/p+4)*60;break}}return{h:u,s:d,l}}static hslStringToHex(e){let[t,o,i]=e.match(/\d+(\.\d+)?/g).map(Number);return r.hslToHex(t,o/100,i/100)}#e;#t;#r;#i;constructor(e,t,o,i=1){this.#e=e,this.#t=t,this.#r=o,this.#i=i}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)),o=this.#r+(100-this.#r)*e**3;return new r(this.#e,t,o,this.#i)}toString(){return this.#i===1?`hsl(${this.#e}, ${this.#t}%, ${this.#r}%)`:`hsla(${this.#e}, ${this.#t}%, ${this.#r}%, ${this.#i})`}};var Ed=(r,e)=>r-e;var zi=Math.PI*2,pM=Math.PI/2,Xb=Math.PI/4,hM=1/Math.sqrt(2),he=(r,e,t)=>Math.max(e,Math.min(r,t)),ci=r=>Math.max(0,Math.min(r,1)),TS=(r,e)=>e+(1-2*e)*Math.max(0,Math.min(r,1)),nn=(r,e)=>Math.floor(r/e)*e,Bd=(r,e)=>Math.ceil(r/e)*e;var zf=(r,e,t)=>r+(e-r)*t,RS=(r,e,t)=>r*Math.pow(e/r,t);var Fd=(r,e)=>dI(r/e)*e,dI=r=>r-Math.floor(r),Tn=r=>Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));var Yb=(r,e)=>r*e/((2*e-1)*(r-1)+e);var di;(function(r){r.valueAt=({slope:i,steps:n,y0:s,y1:a},l)=>r.normalizedAt(l/n,i)*(a-s)+s,r.normalizedAt=(i,n)=>{if(n>.499999&&n<.500001)return i;{let s=he(n,1e-15,.999999999999999);return s*s/(1-s*2)*(Math.pow((1-s)/s,2*i)-1)}},r.inverseAt=(i,n)=>{let s=he(n,1e-15,.999999999999999);return Math.log(i*(1-2*s)/(s*s)+1)/(2*Math.log((1-s)/s))},r.coefficients=i=>{let n=r.valueAt(i,1),a=(r.valueAt(i,2)-n)/(n-i.y0),l=n-a*i.y0;return{m:a,q:l}};function*t(i,n,s,a){let{m:l,q:u}=r.coefficients({slope:i,steps:n,y0:s,y1:a});for(let d=0,p=s;d<n;d++)yield p=l*p+u}r.walk=t;function*o(i,n){let s=1/n,a=r.normalizedAt(s,i),u=(r.normalizedAt(2*s,i)-a)/a;for(let d=0,p=0;d<n;d++)yield p=u*p+a}r.walkNormalized=o,r.byHalf=(i,n,s,a)=>({slope:r.slopeByHalf(n,s,a),steps:i,y0:n,y1:a}),r.slopeByHalf=(i,n,s)=>Math.abs(s-i)<1e-6?.5:(n-i)/(s-i)})(di||(di={}));var yo=new DataView(new ArrayBuffer(8)),dr;(function(r){r.MIN_VALUE=-2147483648,r.MAX_VALUE=2147483647,r.toByte=e=>(yo.setInt8(0,e),yo.getInt8(0)),r.toShort=e=>(yo.setInt16(0,e),yo.getInt16(0)),r.toInt=e=>(yo.setInt32(0,e),yo.getInt32(0))})(dr||(dr={}));var sn;(function(r){let o=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),i=new Float32Array(o),n=new Int32Array(o);r.floatToIntBits=s=>{let a=r.floatToRawIntBits(s);return(a&2139095040)===2139095040&&a&8388607?2143289344:a},r.intBitsToFloat=s=>(n[0]=s,i[0]),r.floatToRawIntBits=s=>(i[0]=s,n[0]),r.toFloat32=s=>(yo.setFloat32(0,s),yo.getFloat32(0))})(sn||(sn={}));var OS;(function(r){r.floatToIntBits=e=>{let t=sn.floatToIntBits(e),o=t>>>16&32768,i=(t&2147483647)+4096;return i>=1199570944?(t&2147483647)>=1199570944?i<2139095040?o|31744:o|31744|(t&8388607)>>>13:o|31743:i>=947912704?o|i-939524096>>>13:i<855638016?o:(i=(t&2147483647)>>>23,o|(t&8388607|8388608)+(8388608>>>i-102)>>>126-i)},r.intBitsToFloat=e=>{let t=e&1023,o=e&31744;if(o===31744)o=261120;else if(o!==0){if(o+=114688,t===0&&o>115712)return sn.intBitsToFloat((e&32768)<<16|o<<13|1023)}else if(t!==0){o=115712;do t<<=1,o-=1024;while(!(t&1024));t&=1023}return sn.intBitsToFloat((e&32768)<<16|(o|t)<<13)}})(OS||(OS={}));var Uf;(function(r){let e=9218868437227405312n,t=4503599627370495n,o=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),i=new Float64Array(o),n=new BigInt64Array(o);r.float64ToLongBits=s=>{let a=r.float64ToRawLongBits(s);return(a&e)===e&&(a&t)!==0n?0x7ff8000000000000n:a},r.longBitsToFloat64=s=>(n[0]=s,i[0]),r.float64ToRawLongBits=s=>(i[0]=s,n[0]),r.clamp=s=>(yo.setFloat64(0,s),yo.getFloat64(0))})(Uf||(Uf={}));var Ge=class{static*empty(){}static one(e){return[e]}static count(e){let t=0;for(let o of e)t++;return t}static some(e,t){for(let o of e)if(t(o))return!0;return!1}static every(e,t){for(let o of e)if(!t(o))return!1;return!0}static reduce(e,t,o){let i=o,n=0;for(let s of e)i=t(i,s,n++);return i}static includes(e,t){for(let o of e)if(o===t)return!0;return!1}static forEach(e,t){for(let o of e)t(o)}static*map(e,t){let o=0;for(let i of e)yield t(i,o++)}static*take(e,t){let o=0;for(let i of e){if(o++>=t)return;yield i}}static filter(e,t){let o=[];for(let i of e)t(i)&&o.push(i);return o}static filterMap(e,t){let o=[];for(let i of e){let n=t(i);G(n)&&o.push(n)}return o}static reverse(e){let t=[];for(let o of e)t.push(o);return t.reverse()}static*pairWise(e){let t=e[Symbol.iterator](),{done:o,value:i}=t.next(),n=i;if(o!==!0)for(;;){let{done:s,value:a}=t.next();if(s===!0){yield[n,null];return}yield[n,a],n=a}}};var Tt=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 o=0;o<t;o++)this.writeShort(e.charCodeAt(o))}toArrayBuffer(){return this.#e.buffer.slice(0,this.#t)}#r(e){let t=this.#e.byteLength;if(this.#t+e>t){let o=this.#e;this.#e=new DataView(new ArrayBuffer(Tn(t+e)));for(let i=0;i<this.#t;i++)this.#e.setInt8(i,o.getInt8(i))}}},Nl=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}},jf=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,o)=>e.#e[o]===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(sn.floatToIntBits(e))}writeDouble(e){this.writeLong(Uf.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(Ge.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},ct=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 o=0;o<e;o++)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 pI=r=>G(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"),Il=(r,e,t)=>{if(!G(t))return function(n,s){if(s&&s.kind==="getter")return function(){let a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this),e);if(!G(a?.get))return F(`Cannot find getter for property '${e}'`);let l=a.get.apply(this);return Object.defineProperty(this,e,{value:l,configurable:!1,writable:!1,enumerable:!1}),l}};let o=pI(t),i=oe(t[o]);return{[o]:function(...n){if(n.length>0)return F("lazy accessory must not have any construction parameters");let s=i.apply(this);return Object.defineProperty(this,e,{value:o==="get"?s:()=>s,configurable:!1,writable:!1,enumerable:!1}),s}}};var an;(function(r){function*e(){}r.empty=e;function*t(...o){for(let i of o)for(let n of i)yield n}r.flatten=t})(an||(an={}));var Rt=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,t)=>(...o)=>this.#e.forEach(i=>Object.getPrototypeOf(i)===Object.getPrototypeOf({})?_(i[t],...o):i[t]?.apply(i,o))})}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 VS=(r,...e)=>new Proxy([],{get(t,o){if(typeof o=="string"){let i=Number(o);if(!isNaN(i)&&i>=0&&Number.isInteger(i))return new r(...e)}return o===Symbol.iterator?function*(){for(;;)yield new r(...e)}:t[o]},has(t,o){if(typeof o=="string"){let i=Number(o);if(!isNaN(i)&&i>=0)return!0}return o in t}});var Xs=class{static createIfAbsent(e,t,o){let i=e.get(t);return i===void 0&&(i=o(t),e.set(t,i)),i}};var Nd=class r{static#e=Object.freeze(new Set);static empty=()=>r.#e};var Lf=class r{#e;#t;constructor(e,t){this.#e=new Map(e),this.#t=m.wrap(t),this.#t.ifSome(o=>Array.from(this.#e.values()).forEach(i=>i.sort(o)))}[Symbol.iterator](){return this.#e.entries()}clear(){this.#e.clear()}containsEntry(e,t){return Ge.some(this.#e.entries(),o=>e===o[0]&&o[1].includes(t))}containsKey(e){return Ge.includes(this.#e.keys(),e)}containsValue(e){return Ge.some(this.#e.values(),t=>t.includes(e))}get(e){return this.#e.get(e)??T.empty()}isEmpty(){return this.keyCount()===0}add(e,t){let o=Xs.createIfAbsent(this.#e,e,()=>[]);if(this.#t.isEmpty())o.push(t);else{let i=tt.stableInsert(o,t,this.#t.unwrap());o.splice(i,0,t)}}addAll(e,t){let o=Xs.createIfAbsent(this.#e,e,()=>[]);o.push(...t),this.#t.nonEmpty()&&o.sort(this.#t.unwrap())}remove(e,t){let o=this.#e.get(e);if(o===void 0)return!1;{let i=o.indexOf(t);return i===-1?!1:(o.splice(i,1),o.length===0&&this.#e.delete(e),!0)}}removeFromKeyIf(e,t){let o=this.#e.get(e);if(o===void 0)return null;{let i=o.findIndex(t);if(i===-1)return null;{let n=o.splice(i,1)[0];return o.length===0&&this.#e.delete(e),n}}}removeValueIf(e){let t=[];for(let[o,i]of this.#e.entries())for(let n of i.filter(s=>e(s)))t.push([o,n]);for(let[o,i]of t)this.remove(o,i);return new Set(t.map(([,o])=>o))}removeKey(e){let t=this.#e.get(e);return this.#e.delete(e),t??T.empty()}forEach(e){Ge.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(),o=Array.from(this.keys()).sort(e);this.#e.clear();for(let i of o)this.addAll(i,t.get(i));return this}clone(){let e=new r;return this.#e.forEach((t,o)=>{e.#e.set(o,t.map(i=>i))}),e}},kl=class r{map;constructor(e){this.map=new Map(e?.map(t=>{let o=t[0],i=t[1];return[o,new Set(i)]}))}clear(){this.map.clear()}containsEntry(e,t){return Ge.some(this.map.entries(),o=>e===o[0]&&o[1].has(t))}containsKey(e){return Ge.includes(this.map.keys(),e)}containsValue(e){return Ge.some(this.map.values(),t=>t.has(e))}get(e){return this.map.get(e)??Nd.empty()}isEmpty(){return this.keyCount()===0}add(e,t){Xs.createIfAbsent(this.map,e,()=>new Set).add(t)}addAll(e,t){let o=Xs.createIfAbsent(this.map,e,()=>new Set);for(let i of t)o.add(i)}remove(e,t){let o=this.map.get(e);return o===void 0?!1:o.delete(t)?(o.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let t=new Set;for(let[o,i]of this.map.entries()){for(let n of i)e(n)&&(i.delete(n),t.add(n));i.size===0&&this.map.delete(o)}return t}removeFromKeyIf(e,t){let o=this.map.get(e);if(o===void 0)return null;for(let i of o)if(t(i))return o.delete(i),o.size===0&&this.map.delete(e),i;return null}removeKey(e){let t=this.map.get(e);return this.map.delete(e),t??Nd.empty()}forEach(e){Ge.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(),o=Array.from(this.keys()).sort(e);this.map.clear();for(let i of o)this.addAll(i,t.get(i));return this}clone(){let e=new r;return this.map.forEach((t,o)=>{e.map.set(o,new Set(Array.from(t)))}),e}};var Z=Object.freeze({Empty:{terminate:on},create:r=>({terminate:r}),many:(...r)=>({terminate:()=>{for(;r.length>0;)r.pop().terminate()}})}),R=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:()=>T.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 Z.many(...t.map(o=>o.subscribe(()=>e(o))))}#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 Kr;(function(r){let e=Object.freeze({});r.empty=()=>e,r.mergeNoOverlap=(t,o)=>{let i=new Set(Object.keys(t));for(let n of Object.keys(o))if(i.has(n))return F(`'${n}' is an overlapping key`);return{...t,...o}},r.include=(t,...o)=>{let i={};for(let n of o)i[n]=t[n];return i},r.exclude=(t,...o)=>{let i=new Set(o);return Object.entries(t).reduce((n,[s,a])=>(i.has(s)||(n[s]=a),n),{})},r.overwrite=(t,o)=>Object.assign(t,o),r.entries=t=>Object.entries(t)})(Kr||(Kr={}));var zS;(function(r){r.seal=e=>new class{getValue(){return e}subscribe(t){return Z.Empty}catchupAndSubscribe(t){return t(this),Z.Empty}}})(zS||(zS={}));var US;(function(r){r.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return Z.Empty}catchupAndSubscribe(e){return e(this),Z.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)}}})(US||(US={}));var Br=class{#e;#t=m.None;constructor(e){this.#e=new te,this.wrap(e)}wrap(e){this.wrapOption(m.wrap(e))}wrapOption(e){this.#t.equals(e)||(this.#t=e,this.#e.notify(this))}clear(e){this.#t.isEmpty()||(G(e)&&e(this.#t.unwrap()),this.#t=m.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 Wr=class{#e;#t=m.None;#r;constructor(e,t){this.#e=new te,this.#r=t?.guard(e)??e,this.#t=m.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 ew=class{#e;#t;constructor(e,t){M(e<t,"Linear is inverse"),this.#e=e,this.#t=t}x(e){return e<=this.#e?0:e>=this.#t?1:(e-this.#e)/(this.#t-this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:this.#e+e*(this.#t-this.#e)}clamp(e){return he(e,this.#e,this.#t)}floating(){return!0}},tw=class{#e;#t;#r;constructor(e,t){this.#e=he(Math.round(e),dr.MIN_VALUE,dr.MAX_VALUE),this.#t=he(Math.round(t),dr.MIN_VALUE,dr.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(he(e,0,1)*this.#r)}clamp(e){return he(Math.round(e),this.#e,this.#t)}floating(){return!1}},rw=class{#e;#t;constructor(e,t){M(e<t,"Exponential is inverse"),this.#e=e,this.#t=t}x(e){return e<=this.#e?0:e>=this.#t?1:Math.log(e/this.#e)/Math.log(this.#t/this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:Math.exp(e*Math.log(this.#t/this.#e))*this.#e}clamp(e){return Math.min(this.#t,Math.max(this.#e,e))}floating(){return!0}},iw=class{#e;constructor(e){this.#e=e}x(e){let t=this.#e.findIndex(o=>o===e);return t===-1?F(`Could not find index for ${e}`):t/(this.#e.length-1)}y(e){let t=Math.round(he(e,0,1)*(this.#e.length-1));return t>-1?oe(this.#e.at(t),`Could not find value for ${e}`):F(`Index ${t} is out of box.`)}clamp(e){return e}floating(){return!1}},ow=class{#e;#t;#r;#i;#o;constructor(e,t,o){this.#e=e,this.#t=o;let i=e*e,n=o*o,s=t*t,a=e+o-2*t,l=o-t;this.#r=((2*o-t)*e-t*o)/a,this.#i=(l*i+(s-n)*e+t*n-s*o)/(i+(2*o-4*t)*e+n-4*t*o+4*s),this.#o=-l/a}y(e){return e<=0?Number.NEGATIVE_INFINITY:e>=1?this.#t:this.#r-this.#i/(e+this.#o)}x(e){return this.#e>=e?0:this.#t<=e?1:-this.#i/(e-this.#r)-this.#o}clamp(e){return Math.min(this.#t,e)}floating(){return!0}},S;(function(r){r.linear=(n,s)=>new ew(n,s),r.linearInteger=(n,s)=>new tw(n,s),r.exponential=(n,s)=>new rw(n,s),r.values=n=>new iw(n),r.decibel=(n,s,a)=>new ow(n,s,a);let e=new class{x(n){return n?1:0}y(n){return n>=.5}clamp(n){return n}floating(){return!1}},t=r.linear(0,1),o=r.linear(-1,1);r.bool=e;let i=r.decibel(-72,-12,0);r.unipolar=()=>t,r.bipolar=()=>o,r.DefaultDecibel=i})(S||(S={}));var E;(function(r){r.percent=({bipolar:n,fractionDigits:s}={})=>new e("%",s,!1,n),r.numeric=({unit:n,fractionDigits:s,unitPrefix:a,bipolar:l}={})=>new e(n,s,a,l),r.indices=(n,s)=>new class{x(a){return{unit:n,value:s[a]}}y(a){let l=s.indexOf(a);return l===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:l}}},r.values=(n,s,a)=>new class{x(l){return{unit:n,value:a.at(s.indexOf(l))??"N/A"}}y(l){let u=a.indexOf(l);return u===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:s[u]}}},r.bool=new class{y(n){switch(n.trim()){case"on":case"yes":case"true":return{type:"explicit",value:!0};default:return{type:"explicit",value:!1}}}x(n){return{value:n?"On":"Off",unit:""}}},r.boolValues=(n,s)=>new class{y(a){switch(a.trim()){case s:case"on":case"yes":case"true":return{type:"explicit",value:!0};case n:default:return{type:"explicit",value:!1}}}x(a){return{value:a?"On":"Off",unit:""}}};class e{#e;#t;#r;#i;constructor(s,a,l,u){this.#e=s??"",this.#t=a??0,this.#r=l??!1,this.#i=u??!1}y(s){let a=s.trim(),l=parseFloat(a);if(isNaN(l))return{type:"unknown",value:a};if(this.#e==="%")return{type:"explicit",value:l/100};if(a.endsWith("%"))return{type:"unitValue",value:this.#i?he(l/200+.5,0,1):he(l/100,0,1)};{a.endsWith(this.#e)&&this.#e.length>0&&(a=a.slice(0,-this.#e.length));let p=/(\d+)(\D+)/.exec(a)?.at(2)?.at(0);if(G(p)){let h=t.indexOf(p);if(h>-1)return{type:"explicit",value:l*Math.pow(10,(h-4)*3)}}return{type:"explicit",value:l}}}x(s){if(Number.isNaN(s))return{value:"\u{1F4A3}",unit:this.#e};if(Number.isFinite(s)){if(this.#e==="%")return this.#i?{value:(s*200-100).toFixed(this.#t),unit:this.#e}:{value:(s*100).toFixed(this.#t),unit:this.#e};if(this.#r){let{value:a,prefix:l}=i(s);return{value:a.toFixed(this.#t),unit:`${l}${this.#e}`}}else return{value:s.toFixed(this.#t),unit:this.#e}}else return{value:s===Number.POSITIVE_INFINITY?"\u221E":"-\u221E",unit:this.#e}}}let t=Object.freeze(["p","n","\u03BC","m","","k","M","G","T"]),o=n=>Math.log(n)/Math.log(9.999999999999998),i=n=>{let s=Math.floor(o(n)/3),a=t[s+4];return G(a)?{value:n*Math.pow(10,s*-3),prefix:a}:{value:n,prefix:""}};r.decible=r.numeric({unit:"db",fractionDigits:1}),r.panning=r.percent({unit:"%",fractionDigits:0})})(E||(E={}));var Rn;(function(r){r.alwaysTrue=()=>!0,r.alwaysFalse=()=>!1,r.definedPredicate=e=>e!=null})(Rn||(Rn={}));var $l;(function(r){r.create=(e=252854082)=>new nw(e),r.monotoneAscending=(e,t=128,o=r.create())=>{let i=e.length;if(i<2)return F("Array must have at least 2 elements");let n=0;for(let a=1;a<i;a++){let l=Math.floor(o.uniform()*(1+t))+1;e[a]=l,n+=l}let s=0;e[0]=0;for(let a=1;a<i;a++)s+=e[a],e[a]=s/n;return e}})($l||($l={}));var nw=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 pr;(function(r){class e{}r.createBuilder=o=>{let i=n=>{let s=n instanceof Array?[]:{};return Object.entries(n).forEach(([a,l])=>{l instanceof e?s[a]=l.initialValue():typeof l=="object"&&(s[a]=i(l))}),s};return()=>new t(o,Object.seal(i(o)))},r.bool=new class extends e{read(o){return o.readByte()===1}write(o,i){o.writeByte(i?1:0)}initialValue(){return!1}},r.int8=new class extends e{read(o){return o.readByte()}write(o,i){o.writeByte(i)}initialValue(){return 0}},r.int16=new class extends e{read(o){return o.readShort()}write(o,i){o.writeShort(i)}initialValue(){return 0}},r.int32=new class extends e{read(o){return o.readInt()}write(o,i){o.writeInt(i)}initialValue(){return 0}},r.float=new class extends e{read(o){return o.readFloat()}write(o,i){o.writeFloat(i)}initialValue(){return 0}},r.double=new class extends e{read(o){return o.readDouble()}write(o,i){o.writeDouble(i)}initialValue(){return 0}},r.int64=new class extends e{read(o){return o.readLong()}write(o,i){o.writeLong(i)}initialValue(){return 0n}},r.floats=o=>new class extends e{read(i,n){for(let s=0;s<n.length;s++)n[s]=i.readFloat();return n}write(i,n){for(let s=0;s<n.length;s++)i.writeFloat(n[s])}initialValue(){return new Float32Array(o)}},r.doubles=o=>new class extends e{read(i,n){for(let s=0;s<n.length;s++)n[s]=i.readDouble();return n}write(i,n){for(let s=0;s<n.length;s++)i.writeDouble(n[s])}initialValue(){return new Float64Array(o)}};class t{#e;#t;#r;constructor(i,n){this.#e=i,this.#t=n,this.#r=this.#i()}get object(){return this.#t}get bytesTotal(){return this.#r}read(i){let n=(s,a)=>{Object.entries(s).forEach(([l,u])=>{let d=a;u instanceof e?d[l]=u.read(i,d[l]):typeof u=="object"&&n(u,d[l])})};n(this.#e,this.#t)}write(i){let n=(s,a)=>{Object.entries(s).forEach(([l,u])=>{let d=a;u instanceof e?u.write(i,d[l]):typeof u=="object"&&n(u,d[l])})};n(this.#e,this.#t)}#i(){let i=new Nl;return this.write(i),i.count}}})(pr||(pr={}));var Dl=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=[]}add(e,t=!1){let o=this.#e(e),i=tt.leftMostMapped(this.#r,o,this.#t,this.#e),n=this.#r[i];return G(n)&&this.#t(this.#e(n),o)===0?t?(this.#r.splice(i,1,e),!0):!1:(this.#r.splice(i,0,e),!0)}getOrCreate(e,t){let o=tt.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[o];if(G(i)&&this.#t(this.#e(i),e)===0)return i;let n=t(e);return this.#r.splice(o,0,n),n}addMany(e){for(let t of e)this.#r.push(t);try{return this.#r.sort((t,o)=>{let i=this.#t(this.#e(t),this.#e(o));if(i===0)throw"cancel";return i}),!0}catch(t){if(t==="cancel"){let o=new Map(this.entries());return this.#r.splice(0,this.#r.length,...o.values()),this.#r.sort((i,n)=>this.#t(this.#e(i),this.#e(n))),!1}return F(t)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let t=tt.leftMostMapped(this.#r,e,this.#t,this.#e),o=this.#r[t];return G(o)&&this.#t(this.#e(o),e)===0?(this.#r.splice(t,1),o):F(`Could not remove ${e}`)}removeByKeyIfExist(e){let t=tt.leftMostMapped(this.#r,e,this.#t,this.#e),o=this.#r[t];return G(o)&&this.#t(this.#e(o),e)===0?(this.#r.splice(t,1),o):null}removeRange(e,t){this.#r.splice(e,(t??this.#r.length)-e)}removeByPredicate(e){let t=0,o=this.#r.length;for(;--o>=0;)e(this.#r[o])&&(this.#r.splice(o,1),t++);return t}get(e){return oe(this.#i(e),`Unknown key: ${e}`)}getOrThrow(e,t){let o=this.#i(e);if(G(o))return o;throw t()}opt(e){return m.wrap(this.#i(e))}getOrNull(e){return this.#i(e)??null}getByIndex(e){return this.#r[e]}hasKey(e){return G(this.#i(e))}hasValue(e){return G(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(){T.clear(this.#r)}[Symbol.iterator](){return this.#r.values()}#i(e){let t=tt.leftMostMapped(this.#r,e,this.#t,this.#e),o=this.#r[t];return G(o)&&this.#t(this.#e(o),e)===0?o:void 0}};var Ml=(()=>{let r=m.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:on}),some:t=>t.progress(e)}),install:e=>{M(r.isEmpty(),"RuntimeNotification already installed"),r=m.wrap(e)}}})();var Id=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;#o;constructor(e){this.#o=e}millis(){return this.#o}absSeconds(){return Math.abs(this.#o)/r.#e}absMinutes(){return Math.abs(this.#o)/r.#t}absHours(){return Math.abs(this.#o)/r.#r}absDays(){return Math.abs(this.#o)/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.#o===0}isPast(){return this.#o<0}isFuture(){return this.#o>0}toUnitString(){let e,t,o=Math.floor(Math.abs(this.#o)/1e3),i=Math.floor(o/60),n=Math.floor(i/60),s=Math.floor(n/24);return o<60?(e=o,t="second"):i<60?(e=i,t="minute"):n<24?(e=n,t="hour"):(e=s,t="day"),new Intl.RelativeTimeFormat("en",{numeric:"auto",style:"long"}).format(e*Math.sign(this.#o),t)}toString(){if(isNaN(this.#o))return"NaN";if(!isFinite(this.#o))return"\u221E";let{d:e,h:t,m:o,s:i}=this.split();return e>0?[r.#n("d",e),r.#n("h",t),r.#n("m",o),r.#n("s",i)].join(", "):t>0?[r.#n("h",t),r.#n("m",o),r.#n("s",i)].join(", "):o>0?[r.#n("m",o),r.#n("s",i)].join(", "):i>0?r.#n("s",i):"now"}static#n=(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 Of(e)}}};var Cl;(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,o,i)=>{if(t.bytesTotal+1>o.byteLength)return F("Insufficient memory allocated.");let n=new Uint8Array(o),s=Tt.use(o,1);return Atomics.store(n,0,e.READ),{tryWrite:()=>Atomics.compareExchange(n,0,e.READ,e.WRITING)===e.WRITING?(i(t.object),s.position=0,t.write(s),Atomics.store(n,0,e.WRITTEN),!0):!1}},r.reader=(t,o)=>{let i=new SharedArrayBuffer(t.bytesTotal+1),n=new Uint8Array(i),s=new ct(i,1);return{buffer:i,tryRead:()=>Atomics.compareExchange(n,0,e.WRITTEN,e.READING)===e.READING?(s.position=0,t.read(s),o(t.object),Atomics.store(n,0,e.READ),!0):!1}}})(Cl||(Cl={}));var b;(function(r){r.length=16,r.generate=()=>e(crypto.getRandomValues(new Uint8Array(r.length))),r.sha256=async t=>{let o=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",o?new Uint8Array(t.slice(0)):t).then(i=>e(new Uint8Array(i.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 o=new Uint8Array(r.length);return t.readBytes(new Int8Array(o.buffer)),o},r.toDataOutput=(t,o)=>t.writeBytes(new Int8Array(o.buffer)),r.toString=t=>{let o=T.create(i=>(i+256).toString(16).substring(1),256);return o[t[0]]+o[t[1]]+o[t[2]]+o[t[3]]+"-"+o[t[4]]+o[t[5]]+"-"+o[t[6]]+o[t[7]]+"-"+o[t[8]]+o[t[9]]+"-"+o[t[10]]+o[t[11]]+o[t[12]]+o[t[13]]+o[t[14]]+o[t[15]]},r.parse=t=>{let o=t.replace(/-/g,"").toLowerCase();if(o.length!==32)return F("Invalid UUID format");let i=new Uint8Array(r.length);for(let n=0,s=0;n<32;n+=2,s++)i[s]=parseInt(o.slice(n,n+2),16);return i},r.Comparator=(t,o)=>{if(t.length!==r.length||o.length!==r.length)return F("Unexpected array length for uuid(v4)");for(let i=0;i<r.length;i++){let n=t[i]-o[i];if(n!==0)return n}return 0},r.equals=(t,o)=>r.Comparator(t,o)===0,r.newSet=t=>new Dl(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 o=new Uint8Array(r.Lowest),i=new Uint8Array(new Uint32Array([t]).buffer);for(let n=0;n<4;n++)o[n]=i[n];return o},r.zType=t=>t.string().refine(o=>r.validateString(o),{message:"Invalid UUID format"}).transform(o=>o);let e=t=>(M(t.length===r.length,"UUID must be 16 bytes long"),t[6]=t[6]&15|64,t[8]=t[8]&63|128,t)})(b||(b={}));var sw=(r,e)=>Math.floor(3840/e)*r,jS=(r,e=4,t=4)=>{let o=sw(1,t),i=Math.floor(r/o),n=Math.floor(i/e),a=(Math.floor(r)-sw(n*e,t))%o,l=Math.floor(a/240),u=a%240;return{bars:n,beats:i-n*e,semiquavers:l,ticks:u}},LS=(r,e)=>r*e/60*960,KS=(r,e)=>r*60/960/e,hI=(r,e)=>e*60/960/r,fI=(r,e,t)=>LS(r/t,e),mI=(r,e,t)=>KS(r,e)*t,q={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:sw,toParts:jS,secondsToPulses:LS,pulsesToSeconds:KS,secondsToBpm:hI,samplesToPulses:fI,pulsesToSamples:mI,toString:(r,e=4,t=4)=>{let{bars:o,beats:i,semiquavers:n,ticks:s}=jS(r|0,e,t);return`${o+1}.${i+1}.${n+1}:${s}`}};var ue=128,Ys=q.fromSignature(1,48),Kf=1e-4;var ye=class r{static Empty=new r(2);#e;constructor(e=2){this.#e=T.create(()=>new Float32Array(ue),e)}clear(e,t){this.#e.forEach(o=>o.fill(0,e,t))}numChannels(){return this.#e.length}getChannel(e){return e<this.numChannels()?this.#e[e]:this.#e[this.numChannels()-1]}assertSanity(){M(!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){M(e.length===2,"mixLayout: target.length must be 2"),M(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){M(e.length===2,"mixLayout: target.length must be 2"),M(this.#e.length===1||this.#e.length===2,"mixLayout: target.length must be 1 or 2");let[t,o]=e;if(this.#e.length===1){let[i]=this.#e;for(let n=0;n<ue;n++)t[n]+=i[n],o[n]+=i[n]}else{let[i,n]=this.#e;for(let s=0;s<ue;s++)t[s]+=i[s],o[s]+=n[s]}}};var pt;(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"})(pt||(pt={}));var Tl=class{#e;#t=pt.Idle;#r=0;#i=0;#o=0;#n=0;#s=0;#l=0;#u=0;#a=0;#c=0;constructor(e){this.#e=1/e}get gate(){return this.#t!==pt.Idle&&this.#t!==pt.Release}get complete(){return this.#t===pt.Idle}get value(){return this.#r}get phase(){return this.#i}set(e,t,o,i){this.#o=e,this.#n=t,this.#s=o,this.#l=i,this.#d()}#d(){switch(this.#t){case pt.Attack:{let e=1-this.#r;this.#u=e*this.#e/Math.max(this.#o,1e-6);break}case pt.Decay:{let e=this.#r-this.#s;this.#a=e*this.#e/Math.max(this.#n,1e-6);break}case pt.Release:{let e=this.#r;this.#c=e*this.#e/Math.max(this.#l,1e-6);break}case pt.Sustain:case pt.Idle:{this.#u=this.#e/Math.max(this.#o,1e-6),this.#a=(1-this.#s)*this.#e/Math.max(this.#n,1e-6),this.#c=this.#s*this.#e/Math.max(this.#l,1e-6);break}}}gateOn(){this.#t=pt.Attack}gateOff(){this.#t!==pt.Idle&&(this.#t=pt.Release,this.#d())}forceStop(){this.#t=pt.Idle,this.#r=0}process(e,t,o){for(let i=t;i<o;)switch(this.#t){case pt.Attack:for(;i<o;){if(this.#r+=this.#u,this.#r>=1){this.#r=1,this.#i=1,e[i++]=this.#r,this.#t=pt.Decay,this.#d();break}e[i++]=this.#i=this.#r}break;case pt.Decay:for(;i<o;){if(this.#r-=this.#a,this.#r<=this.#s){this.#r=this.#s,this.#i=2,e[i++]=this.#r,this.#t=pt.Sustain,this.#d();break}this.#i=1+(1-this.#r)/(1-this.#s),e[i++]=this.#r}break;case pt.Sustain:e.fill(this.#s,i,o);return;case pt.Release:for(;i<o;){if(this.#r-=this.#c,this.#r<=0){this.#r=0,this.#i=0,e[i++]=this.#r,this.#t=pt.Idle,this.#d();break}this.#i=3+(1-this.#r/this.#s),e[i++]=this.#r}break;case pt.Idle:e.fill(0,i,o);return}}};var xo=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=he(e,0,1),e>=.5)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let o=zi*e,i=Math.sin(o)/(2*t),n=Math.cos(o),s=(1-n)/2,a=s,l=2*s,u=s,d=1+i,p=-2*n,h=1-i;this.setNormalizedCoefficients(a,l,u,d,p,h)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}setHighpassParams(e,t=Math.SQRT1_2){if(e=he(e,0,1),e===1)this.setNormalizedCoefficients(0,0,0,1,0,0);else if(e>0){let o=zi*e,i=Math.sin(o)/(2*t),n=Math.cos(o),s=(1+n)/2,a=s,l=-2*s,u=s,d=1+i,p=-2*n,h=1-i;this.setNormalizedCoefficients(a,l,u,d,p,h)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNormalizedCoefficients(e,t,o,i,n,s){let a=1/i;return this.b0=e*a,this.b1=t*a,this.b2=o*a,this.a1=n*a,this.a2=s*a,this}setLowShelfParams(e,t){e=he(e,0,1);let o=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(o*o,0,0,1,0,0);else if(e>0){let i=zi*e,s=.5*Math.sin(i)*Math.sqrt((o+1/o)*(1/1-1)+2),a=Math.cos(i),l=2*Math.sqrt(o)*s,u=o+1,d=o-1,p=o*(u-d*a+l),h=2*o*(d-u*a),g=o*(u-d*a-l),v=u+d*a+l,y=-2*(d+u*a),x=u+d*a-l;this.setNormalizedCoefficients(p,h,g,v,y,x)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setHighShelfParams(e,t){e=he(e,0,1);let o=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let i=zi*e,s=.5*Math.sin(i)*Math.sqrt((o+1/o)*(1/1-1)+2),a=Math.cos(i),l=2*Math.sqrt(o)*s,u=o+1,d=o-1,p=o*(u+d*a+l),h=-2*o*(d+u*a),g=o*(u+d*a-l),v=u-d*a+l,y=2*(d-u*a),x=u-d*a-l;this.setNormalizedCoefficients(p,h,g,v,y,x)}else this.setNormalizedCoefficients(o*o,0,0,1,0,0);return this}setPeakingParams(e,t,o){e=he(e,0,1),t=Math.max(0,t);let i=Math.pow(10,o/40);if(e>0&&e<1)if(t>0){let n=zi*e,s=Math.sin(n)/(2*t),a=Math.cos(n),l=1+s*i,u=-2*a,d=1-s*i,p=1+s/i,h=-2*a,g=1-s/i;this.setNormalizedCoefficients(l,u,d,p,h,g)}else this.setNormalizedCoefficients(i*i,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setAllpassParams(e,t){if(e=he(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let o=zi*e,i=Math.sin(o)/(2*t),n=Math.cos(o),s=1-i,a=-2*n,l=1+i,u=1+i,d=-2*n,p=1-i;this.setNormalizedCoefficients(s,a,l,u,d,p)}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=he(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let o=zi*e,i=Math.sin(o)/(2*t),n=Math.cos(o),s=1,a=-2*n,l=1,u=1+i,d=-2*n,p=1-i;this.setNormalizedCoefficients(s,a,l,u,d,p)}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 o=zi*e;if(t>0){let i=Math.sin(o)/(2*t),n=Math.cos(o),s=i,a=0,l=-i,u=1+i,d=-2*n,p=1-i;this.setNormalizedCoefficients(s,a,l,u,d,p)}else this.setNormalizedCoefficients(1,0,0,1,0,0)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}getFrequencyResponse(e,t,o){M(e.length===t.length&&e.length===o.length,"Array lengths do not match");let i=this.b0,n=this.b1,s=this.b2,a=this.a1,l=this.a2;for(let u=0;u<e.length;++u){let d=-Math.PI*2*e[u],p=Math.cos(d),h=Math.sin(d),g=i+((n+s*p)*p-s*h*h),v=(n+s*p)*h+s*h*p,y=1+((a+l*p)*p-l*h*h),x=(a+l*p)*h+l*h*p,$=y*y+x*x,D=(g*y+v*x)/$,V=(v*y-g*x)/$;t[u]=Math.sqrt(D*D+V*V),o[u]=Math.atan2(V,D)}}};var Ft=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:o,b1:i,b2:n},s,a,l,u){let d=this.#e,p=this.#t,h=this.#r,g=this.#i;for(let v=l;v<u;v++){let y=s[v],x=a[v]=o*y+i*d+n*p-e*h-t*g+1e-18-1e-18;p=d,d=y,g=h,h=x}this.#e=d,this.#t=p,this.#r=h,this.#i=g}processFrame({a1:e,a2:t,b0:o,b1:i,b2:n},s){let a=o*s+i*this.#e+n*this.#t-e*this.#r-t*this.#i+1e-18-1e-18;return this.#t=this.#e,this.#e=s,this.#i=this.#r,this.#r=a,a}},On=class{#e;#t;constructor(e){this.#e=T.create(()=>new Ft,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,o,i,n){for(let s=0;s<this.#t;s++)this.#e[s].process(e,t,o,i,n),t=o}processFrame(e,t){for(let o=0;o<this.#t;o++)t=this.#e[o].processFrame(e,t);return t}},kd=512,Wf=class{#e;#t=new xo;#r;#i=-1;constructor(e,t,o){this.#r=new On(4),this.#e=new Float32Array(kd+1);let i=Math.log(t/e),n=1/o;for(let s=0;s<=kd;s++)this.#e[s]=e*Math.exp(s/kd*i)*n}get order(){return this.#r.order}set order(e){this.#r.order=e}reset(){this.#r.reset()}process(e,t,o,i,n,s){let a=this.#e,l=this.#r,u=this.#t,d=i/l.order**1.25,p=n,h=this.#i;for(;p<s;){let g=Math.floor(ci(o[p])*kd),v=p+1;for(;v<s&&Math.floor(ci(o[v])*kd)===g;)++v;g!==h&&(h=g,u.setLowpassParams(a[g],d)),l.process(u,e,t,p,v),p=v}this.#i=h}};var WS=Math.log(10)/20,$d=(r=60,e=440)=>e*Math.pow(2,(r+3)/12-6);var Ve=r=>Math.exp(r*WS),aw=r=>Math.log(r)/WS,Rl=r=>Ve(20*Math.log10(r));var gI=.02,ZS=1e3,Zf=class{#e;#t;#r;#i;#o;#n;#s=NaN;#l=NaN;#u=0;#a=0;#c=0;#d=8;#p=0;#h=1;#f=!1;constructor(e){this.#e=e,this.#t=Math.ceil(e*gI)|0,this.#r=new xo,this.#r.setLowpassParams(.5),this.#i=[new Ft,new Ft],this.#o=[new Float32Array(ue),new Float32Array(ue)],this.#n=new Float32Array(2)}process(e,t,o,i){let[n,s]=e,[a,l]=t,[u,d]=this.#o;this.#i[0].process(this.#r,n,u,o,i),this.#i[1].process(this.#r,s,d,o,i);let p=Ve(this.#p),h=Ve(-this.#p/2),g=this.#e/this.#s,v=Math.pow(2,this.#d)-1,y=1/v;for(let x=o;x<i;x++)this.#a>0&&(this.#s+=this.#u,--this.#a===0&&(this.#u=0,this.#s=this.#l),this.#r.setLowpassParams(Math.max(this.#s,ZS)/this.#e)),this.#c+=1,this.#c>=g&&(this.#c-=g,this.#n[0]=he(Math.round(u[x]*p*v)*y,-1,1),this.#n[1]=he(Math.round(d[x]*p*v)*y,-1,1)),a[x]=(n[x]*(1-this.#h)+this.#n[0]*this.#h)*h,l[x]=(s[x]*(1-this.#h)+this.#n[1]*this.#h)*h;this.#f=!0}setCrush(e){let t=RS(20,this.#e*.5,e);this.#f&&isFinite(this.#s)?(this.#l=t,this.#u=(t-this.#s)/this.#t,this.#a=this.#t):(this.#s=t,this.#r.setLowpassParams(Math.max(this.#s,ZS)/this.#e))}setBitDepth(e){this.#d=he(e,1,16)}setBoost(e){this.#p=e}setMix(e){this.#h=ci(e)}reset(){this.#f=!1,this.#l=NaN,this.#u=0,this.#a=0,this.#c=0,this.#n.fill(0),this.#i[0].reset(),this.#i[1].reset()}};var Gf=class r{static#e=10;#t=1;#r=0;#i=0;#o=0;#n=0;#s=0;set(e,t,o){this.#t=e,this.#r=t*r.#e,this.#i=zf(1e-5,1-1e-5,o),this.#o=2**Math.abs(this.#r),this.#n=1/this.#i,this.#s=1/(1-this.#i)}compute(e){let t=e-Math.floor(e),o,i,n,s;return this.#r<0?(o=1-t,i=1-this.#i,n=this.#s,s=this.#n):(o=t,i=this.#i,n=this.#n,s=this.#s),o<=i?1-(1-o*n)**this.#o*this.#t:((1-o)*s)**this.#o*this.#t-this.#t+1}};var Dd;(function(r){r.Comparator=(e,t)=>e.position-t.position,r.PositionExtractor=e=>e.position})(Dd||(Dd={}));var ea;(function(r){r.complete=e=>e.position+e.duration,r.DescendingComparator=(e,t)=>r.complete(t)-r.complete(e)})(ea||(ea={}));var Yt;(function(r){r.globalToLocal=(t,o)=>Fd(o-t.position+t.loopOffset,t.loopDuration),r.locateLoop=({position:t,complete:o,loopOffset:i,loopDuration:n},s,a)=>{let l=t-i,u=l+n;if(l>=a||u<=s)return m.None;let d=Math.max(l,s),p=Math.min(u,a);return m.wrap({index:0,rawStart:l,rawEnd:u,regionStart:Math.max(l,t),regionEnd:Math.min(u,o),resultStart:d,resultEnd:p,resultStartValue:l<d?(d-l)/n:0,resultEndValue:u>p?(p-l)/n:1})};function*e({position:t,complete:o,loopOffset:i,loopDuration:n},s,a){let l=t-i,u=Math.max(t,s),d=Math.min(o,a),p=Math.floor((u-l)/n),h=l+p*n;for(;h<d;){let g=h+n,v=Math.max(h,t),y=Math.min(g,o),x=Math.max(h,u),$=Math.min(g,d),D=h<x?(x-h)/n:0,V=g>$?($-h)/n:1;yield{index:p++,rawStart:h,rawEnd:g,regionStart:v,regionEnd:y,resultStart:x,resultEnd:$,resultStartValue:D,resultEndValue:V},h=g}}r.locateLoops=e})(Yt||(Yt={}));var Fr=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 qf(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()?an.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t,o){return this.#e.isEmpty()?an.empty():this.#e.iterate(this.#e.ceilFirstIndex(e),t,o)}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()}},Vn=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 qf(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()?an.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t){if(this.#e.isEmpty())return an.empty();let o=Math.max(0,this.#e.floorLastIndex(e)),i=this.#e.optAt(o);if(i===null)return an.empty();for(;i.position+i.duration<=e;)if(i=this.#e.optAt(++o),i===null||i.position>=t)return an.empty();return this.#e.iterate(o,t)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},ta=class{#e;constructor(){this.#e=[]}addAndRetain(e){if(this.#e.length===0)this.#e.push(e);else{let t=tt.leftMost(this.#e,e,ea.DescendingComparator);this.#e.splice(t,0,e)}}*overlapping(e,t){let o=this.#e.filter(i=>i.position<=e&&e<i.position+i.duration);yield*G(t)?o.sort(t):o}*releaseLinearCompleted(e){if(this.#e.length!==0)for(let t=this.#e.length-1;t>=0;t--){let o=this.#e[t];if(ea.complete(o)<e)this.#e.splice(t,1),yield o;else return}}*release(e){if(this.#e.length!==0)for(let t=this.#e.length-1;t>=0;t--){let o=this.#e[t];e(o)&&(this.#e.splice(t,1),yield o)}}*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(){T.clear(this.#e)}},qf=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 o=e.position,i=tt.leftMostMapped(this.#e,o,Ed,Dd.PositionExtractor);for(let n=i;n<this.#e.length;n++){let s=this.#e[n];if(s===e)return!0;if(s.position!==o)return!1}return!1}clear(){++this.modCount,T.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 o=this.floorLastIndex(e);for(;o>=0;){let i=this.#e[o--];if(t(i))return i}return null}greaterEqual(e,t){if(t===void 0)return this.optAt(this.ceilFirstIndex(e));let o=this.ceilFirstIndex(e);for(;o<this.#e.length;){let i=this.#e[o++];if(t(i))return i}return null}floorLastIndex(e){return this.#t&&this.#r(),tt.rightMostMapped(this.#e,e,Ed,Dd.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),tt.leftMostMapped(this.#e,e,Ed,Dd.PositionExtractor)}iterateFrom(e,t){let o=this.floorLastIndex(e),i=o;if(i<0)return this.iterate(0,dr.MAX_VALUE,t);for(;i>=0;){let n=this.optAt(i);if(n!==null&&t!==void 0&&t(n))return this.iterate(i,dr.MAX_VALUE,t);i--}return this.iterate(o,dr.MAX_VALUE,t)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,t,o=Rn.alwaysTrue){for(this.#t&&this.#r();e<this.#e.length;){let i=this.#e[e++];if(i.position>=t)return;o(i)&&(yield i)}}#r(){this.#e.sort(this.comparator),this.#t=!1}};var Cf=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 o=0;o<t;o++){let i=2*Math.PI*o/e;this.#r[o]=Math.cos(i),this.#i[o]=Math.sin(i)}}process(e,t){let o,i,n,s;for(let u=0;u<this.#e;++u)i=r.reverse(u)>>>this.#t,i>u&&(s=e[u],e[u]=e[i],e[i]=s,s=t[u],t[u]=t[i],t[i]=s);let a=this.#r,l=this.#i;for(let u=2;u<=this.#e;u<<=1){let d=u>>1,p=this.#e/u;for(o=0;o<this.#e;o+=u){let h=o+d;for(i=o,n=0;i<h;i++,n=n+p|0){let g=i+d|0,v=a[n],y=l[n],x=e[g],$=t[g],D=x*v+$*y,V=$*v-x*y,O=e[i],j=t[i];e[g]=O-D,t[g]=j-V,e[i]=O+D,t[i]=j+V}}if(u===this.#e)break}}};var lw=r=>{let e=.25*r+.25;return 4*(Math.abs(e-Math.round(e))-.25)};var hr;(function(r){r.builder=()=>new e,r.toDouble=([t,o])=>t/o,r.toPPQN=([t,o])=>q.fromSignature(t,o);class e{#e=[];add(o){return this.#e.push(o),this}asArray(){return this.#e}asAscendingArray(){return this.#e.toSorted((o,i)=>r.toDouble(o)-r.toDouble(i))}asDescendingArray(){return this.#e.toSorted((o,i)=>r.toDouble(i)-r.toDouble(o))}}})(hr||(hr={}));var zn=class{static*iterate(e,t,o){let i=Math.ceil(e/o),n=i*o;for(;n<t;)yield n,n=++i*o}static*iterateWithIndex(e,t,o){let i=Math.ceil(e/o),n=i*o;for(;n<t;)yield{position:n,index:i},n=++i*o}};var Ol=class{#e=0;#t=NaN;#r=NaN;#i=0;#o=0;constructor(){}reset(){this.#e=0,this.#t=NaN,this.#r=NaN,this.#i=0,this.#o=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.#o=t}process(e,t,o,i){if(isNaN(this.#r)){for(let n=o;n<i;n++)e[n]*=this.#e;this.#t=this.#e}else{let n=q.samplesToPulses(1,t,sampleRate);for(let s=o;s<i;s++){if(this.#i+=n/this.#o,this.#i>=1){this.#i=1,this.#e=this.#r,this.#r=NaN;for(let a=s;a<i;a++)e[a]*=this.#e;break}e[s]*=this.#t=this.#e+(this.#r-this.#e)*this.#i}}}advance(e,t,o){if(isNaN(this.#r))this.#t=this.#e;else{let i=q.samplesToPulses(o-t,e,sampleRate);this.#i+=i/this.#o,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 Hf=class{#e;#t;constructor(){this.#e=[],this.#t=new Map}addVertex(e){M(!this.#e.includes(e),"Vertex already exists"),this.#e.push(e),M(!this.#t.has(e),"Predecessor already exists"),this.#t.set(e,[])}removeVertex(e){T.remove(this.#e,e);let t=this.#t.delete(e);M(t,"Predecessor does not exists")}getPredecessors(e){return this.#t.get(e)??T.empty()}predecessors(){return this.#t}vertices(){return this.#e}addEdge([e,t]){oe(this.#t.get(t),`[add] Edge has unannounced vertex. (${t})`).push(e)}removeEdge([e,t]){let o=oe(this.#t.get(t),`[remove] Edge has unannounced vertex. (${t})`);M(o.includes(e),`${e} is not marked.`),T.remove(o,e)}isEmpty(){return this.#e.length===0}},Jf=class{#e;#t;#r;#i;#o;constructor(e){this.#e=e,this.#t=[],this.#r=new Set,this.#i=new Set,this.#o=new Map}update(){this.#n(),this.#e.vertices().forEach(e=>this.#s(e))}sorted(){return this.#t}hasLoops(){return this.#i.size!==0}#n(){this.#l();let e=new Map;for(let o of this.#e.vertices())this.#o.set(o,new Set),e.set(o,new Set);for(let o of this.#e.vertices())for(let i of this.#e.getPredecessors(o))oe(this.#o.get(i),`Could not find Successor for ${i}`).add(o);let t;do{t=!1;for(let o of this.#e.vertices()){oe(e.get(o)).clear();for(let i of oe(this.#o.get(o)))for(let n of oe(this.#o.get(i)))this.#o.get(o)?.has(n)||(t=!0,oe(e.get(o)).add(n))}for(let o of this.#e.vertices()){let i=oe(this.#o.get(o));oe(e.get(o)).forEach(n=>i.add(n))}}while(t)}#s(e){if(!this.#r.has(e)){this.#r.add(e);for(let t of this.#e.getPredecessors(e)){if(oe(this.#o.get(e)).has(t)){this.#i.add(e),this.#i.add(t);continue}this.#s(t)}this.#t.push(e)}}#l(){T.clear(this.#t),this.#r.clear(),this.#i.clear(),this.#o.clear()}};var Md;(function(r){r.Identity={warp:e=>e,unwarp:e=>e}})(Md||(Md={}));var Qf=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 o=this.#e.duration(),i=nn(t,o),n=(t-i)/o,s=e?this.#e.fx(n):this.#e.fy(n);return i+s*o}};var Ke;(function(r){r[r.sine=0]="sine",r[r.triangle=1]="triangle",r[r.saw=2]="saw",r[r.square=3]="square"})(Ke||(Ke={}));var Xf=class{sampleRate;#e=0;constructor(e){this.sampleRate=e}fill(e,t,o,i,n){let s=o/this.sampleRate;switch(t){case Ke.sine:{for(let a=i;a<n;a++)e[a]=Math.sin(this.#e*Math.PI*2),this.#e+=s,this.#e>=1&&(this.#e-=1);break}case Ke.triangle:{for(let a=i;a<n;a++){let l=this.#e%1;e[a]=4*Math.abs(l-.5)-1,this.#e+=s,this.#e>=1&&(this.#e-=1)}break}case Ke.saw:{for(let a=i;a<n;a++){let l=this.#e%1;e[a]=2*l-1,this.#e+=s,this.#e>=1&&(this.#e-=1)}break}case Ke.square:{for(let a=i;a<n;a++){let l=this.#e%1;e[a]=l<.5?1:-1,this.#e+=s,this.#e>=1&&(this.#e-=1)}break}}}reset(){this.#e=0}};var bo;(function(r){r[r.Linear=0]="Linear",r[r.EqualPower=1]="EqualPower"})(bo||(bo={}));var Yf;(function(r){r.BlackKeyIndices=[1,3,6,8,10],r.BlackKeyBits=r.BlackKeyIndices.reduce((t,o)=>t|=1<<o,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,o)=>ci((t-60)*o);class e{#e;#t;constructor(o,...i){this.#e=o,this.#t=i.reduce((n,s)=>n|=1<<s,0)}get name(){return this.#e}get bits(){return this.#t}has(o){return(this.#t&1<<o%12)!==0}equals(o){return this.#t===o.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)]})(Yf||(Yf={}));var er;(function(r){r.isOfType=e=>e.type==="note-event",r.Comparator=(e,t)=>{let o=e.position-t.position;if(o!==0)return o;let i=e.pitch-t.pitch;return i!==0?i: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 o=ea.complete(e)-ea.complete(t);return o!==0?o:e.pitch-t.pitch}})(er||(er={}));var Cd=class{#e;#t=0;#r=0;constructor(e){this.#e=1/e}generate(e,t,o,i,n){let s=t*this.#e;switch(o){case Ke.sine:this.#i(e,s,i,n);break;case Ke.saw:this.#o(e,s,i,n);break;case Ke.square:this.#n(e,s,i,n);break;case Ke.triangle:this.#s(e,s,i,n);break}}generateFromFrequencies(e,t,o,i,n){switch(o){case Ke.sine:this.#l(e,t,i,n);break;case Ke.saw:this.#u(e,t,i,n);break;case Ke.square:this.#a(e,t,i,n);break;case Ke.triangle:this.#c(e,t,i,n);break}}#i(e,t,o,i){let n=this.#t;for(let s=o;s<i;s++)e[s]=Math.sin(2*Math.PI*(n%1)),n+=t;this.#t=n}#o(e,t,o,i){let n=this.#t;for(let s=o;s<i;s++){let a=n%1;e[s]=2*a-1-wo(a,t),n+=t}this.#t=n}#n(e,t,o,i){let n=this.#t;for(let s=o;s<i;s++){let a=n%1;e[s]=(a<.5?1:-1)+wo(a,t)-wo((a+.5)%1,t),n+=t}this.#t=n}#s(e,t,o,i){let n=this.#t,s=this.#r,a=4*t;for(let l=o;l<i;l++){let u=n%1,d=(u<.5?1:-1)+wo(u,t)-wo((u+.5)%1,t);s=s*.9995+d*a,e[l]=s,n+=t}this.#t=n,this.#r=s}#l(e,t,o,i){let n=this.#e,s=this.#t;for(let a=o;a<i;a++)e[a]=Math.sin(2*Math.PI*(s%1)),s+=t[a]*n;this.#t=s}#u(e,t,o,i){let n=this.#e,s=this.#t;for(let a=o;a<i;a++){let l=t[a]*n,u=s%1;e[a]=2*u-1-wo(u,l),s+=l}this.#t=s}#a(e,t,o,i){let n=this.#e,s=this.#t;for(let a=o;a<i;a++){let l=t[a]*n,u=s%1;e[a]=(u<.5?1:-1)+wo(u,l)-wo((u+.5)%1,l),s+=l}this.#t=s}#c(e,t,o,i){let n=this.#e,s=this.#t,a=this.#r;for(let l=o;l<i;l++){let u=t[l]*n,d=s%1,p=(d<.5?1:-1)+wo(d,u)-wo((d+.5)%1,u);a=a*.9995+p*(4*u),e[l]=a,s+=u}this.#t=s,this.#r=a}},wo=(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 ln;(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:o,invertL:i,invertR:n,stereo:s,swap:a},l=bo.EqualPower)=>{let[u,d]=r.panningToGains(o,l),p=u*t,h=d*t;i&&(p*=-1),n&&(h*=-1);let g=Math.max(0,-s),v=Math.max(0,s),y=1-v,x=1+v,$=g*.5,D=1-g,V=(y+x)*.5,O=(y-x)*.5,j=(y-x)*.5,Y=(y+x)*.5,K=p*($+D)*V+h*$*O,ie=p*($+D)*j+h*$*Y,re=p*$*V+h*($+D)*O,Ce=p*$*j+h*($+D)*Y;a?(e.ll=ie,e.rl=K,e.lr=Ce,e.rr=re):(e.ll=K,e.lr=re,e.rl=ie,e.rr=Ce)},r.panningToGains=(e,t)=>{let o=he(e,-1,1);switch(t){case bo.Linear:return[Math.min(1-o,1),Math.min(o+1,1)];case bo.EqualPower:return[Math.cos((o+1)*Xb),Math.sin((o+1)*Xb)]}},r.applyFrame=(e,t,o)=>[e.ll*t+e.rl*o,e.lr*t+e.rr*o],r.processFrames=(e,t,o,i,n)=>{let[s,a]=t,[l,u]=o;for(let d=i;d<n;d++){let p=s[d],h=a[d];l[d]=e.ll*p+e.rl*h,u[d]=e.lr*p+e.rr*h}},r.replaceFrames=(e,[t,o],i,n)=>{for(let s=i;s<n;s++){let a=t[s],l=o[s];t[s]=e.ll*a+e.rl*l,o[s]=e.lr*a+e.rr*l}}})(ln||(ln={}));var tr;(function(r){r.linear=(o,i=.005)=>new e(Math.ceil(o*i)|0),r.stereoMatrix=(o,i=.005)=>new t(Math.ceil(o*i)|0);class e{#e;#t=0;#r=0;#i=0;#o=0;constructor(i){this.#e=i}set(i,n){this.#t!==i&&(n===!0?(this.#r=i,this.#i=(i-this.#t)/this.#e,this.#o=this.#e):(this.#t=this.#r=i,this.#i=0,this.#o=0))}get(){return this.#t}moveAndGet(){return 0<this.#o&&(this.#t+=this.#i,--this.#o===0&&(this.#i=0,this.#t=this.#r)),this.#t}isFixed(i){return this.#t===i&&this.#o===0}isInterpolating(){return this.#o>0}}class t{#e;#t=ln.zero();#r=ln.zero();#i=ln.zero();#o=0;constructor(i){this.#e=i}update(i,n,s){ln.update(this.#r,i,n),s===!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.#o=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.#o=0)}processFrames(i,n,s,a){let[l,u]=i,[d,p]=n;if(this.isInterpolating())for(let h=s;h<a;h++){let g=l[h],v=u[h],y=this.moveAndGet();d[h]=y.ll*g+y.rl*v,p[h]=y.lr*g+y.rr*v}else{let h=this.#r;for(let g=s;g<a;g++){let v=l[g],y=u[g];d[g]=h.ll*v+h.rl*y,p[g]=h.lr*v+h.rr*y}}}set(i,n){this.#n(i)||(n===!0?(this.#r.ll=i.ll,this.#r.lr=i.lr,this.#r.rl=i.rl,this.#r.rr=i.rr,this.#i.ll=(i.ll-this.#t.ll)/this.#e,this.#i.lr=(i.lr-this.#t.lr)/this.#e,this.#i.rl=(i.rl-this.#t.rl)/this.#e,this.#i.rr=(i.rr-this.#t.rr)/this.#e,this.#o=this.#e):(this.#t.ll=this.#r.ll=i.ll,this.#t.lr=this.#r.lr=i.lr,this.#t.rl=this.#r.rl=i.rl,this.#t.rr=this.#r.rr=i.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#o=0))}get(){return this.#t}moveAndGet(){return 0<this.#o&&(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.#o===0&&(this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#t.ll=this.#r.ll,this.#t.lr=this.#r.lr,this.#t.rl=this.#r.rl,this.#t.rr=this.#r.rr)),this.#t}isFixed(i){return this.#n(i)&&this.#o===0}isInterpolating(){return this.#o>0}#n(i){return this.#t.ll===i.ll&&this.#t.lr===i.lr&&this.#t.rl===i.rl&&this.#t.rr===i.rr}}r.StereoMatrixRamp=t})(tr||(tr={}));var Td=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]),uw=new Float32Array(12),GS=new Float32Array(11);for(let r=0,e=0,t=0;r<Td.length;r++)r%2===0?uw[e++]=Td[r]:GS[t++]=Td[r];var cw=class{#e=new Float32Array(uw.length);#t=new Float32Array(Td.length);#r=0;#i=0;reset(){this.#e.fill(0),this.#t.fill(0),this.#r=0,this.#i=0}upsample(e,t,o,i){let n=this.#e,s=uw,a=GS;for(let l=o;l<i;l++){let u=e[l],d=(l-o)*2;n[this.#r]=u;let p=0;for(let g=0;g<s.length;g++){let v=(this.#r-g+n.length)%n.length;p+=n[v]*s[g]}t[d]=p*2;let h=0;for(let g=0;g<a.length;g++){let v=(this.#r-g+n.length-1)%n.length;h+=n[v]*a[g]}t[d+1]=h*2,this.#r=(this.#r+1)%n.length}}downsample(e,t,o,i){let n=this.#t,s=Td;for(let a=o;a<i;a++){let l=(a-o)*2;n[this.#i]=e[l],this.#i=(this.#i+1)%n.length,n[this.#i]=e[l+1],this.#i=(this.#i+1)%n.length;let u=0;for(let d=0;d<s.length;d++){let p=(this.#i-1-d+n.length)%n.length;u+=n[p]*s[d]}t[a]=u}}},em=class{#e;#t;#r;constructor(e){this.#e=e;let t=e===2?1:e===4?2:3;this.#t=T.create(()=>new cw,t),this.#r=T.create(o=>new Float32Array(ue*(2<<o)),t-1)}reset(){this.#t.forEach(e=>e.reset())}upsample(e,t,o,i){let n=i-o,s=e,a=o,l=i;for(let u=0;u<this.#t.length;u++){let p=u===this.#t.length-1?t:this.#r[u];this.#t[u].upsample(s,p,a,l),s=p,a=0,l=n*(2<<u)}}downsample(e,t,o,i){let n=i-o,s=e,a=n*this.#e;for(let l=this.#t.length-1;l>=0;l--){let u=l===0,d=u?t:this.#r[l-1],p=u?o:0,h=u?i:a/2;this.#t[l].downsample(s,d,p,h),s=d,a=h}}},tm=class{#e;#t;constructor(e){this.#e=new em(e),this.#t=new em(e)}reset(){this.#e.reset(),this.#t.reset()}upsample(e,t,o,i){this.#e.upsample(e[0],t[0],o,i),this.#t.upsample(e[1],t[1],o,i)}downsample(e,t,o,i){this.#e.downsample(e[0],t[0],o,i),this.#t.downsample(e[1],t[1],o,i)}};var Vl=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,o){let i=this.#e,n=i.length,s=this.#r,a=this.#i;for(let l=t;l<o;l++){let u=e[l]*e[l];a+=u-i[s],i[s]=u,++s===n&&(s=0)}return this.#r=s,this.#i=a,a<=0?0:Math.sqrt(a*this.#t)}clear(){this.#e.fill(0),this.#i=0,this.#r=0}};var rm=class r{static#e=.003;static#t=.02;#r;#i;#o=0;constructor(e){this.#r=Math.pow(.01,1/(r.#e*e)),this.#i=Math.pow(.01,1/(r.#t*e))}clear(){this.#o=0}replace(e,t,o){let i=this.#r,n=this.#i,[s,a]=e.channels(),l=this.#o;for(let u=t;u<o;++u){let d=s[u],p=a[u],h=Math.max(Math.abs(d),Math.abs(p));if(l=h>l?i*(l-h)+h:n*(l-h)+h,l>1){let g=1/l;s[u]=d*g,a[u]=p*g}}this.#o=l}};var Ui=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 Nr;(function(r){r.Musical="musical",r.Seconds="seconds"})(Nr||(Nr={}));var Un;(function(r){function e(t,o,i){return new dw(t,o,i)}r.aware=e})(Un||(Un={}));var dw=class{#e;#t;#r;constructor(e,t,o){this.#r=o,this.#t=t,this.#e=e}toPPQN(e){let t=this.#r.getValue();if(this.getTimeBase()===Nr.Musical)return t;let o=this.#e.ppqnToSeconds(e),i=o+t;return this.#e.intervalToPPQN(o,i)}fromPPQN(e,t){if(this.getTimeBase()===Nr.Musical)this.#r.setValue(e);else{let o=this.#e.intervalToSeconds(t,t+e);this.#r.setValue(o)}}toSeconds(e){let t=this.#r.getValue();return this.getTimeBase()===Nr.Seconds?t:this.#e.intervalToSeconds(e,e+t)}toSamples(e,t){return this.toSeconds(e)*t}rawValue(){return this.#r.getValue()}getTimeBase(){return ui(this.#t.getValue(),Nr)}};var im=q.fromSignature(1,384);var un={None:{type:"none"},Linear:{type:"linear"},Curve:r=>r===.5?un.Linear:{type:"curve",slope:r}},om;(function(r){r.Comparator=(i,n)=>{let s=i.position-n.position;if(s!==0)return s;let a=i.index-n.index;return a!==0?a:i===n?0:F(`${i} and ${n} are identical in terms of comparison`)};function*e(i,n,s){if(i.isEmpty())return Ge.empty();for(let a of i.iterateFrom(n))if(yield a,a.position>=s)return}r.iterateWindow=e,r.nextEvent=(i,n)=>{let s=i.asArray(),a=tt.rightMost(s,n,r.Comparator);return a===-1?null:s[a+1]??null},r.valueAt=(i,n,s)=>{if(i.isEmpty())return s;let a=i.iterateFrom(n),{done:l,value:u}=a.next();if(l)return s;if(u.position<=n){let{done:d,value:p}=a.next();if(d)return u.value;if(n<p.position)return o(u,p,n);if(u.interpolation===un.None)return u.value}return u.value};function*t(i,n,s,a){if(i.isEmpty())return;let l=i.iterateFrom(n),{done:u,value:d}=l.next();if(u)return;let p=s/a,h=d;if(h.position>n){for(;n<h.position;)if(yield{position:n,value:h.value},n+=p,n>s)return;h.position<=s&&(yield h)}for(;n<=s;){let{done:g,value:v}=l.next();if(g)break;for(;n<v.position;){if(n>s)return;yield{position:n,value:o(h,v,n)},n+=p}v.position<s&&(h.interpolation===un.None&&(yield{position:v.position,value:h.value}),yield v),h=v}for(;n<=s;)yield{position:n,value:h.value},n+=p}r.quantise=t;let o=({value:i,position:n,interpolation:s},a,l)=>s.type==="none"?i:s.type==="linear"?i+(l-n)/(a.position-n)*(a.value-i):s.type==="curve"?di.valueAt({slope:s.slope,steps:a.position-n,y0:i,y1:a.value},l-n):F("Unknown interpolation")})(om||(om={}));var Pd;(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,o)=>{let i=new Float32Array(o),n=Math.PI/(o-1);switch(t){case e.Bartlett:{let s=(o>>1)-1,a=0;for(;a<=s;++a)i[a]=2*a/(o-1);for(;a<o;++a)i[a]=2-2*a/(o-1);return i}case e.Blackman:{let s=2*n,a=4*n;for(let l=0;l<o;++l)i[l]=.42323-.49755*Math.cos(s*l)+.07922*Math.cos(a*l);return i}case e.BlackmanHarris:{let s=2*n,a=4*n,l=6*n;for(let u=0;u<o;++u)i[u]=.35875-.48829*Math.cos(s*u)+.14128*Math.cos(a*u)-.01168*Math.cos(l*u);return i}case e.Hamming:{let s=2*n;for(let a=0;a<o;++a)i[a]=.54-.46*Math.cos(s*a);return i}case e.Hanning:{let s=2*n;for(let a=0;a<o;++a)i[a]=.5-.5*Math.cos(s*a);return i}}}})(Pd||(Pd={}));var nm=class extends AudioWorkletProcessor{#e;#t;#r;#i;#o;#n=0;constructor({processorOptions:{sab:e,numberOfChannels:t,rmsWindowInSeconds:o,valueDecay:i}}){super(),this.#e=t,this.#t=new Float32Array(t),this.#r=new Float32Array(t),this.#i=T.create(()=>new Vl(sampleRate*o),t);let n=pr.createBuilder({peak:pr.floats(t),rms:pr.floats(t)})();this.#o=Cl.writer(n,e,s=>{let a=Math.exp(-(128*this.#n)/(sampleRate*i));for(let l=0;l<t;++l){let u=this.#t[l],d=this.#r[l];s.peak[l]=u,s.rms[l]=Math.sqrt(d),this.#t[l]=u*a,this.#r[l]=d*a}this.#n=0})}process([e]){for(let t=0;t<this.#e;++t){let o=e[t];if(o===void 0)this.#t[t]=0,this.#r[t]=0;else{let i=this.#i[t],n=this.#t[t],s=this.#r[t];for(let a=0;a<ue;++a){let l=o[a];n=Math.max(n,Math.abs(l)),s=Math.max(s,i.pushPop(l*l))}this.#t[t]=n,this.#r[t]=s}}return this.#n++,this.#o.tryWrite(),!0}};var xe=class r{static newSet(e){return new Dl(e,r.Comparator)}static compose=(e,...t)=>{let o=t.length===0?this.#e:new Int16Array(t);return M(o.every((i,n)=>i===t[n]),`fieldKeys (${o.join(",")}) only allows i16`),new r(e,o)};static decode(e){let t=e.split("/");return M(t.length>0,"Unable to parse Address"),r.compose(b.parse(t[0]),...t.slice(1).map(o=>parseInt(o)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,t,o){let i=e.values(),n=tt.leftMostMapped(i,t,b.Comparator,o),s=i.length;if(n<0||n>=s)return null;for(let a=n;a<s;a++)if(b.Comparator(o(i[a]),t)!==0)return n<a?[n,a]:null;return[n,s]}static Comparator=(e,t)=>{let o=b.Comparator(e.#t,t.#t);if(o!==0)return o;let i=Math.min(e.#r.length,t.#r.length);for(let n=0;n<i;n++){let s=e.#r[n]-t.#r[n];if(s!==0)return s}return e.#r.length-t.#r.length};static MinimalComparator=(e,t)=>{let o=b.Comparator(e.#t,t.#t);if(o!==0)return o;let i=Math.min(e.#r.length,t.#r.length);for(let n=0;n<i;n++){let s=e.#r[n]-t.#r[n];if(s!==0)return s}return 0};static LengthComparator=(e,t)=>{let o=b.Comparator(e.#t,t.#t);return o!==0?o: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 b.Comparator(e.#t,this.#t)===0&&e.#r.length<=this.#r.length&&e.#r.every((t,o)=>this.#r[o]===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(b.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,b.length),e.buffer}toString(){return[b.toString(this.#t),...this.#r].join("/")}static read(e){let t=b.fromDataInput(e),o=e.readByte();return r.compose(t,...T.create(()=>e.readShort(),o))}},ra;(function(r){r.AddressReader=e=>e.address,r.Comparator=({address:e},{address:t})=>xe.Comparator(e,t),r.equals=(e,t)=>{let[o,i]=tt.rangeMapped(t,e,xe.Comparator,r.AddressReader);return t.slice(o,i+1)},r.startsWith=(e,t)=>{let[o,i]=tt.rangeMapped(t,e,xe.MinimalComparator,r.AddressReader);return t.slice(o,i+1).filter(n=>n.address.startsWith(e))},r.endsWith=(e,t)=>{let o=tt.leftMostMapped(t,e,xe.LengthComparator,r.AddressReader),i=tt.rightMostMapped(t,e,xe.MinimalComparator,r.AddressReader);return t.slice(o,i+1).filter(n=>e.startsWith(n.address))}})(ra||(ra={}));var Ao=class r{static validate(e,t){if(e.address.equals(t.address))return m.wrap(`PointerField cannot point to itself: ${e}`);if(!t.pointerRules.accepts.some(o=>o===e.pointerType)){let o=t.pointerRules.accepts.join(", ");return m.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${o}).`)}return m.None}#e;#t;constructor(e){this.#e=e,this.#t=new Rt}subscribe(e,...t){return this.#r(this.#t,e,t)}catchupAndSubscribe(e,...t){let o=xe.newSet(i=>i.address);return o.addMany(this.filter(...t)),o.forEach(i=>e.onAdded(i)),this.subscribe({onAdded:i=>{o.add(i)&&e.onAdded(i)},onRemoved:i=>{o.removeByKey(i.address),e.onRemoved(i)}},...t)}filter(...e){return e.length===0?this.incoming():Ge.filter(this.incoming().values(),t=>e.some(o=>o===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,o){return e.subscribe({onAdded:i=>{(o.length===0||o.some(n=>n===i.pointerType))&&t.onAdded(i)},onRemoved:i=>{(o.length===0||o.some(n=>n===i.pointerType))&&t.onRemoved(i)}})}};var pw=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},zl=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;#o;constructor({parent:e,fieldKey:t,fieldName:o,pointerRules:i,deprecated:n}){this.#e=e,this.#t=t,this.#r=o,this.#i=i,this.#o=n,i.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.#o}get pointerHub(){return new Ao(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 T.empty()}record(){return Kr.empty()}getField(e){return F()}optField(e){return m.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()}`}};pw([Il,zl("design:type",Ao),zl("design:paramtypes",[])],W.prototype,"pointerHub",null);pw([Il,zl("design:type",xe),zl("design:paramtypes",[])],W.prototype,"address",null);pw([Il,zl("design:type",String),zl("design:paramtypes",[])],W.prototype,"debugPath",null);var f=Object.freeze({mandatory:!1,accepts:[]});var sm=class r extends W{static create(e,t,o){return new r(e,t,o)}#e;constructor(e,t,o){super(e),this.#e=T.create(i=>t({parent:this,fieldKey:i,fieldName:String(i),pointerRules:f,deprecated:e.deprecated}),o)}accept(e){return _(e.visitArrayField,this)}fields(){return this.#e}record(){return T.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return oe(this.#e[e])}optField(e){return m.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,o)=>this.#e[o].fromJSON(t));else return F("Type mismatch")}};var jn;(function(r){r.writeFields=(t,o)=>{let i=Object.entries(o).filter(([n,s])=>!s.deprecated);t.writeInt(1179403347),t.writeShort(i.length),i.forEach(([n,s])=>{let a=Tt.create();s.write(a);let l=new Int8Array(a.toArrayBuffer());t.writeShort(Number(n)),t.writeInt(l.length),t.writeBytes(l)})},r.readFields=(t,o)=>{M(t.readInt()===1179403347,"Serializer header is corrupt");let i=t.readShort();for(let n=0;n<i;n++){let s=t.readShort();if(Fl(o[s]))continue;let a=t.readInt(),l=new Int8Array(a);t.readBytes(l);let{status:u,error:d}=rn(()=>o[s]?.read(new ct(l.buffer)));u==="failure"&&console.warn(o,d)}}})(jn||(jn={}));var vI=function(r,e,t,o){var i=arguments.length,n=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,o);else for(var a=r.length-1;a>=0;a--)(s=r[a])&&(n=(i<3?s(n):i>3?s(e,t,n):s(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n},qS=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;#o;#n=r.Index++;constructor({uuid:e,graph:t,name:o,pointerRules:i}){this.#e=xe.compose(e),this.#t=t,this.#r=o,this.#i=i,this.#o=this.initializeFields(),i.mandatory&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#o)}record(){return this.#o}getField(e){return oe(this.#o[e],()=>`Field ${String(e)} not found in ${this.toString()}`)}optField(e){return m.wrap(this.#o[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.#n}get pointerHub(){return new Ao(this)}estimateMemory(){let e=new Nl;return this.write(e),e.count}isBox(){return!0}asBox(e){return Ie(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){jn.readFields(e,this.#o)}write(e){jn.writeFields(e,this.#o)}serialize(){let e=Tt.create();return e.writeInt(this.#n),e.writeString(this.name),e.writeBytes(new Int8Array(this.address.uuid.buffer)),this.write(e),e.toArrayBuffer()}toArrayBuffer(){let e=Tt.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#o).reduce((e,[t,o])=>{let i=o.toJSON();return G(i)&&(e[t]=i),e},{})}fromJSON(e){if(Rf(e))Object.entries(e).forEach(([t,o])=>{let i=this.#o[parseInt(t)];G(o)&&i.fromJSON(o)});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 T.empty();let o=this.getField(t[0]),i=[e(o)];for(let n=1;n<t.length;n++)o=o.getField(t[n]),i.push(e(o));return i}searchVertex(e){if(e.length===0)return m.wrap(this);let t=this.optField(e[0]);if(t.isEmpty())return m.None;for(let o=1;o<e.length;o++)if(t=t.unwrap().optField(e[o]),t.isEmpty())return m.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(o=>o.toString()).join(`
2
- `)),console.debug(" unstages",[...e].map(o=>o.toString()).join(`
3
- `),this));for(let o of t)o.defer();for(let o of e)o.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(o=>o.accept({visitPointerField:i=>!i.mandatory||i.nonEmpty(),visitArrayField:i=>e(i.fields()),visitObjectField:i=>e(i.fields()),visitPrimitiveField:i=>!0,visitField:i=>!0})??!0);return e(this.fields())}toString(){return`${this.constructor.name} ${this.address.toString()}`}};vI([Il,qS("design:type",Ao),qS("design:paramtypes",[])],N.prototype,"pointerHub",null);var Rd;(function(r){r.clampInt32=(e,t)=>t,r.clampFloat32=(e,t)=>t})(Rd||(Rd={}));var Se;(function(r){r[r.This=0]="This",r[r.Parent=1]="Parent",r[r.Children=2]="Children"})(Se||(Se={}));var am;(function(r){r.create=()=>new hw})(am||(am={}));var hw=class{#e=new Od(ra.equals);#t=new Od(ra.startsWith);#r=new Od(ra.endsWith);#i=[];#o=0;#n=!1;subscribe(e,t,o){let i=new fw(t,e,this.#o++,o);if(this.#n){let n=new mw(i,e);return this.#i.push(n),n}else return this.subscribeMonitor(i,e)}dispatch(e){this.#n=!0,[...this.#e.filter(e),...this.#t.filter(e),...this.#r.filter(e)].sort(({order:o},{order:i})=>o-i).forEach(o=>o.procedure(e)),this.#n=!1,this.#i.forEach(o=>o.subscribe(this)),this.#i.length=0}subscribeMonitor(e,t){switch(t){case Se.This:return this.#e.subscribe(e);case Se.Parent:return this.#t.subscribe(e);case Se.Children:return this.#r.subscribe(e);default:return Of(t)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},fw=class{address;propagation;order;procedure;constructor(e,t,o,i){this.address=e,this.propagation=t,this.order=o,this.procedure=i}toString(){return`{ Monitor address: ${this.address}, propagation: ${Se[this.propagation]}, order: ${this.order} }`}},Od=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(ra.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},mw=class{monitor;propagation;#e=new R;#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 yt;(function(r){r.Boolean="boolean",r.Float32="float32",r.Int32="int32",r.String="string",r.Bytes="bytes"})(yt||(yt={}));var oa={[yt.Boolean]:{type:yt.Boolean,encode:(r,e)=>r.writeBoolean(e),decode:r=>r.readBoolean()},[yt.Float32]:{type:yt.Float32,encode:(r,e)=>r.writeFloat(e),decode:r=>r.readFloat()},[yt.Int32]:{type:yt.Int32,encode:(r,e)=>r.writeInt(e),decode:r=>r.readInt()},[yt.String]:{type:yt.String,encode:(r,e)=>r.writeString(e),decode:r=>r.readString()},[yt.Bytes]:{type:yt.Bytes,encode:(r,e)=>{r.writeInt(e.length),r.writeBytes(e)},decode:r=>{let e=new Int8Array(r.readInt());return r.readBytes(e),e}}},ia=class extends W{#e;#t;#r;constructor(e,t,o){super(e),this.#e=t,this.#t=o,this.#r=this.#t}accept(e){return _(e.visitPrimitiveField,this)}subscribe(e){return this.graph.subscribeVertexUpdates(Se.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){M(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,o=this.clamp(e);this.equals(o)||(this.#r=o,this.graph.onPrimitiveValueUpdate(this,t,o))}writeValue(e,t){M(!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)}},I=class r extends ia{static create(e,t=!1){return new r(e,t)}constructor(e,t){super(e,yt.Boolean,t)}toggle(){this.setValue(!this.getValue())}serialization(){return oa[yt.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){M(!this.deprecated,"BooleanField.write: deprecated field"),e.writeBoolean(this.getValue())}fromJSON(e){this.deprecated||(typeof e=="boolean"?this.setValue(e):console.warn("BooleanField Type mismatch",e,this.address.toString()))}},A=class r extends ia{static create(e,t,o,i=0){return new r(e,t,o,i)}#e;#t;constructor(e,t,o,i){super(e,yt.Float32,i),this.#e=t,this.#t=o}serialization(){return oa[yt.Float32]}equals(e){return this.getValue()===e}clamp(e){return Rd.clampFloat32(this.#e,sn.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){M(!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()))}},P=class r extends ia{static create(e,t,o,i=0){return new r(e,t,o,i)}#e;#t;constructor(e,t,o,i){super(e,yt.Int32,i),this.#e=t,this.#t=o}serialization(){return oa[yt.Int32]}equals(e){return this.getValue()===e}clamp(e){return Rd.clampInt32(this.#e,dr.toInt(e))}read(e){this.setValue(e.readInt())}write(e){M(!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>=dr.MIN_VALUE&&e<=dr.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},C=class r extends ia{static create(e,t=""){return new r(e,t)}constructor(e,t){super(e,yt.String,t)}serialization(){return oa[yt.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){M(!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()))}},HS=class r extends ia{static create(e,t=this.#e){return new r(e,t)}static#e=Object.freeze(new Int8Array(0));constructor(e,t){super(e,yt.Bytes,t)}serialization(){return oa[yt.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){M(!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 JS;(function(r){r.decode=e=>{let t=e.readInt();return T.create(()=>{switch(e.readString()){case"new":{let i=b.fromDataInput(e),n=e.readString(),s=new Int8Array(e.readInt());return e.readBytes(s),new Vd(i,n,s.buffer)}case"pointer":{let i=xe.read(e),n=e.readBoolean()?m.wrap(xe.read(e)):m.None,s=e.readBoolean()?m.wrap(xe.read(e)):m.None;return new Ud(i,n,s)}case"primitive":{let i=xe.read(e),n=e.readString(),s=oa[n],a=s.decode(e),l=s.decode(e);return new zd(i,s,a,l)}case"delete":{let i=b.fromDataInput(e),n=e.readString(),s=new Int8Array(e.readInt());return e.readBytes(s),new jd(i,n,s.buffer)}}},t)}})(JS||(JS={}));var Vd=class{type="new";#e;#t;#r;constructor(e,t,o){this.#e=e,this.#t=t,this.#r=o}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 ct(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),b.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${b.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},zd=class{type="primitive";#e;#t;#r;#i;constructor(e,t,o,i){this.#e=e,this.#t=t,this.#r=o,this.#i=i}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}`}},Ud=class{type="pointer";#e;#t;#r;constructor(e,t,o){this.#e=e,this.#t=t,this.#r=o}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()}`}},jd=class{type="delete";#e;#t;#r;constructor(e,t,o){this.#e=e,this.#t=t,this.#r=o}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 ct(this.#r)))}write(e){e.writeString(this.type),b.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${b.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var UR=Symbol("Unreferenceable"),B=class r extends W{static create(e,t,o){return new r(e,t,o)}static encodeWith(e,t){M(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=m.wrap(e);let o=rn(t);if(this.#e=m.None,o.status==="failure")throw o.error;return o.value}static decodeWith(e,t){M(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=m.wrap(e);let o=rn(t);if(this.#t=m.None,o.status==="failure")throw o.error;return o.value}static#e=m.None;static#t=m.None;#r;#i;#o=m.None;#n=m.None;constructor(e,t,o){super(e),this.#r=t,this.#i=o,o&&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(Se.This,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}catchupAndSubscribe(e){return e(this),this.subscribe(e)}refer(e){this.targetVertex=m.wrap(e)}defer(){this.targetVertex=m.None}get targetVertex(){return this.graph.inTransaction()?this.#n.flatMap(e=>this.graph.findVertex(e)):this.#o}set targetVertex(e){if(e.nonEmpty()){let t=Ao.validate(this,e.unwrap());t.nonEmpty()&&F(t.unwrap())}this.targetAddress=e.map(t=>t.address)}get targetAddress(){return this.#n}set targetAddress(e){let t=this.#n;t.isEmpty()&&e.isEmpty()||(e.nonEmpty()&&t.unwrapOrNull()?.equals(e.unwrap()))===!0||(this.#n=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.#o=e}read(e){let t=e.readBoolean()?m.wrap(xe.read(e)):m.None;this.targetAddress=r.#t.match({none:()=>t,some:o=>o.map(this,t)})}write(e){M(!this.deprecated,"PointerField.write: deprecated field"),r.#e.match({none:()=>this.#n,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.#n,some:e=>e.map(this)}).match({none:()=>null,some:e=>e.toString()})}fromJSON(e){if(!this.deprecated)if(mo(e)||typeof e=="string"){let t=m.wrap(mo(e)?null:xe.decode(e));this.targetAddress=r.#t.match({none:()=>t,some:o=>o.map(this,t)})}else return F(`Pointer: Type mismatch. value (${typeof e}) must be a string.`)}};var lm=class{#e;#t;#r;#i;constructor(){this.#e=xe.newSet(e=>e.address),this.#t=xe.newSet(e=>e.address),this.#r=xe.newSet(([e])=>e),this.#i=xe.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:o}}})=>o;for(let{address:{uuid:o}}of e)this.#n(this.#e,o,t),this.#n(this.#t,o,t);for(let o of e){let i=this.outgoingEdgesOf(o);if(i.length>0)return F(`${o} has outgoing edges: ${i.map(([s,a])=>`[${s.toString()}, ${a.toString()}]`)}`);let n=this.incomingEdgesOf(o);if(n.length>0)return F(`${o} has incoming edges from: ${n.map(s=>s.toString())}`)}}connect(e,t){this.#i.add([e,t]),this.#r.opt(t).match({none:()=>this.#r.add([t,[e]]),some:([,o])=>o.push(e)})}disconnect(e){let[,t]=this.#i.removeByKey(e.address),[,o]=this.#r.get(t);T.remove(o,e),o.length===0&&this.#r.removeByKey(t)}isConnected(e,t){return this.#i.opt(e.address).mapOr(([,o])=>o.equals(t),!1)}outgoingEdgesOf(e){return this.#o(this.#i,e.address.uuid,([{box:{address:{uuid:t}}}])=>t)}incomingEdgesOf(e){return e.isBox()?this.#o(this.#r,e.address.uuid,([{uuid:t}])=>t).flatMap(([t,o])=>o):this.#r.opt(e.address).mapOr(([t,o])=>o,T.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.`)})}#o(e,t,o){let i=xe.boxRange(e,t,o);return G(i)?e.values().slice(i[0],i[1]):T.empty()}#n(e,t,o){let i=xe.boxRange(e,t,o);G(i)&&e.removeRange(i[0],i[1])}};var na=class{#e;#t;#r;#i;#o;#n;#s;#l;#u;#a;#c=!1;#d=!1;constructor(e=m.None){this.#e=e,this.#t=b.newSet(t=>t.address.uuid),this.#r=[],this.#s=am.create(),this.#i=new Rt,this.#o=new Rt,this.#n=new Rt,this.#l=new lm,this.#u=xe.newSet(({pointer:t})=>t.address),this.#a=[]}beginTransaction(){M(!this.#c,"Transaction already in progress"),this.#c=!0,this.#n.proxy.onBeginTransaction()}endTransaction(){for(M(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.#u.values().toSorted((e,t)=>e.index-t.index).forEach(({pointer:e,initial:t,final:o})=>{t.equals(o)||(t.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onRemoved(e)),o.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#u.clear(),this.#c=!1;this.#a.length>0;)this.#a.splice(0).forEach(e=>e()),this.#a.length>0&&console.debug(`${this.#a.length} new observers while notifying`);this.#n.proxy.onEndTransaction()}inTransaction(){return this.#c}constructingBox(){return this.#d}createBox(e,t,o){return this.#e.unwrap("No box-factory installed")(e,this,t,o)}stageBox(e,t){this.#m(),M(!this.#d,"Cannot construct box while other box is constructing"),G(t)&&(this.#d=!0,t(e),this.#d=!1);let o=this.#t.add(e);M(o,`${e} already staged`);let i=new Vd(e.address.uuid,e.name,e.toArrayBuffer());return this.#i.proxy.onUpdate(i),this.#o.proxy.onUpdate(i),e}subscribeTransaction(e){return this.#n.subscribe(e)}subscribeToAllUpdates(e){return this.#i.subscribe(e)}subscribeToAllUpdatesImmediate(e){return this.#o.subscribe(e)}subscribeVertexUpdates(e,t,o){return this.#s.subscribe(e,t,o)}subscribeEndTransaction(e){this.#a.push(e)}unstageBox(e){this.#m();let t=this.#t.removeByKey(e.address.uuid);M(t===e,`${e} could not be found to unstage`),this.#l.unwatchVerticesOf(e);let o=new jd(e.address.uuid,e.name,e.toArrayBuffer());this.#i.proxy.onUpdate(o),this.#o.proxy.onUpdate(o)}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 jf;return this.boxes().forEach(t=>t.write(e)),e.result()}onPrimitiveValueUpdate(e,t,o){if(this.#m(),e.isAttached()&&!this.#d){let i=new zd(e.address,e.serialization(),t,o);this.#s.dispatch(i),this.#i.proxy.onUpdate(i),this.#o.proxy.onUpdate(i)}}onPointerAddressUpdated(e,t,o){this.#m(),t.nonEmpty()&&this.#l.disconnect(e),o.nonEmpty()&&this.#l.connect(e,o.unwrap());let i=new Ud(e.address,t,o);this.#d?this.#r.push({pointerField:e,update:i}):(this.#p(e,i),this.#o.proxy.onUpdate(i))}#p(e,t){let{oldAddress:o,newAddress:i}=t;e.resolvedTo(i.flatMap(s=>this.findVertex(s))),this.#u.opt(e.address).match({none:()=>this.#u.add({pointer:e,initial:o,final:i,index:this.#u.size()}),some:s=>s.final=i}),this.#s.dispatch(t),this.#i.proxy.onUpdate(t)}findOrphans(e){let t=this.#h(e);return this.boxes().filter(o=>!t.has(o))}#h(e){let t=new Set,o=[e];for(;o.length>0;){let i=o.pop();if(!t.has(i)){t.add(i),this.#f(i).forEach(n=>{n.targetAddress.ifSome(s=>{this.findBox(s.uuid).ifSome(a=>{t.has(a)||o.push(a)})})});for(let n of i.incomingEdges())t.has(n.box)||o.push(n.box)}}return t}#f(e){let t=[],o=i=>{for(let n of i)n.accept({visitPointerField:s=>t.push(s),visitObjectField:s=>o(s.fields()),visitArrayField:s=>o(s.fields())})};return o(e.fields()),t}dependenciesOf(e,t={}){let o=G(t.excludeBox)?t.excludeBox:Rn.alwaysFalse,i=G(t.alwaysFollowMandatory)?t.alwaysFollowMandatory:!1,n=new Set,s=new Set,a=l=>{n.has(l)||o(l)||(n.add(l),l.outgoingEdges().filter(([u])=>!s.has(u)).forEach(([u,d])=>{let p=this.findVertex(d).unwrap(`Could not find target of ${u.toString()}`);if(s.add(u),p.pointerRules.mandatory&&(i||p.pointerHub.incoming().filter(h=>h.targetAddress.mapOr(g=>g.equals(d),!1)).every(h=>s.has(h))))return a(p.box)}),l.incomingEdges().forEach(u=>{s.add(u),u.mandatory&&a(u.box)}))};return a(e),n.delete(e),{boxes:n,pointers:Array.from(s).reverse()}}verifyPointers(){this.#l.validateRequirements();let e=0,t=o=>{for(let i of o.fields())i.accept({visitPointerField:n=>{if(n.targetAddress.nonEmpty()){let s=n.targetVertex.nonEmpty(),a=this.findVertex(n.targetAddress.unwrap()).nonEmpty();M(s,`pointer ${n.address} is broken`),M(a,`Cannot find target for pointer ${n.address}`),e++}},visitObjectField:n=>t(n)})};return this.#t.forEach(o=>t(o)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#t.values().reduce((e,t)=>(e[b.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(o=>o.name):this.findBox(t.uuid).flatMap(o=>o.searchVertex(t.fieldKeys).map(i=>i.isField()?i.debugPath:F("Unknown address"))))}toArrayBuffer(){let e=Tt.create(),t=this.#t.values();return e.writeInt(t.length),t.forEach(o=>{let i=o.serialize();e.writeInt(i.byteLength),e.writeBytes(new Int8Array(i))}),e.toArrayBuffer()}fromArrayBuffer(e){M(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let t=new ct(e),o=t.readInt();this.beginTransaction();let i=[];for(let n=0;n<o;n++){let s=t.readInt(),a=new Int8Array(s);t.readBytes(a);let l=new ct(a.buffer),u=l.readInt(),d=l.readString(),p=b.fromDataInput(l);i.push({creationIndex:u,name:d,uuid:p,boxStream:l})}i.sort((n,s)=>n.creationIndex-s.creationIndex).forEach(({name:n,uuid:s,boxStream:a})=>this.createBox(n,s,l=>l.read(a))),this.endTransaction()}toJSON(){return this.#t.values().map(e=>({name:e.name,uuid:e.address.toString(),fields:oe(e.toJSON())}))}#m(){M(this.#c,()=>"Modification only prohibited in transaction mode.")}};var Ul;(function(r){r.insertOrder=(e,t=Number.MAX_SAFE_INTEGER)=>{let o=r.collectIndexedBoxes(e),i=he(t,0,o.length);if(i<o.length)for(let n=i;n<o.length;n++)o[n].index.setValue(n+1);return i},r.removeOrder=(e,t)=>{let o=r.collectIndexedBoxes(e);if(t<o.length)for(let i=t+1;i<o.length;i++)o[i].index.setValue(i-1)},r.moveIndex=(e,t,o)=>{let i=r.collectIndexedBoxes(e),n=i[t];if(o<0){let s=he(t+o,0,i.length-1);for(let a=s;a<t;a++)i[a].index.setValue(a+1);n.index.setValue(s)}else if(o>1){let s=he(t+(o-1),0,i.length-1);for(let a=t;a<s;a++)i[a+1].index.setValue(a);n.index.setValue(s)}else console.warn(`moveIndex had no effect: startIndex: ${t}, delta: ${o}`)},r.isIndexedBox=e=>"index"in e&&e.index instanceof P,r.collectIndexedBoxes=(e,t)=>e.pointerHub.incoming().map(({box:o})=>r.isIndexedBox(o)&&(t===void 0||o instanceof t)?o:F(`${o} has no index field`)).sort((o,i)=>o.index.getValue()-i.index.getValue())})(Ul||(Ul={}));var Me=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 oe(this.#e[e])}optField(e){return m.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(Se.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){jn.readFields(e,this.#e)}write(e){jn.writeFields(e,this.#e)}toJSON(){if(!this.deprecated)return Object.entries(this.#e).reduce((e,[t,o])=>(e[t]=o.toJSON(),e),{})}fromJSON(e){if(!this.deprecated)if(Rf(e))Object.entries(e).forEach(([t,o])=>{let i=this.#e[parseInt(t)];G(o)&&i.fromJSON(o)});else return F("Type mismatch")}};var cn;(function(r){r.sender=(i,n)=>n(new t(i)),r.executor=(i,n)=>new o(i,n);let e=i=>{let n=[];for(let s of i)s instanceof MessagePort&&n.push(s),typeof ImageBitmap<"u"&&s instanceof ImageBitmap&&n.push(s),typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas&&n.push(s);return n};class t{#e;#t=new Map;#r;#i=0;constructor(n){this.#e=n,this.#r=n.subscribe(this.#o)}terminate(){this.#r.terminate()}dispatchAndForget=(n,...s)=>{let a=e(s);this.#e.send({type:"send",returnId:!1,func:n.name,args:Array.from(Ge.map(s,l=>({value:l})))},a)};dispatchAndReturn=(n,...s)=>new Promise((a,l)=>{let u=Ge.reduce(s,(p,h,g)=>(typeof h=="function"&&p.push([g,h]),p),[]);this.#t.set(this.#i,{executorTuple:{resolve:a,reject:l},callbacks:new Map(u)});let d=e(s);this.#e.send({type:"send",returnId:this.#i,func:n.name,args:Array.from(Ge.map(s,(p,h)=>typeof p=="function"?{callback:h}:{value:p}))},d),this.#i++});#o=n=>{let s=this.#t.get(n.returnId);G(s)?n.type==="resolve"?(s.executorTuple.resolve(n.resolve),this.#t.delete(n.returnId)):n.type==="reject"?(s.executorTuple.reject(n.reject),this.#t.delete(n.returnId)):n.type==="callback"&&s.callbacks?.get(n.funcAt).apply(this,n.args):F(`Promise has already been resolved. ${JSON.stringify(n)}`)}}class o{#e;#t;#r;constructor(n,s){this.#e=n,this.#t=s,this.#r=n.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=n=>{M(n.type==="send",()=>"Message type must be 'send'");let s=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),a=oe(s[n.func],`${n.func.toString()} does not exists on ${this.#t}`),l=n.returnId;if(l===!1)a.apply(this.#t,n.args.map(u=>"value"in u?u.value:F(`${n.func.toString()} has no promise.`)));else try{a.apply(this.#t,n.args.map(d=>"callback"in d?(...p)=>this.#s(l,d.callback,p):d.value)).then(d=>{try{this.#o(l,d)}catch(p){this.#n(l,p)}},d=>this.#n(l,d))}catch(u){this.#n(l,u)}};#o=(n,s)=>this.#e.send({type:"resolve",returnId:n,resolve:s});#n=(n,s)=>this.#e.send({type:"reject",returnId:n,reject:s});#s=(n,s,a)=>this.#e.send({type:"callback",returnId:n,funcAt:s,args:a})}r.Executor=o})(cn||(cn={}));var QS={for:r=>new gw(r)},yI=[],gw=class{#e;#t=new te;constructor(e){if(this.#e=e,G(e.onmessage)||G(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??yI)}channel(e){return new vw(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},vw=class r{#e;#t;#r=new te;#i;constructor(e,t){this.#e=e,this.#t=t,this.#i=e.subscribe(o=>{"__id__"in o&&o.__id__==="42"&&"message"in o&&"channel"in o&&o.channel===t&&this.#r.notify(o.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 Ld;(function(r){r.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),r.frames=e=>new Promise(t=>{let o=e,i=()=>{--o<=0?t():requestAnimationFrame(i)};requestAnimationFrame(i)}),r.timeSpan=(e,...t)=>new Promise(o=>setTimeout(o,e.millis(),...t)),r.event=(e,t)=>new Promise(o=>e.addEventListener(t,o,{once:!0})),r.observable=e=>new Promise(t=>{let o=e.subscribe(()=>{o.terminate(),t()})}),r.complete=e=>new Promise((t,o)=>{let i=setInterval(()=>{let{status:n,value:s,error:a}=rn(()=>e.next());if(n==="success"){let{done:l,value:u}=s;l&&(clearInterval(i),t(u))}else clearInterval(i),o(a)},0)})})(Ld||(Ld={}));var yw=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)}},um;(function(r){class e{value;status="resolved";constructor(a){this.value=a}error=Qs("Cannot access error when promise is resolved")}r.ResolveResult=e;class t{error;status="rejected";constructor(a){this.error=a}value=Qs("Cannot access value when promise is rejected")}r.RejectedResult=t,r.makeAbortable=async(s,a)=>{let l=!0;return s.own(Z.create(()=>l=!1)),new Promise((u,d)=>a.then(p=>{l&&u(p)},p=>{l&&d(p)}))},r.tryCatch=s=>s.then(a=>new e(a),a=>new t(a));let o=new yw(3,Id.seconds(3));r.retry=(s,a=o)=>s().catch(l=>new Promise((u,d)=>{let p=h=>{a.retry(h,()=>s().then(g=>u(g),p))||d(h)};p(l)})),r.guardedRetry=(s,a)=>{let l=async(u=0)=>{try{return await s()}catch(d){if(a(d,++u))return console.debug(`retry after failure (online: ${navigator.onLine}):`,d),await Ld.timeSpan(Id.seconds(1)),l(u);throw new Error(`Failed after ${u} retries: ${d}`)}};return l()},r.approvedRetry=(s,a)=>{let l=async()=>{try{return await s()}catch(u){if(await Ml.approve(a(u)))return l();throw u}};return l()},r.delay=(s,a)=>Promise.all([s,Ld.timeSpan(a)]).then(([l])=>l),r.fail=(s,a="fail")=>Promise.reject(a),r.timeout=(s,a,l)=>new Promise((u,d)=>{let p=!0,h=setTimeout(()=>{p=!1,d(new Error(l??"timeout"))},a.millis());s.then(g=>{p&&u(g)},g=>{p&&d(g)}).finally(()=>clearTimeout(h))}),r.sequentialAll=s=>s.reduce((a,l)=>a.then(async u=>[...u,await l()]),Promise.resolve([])),r.sequentialize=s=>{let a=Promise.resolve();return l=>{let u=()=>s(l),d=a.then(u,u);return a=d.catch(()=>{}),d}},r.memoizeAsync=(s,a)=>{let l=null,u=Date.now();return()=>{let d=Date.now();return(mo(l)||G(a)&&d-u>a.millis())&&(u=d,l=s(),l.catch(p=>(l=null,p))),l}},r.allWithLimit=async(s,a=1)=>{let l=new Array(s.length),u=0,d=!1,p=async()=>{for(;u<s.length&&!d;){let h=u++;try{let g=await s[h]();d||(l[h]=g)}catch(g){throw d=!0,g}}};return await Promise.all(Array.from({length:Math.min(a,s.length)},p)),l},r.allSettledWithLimit=async(s,a=1)=>{let l=new Array(s.length),u=0,d=async()=>{for(;u<s.length;){let p=u++;try{let h=await s[p]();l[p]={status:"fulfilled",value:h}}catch(h){l[p]={status:"rejected",reason:h}}}};return await Promise.all(Array.from({length:Math.min(a,s.length)},d)),l};class i{max;#e;#t=0;constructor(a=1){this.max=a,this.#e=[]}async add(a){if(this.#t<this.max)return this.#t++,a().finally(()=>this.#r());{let l=Promise.withResolvers();return this.#e.push([a,l]),l.promise.finally(()=>this.#r())}}#r(){if(M(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[a,{resolve:l,reject:u}]=this.#e.shift();this.#t++,a().then(l,u)}}}r.Limit=i;class n{#e;#t;#r;#i=m.None;constructor(a,l,u){this.#e=a,this.#t=l,this.#r=u}update(a){this.#i=m.wrap(a),a.then(l=>{this.#i.contains(a)&&this.#e(l)}).catch(l=>{this.#i.contains(a)&&this.#t(l)}).finally(()=>{this.#i.contains(a)&&(this.terminate(),_(this.#r))})}terminate(){this.#i=m.None}}r.Latest=n})(um||(um={}));var XS=(r,e)=>cn.executor(e,new class{sendUpdates(t){r.beginTransaction(),t.forEach(o=>{let i=o.type;i==="new"?r.createBox(o.name,o.uuid,n=>n.read(new ct(o.buffer))):i==="update-primitive"?r.findVertex(xe.reconstruct(o.address)).unwrap(()=>`Could not find primitive field ${o.address}`).setValue(o.value):i==="update-pointer"?r.findVertex(xe.reconstruct(o.address)).unwrap(()=>`Could not find pointer field ${o.address}`).targetAddress=G(o.target)?m.wrap(xe.reconstruct(o.target)):m.None:o.type==="delete"&&r.unstageBox(r.findBox(o.uuid).unwrap(()=>`Could not find box ${b.toString(o.uuid)}`))}),r.endTransaction()}checksum(t){return T.equals(r.checksum(),t)?Promise.resolve():Promise.reject("Checksum mismatch")}});var cm=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 YS;(function(r){r.NoSync="nosync",r.Pitch="pitch",r.Timestretch="timestretch",r.AudioFit="audiofit"})(YS||(YS={}));var eE;(function(r){r[r.Pre=0]="Pre",r[r.Post=1]="Post"})(eE||(eE={}));var Nt;(function(r){r.Instrument="instrument",r.Bus="bus",r.Aux="aux",r.Output="output"})(Nt||(Nt={}));var Ln={white:new Bt(0,0,100),blue:new Bt(189,100,65),green:new Bt(150,77,69),yellow:new Bt(60,100,84),cream:new Bt(65,20,83),orange:new Bt(31,100,73),red:new Bt(354,100,65),purple:new Bt(314,100,78),bright:new Bt(197,0,100),gray:new Bt(197,31,85),dark:new Bt(197,15,60),shadow:new Bt(197,10,45),black:new Bt(197,10,16),background:new Bt(197,6,7),panelBackground:new Bt(197,14,10),panelBackgroundBright:new Bt(197,16,14),panelBackgroundDark:new Bt(197,14,9)};var $e;(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"})($e||($e={}));(function(r){r.toName=e=>r[e],r.fromName=e=>r[e]??r.Rectangle})($e||($e={}));var c;(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.MIDIControllers=23]="MIDIControllers",r[r.MIDIDevice=24]="MIDIDevice",r[r.MIDIEffectHost=25]="MIDIEffectHost",r[r.ModularSetup=26]="ModularSetup",r[r.Modulation=27]="Modulation",r[r.ModuleCollection=28]="ModuleCollection",r[r.NoteEventCollection=29]="NoteEventCollection",r[r.NoteEventFeature=30]="NoteEventFeature",r[r.NoteEvents=31]="NoteEvents",r[r.NotesConnection=32]="NotesConnection",r[r.Parameter=33]="Parameter",r[r.ParameterController=34]="ParameterController",r[r.PianoMode=35]="PianoMode",r[r.RegionCollection=36]="RegionCollection",r[r.Sample=37]="Sample",r[r.Selection=38]="Selection",r[r.Shadertoy=39]="Shadertoy",r[r.SideChain=40]="SideChain",r[r.SignatureAutomation=41]="SignatureAutomation",r[r.SoundfontFile=42]="SoundfontFile",r[r.StepAutomation=43]="StepAutomation",r[r.Timeline=44]="Timeline",r[r.TrackCollection=45]="TrackCollection",r[r.TransientMarkers=46]="TransientMarkers",r[r.User=47]="User",r[r.ValueEventCollection=48]="ValueEventCollection",r[r.ValueEvents=49]="ValueEvents",r[r.ValueInterpolation=50]="ValueInterpolation",r[r.VoltageConnection=51]="VoltageConnection",r[r.WarpMarkers=52]="WarpMarkers"})(c||(c={}));var Kn;(function(r){r[r.Once=0]="Once",r[r.Repeat=1]="Repeat",r[r.Pingpong=2]="Pingpong"})(Kn||(Kn={}));var _o;(function(r){r[r.Monophonic=0]="Monophonic",r[r.Polyphonic=1]="Polyphonic"})(_o||(_o={}));var tE=(r,e)=>{if(r===e)return 0;let t=r-e;return t===0?F(`Indices cannot be equal (${r}, ${e})`):t};var dn=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Gt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},dm,ji,Wn,pm,pn,Ot=class r{static create(e,t,o){return new r(e,t,o)}constructor(e,t,o){dm.set(this,void 0),ji.set(this,void 0),Wn.set(this,void 0),pm.set(this,void 0),pn.set(this,null),dn(this,dm,e,"f"),dn(this,ji,b.newSet(i=>i.adapter.uuid),"f"),dn(this,Wn,new Rt,"f"),dn(this,pm,e.pointerHub.catchupAndSubscribe({onAdded:i=>{dn(this,pn,null,"f");let n=t(i.box),s=n.indexField.subscribe(()=>{dn(this,pn,null,"f"),Gt(this,Wn,"f").proxy.onReorder(n)}),a=Gt(this,ji,"f").add({adapter:n,subscription:s});M(a,`Could not add ${n}`),Gt(this,Wn,"f").proxy.onAdd(n)},onRemoved:i=>{dn(this,pn,null,"f");let n=i.box.address.uuid,{adapter:s,subscription:a}=Gt(this,ji,"f").removeByKey(n);a.terminate(),Gt(this,Wn,"f").proxy.onRemove(s)}},o),"f")}field(){return Gt(this,dm,"f")}subscribe(e){return Gt(this,Wn,"f").subscribe(e)}catchupAndSubscribe(e){return Gt(this,ji,"f").forEach(({adapter:t})=>e.onAdd(t)),this.subscribe(e)}getAdapterByIndex(e){let t=tt.exactMapped(this.adapters(),e,tE,o=>o.indexField.getValue());return t===-1?m.None:m.wrap(this.adapters()[t])}getAdapterById(e){return Gt(this,ji,"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 Gt(this,pn,"f")===null&&dn(this,pn,Gt(this,ji,"f").values().map(({adapter:e})=>e).sort((e,t)=>e.indexField.getValue()-t.indexField.getValue()),"f"),Gt(this,pn,"f")}move(e,t){this.moveIndex(e.indexField.getValue(),t)}moveIndex(e,t){let o=this.adapters(),i=o[e];if(t<0){let n=he(e+t,0,o.length-1);for(let s=n;s<e;s++)o[s].indexField.setValue(s+1);i.indexField.setValue(n)}else if(t>1){let n=he(e+(t-1),0,o.length-1);for(let s=e;s<n;s++)o[s+1].indexField.setValue(s);i.indexField.setValue(n)}else console.warn(`moveIndex had no effect: startIndex: ${e}, delta: ${t}`)}size(){return Gt(this,ji,"f").size()}isEmpty(){return this.size()===0}terminate(){dn(this,pn,null,"f"),Gt(this,ji,"f").forEach(({subscription:e})=>e.terminate()),Gt(this,ji,"f").clear(),Gt(this,Wn,"f").terminate(),Gt(this,pm,"f").terminate()}};dm=new WeakMap,ji=new WeakMap,Wn=new WeakMap,pm=new WeakMap,pn=new WeakMap;var sa;(function(r){r.create=(e,t,o,i)=>{switch(e){case"MetaDataBox":return hn.create(t,o,i);case"RootBox":return jl.create(t,o,i);case"SelectionBox":return Po.create(t,o,i);case"UserInterfaceBox":return aa.create(t,o,i);case"UploadFileBox":return hm.create(t,o,i);case"ShadertoyBox":return fm.create(t,o,i);case"MIDIControllerBox":return mm.create(t,o,i);case"TimelineBox":return la.create(t,o,i);case"TrackBox":return fr.create(t,o,i);case"NoteEventBox":return Zn.create(t,o,i);case"NoteEventRepeatBox":return gm.create(t,o,i);case"NoteEventCollectionBox":return fn.create(t,o,i);case"NoteRegionBox":return ua.create(t,o,i);case"NoteClipBox":return Ll.create(t,o,i);case"ValueEventBox":return Gn.create(t,o,i);case"ValueEventCollectionBox":return Li.create(t,o,i);case"ValueEventCurveBox":return qn.create(t,o,i);case"ValueRegionBox":return ca.create(t,o,i);case"ValueClipBox":return Kl.create(t,o,i);case"SignatureEventBox":return Wl.create(t,o,i);case"AudioRegionBox":return Hn.create(t,o,i);case"AudioClipBox":return Zl.create(t,o,i);case"AudioPitchStretchBox":return Gl.create(t,o,i);case"AudioTimeStretchBox":return ql.create(t,o,i);case"TransientMarkerBox":return Hl.create(t,o,i);case"WarpMarkerBox":return Jn.create(t,o,i);case"MarkerBox":return Jl.create(t,o,i);case"AudioFileBox":return mr.create(t,o,i);case"SoundfontFileBox":return Ir.create(t,o,i);case"AudioUnitBox":return st.create(t,o,i);case"CaptureAudioBox":return Qn.create(t,o,i);case"CaptureMidiBox":return Xn.create(t,o,i);case"AudioBusBox":return Ki.create(t,o,i);case"AuxSendBox":return da.create(t,o,i);case"GrooveShuffleBox":return Ql.create(t,o,i);case"UnknownAudioEffectDeviceBox":return vm.create(t,o,i);case"UnknownMidiEffectDeviceBox":return ym.create(t,o,i);case"DeviceInterfaceKnobBox":return xm.create(t,o,i);case"ModularDeviceBox":return bm.create(t,o,i);case"StereoToolDeviceBox":return wm.create(t,o,i);case"CompressorDeviceBox":return Xl.create(t,o,i);case"DelayDeviceBox":return Am.create(t,o,i);case"CrusherDeviceBox":return _m.create(t,o,i);case"DattorroReverbDeviceBox":return Pm.create(t,o,i);case"VelocityDeviceBox":return Sm.create(t,o,i);case"FoldDeviceBox":return Em.create(t,o,i);case"TidalDeviceBox":return Bm.create(t,o,i);case"RevampDeviceBox":return Fm.create(t,o,i);case"ReverbDeviceBox":return Nm.create(t,o,i);case"VaporisateurDeviceBox":return Yl.create(t,o,i);case"MIDIOutputDeviceBox":return eu.create(t,o,i);case"MIDIOutputBox":return Wi.create(t,o,i);case"MIDIOutputParameterBox":return Zi.create(t,o,i);case"SoundfontDeviceBox":return tu.create(t,o,i);case"NanoDeviceBox":return ru.create(t,o,i);case"PlayfieldDeviceBox":return iu.create(t,o,i);case"PlayfieldSampleBox":return Yn.create(t,o,i);case"TapeDeviceBox":return ou.create(t,o,i);case"ArpeggioDeviceBox":return Im.create(t,o,i);case"PitchDeviceBox":return km.create(t,o,i);case"ZeitgeistDeviceBox":return $m.create(t,o,i);case"ModularBox":return Dm.create(t,o,i);case"ModuleConnectionBox":return Mm.create(t,o,i);case"ModularAudioInputBox":return Cm.create(t,o,i);case"ModularAudioOutputBox":return Tm.create(t,o,i);case"ModuleDelayBox":return Rm.create(t,o,i);case"ModuleMultiplierBox":return Om.create(t,o,i);case"ModuleGainBox":return Vm.create(t,o,i);default:return F(`Unknown box class '${e}'`)}},r.deserialize=(e,t)=>{let o=new ct(t),i=o.readString(),n=b.fromDataInput(o),s=r.create(i,e,n);return s.read(o),s}})(sa||(sa={}));var hn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MetaDataBox",pointerRules:f}),o)}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:f},c.MetaData,!0),2:C.create({parent:this,fieldKey:2,fieldName:"origin",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"value",deprecated:!1,pointerRules:f})}}};var zm=class r extends Me{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:P.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:f},{length:4},"",0),2:A.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:f},{min:1,max:64,scaling:"linear"},"",8),3:A.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:f},{min:.5,max:2,scaling:"linear"},"",1),4:I.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:f},!1),5:P.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:f},{min:-48,max:48},"st",0)}}};var jl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"RootBox",pointerRules:f}),o)}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:f},c.Timeline,!0),2:W.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[c.User],mandatory:!0}}),3:C.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:f}),4:B.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:f},c.Groove,!0),10:W.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[c.ModularSetup],mandatory:!1}}),20:W.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[c.AudioUnits],mandatory:!1}}),21:W.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[c.AudioBusses],mandatory:!1}}),30:W.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[c.AudioOutput],mandatory:!0}}),35:W.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[c.MIDIDevice],mandatory:!1}}),40:zm.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:f}),100:B.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:f},c.Shadertoy,!1),111:B.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:f},c.Editing,!1)}}};var Po=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"SelectionBox",pointerRules:f}),o)}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:f},c.Selection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:f},c.Selection,!0)}}};var aa=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"UserInterfaceBox",pointerRules:{accepts:[c.MetaData],mandatory:!1}}),o)}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)}get midiControllers(){return this.getField(30)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:f},c.User,!0),10:W.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[c.Selection],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[c.FileUploadState],mandatory:!1}}),21:B.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:f},c.Editing,!1),22:B.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:f},c.Editing,!1),23:B.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:f},c.Editing,!1),30:W.hook({parent:this,fieldKey:30,fieldName:"midiControllers",deprecated:!1,pointerRules:{accepts:[c.MIDIControllers],mandatory:!1}})}}};var hm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"UploadFileBox",pointerRules:f}),o)}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:f},c.FileUploadState,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:f},c.FileUploadState,!0)}}};var fm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ShadertoyBox",pointerRules:{accepts:[c.Shadertoy],mandatory:!0}}),o)}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:f}),2:I.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:f},!0)}}};var mm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIControllerBox",pointerRules:f}),o)}static ClassName="MIDIControllerBox";constructor(e){super(e)}accept(e){return _(e.visitMIDIControllerBox,this)}get controllers(){return this.getField(1)}get parameter(){return this.getField(2)}get deviceId(){return this.getField(3)}get deviceChannel(){return this.getField(4)}get controlId(){return this.getField(5)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"controllers",deprecated:!1,pointerRules:f},c.MIDIControllers,!0),2:B.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:f},c.MIDIControl,!0),3:C.create({parent:this,fieldKey:3,fieldName:"deviceId",deprecated:!1,pointerRules:f}),4:P.create({parent:this,fieldKey:4,fieldName:"deviceChannel",deprecated:!1,pointerRules:f},{min:0,max:127},""),5:P.create({parent:this,fieldKey:5,fieldName:"controlId",deprecated:!1,pointerRules:f},{min:0,max:127},"")}}};var Um=class r extends Me{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:P.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:f},{min:1,max:32},"",4),2:P.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:f},{min:1,max:32},"",4)}}};var jm=class r extends Me{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),2:P.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:f},"any","ppqn",0),3:P.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:f},"any","ppqn",15360)}}};var Lm=class r extends Me{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:[c.MarkerTrack],mandatory:!1}}),10:P.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index","",0),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0)}}};var Km=class r extends Me{static create(e){return new r(e)}constructor(e){super(e)}get events(){return this.getField(1)}get index(){return this.getField(10)}get minBpm(){return this.getField(15)}get maxBpm(){return this.getField(16)}get enabled(){return this.getField(20)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!1),10:P.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index","",2),15:P.create({parent:this,fieldKey:15,fieldName:"minBpm",deprecated:!1,pointerRules:f},{min:30,max:999},"bpm",60),16:P.create({parent:this,fieldKey:16,fieldName:"maxBpm",deprecated:!1,pointerRules:f},{min:31,max:1e3},"bpm",240),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0)}}};var Wm=class r extends Me{static create(e){return new r(e)}constructor(e){super(e)}get events(){return this.getField(1)}get index(){return this.getField(10)}get enabled(){return this.getField(20)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[c.SignatureAutomation],mandatory:!1}}),10:P.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index","",1),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0)}}};var la=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"TimelineBox",pointerRules:f}),o)}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 tempoTrack(){return this.getField(22)}get signatureTrack(){return this.getField(23)}get durationInPulses(){return this.getField(30)}get bpm(){return this.getField(31)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[c.Timeline],mandatory:!0}}),10:Um.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:f}),11:jm.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:f}),20:W.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!0,pointerRules:{accepts:[c.MarkerTrack],mandatory:!1}}),21:Lm.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:f}),22:Km.create({parent:this,fieldKey:22,fieldName:"tempoTrack",deprecated:!1,pointerRules:f}),23:Wm.create({parent:this,fieldKey:23,fieldName:"signatureTrack",deprecated:!1,pointerRules:f}),30:P.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:f},"positive","ppqn",491520),31:A.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:f},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var fr=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"TrackBox",pointerRules:{accepts:[c.Selection,c.PianoMode,c.MetaData],mandatory:!1}}),o)}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:f},c.TrackCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:f},c.Automation,!0),3:W.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[c.RegionCollection],mandatory:!1}}),4:W.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[c.ClipCollection],mandatory:!1}}),10:P.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),11:P.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:f},{values:[0,1,2,3]},""),20:I.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),30:I.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:f},!1)}}};var Zn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventBox",pointerRules:{accepts:[c.Selection,c.NoteEventFeature],mandatory:!1}}),o)}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:f},c.NoteEvents,!0),10:P.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:P.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn",240),20:P.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:f},{min:0,max:127},"",60),21:A.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:f},"unipolar","%",.7874015748031497),22:P.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:f},{min:1,max:128},"",1),23:A.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:f},"bipolar","%",0),24:A.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:f},{min:-50,max:50,scaling:"linear"},"ct",0),25:P.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:f},{min:0,max:100},"",100)}}};var gm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventRepeatBox",pointerRules:f}),o)}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:f},c.NoteEventFeature,!0),2:P.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:f},{min:1,max:128},"",1),3:A.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:f},"bipolar","%",0),4:A.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:f},"unipolar","%",1)}}};var fn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),o)}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:[c.NoteEvents],mandatory:!1}}),2:W.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[c.NoteEventCollection],mandatory:!0}})}}};var ua=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[c.Selection,c.Editing,c.MetaData],mandatory:!1}}),o)}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:f},c.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.NoteEventCollection,!0),10:P.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:P.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),12:P.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:f},"any","ppqn"),13:P.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:f},"positive","ppqn"),14:P.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:f},"any","ppqn"),15:I.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:f}),16:C.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:f}),17:P.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var es=class r extends Me{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:I.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:f},!0),2:I.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:f}),3:I.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:f}),4:P.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:f},"non-negative",""),5:P.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:f},"non-negative",""),6:P.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:f},"non-negative","")}}};var Ll=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NoteClipBox",pointerRules:{accepts:[c.Selection,c.Editing,c.MetaData],mandatory:!1}}),o)}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:f},c.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.NoteEventCollection,!0),3:P.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:es.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:f}),10:P.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),11:I.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:f}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:f}),13:P.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var Gn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),o)}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:f},c.ValueEvents,!0),10:P.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:P.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),12:P.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[c.ValueInterpolation],mandatory:!1}},{values:[0,1]},"",1),13:A.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:f},"any",""),14:A.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:f},"any","",NaN)}}};var Li=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),o)}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:[c.ValueEvents],mandatory:!1}}),2:W.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[c.ValueEventCollection],mandatory:!0}})}}};var qn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCurveBox",pointerRules:f}),o)}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:f},c.ValueInterpolation,!0),2:A.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:f},"unipolar","%",.5)}}};var ca=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[c.Selection,c.Editing,c.MetaData],mandatory:!1}}),o)}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:f},c.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),10:P.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:P.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),12:P.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:f},"any","ppqn"),13:P.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:f},"positive","ppqn"),14:I.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:f}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:f}),16:P.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var Kl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ValueClipBox",pointerRules:{accepts:[c.Selection,c.Editing,c.MetaData],mandatory:!1}}),o)}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:f},c.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),3:P.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:es.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:f}),10:P.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),11:I.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:f}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:f}),13:P.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var Wl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"SignatureEventBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),o)}static ClassName="SignatureEventBox";constructor(e){super(e)}accept(e){return _(e.visitSignatureEventBox,this)}get events(){return this.getField(1)}get index(){return this.getField(9)}get relativePosition(){return this.getField(10)}get nominator(){return this.getField(21)}get denominator(){return this.getField(22)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:f},c.SignatureAutomation,!0),9:P.create({parent:this,fieldKey:9,fieldName:"index",deprecated:!1,pointerRules:f},"index","",0),10:P.create({parent:this,fieldKey:10,fieldName:"relativePosition",deprecated:!1,pointerRules:f},"positive","bars",1),21:P.create({parent:this,fieldKey:21,fieldName:"nominator",deprecated:!1,pointerRules:f},"positive","",4),22:P.create({parent:this,fieldKey:22,fieldName:"denominator",deprecated:!1,pointerRules:f},"positive","",4)}}};var Hn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[c.Selection,c.Editing,c.MetaData],mandatory:!1}}),o)}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:f},c.RegionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!0),3:C.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:f}),4:C.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:f},"musical"),5:B.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),6:B.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:f},c.Deprecated,!1),7:A.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:f},"any","seconds"),8:B.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:f},c.AudioPlayMode,!1),10:P.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:A.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"any","mixed"),12:A.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:f},"any","mixed"),13:A.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:f},"any","mixed"),14:I.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:f}),15:C.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:f}),16:P.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0"),17:A.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:f},"decibel","db")}}};var Zl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioClipBox",pointerRules:{accepts:[c.Selection,c.Editing,c.MetaData],mandatory:!1}}),o)}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:f},c.ClipCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!0),3:P.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:es.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:f}),5:B.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),6:B.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:f},c.Deprecated,!1),7:A.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:f},"any","seconds"),8:B.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:f},c.AudioPlayMode,!1),10:A.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:f},"any","ppqn"),11:I.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:f}),12:C.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:f}),13:P.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0"),14:A.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:f},"decibel","db"),20:C.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!0,pointerRules:f}),21:C.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:f},"musical")}}};var Gl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioPitchStretchBox",pointerRules:{accepts:[c.AudioPlayMode],mandatory:!0}}),o)}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:[c.WarpMarkers],mandatory:!0}})}}};var ql=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioTimeStretchBox",pointerRules:{accepts:[c.AudioPlayMode],mandatory:!0}}),o)}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:[c.WarpMarkers],mandatory:!0}}),2:P.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:f},"positive","enum",2),3:A.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:f},"positive","ratio",1)}}};var Hl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"TransientMarkerBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),o)}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:f},c.TransientMarkers,!0),2:A.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:f},"non-negative","seconds")}}};var Jn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"WarpMarkerBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),o)}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:f},c.WarpMarkers,!0),2:P.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),3:A.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:f},"non-negative","seconds")}}};var Jl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MarkerBox",pointerRules:{accepts:[c.Selection,c.MetaData],mandatory:!1}}),o)}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:f},c.MarkerTrack,!0),2:P.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),3:P.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:f},"non-negative","",1),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:f}),5:P.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var mr=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioFileBox",pointerRules:{accepts:[c.AudioFile,c.FileUploadState,c.MetaData],mandatory:!0}}),o)}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:A.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:f},"non-negative","s"),2:A.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:f},"non-negative","s"),3:C.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:f}),10:W.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[c.TransientMarkers],mandatory:!1}})}}};var Ir=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[c.SoundfontFile],mandatory:!0}}),o)}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:f})}}};var st=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[c.Selection,c.Automation,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},"instrument"),2:B.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:f},c.AudioUnits,!0),3:W.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[c.Editing],mandatory:!1}}),11:P.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),12:A.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-96,mid:-9,max:6,scaling:"decibel"},"dB"),13:A.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%"),14:I.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),15:I.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),20:W.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[c.TrackCollection],mandatory:!1}}),21:W.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[c.MIDIEffectHost],mandatory:!1}}),22:W.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[c.InstrumentHost,c.AudioOutput],mandatory:!1}}),23:W.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[c.AudioEffectHost],mandatory:!1}}),24:W.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[c.AuxSend],mandatory:!1}}),25:B.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:f},c.AudioOutput,!1),26:B.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:f},c.Capture,!1)}}};var Qn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[c.Capture],mandatory:!0}}),o)}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:f}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:f},"normal"),10:P.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:f},"any","",1),11:A.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:f},"decibel","dB",0)}}};var Xn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[c.Capture],mandatory:!0}}),o)}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:f}),2:C.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:f},"normal"),10:P.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:f},"any","",-1)}}};var Ki=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AudioBusBox",pointerRules:{accepts:[c.SideChain],mandatory:!1}}),o)}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:f},c.AudioBusses,!0),2:B.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:f},c.AudioOutput,!0),3:W.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[c.AudioOutput],mandatory:!1}}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:C.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:f}),6:C.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:f}),7:C.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:f},"red"),8:I.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:f})}}};var da=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"AuxSendBox",pointerRules:{accepts:[c.SideChain],mandatory:!1}}),o)}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:f},c.AuxSend,!0),2:B.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:f},c.AudioOutput,!0),3:P.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:P.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:f},{values:[0,1]},"",1),5:A.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB"),6:A.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","")}}};var Ql=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[c.Groove],mandatory:!0}}),o)}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:f}),10:A.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.6),11:P.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"non-negative","ppqn",480)}}};var vm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},c.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:f})}}};var ym=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData],mandatory:!1}}),o)}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:f},c.MIDIEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:C.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:f})}}};var xm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:f}),o)}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:f},c.DeviceUserInterface,!0),2:B.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:f},c.ParameterController,!0),3:P.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),10:A.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:f},"unipolar","%"),11:C.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:f})}}};var Zm=class r extends Me{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:[c.DeviceUserInterface],mandatory:!1}})}}};var bm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},c.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:B.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:f},c.ModularSetup,!0),11:Zm.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:f})}}};var wm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},c.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:A.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-72,mid:0,max:12,scaling:"decibel"},"dB",0),11:A.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%",0),12:A.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%",0),13:I.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),14:I.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),15:I.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),20:P.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:f},{values:[0,1]},"",1)}}};var Xl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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)}get sideChain(){return this.getField(30)}initializeFields(){return{1:B.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:I.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},!1),11:I.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},!0),12:I.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},!1),13:I.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},!1),14:A.create({parent:this,fieldKey:14,fieldName:"inputgain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-30,max:30,scaling:"linear"},"dB",0),15:A.create({parent:this,fieldKey:15,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-60,max:0,scaling:"linear"},"dB",-10),16:A.create({parent:this,fieldKey:16,fieldName:"ratio",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:1,max:24,scaling:"exponential"},"",2),17:A.create({parent:this,fieldKey:17,fieldName:"knee",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:24,scaling:"linear"},"dB",0),18:A.create({parent:this,fieldKey:18,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:100,scaling:"linear"},"ms",0),19:A.create({parent:this,fieldKey:19,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:5,max:1500,scaling:"linear"},"ms",25),20:A.create({parent:this,fieldKey:20,fieldName:"makeup",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-40,max:40,scaling:"linear"},"dB",0),21:A.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",1),30:B.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:f},c.SideChain,!1)}}};var Am=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},c.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:A.create({parent:this,fieldKey:10,fieldName:"delay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"any","",4),11:A.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.5),12:A.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%",0),13:A.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%",0),14:A.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",-6),15:A.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",0)}}};var _m=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},c.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:A.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",0),11:P.create({parent:this,fieldKey:11,fieldName:"bits",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:1,max:16},"bits",16),12:A.create({parent:this,fieldKey:12,fieldName:"boost",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:24,scaling:"linear"},"dB",0),13:A.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",1)}}};var Pm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"DattorroReverbDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},c.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:A.create({parent:this,fieldKey:10,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),11:A.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.9999),12:A.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.75),13:A.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.625),14:A.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.75),15:A.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.7),16:A.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.5),17:A.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.005),18:A.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.5),19:A.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.7),20:A.create({parent:this,fieldKey:20,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",-6),21:A.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",0)}}};var Sm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"VelocityDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData],mandatory:!1}}),o)}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:f},c.MIDIEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:A.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.5),11:A.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%"),12:P.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:f},"any","",2048),13:A.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%"),14:A.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%",0),15:A.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",1)}}};var Em=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},c.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:A.create({parent:this,fieldKey:10,fieldName:"drive",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:30,scaling:"linear"},"dB",0),11:P.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:f},{length:3},"",0),12:A.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-18,max:0,scaling:"linear"},"dB",0)}}};var Bm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"TidalDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},c.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:A.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%",-.25),11:A.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.5),20:A.create({parent:this,fieldKey:20,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",3),21:A.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","",1),22:A.create({parent:this,fieldKey:22,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0),23:A.create({parent:this,fieldKey:23,fieldName:"channelOffset",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0)}}};var Kd=class r extends Me{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),10:A.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:P.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{length:4},""),12:A.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Wd=class r extends Me{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),10:A.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:A.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-24,max:24,scaling:"linear"},"dB")}}};var nu=class r extends Me{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:I.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),10:A.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:A.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-24,max:24,scaling:"linear"},"dB"),12:A.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var Fm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},c.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:Kd.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:f}),11:Wd.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:f}),12:nu.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:f}),13:nu.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:f}),14:nu.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:f}),15:Wd.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:f}),16:Kd.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:f}),17:A.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-18,max:18,scaling:"linear"},"db")}}};var Nm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},c.AudioEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:A.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.5),11:A.create({parent:this,fieldKey:11,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:.5,scaling:"exponential"},"s",0),12:A.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.5),13:A.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%",0),14:A.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",-3),15:A.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",0)}}};var Gm=class r extends Me{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:P.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{values:[0,1,2,3]},""),2:A.create({parent:this,fieldKey:2,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","db",-1/0),3:P.create({parent:this,fieldKey:3,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-3,max:3},"oct",0),4:A.create({parent:this,fieldKey:4,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-1200,max:1200,scaling:"linear"},"ct")}}};var qm=class r extends Me{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:P.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{values:[0,1,2,3]},""),2:A.create({parent:this,fieldKey:2,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:1e-4,max:30,scaling:"exponential"},"Hz",1e-4),3:I.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},!1),10:A.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%"),11:A.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%"),12:A.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%")}}};var Hm=class r extends Me{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:A.create({parent:this,fieldKey:1,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),2:A.create({parent:this,fieldKey:2,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),3:A.create({parent:this,fieldKey:3,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),4:A.create({parent:this,fieldKey:4,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","db",.001)}}};var Yl=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:A.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",-6),11:P.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"any","oct"),12:A.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"any","ct"),13:P.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"any",""),14:A.create({parent:this,fieldKey:14,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),15:A.create({parent:this,fieldKey:15,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"q"),16:A.create({parent:this,fieldKey:16,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s"),17:A.create({parent:this,fieldKey:17,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s"),18:A.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%"),19:A.create({parent:this,fieldKey:19,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),20:A.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",1),21:A.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",0),22:P.create({parent:this,fieldKey:22,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{values:[0,1]},"",1),23:P.create({parent:this,fieldKey:23,fieldName:"unisonCount",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{values:[1,3,5]},"",1),24:A.create({parent:this,fieldKey:24,fieldName:"unisonDetune",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:1,max:1200,scaling:"exponential"},"ct",30),25:A.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",1),26:P.create({parent:this,fieldKey:26,fieldName:"filterOrder",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{values:[1,2,3,4]},"",1),27:A.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%"),30:qm.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:f}),40:sm.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:f},e=>Gm.create(e),2),50:Hm.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:f}),99:P.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:f},"any","")}}};var Jm=class r extends Me{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:f}),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f})}}};var eu=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:Jm.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:f}),11:P.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:f},{min:0,max:15},"ch"),12:P.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:f},"any","ms",10),13:W.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[c.Parameter],mandatory:!1}}),14:B.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:f},c.MIDIDevice,!1)}}};var Wi=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputBox",pointerRules:f}),o)}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:f},c.MIDIDevice,!0),2:W.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[c.MIDIDevice],mandatory:!0}}),3:C.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:f}),4:C.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:f}),5:P.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:f},{min:0,max:500},"ms",10),6:I.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:f},!0)}}};var Zi=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputParameterBox",pointerRules:f}),o)}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:f},c.Parameter,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f},""),3:P.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:f},{min:0,max:127},"#",64),4:A.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!0}},"unipolar","%")}}};var tu=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:B.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:f},c.SoundfontFile,!1),11:P.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:f},{min:0,max:65535},"")}}};var ru=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:A.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",-3),15:B.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!1),20:A.create({parent:this,fieldKey:20,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:8,scaling:"exponential"},"s",.1)}}};var iu=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),o)}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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:W.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[c.Sample],mandatory:!1}})}}};var Yn=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[c.Editing,c.SideChain],mandatory:!1}}),o)}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:f},c.Sample,!0),11:B.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!0),12:W.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[c.MIDIEffectHost],mandatory:!1}}),13:W.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[c.AudioEffectHost],mandatory:!1}}),15:P.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:f},{min:0,max:127},"",60),20:C.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!1,pointerRules:f}),21:C.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:f}),22:I.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),23:I.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),40:I.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:f}),41:I.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:f}),42:I.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:f}),43:I.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:f}),44:P.create({parent:this,fieldKey:44,fieldName:"gate",deprecated:!1,pointerRules:f},{length:3},"",0),45:A.create({parent:this,fieldKey:45,fieldName:"pitch",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-1200,max:1200,scaling:"linear"},"ct"),46:A.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",0),47:A.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",1),48:A.create({parent:this,fieldKey:48,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),49:A.create({parent:this,fieldKey:49,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.02)}}};var ou=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain,c.Automation],mandatory:!1}}),o)}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:f},c.InstrumentHost,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:C.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:A.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%"),11:A.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%"),12:A.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%"),13:A.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%")}}};var Im=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData],mandatory:!1}}),o)}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:f},c.MIDIEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:P.create({parent:this,fieldKey:10,fieldName:"modeIndex",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{length:3},"",0),11:P.create({parent:this,fieldKey:11,fieldName:"numOctaves",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:1,max:5},"oct",1),12:P.create({parent:this,fieldKey:12,fieldName:"rateIndex",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{length:17},"",9),13:A.create({parent:this,fieldKey:13,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:2,scaling:"linear"},"",1),14:P.create({parent:this,fieldKey:14,fieldName:"repeat",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:1,max:16},"",1),15:A.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","",0)}}};var km=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData],mandatory:!1}}),o)}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:f},c.MIDIEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:P.create({parent:this,fieldKey:10,fieldName:"semiTones",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-36,max:36},"st",0),11:A.create({parent:this,fieldKey:11,fieldName:"cents",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-50,max:50,scaling:"linear"},"ct",0),12:P.create({parent:this,fieldKey:12,fieldName:"octaves",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-7,max:7},"oct",0)}}};var $m=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData],mandatory:!1}}),o)}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:f},c.MIDIEffectHost,!0),2:P.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:C.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:I.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:I.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:B.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:f},c.Groove,!0)}}};var Dm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModularBox",pointerRules:f}),o)}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:f},c.ModularSetup,!0),2:W.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[c.ModularSetup],mandatory:!0}}),3:W.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[c.Editing],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[c.ModuleCollection],mandatory:!1}}),12:W.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[c.ConnectionCollection],mandatory:!1}}),13:C.create({parent:this,fieldKey:13,fieldName:"label",deprecated:!1,pointerRules:f})}}};var Mm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleConnectionBox",pointerRules:f}),o)}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:f},c.ConnectionCollection,!0),2:B.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:f},c.VoltageConnection,!0),3:B.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:f},c.VoltageConnection,!0)}}};var pi=class r extends Me{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:f},c.ModuleCollection,!0),2:C.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:P.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:f},"any","x"),4:P.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:f},"any","y"),5:I.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:f},!1),6:I.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:f},!0)}}};var Cm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),o)}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:pi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:W.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}})}}};var Tm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),o)}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:pi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:W.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}})}}};var Rm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),o)}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:pi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:W.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),20:A.create({parent:this,fieldKey:20,fieldName:"time",deprecated:!1,pointerRules:{accepts:[c.ParameterController],mandatory:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",500)}}};var Om=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),o)}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:pi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:W.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),12:W.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),20:A.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:f},"unipolar","%")}}};var Vm=class r extends N{static create(e,t,o){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),o)}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:pi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:W.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),12:W.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),20:A.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[c.ParameterController],mandatory:!1}},"decibel","dB")}}};var So;(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 o=e.pointerHub.filter(c.ValueInterpolation).at(0)?.box;G(o)?(Jb(o,qn),o.slope.setValue(t.slope)):qn.create(e.box.graph,b.generate(),i=>{i.slope.setValue(t.slope),i.event.refer(e)})}},r.read=e=>{let t=e.pointerHub.incoming().at(0)?.box;return G(t)?(Jb(t,qn),{type:"curve",slope:t.slope.getValue()}):e.getValue()===0?un.None:e.getValue()===1?un.Linear:F("Unknown Interpolation value")}})(So||(So={}));var ts=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Re=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Zd,su,ht,Gd,rs,qd,mn=class r{constructor(e,t){this.type="value-event",Zd.set(this,new R),su.set(this,void 0),ht.set(this,void 0),Gd.set(this,void 0),rs.set(this,void 0),qd.set(this,!1),ts(this,su,e,"f"),ts(this,ht,t,"f"),ts(this,Gd,Re(this,Zd,"f").own(new Vf(()=>So.read(Re(this,ht,"f").interpolation))),"f");let o=()=>{Re(this,Gd,"f").invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};Re(this,Zd,"f").ownAll(Re(this,ht,"f").subscribe(Se.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let n=this.collection.unwrap(),s=i.address.fieldKeys,a=T.equals(Re(this,ht,"f").index.address.fieldKeys,s),l=T.equals(Re(this,ht,"f").position.address.fieldKeys,s);a||l?n.requestSorting():n.onEventPropertyChanged()}}),Re(this,ht,"f").interpolation.subscribe(o),Re(this,ht,"f").interpolation.pointerHub.subscribe({onAdded:({box:i})=>{Re(this,rs,"f").terminate(),ts(this,rs,i.subscribe(Se.Children,o),"f"),o()},onRemoved:()=>{Re(this,rs,"f").terminate(),ts(this,rs,Z.Empty,"f"),o()}})),ts(this,rs,Re(this,ht,"f").interpolation.pointerHub.filter(c.ValueInterpolation).at(0)?.box.subscribe(Se.Children,o)??Z.Empty,"f")}onSelected(){ts(this,qd,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){ts(this,qd,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Re(this,rs,"f").terminate(),Re(this,Zd,"f").terminate()}get box(){return Re(this,ht,"f")}get uuid(){return Re(this,ht,"f").address.uuid}get address(){return Re(this,ht,"f").address}get position(){return Re(this,ht,"f").position.getValue()}get index(){return Re(this,ht,"f").index.getValue()}set interpolation(e){So.write(Re(this,ht,"f").interpolation,e)}get interpolation(){return Re(this,Gd,"f").get()}get value(){return Re(this,ht,"f").value.getValue()}get isSelected(){return Re(this,qd,"f")}get collection(){return Re(this,ht,"f").events.targetVertex.map(e=>Re(this,su,"f").boxAdapters.adapterFor(e.box,qt))}copyTo(e){let t=Gn.create(Re(this,su,"f").boxGraph,b.generate(),o=>{o.position.setValue(e?.position??this.position),o.index.setValue(e?.index??this.index),o.events.refer(e?.events??this.collection.unwrap().box.events),o.value.setValue(e?.value??this.value)});return So.write(t.interpolation,e?.interpolation??this.interpolation),Re(this,su,"f").boxAdapters.adapterFor(t,r)}copyFrom(e){return Re(this,ht,"f").position.setValue(e?.position??this.position),Re(this,ht,"f").index.setValue(e?.index??this.index),Re(this,ht,"f").events.refer(e?.events??this.collection.unwrap().box.events),Re(this,ht,"f").value.setValue(e?.value??this.value),So.write(Re(this,ht,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};Zd=new WeakMap,su=new WeakMap,ht=new WeakMap,Gd=new WeakMap,rs=new WeakMap,qd=new WeakMap;mn.Comparator=(r,e)=>{let t=r.position-e.position;if(t!==0)return t;let o=r.index-e.index;if(o!==0)return o;throw new Error(`${r} and ${e} are identical in terms of comparison`)};var Hd=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Oe=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Jd,Qd,is,hi,pa,Xd,gn,Qm,qt=class r{constructor(e,t){Jd.add(this),Qd.set(this,new R),is.set(this,void 0),hi.set(this,void 0),pa.set(this,void 0),Xd.set(this,void 0),gn.set(this,void 0),Hd(this,is,e,"f"),Hd(this,hi,t,"f"),Hd(this,pa,new te,"f"),Hd(this,Xd,b.newSet(i=>i.uuid),"f"),Hd(this,gn,Fr.create(mn.Comparator),"f");let o=i=>{let n=oe(i.accept({visitValueEventBox:s=>Oe(this,is,"f").boxAdapters.adapterFor(s,mn)}),`Could not find adapter for ${i}`);Oe(this,Xd,"f").add(n)&&(Oe(this,gn,"f").add(n),Oe(this,Jd,"m",Qm).call(this))};Oe(this,hi,"f").events.pointerHub.incoming().forEach(({box:i})=>o(i)),Oe(this,Qd,"f").own(Oe(this,hi,"f").events.pointerHub.subscribe({onAdded:({box:i})=>o(i),onRemoved:({box:{address:{uuid:i}}})=>{Oe(this,gn,"f").remove(Oe(this,Xd,"f").removeByKey(i)),Oe(this,Jd,"m",Qm).call(this)}})),Oe(this,Qd,"f").own(Oe(this,hi,"f").owners.pointerHub.subscribe({onAdded:()=>Oe(this,pa,"f").notify(this),onRemoved:()=>Oe(this,pa,"f").notify(this)}))}valueAt(e,t){return om.valueAt(Oe(this,gn,"f"),e,t)}copy(){let e=Oe(this,is,"f").boxGraph,t=Li.create(e,b.generate());return Oe(this,gn,"f").asArray().forEach(o=>o.copyTo({events:t.events})),Oe(this,is,"f").boxAdapters.adapterFor(t,r)}cut(e,t=S.unipolar()){let o=this.events.lowerEqual(e),i=this.events.greaterEqual(e);if(i===null)return o===null?m.None:m.wrap(this.createEvent({position:e,value:o.value,index:o.index,interpolation:o.interpolation}));if(o===null)return m.wrap(this.createEvent({position:e,value:i.value,index:i.index,interpolation:i.interpolation}));if(o.position===e)return m.wrap(o);if(o.interpolation.type==="none")return m.wrap(this.createEvent({position:e,value:o.value,index:o.index,interpolation:o.interpolation}));if(o.interpolation.type==="linear"){let{position:n}=o,{position:s}=i,a=t.x(o.value),l=t.x(i.value),u=zf(a,l,(e-n)/(s-n));return m.wrap(this.createEvent({position:e,value:t.y(u),index:0,interpolation:o.interpolation}))}if(o.interpolation.type==="curve"){let{position:n}=o,{position:s}=i,a=t.x(o.value),l=t.x(i.value),u=s-n,d=e-n,p=di.byHalf(u,a,di.valueAt({slope:o.interpolation.slope,steps:u,y0:a,y1:l},u*.5),l),h=di.valueAt(p,d),g=di.slopeByHalf(a,di.valueAt(p,d*.5),h);return So.write(o.box.interpolation,un.Curve(g)),m.wrap(this.createEvent({position:e,value:t.y(h),index:0,interpolation:un.Curve(di.slopeByHalf(h,di.valueAt(p,(d+u)*.5),l))}))}return F("Unknown interpolation type")}subscribeChange(e){return Oe(this,pa,"f").subscribe(e)}createEvent({position:e,index:t,value:o,interpolation:i}){let n=Gn.create(Oe(this,is,"f").boxGraph,b.generate(),s=>{s.position.setValue(e),s.index.setValue(t),s.value.setValue(o),s.events.refer(Oe(this,hi,"f").events)});return So.write(n.interpolation,i),Oe(this,is,"f").boxAdapters.adapterFor(n,mn)}requestSorting(){Oe(this,gn,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){Oe(this,Jd,"m",Qm).call(this)}terminate(){Oe(this,Qd,"f").terminate()}get box(){return Oe(this,hi,"f")}get uuid(){return Oe(this,hi,"f").address.uuid}get address(){return Oe(this,hi,"f").address}get numOwners(){return Oe(this,hi,"f").owners.pointerHub.filter(c.ValueEventCollection).length}get events(){return Oe(this,gn,"f")}toString(){return`{ValueEventCollectionBox ${b.toString(Oe(this,hi,"f").address.uuid)}}`}};Qd=new WeakMap,is=new WeakMap,hi=new WeakMap,pa=new WeakMap,Xd=new WeakMap,gn=new WeakMap,Jd=new WeakSet,Qm=function(){Oe(this,pa,"f").notify(this)};var ha=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},_e=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},fa,os,ma,It,ga,tp,Yd,ep,au,ns=class{constructor(e,t){fa.add(this),this.type="value-clip",os.set(this,new R),ma.set(this,void 0),It.set(this,void 0),ga.set(this,void 0),tp.set(this,void 0),Yd.set(this,void 0),ep.set(this,Z.Empty),ha(this,ma,e,"f"),ha(this,It,t,"f"),ha(this,Yd,!0,"f"),ha(this,ga,_e(this,os,"f").own(new Wr(!1)),"f"),ha(this,tp,_e(this,os,"f").own(new te),"f"),_e(this,os,"f").own(_e(this,It,"f").pointerHub.subscribe({onAdded:()=>_e(this,fa,"m",au).call(this),onRemoved:()=>_e(this,fa,"m",au).call(this)})),_e(this,os,"f").own(_e(this,It,"f").subscribe(Se.Children,o=>_e(this,fa,"m",au).call(this))),_e(this,os,"f").own(_e(this,It,"f").events.catchupAndSubscribe(({targetVertex:o})=>{_e(this,ep,"f").terminate(),ha(this,ep,o.match({none:()=>Z.Empty,some:({box:i})=>_e(this,ma,"f").boxAdapters.adapterFor(i,qt).subscribeChange(()=>_e(this,fa,"m",au).call(this))}),"f"),_e(this,fa,"m",au).call(this)})),ha(this,Yd,!1,"f")}valueAt(e,t){let o=this.optCollection;return o.isEmpty()?t:o.unwrap().valueAt(e%this.duration,t)}catchupAndSubscribeSelected(e){return _e(this,ga,"f").catchupAndSubscribe(e)}subscribeChange(e){return _e(this,tp,"f").subscribe(e)}accept(e){return _(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&_e(this,It,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:_e(this,It,"f").events.targetVertex.unwrap();Kl.create(_e(this,ma,"f").boxGraph,b.generate(),o=>{o.index.setValue(this.indexField.getValue()),o.label.setValue(this.label),o.hue.setValue(this.hue),o.duration.setValue(this.duration),o.mute.setValue(this.mute),o.clips.refer(_e(this,It,"f").clips.targetVertex.unwrap()),o.events.refer(t)})}onSelected(){_e(this,ga,"f").setValue(!0)}onDeselected(){_e(this,ga,"f").setValue(!1)}get isSelected(){return _e(this,ga,"f").getValue()}terminate(){_e(this,ep,"f").terminate(),_e(this,os,"f").terminate()}get box(){return _e(this,It,"f")}get uuid(){return _e(this,It,"f").address.uuid}get address(){return _e(this,It,"f").address}get indexField(){return _e(this,It,"f").index}get duration(){return _e(this,It,"f").duration.getValue()}get mute(){return _e(this,It,"f").mute.getValue()}get hue(){return _e(this,It,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return _e(this,It,"f").events.targetVertex.map(e=>_e(this,ma,"f").boxAdapters.adapterFor(e.box,qt))}get label(){return _e(this,It,"f").label.getValue()}get trackBoxAdapter(){return _e(this,Yd,"f")?m.None:_e(this,It,"f").clips.targetVertex.map(e=>_e(this,ma,"f").boxAdapters.adapterFor(e.box,xt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${b.toString(_e(this,It,"f").address.uuid)} d: ${q.toString(this.duration)}}`}};os=new WeakMap,ma=new WeakMap,It=new WeakMap,ga=new WeakMap,tp=new WeakMap,Yd=new WeakMap,ep=new WeakMap,fa=new WeakSet,au=function(){_e(this,tp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var rE=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},lu=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},xw,va,Xm,uu=class{constructor(e){this.type="transient-marker",xw.set(this,new R),va.set(this,void 0),Xm.set(this,void 0),rE(this,va,e,"f"),rE(this,Xm,new te,"f")}get box(){return lu(this,va,"f")}get uuid(){return lu(this,va,"f").address.uuid}get address(){return lu(this,va,"f").address}get position(){return lu(this,va,"f").position.getValue()}subscribe(e){return lu(this,Xm,"f").subscribe(e)}terminate(){lu(this,xw,"f").terminate()}};xw=new WeakMap,va=new WeakMap,Xm=new WeakMap;var rp=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ht=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Ym,ip,Eo,op,cu,eg,Gi=class r{constructor(e,t){Ym.set(this,new R),ip.set(this,void 0),Eo.set(this,void 0),op.set(this,void 0),cu.set(this,void 0),eg.set(this,void 0),rp(this,ip,e,"f"),rp(this,Eo,t,"f"),rp(this,op,b.newSet(({uuid:o})=>o),"f"),rp(this,cu,Fr.create(r.Comparator),"f"),rp(this,eg,um.memoizeAsync(async()=>{if(this.data.nonEmpty())return this.data.unwrap();let{promise:o,resolve:i,reject:n}=Promise.withResolvers(),s=this.getOrCreateLoader(),a=s.subscribe(l=>{l.type==="loaded"?(a.terminate(),i(s.data.unwrap("State mismatch"))):l.type==="error"&&(a.terminate(),n(new Error(l.reason)))});return o}),"f"),Ht(this,Ym,"f").own(t.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:o=>{let i=Ht(this,ip,"f").boxAdapters.adapterFor(o.box,uu);Ht(this,op,"f").add(i)&&Ht(this,cu,"f").add(i)},onRemoved:({box:{address:{uuid:o}}})=>{Ht(this,cu,"f").remove(Ht(this,op,"f").removeByKey(o))}}))}get box(){return Ht(this,Eo,"f")}get uuid(){return Ht(this,Eo,"f").address.uuid}get address(){return Ht(this,Eo,"f").address}get startInSeconds(){return Ht(this,Eo,"f").startInSeconds.getValue()}get endInSeconds(){return Ht(this,Eo,"f").endInSeconds.getValue()}get transients(){return Ht(this,cu,"f")}get fileName(){return Ht(this,Eo,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return Ht(this,eg,"f").call(this)}getOrCreateLoader(){return Ht(this,ip,"f").sampleManager.getOrCreate(Ht(this,Eo,"f").address.uuid)}terminate(){Ht(this,Ym,"f").terminate()}};Ym=new WeakMap,ip=new WeakMap,Eo=new WeakMap,op=new WeakMap,cu=new WeakMap,eg=new WeakMap;Gi.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 np=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},gr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},sp,tg,rg,vn,lp,ap,ig,ss=class{constructor(e,t){sp.add(this),this.type="warp-marker",tg.set(this,new R),rg.set(this,void 0),vn.set(this,void 0),lp.set(this,void 0),ap.set(this,!1),np(this,rg,e,"f"),np(this,vn,t,"f"),np(this,lp,new te,"f"),gr(this,tg,"f").own(t.subscribe(Se.Children,()=>gr(this,sp,"m",ig).call(this)))}onSelected(){np(this,ap,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),gr(this,sp,"m",ig).call(this)}onDeselected(){np(this,ap,!1,"f"),gr(this,sp,"m",ig).call(this)}get box(){return gr(this,vn,"f")}get uuid(){return gr(this,vn,"f").address.uuid}get address(){return gr(this,vn,"f").address}get position(){return gr(this,vn,"f").position.getValue()}get seconds(){return gr(this,vn,"f").seconds.getValue()}get isSelected(){return gr(this,ap,"f")}get optWarping(){return gr(this,vn,"f").owner.targetVertex.map(e=>gr(this,rg,"f").boxAdapters.adapterFor(e.box,Bo.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return gr(this,lp,"f").subscribe(e)}terminate(){gr(this,tg,"f").terminate()}};tg=new WeakMap,rg=new WeakMap,vn=new WeakMap,lp=new WeakMap,ap=new WeakMap,sp=new WeakSet,ig=function(){gr(this,lp,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var og=(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 up=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},rr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},ng,sg,ya,xa,cp,du,Fo=class{constructor(e,t){ng.set(this,new R),sg.set(this,void 0),ya.set(this,void 0),xa.set(this,void 0),cp.set(this,void 0),du.set(this,void 0),up(this,sg,e,"f"),up(this,ya,t,"f"),up(this,xa,new te,"f"),up(this,cp,b.newSet(({uuid:o})=>o),"f"),up(this,du,Fr.create(og),"f"),rr(this,ng,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:o=>{let i=rr(this,sg,"f").boxAdapters.adapterFor(o.box,ss);rr(this,cp,"f").add(i)&&(rr(this,du,"f").add(i),rr(this,xa,"f").notify())},onRemoved:({box:{address:{uuid:o}}})=>{rr(this,du,"f").remove(rr(this,cp,"f").removeByKey(o)),rr(this,xa,"f").notify()}}))}get box(){return rr(this,ya,"f")}get uuid(){return rr(this,ya,"f").address.uuid}get address(){return rr(this,ya,"f").address}get warpMarkers(){return rr(this,du,"f")}clone(){let e=Gl.create(rr(this,ya,"f").graph,b.generate());return this.warpMarkers.asArray().forEach(t=>Jn.create(e.graph,b.generate(),o=>{o.position.setValue(t.position),o.seconds.setValue(t.seconds),o.owner.refer(e.warpMarkers)})),e}subscribe(e){return rr(this,xa,"f").subscribe(e)}onChanged(){rr(this,xa,"f").notify()}terminate(){rr(this,ng,"f").terminate()}};ng=new WeakMap,sg=new WeakMap,ya=new WeakMap,xa=new WeakMap,cp=new WeakMap,du=new WeakMap;var dp=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},kt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},ag,lg,qi,ba,pp,pu,No=class{constructor(e,t){ag.set(this,new R),lg.set(this,void 0),qi.set(this,void 0),ba.set(this,void 0),pp.set(this,void 0),pu.set(this,void 0),dp(this,lg,e,"f"),dp(this,qi,t,"f"),dp(this,ba,new te,"f"),dp(this,pp,b.newSet(({uuid:o})=>o),"f"),dp(this,pu,Fr.create(og),"f"),kt(this,ag,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:o=>{let i=kt(this,lg,"f").boxAdapters.adapterFor(o.box,ss);kt(this,pp,"f").add(i)&&(kt(this,pu,"f").add(i),kt(this,ba,"f").notify())},onRemoved:({box:{address:{uuid:o}}})=>{kt(this,pu,"f").remove(kt(this,pp,"f").removeByKey(o)),kt(this,ba,"f").notify()}}))}get box(){return kt(this,qi,"f")}get uuid(){return kt(this,qi,"f").address.uuid}get address(){return kt(this,qi,"f").address}get warpMarkers(){return kt(this,pu,"f")}get playbackRate(){return kt(this,qi,"f").playbackRate.getValue()}get cents(){return Math.log2(kt(this,qi,"f").playbackRate.getValue())*1200}set cents(e){kt(this,qi,"f").playbackRate.setValue(he(2**(e/1200),.5,2))}get transientPlayMode(){return ui(kt(this,qi,"f").transientPlayMode.getValue(),Kn)}clone(){let e=ql.create(kt(this,qi,"f").graph,b.generate(),t=>{t.transientPlayMode.setValue(this.transientPlayMode),t.playbackRate.setValue(this.playbackRate),t.warpMarkers});return this.warpMarkers.asArray().forEach(t=>Jn.create(e.graph,b.generate(),o=>{o.position.setValue(t.position),o.seconds.setValue(t.seconds),o.owner.refer(e.warpMarkers)})),e}subscribe(e){return kt(this,ba,"f").subscribe(e)}onChanged(){kt(this,ba,"f").notify()}terminate(){kt(this,ag,"f").terminate()}};ag=new WeakMap,lg=new WeakMap,qi=new WeakMap,ba=new WeakMap,pp=new WeakMap,pu=new WeakMap;var Bo;(function(r){r.isAudioPlayMode=e=>e instanceof Fo||e instanceof No})(Bo||(Bo={}));var Zr=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},le=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},wa,hu,Aa,ft,_a,Pa,hp,mp,fp,Sa,fu,mu,gu,as=class{constructor(e,t){wa.add(this),this.type="audio-clip",hu.set(this,new R),Aa.set(this,void 0),ft.set(this,void 0),_a.set(this,void 0),Pa.set(this,void 0),hp.set(this,void 0),mp.set(this,void 0),fp.set(this,void 0),Sa.set(this,m.None),fu.set(this,m.None),mu.set(this,Z.Empty),Zr(this,Aa,e,"f"),Zr(this,ft,t,"f"),Zr(this,fp,!0,"f"),Zr(this,_a,new Br,"f"),Zr(this,Pa,le(this,hu,"f").own(new Wr(!1)),"f"),Zr(this,hp,Un.aware(e.tempoMap,t.timeBase,t.duration),"f"),Zr(this,mp,le(this,hu,"f").own(new te),"f"),le(this,hu,"f").ownAll(le(this,ft,"f").pointerHub.subscribe({onAdded:()=>le(this,wa,"m",gu).call(this),onRemoved:()=>le(this,wa,"m",gu).call(this)}),le(this,ft,"f").playMode.catchupAndSubscribe(({targetVertex:o})=>{le(this,mu,"f").terminate(),o.match({none:()=>le(this,_a,"f").clear(),some:({box:i})=>{let n=le(this,Aa,"f").boxAdapters.adapterFor(i,Bo.isAudioPlayMode);Zr(this,mu,n.subscribe(()=>le(this,wa,"m",gu).call(this)),"f"),le(this,_a,"f").wrap(n)}})}),le(this,ft,"f").file.catchupAndSubscribe(o=>{Zr(this,Sa,o.targetVertex.map(i=>le(this,Aa,"f").boxAdapters.adapterFor(i.box,Gi)),"f"),le(this,fu,"f").ifSome(i=>i.terminate()),Zr(this,fu,le(this,Sa,"f").map(i=>i.getOrCreateLoader().subscribe(()=>le(this,wa,"m",gu).call(this))),"f")}),le(this,ft,"f").subscribe(Se.Children,o=>le(this,wa,"m",gu).call(this))),Zr(this,fp,!1,"f")}catchupAndSubscribeSelected(e){return le(this,Pa,"f").catchupAndSubscribe(e)}subscribeChange(e){return le(this,mp,"f").subscribe(e)}accept(e){return _(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){let t=this.observableOptPlayMode.map(o=>o.clone());Zl.create(le(this,Aa,"f").boxGraph,b.generate(),o=>{o.index.setValue(this.indexField.getValue()),o.gain.setValue(this.gain.getValue()),o.timeBase.setValue(this.timeBase),o.label.setValue(this.label),o.hue.setValue(this.hue),o.duration.setValue(this.duration),o.mute.setValue(this.mute),o.clips.refer(le(this,ft,"f").clips.targetVertex.unwrap()),o.file.refer(le(this,ft,"f").file.targetVertex.unwrap()),o.events.refer(le(this,ft,"f").events.targetVertex.unwrap()),t.ifSome(i=>o.playMode.refer(i))})}onSelected(){le(this,Pa,"f").setValue(!0)}onDeselected(){le(this,Pa,"f").setValue(!1)}get isSelected(){return le(this,Pa,"f").getValue()}get box(){return le(this,ft,"f")}get uuid(){return le(this,ft,"f").address.uuid}get address(){return le(this,ft,"f").address}get indexField(){return le(this,ft,"f").index}get duration(){return le(this,hp,"f").toPPQN(0)}set duration(e){le(this,hp,"f").fromPPQN(e,0)}get mute(){return le(this,ft,"f").mute.getValue()}get hue(){return le(this,ft,"f").hue.getValue()}get gain(){return le(this,ft,"f").gain}get file(){return le(this,Sa,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return le(this,_a,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return m.None}get timeBase(){return ui(le(this,ft,"f").timeBase.getValue(),Nr)}get waveformOffset(){return le(this,ft,"f").waveformOffset}get isPlayModeNoStretch(){return le(this,ft,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>Te(e,Fo)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Te(e,No)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>Bo.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(le(this,Sa,"f").isEmpty())return"No Audio File";let e=le(this,Sa,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):le(this,ft,"f").label.getValue()}get trackBoxAdapter(){return le(this,fp,"f")?m.None:le(this,ft,"f").clips.targetVertex.map(e=>le(this,Aa,"f").boxAdapters.adapterFor(e.box,xt))}get isMirrowed(){return!1}get canMirror(){return!1}get canResize(){return le(this,_a,"f").nonEmpty()}terminate(){le(this,fu,"f").ifSome(e=>e.terminate()),Zr(this,fu,m.None,"f"),le(this,mu,"f").terminate(),Zr(this,mu,Z.Empty,"f"),le(this,hu,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${b.toString(le(this,ft,"f").address.uuid)} d: ${q.toString(this.duration)}}`}};hu=new WeakMap,Aa=new WeakMap,ft=new WeakMap,_a=new WeakMap,Pa=new WeakMap,hp=new WeakMap,mp=new WeakMap,fp=new WeakMap,Sa=new WeakMap,fu=new WeakMap,mu=new WeakMap,wa=new WeakSet,gu=function(){le(this,mp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var gp=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Pt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},vu,Vt,ug,vp,Ea=class r{constructor(e,t){this.type="note-event",vu.set(this,void 0),Vt.set(this,void 0),ug.set(this,void 0),vp.set(this,!1),gp(this,vu,e,"f"),gp(this,Vt,t,"f"),gp(this,ug,Pt(this,Vt,"f").subscribe(Se.Children,o=>{if(!this.collection.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let i=this.collection.unwrap(),n=o.address.fieldKeys,s=T.equals(Pt(this,Vt,"f").pitch.address.fieldKeys,n),a=T.equals(Pt(this,Vt,"f").position.address.fieldKeys,n);s||a?i.requestSorting():i.onEventPropertyChanged()}}),"f")}onSelected(){gp(this,vp,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){gp(this,vp,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Pt(this,ug,"f").terminate()}get box(){return Pt(this,Vt,"f")}get uuid(){return Pt(this,Vt,"f").address.uuid}get address(){return Pt(this,Vt,"f").address}get position(){return Pt(this,Vt,"f").position.getValue()}get duration(){return Pt(this,Vt,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return Pt(this,Vt,"f").velocity.getValue()}get pitch(){return Pt(this,Vt,"f").pitch.getValue()}get cent(){return Pt(this,Vt,"f").cent.getValue()}get chance(){return Pt(this,Vt,"f").chance.getValue()}get playCount(){return Pt(this,Vt,"f").playCount.getValue()}get playCurve(){return Pt(this,Vt,"f").playCurve.getValue()}get isSelected(){return Pt(this,vp,"f")}get collection(){return Pt(this,Vt,"f").events.targetVertex.map(e=>Pt(this,vu,"f").boxAdapters.adapterFor(e.box,fi))}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 Pt(this,vu,"f").boxAdapters.adapterFor(Zn.create(Pt(this,vu,"f").boxGraph,b.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 er.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,t=this.collection.unwrap().box.events,o=T.create(i=>{let n=Math.floor(this.computeCurveValue(i/e)*this.duration),s=Math.floor(this.computeCurveValue((i+1)/e)*this.duration);return this.copyTo({position:Math.floor(this.position+n),duration:Math.max(1,s-n),playCount:1,events:t})},e);return Pt(this,Vt,"f").delete(),o}};vu=new WeakMap,Vt=new WeakMap,ug=new WeakMap,vp=new WeakMap;var Io=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},fe=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},yn,yp,ls,Hi,Ba,xp,Gr,dg,pg,hg,us,cg,bp,fi=class r{constructor(e,t){yn.add(this),yp.set(this,new R),ls.set(this,void 0),Hi.set(this,void 0),Ba.set(this,void 0),xp.set(this,void 0),Gr.set(this,void 0),dg.set(this,60),pg.set(this,60),hg.set(this,0),us.set(this,!1),Io(this,ls,e,"f"),Io(this,Hi,t,"f"),Io(this,Ba,new te,"f"),Io(this,xp,b.newSet(o=>o.uuid),"f"),Io(this,Gr,Fr.create(er.Comparator),"f"),fe(this,yp,"f").own(fe(this,Hi,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:o})=>{let i=fe(this,ls,"f").boxAdapters.adapterFor(o,Ea);fe(this,xp,"f").add(i)&&(fe(this,Gr,"f").add(i),fe(this,yn,"m",cg).call(this))},onRemoved:({box:{address:{uuid:o}}})=>{fe(this,Gr,"f").remove(fe(this,xp,"f").removeByKey(o)),fe(this,yn,"m",cg).call(this)}})),fe(this,yp,"f").own(fe(this,Hi,"f").owners.pointerHub.subscribe({onAdded:()=>fe(this,Ba,"f").notify(this),onRemoved:()=>fe(this,Ba,"f").notify(this)}))}copy(){let e=fe(this,ls,"f").boxGraph,t=fn.create(e,b.generate());return fe(this,Gr,"f").asArray().forEach(o=>o.copyTo({events:t.events})),fe(this,ls,"f").boxAdapters.adapterFor(t,r)}createEvent({position:e,duration:t,velocity:o,pitch:i,chance:n,playCount:s,cent:a}){return fe(this,ls,"f").boxAdapters.adapterFor(Zn.create(fe(this,ls,"f").boxGraph,b.generate(),l=>{l.position.setValue(e),l.duration.setValue(t),l.velocity.setValue(o),l.pitch.setValue(i),l.chance.setValue(n),l.playCount.setValue(s),l.cent.setValue(a),l.events.refer(fe(this,Hi,"f").events)}),Ea)}subscribeChange(e){return fe(this,Ba,"f").subscribe(e)}selectable(){return fe(this,Gr,"f").asArray()}selectableAt(e){for(let t of fe(this,Gr,"f").asArray())if(t.position<=e.u&&e.u<t.complete&&t.pitch===e.v)return Ge.one(t);return Ge.empty()}selectablesBetween(e,t){let o=[],i=fe(this,Gr,"f").asArray(),n=fe(this,Gr,"f").ceilFirstIndex(t.u);for(let s=0;s<n;s++){let a=i[s];a.complete>e.u&&a.pitch>=e.v&&a.pitch<=t.v&&o.push(a)}return o}requestSorting(){fe(this,Gr,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){fe(this,yn,"m",cg).call(this)}terminate(){fe(this,yp,"f").terminate()}get box(){return fe(this,Hi,"f")}get uuid(){return fe(this,Hi,"f").address.uuid}get address(){return fe(this,Hi,"f").address}get numOwners(){return fe(this,Hi,"f").owners.pointerHub.filter(c.NoteEventCollection).length}get events(){return fe(this,us,"f")||fe(this,yn,"m",bp).call(this),fe(this,Gr,"f")}get minPitch(){return fe(this,us,"f")||fe(this,yn,"m",bp).call(this),fe(this,dg,"f")}get maxPitch(){return fe(this,us,"f")||fe(this,yn,"m",bp).call(this),fe(this,pg,"f")}get maxDuration(){return fe(this,us,"f")||fe(this,yn,"m",bp).call(this),fe(this,hg,"f")}toString(){return`{NoteEventCollectionBox ${b.toString(fe(this,Hi,"f").address.uuid)}}`}};yp=new WeakMap,ls=new WeakMap,Hi=new WeakMap,Ba=new WeakMap,xp=new WeakMap,Gr=new WeakMap,dg=new WeakMap,pg=new WeakMap,hg=new WeakMap,us=new WeakMap,yn=new WeakSet,cg=function(){Io(this,us,!1,"f"),fe(this,Ba,"f").notify(this)},bp=function(){let e=127,t=0,o=0;fe(this,Gr,"f").asArray().forEach(({pitch:i,duration:n})=>{e=Math.min(e,i),t=Math.max(t,i),o=Math.max(o,n)}),Io(this,dg,e,"f"),Io(this,pg,t,"f"),Io(this,hg,o,"f"),Io(this,us,!0,"f")};var Fa=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Be=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Na,yu,Ia,$t,ka,_p,wp,Ap,xu,bu=class{constructor(e,t){Na.add(this),this.type="note-clip",yu.set(this,new R),Ia.set(this,void 0),$t.set(this,void 0),ka.set(this,void 0),_p.set(this,void 0),wp.set(this,void 0),Ap.set(this,Z.Empty),Fa(this,Ia,e,"f"),Fa(this,$t,t,"f"),Fa(this,wp,!0,"f"),Fa(this,ka,Be(this,yu,"f").own(new Wr(!1)),"f"),Fa(this,_p,Be(this,yu,"f").own(new te),"f"),Be(this,yu,"f").ownAll(Be(this,$t,"f").pointerHub.subscribe({onAdded:()=>Be(this,Na,"m",xu).call(this),onRemoved:()=>Be(this,Na,"m",xu).call(this)}),Be(this,$t,"f").subscribe(Se.Children,o=>Be(this,Na,"m",xu).call(this)),Be(this,$t,"f").events.catchupAndSubscribe(({targetVertex:o})=>{Be(this,Ap,"f").terminate(),Fa(this,Ap,o.match({none:()=>Z.Empty,some:({box:i})=>Be(this,Ia,"f").boxAdapters.adapterFor(i,fi).subscribeChange(()=>Be(this,Na,"m",xu).call(this))}),"f"),Be(this,Na,"m",xu).call(this)})),Fa(this,wp,!1,"f")}catchupAndSubscribeSelected(e){return Be(this,ka,"f").catchupAndSubscribe(e)}subscribeChange(e){return Be(this,_p,"f").subscribe(e)}accept(e){return _(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Be(this,$t,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:Be(this,$t,"f").events.targetVertex.unwrap();Ll.create(Be(this,Ia,"f").boxGraph,b.generate(),o=>{o.index.setValue(this.indexField.getValue()),o.label.setValue(this.label),o.hue.setValue(this.hue),o.duration.setValue(this.duration),o.mute.setValue(this.mute),o.clips.refer(Be(this,$t,"f").clips.targetVertex.unwrap()),o.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,Ap,"f").terminate(),Be(this,yu,"f").terminate()}get box(){return Be(this,$t,"f")}get uuid(){return Be(this,$t,"f").address.uuid}get address(){return Be(this,$t,"f").address}get indexField(){return Be(this,$t,"f").index}get duration(){return Be(this,$t,"f").duration.getValue()}get mute(){return Be(this,$t,"f").mute.getValue()}get hue(){return Be(this,$t,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return Be(this,$t,"f").events.targetVertex.map(e=>Be(this,Ia,"f").boxAdapters.adapterFor(e.box,fi))}get label(){return Be(this,$t,"f").label.getValue()}get trackBoxAdapter(){return Be(this,wp,"f")?m.None:Be(this,$t,"f").clips.targetVertex.map(e=>Be(this,Ia,"f").boxAdapters.adapterFor(e.box,xt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${b.toString(Be(this,$t,"f").address.uuid)} d: ${q.toString(this.duration)}}`}};yu=new WeakMap,Ia=new WeakMap,$t=new WeakMap,ka=new WeakMap,_p=new WeakMap,wp=new WeakMap,Ap=new WeakMap,Na=new WeakSet,xu=function(){Be(this,_p,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var fg={for:(r,e)=>oe(e.accept({visitNoteClipBox:t=>r.adapterFor(t,bu),visitValueClipBox:t=>r.adapterFor(t,ns),visitAudioClipBox:t=>r.adapterFor(t,as)}),"")};var mg=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},cs=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},gg,wu,Pp,Sp,vg=class{constructor(e,t){gg.set(this,void 0),wu.set(this,void 0),Pp.set(this,void 0),Sp.set(this,void 0),mg(this,gg,e,"f"),mg(this,wu,new R,"f"),mg(this,Pp,cs(this,wu,"f").own(new te),"f"),mg(this,Sp,cs(this,wu,"f").own(Ot.create(e.box.clips,o=>fg.for(t,o),c.ClipCollection)),"f"),cs(this,Sp,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return cs(this,gg,"f")}get collection(){return cs(this,Sp,"f")}dispatchChange(){cs(this,Pp,"f").notify()}subscribeChanges(e){return cs(this,Pp,"f").subscribe(e)}terminate(){cs(this,wu,"f").terminate()}};gg=new WeakMap,wu=new WeakMap,Pp=new WeakMap,Sp=new WeakMap;var bt=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},H=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},qr,Ep,ko,We,Au,_u,Pu,$a,Bp,Fp,Da,Su,Eu,Bu,Fu,Nu,mi,ds=class r{constructor(e,t){qr.add(this),this.type="audio-region",Ep.set(this,void 0),ko.set(this,void 0),We.set(this,void 0),Au.set(this,void 0),_u.set(this,void 0),Pu.set(this,void 0),$a.set(this,void 0),Bp.set(this,void 0),Fp.set(this,void 0),Da.set(this,m.None),Su.set(this,Z.Empty),Eu.set(this,Z.Empty),Bu.set(this,Z.Empty),Fu.set(this,Z.Empty),Nu.set(this,void 0),bt(this,ko,e,"f"),bt(this,We,t,"f"),bt(this,Ep,new R,"f");let{timeBase:o,duration:i,loopOffset:n,loopDuration:s}=t;bt(this,Au,Un.aware(e.tempoMap,o,i),"f"),bt(this,_u,Un.aware(e.tempoMap,o,n),"f"),bt(this,Pu,Un.aware(e.tempoMap,o,s),"f"),bt(this,$a,new Br,"f"),bt(this,Bp,new te,"f"),bt(this,Nu,!1,"f"),bt(this,Fp,!0,"f"),H(this,Ep,"f").ownAll(H(this,We,"f").pointerHub.subscribe({onAdded:()=>H(this,qr,"m",mi).call(this),onRemoved:()=>H(this,qr,"m",mi).call(this)}),H(this,We,"f").file.catchupAndSubscribe(a=>{bt(this,Da,a.targetVertex.map(l=>H(this,ko,"f").boxAdapters.adapterFor(l.box,Gi)),"f"),H(this,Su,"f").terminate(),bt(this,Su,H(this,Da,"f").mapOr(l=>l.getOrCreateLoader().subscribe(()=>H(this,qr,"m",mi).call(this)),Z.Empty),"f")}),H(this,We,"f").playMode.catchupAndSubscribe(({targetVertex:a})=>{H(this,Eu,"f").terminate(),a.match({none:()=>H(this,$a,"f").clear(),some:({box:l})=>{let u=H(this,ko,"f").boxAdapters.adapterFor(l,Bo.isAudioPlayMode);bt(this,Eu,u.subscribe(()=>H(this,qr,"m",mi).call(this)),"f"),H(this,$a,"f").wrap(u)}})}),H(this,We,"f").timeBase.catchupAndSubscribe(a=>{H(this,Bu,"f").terminate(),ui(a.getValue(),Nr)===Nr.Seconds&&bt(this,Bu,e.tempoMap.subscribe(()=>H(this,qr,"m",mi).call(this)),"f")}),H(this,We,"f").subscribe(Se.Children,a=>{if(!this.trackBoxAdapter.isEmpty()&&(a.type==="primitive"||a.type==="pointer")){let l=this.trackBoxAdapter.unwrap();H(this,We,"f").position.address.equals(a.address)?(l.regions.onIndexingChanged(),H(this,qr,"m",mi).call(this)):H(this,qr,"m",mi).call(this)}}),H(this,We,"f").events.catchupAndSubscribe(({targetVertex:a})=>{H(this,Fu,"f").terminate(),bt(this,Fu,a.match({none:()=>Z.Empty,some:({box:l})=>H(this,ko,"f").boxAdapters.adapterFor(l,qt).subscribeChange(()=>H(this,qr,"m",mi).call(this))}),"f"),H(this,qr,"m",mi).call(this)})),bt(this,Fp,!1,"f")}subscribeChange(e){return H(this,Bp,"f").subscribe(e)}accept(e){return _(e.visitAudioRegionBoxAdapter,this)}onSelected(){bt(this,Nu,!0,"f"),H(this,qr,"m",mi).call(this)}onDeselected(){bt(this,Nu,!1,"f"),H(this,qr,"m",mi).call(this)}get isSelected(){return H(this,Nu,"f")}get box(){return H(this,We,"f")}get uuid(){return H(this,We,"f").address.uuid}get address(){return H(this,We,"f").address}get position(){return H(this,We,"f").position.getValue()}get duration(){return H(this,Au,"f").toPPQN(this.position)}get complete(){return this.position+this.duration}get loopOffset(){return H(this,_u,"f").toPPQN(this.position)}get loopDuration(){return H(this,Pu,"f").toPPQN(this.position)}resolveDuration(e){return H(this,Au,"f").toPPQN(e)}resolveComplete(e){return e+this.resolveDuration(e)}resolveLoopOffset(e){return H(this,_u,"f").toPPQN(e)}resolveLoopDuration(e){return H(this,Pu,"f").toPPQN(e)}get offset(){return this.position-this.loopOffset}get mute(){return H(this,We,"f").mute.getValue()}get hue(){return H(this,We,"f").hue.getValue()}get gain(){return H(this,We,"f").gain}get file(){return H(this,Da,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return H(this,$a,"f")}get timeBase(){return ui(H(this,We,"f").timeBase.getValue(),Nr)}get waveformOffset(){return H(this,We,"f").waveformOffset}get isPlayModeNoStretch(){return H(this,We,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>Te(e,Fo)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Te(e,No)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>Bo.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(H(this,Da,"f").isEmpty())return"No Audio File";let e=H(this,Da,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):H(this,We,"f").label.getValue()}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return H(this,$a,"f").nonEmpty()}get trackBoxAdapter(){return H(this,We,"f").regions.targetVertex.map(e=>H(this,ko,"f").boxAdapters.adapterFor(e.box,xt))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return H(this,We,"f").events.targetVertex.map(e=>H(this,ko,"f").boxAdapters.adapterFor(e.box,qt))}set position(e){H(this,We,"f").position.setValue(e)}set duration(e){H(this,Au,"f").fromPPQN(e,this.position)}set loopOffset(e){H(this,_u,"f").fromPPQN(e,this.position)}set loopDuration(e){H(this,Pu,"f").fromPPQN(e,this.position)}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),o=e?.consolidate===!0?t.copy().box.owners:t.box.owners,i=this.observableOptPlayMode.map(s=>s.clone()),n=H(this,ko,"f").boxAdapters.adapterFor(Hn.create(H(this,ko,"f").boxGraph,b.generate(),s=>{s.timeBase.setValue(H(this,We,"f").timeBase.getValue()),s.position.setValue(e?.position??H(this,We,"f").position.getValue()),s.regions.refer(e?.track??H(this,We,"f").regions.targetVertex.unwrap()),s.file.refer(H(this,We,"f").file.targetVertex.unwrap()),s.events.refer(o),s.mute.setValue(this.mute),s.hue.setValue(this.hue),s.label.setValue(this.label),s.gain.setValue(this.gain.getValue()),s.waveformOffset.setValue(this.waveformOffset.getValue()),i.ifSome(a=>s.playMode.refer(a))}),r);return n.duration=e?.duration??this.resolveDuration(n.position),n.loopOffset=e?.loopOffset??this.resolveLoopOffset(n.position),n.loopDuration=e?.loopDuration??this.resolveLoopDuration(n.position),n}consolidate(){}canFlatten(e){return!1}flatten(e){return m.None}terminate(){H(this,Su,"f").terminate(),bt(this,Su,Z.Empty,"f"),H(this,Bu,"f").terminate(),bt(this,Bu,Z.Empty,"f"),H(this,Eu,"f").terminate(),bt(this,Eu,Z.Empty,"f"),H(this,Fu,"f").terminate(),bt(this,Fu,Z.Empty,"f"),H(this,Ep,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${b.toString(H(this,We,"f").address.uuid)}}`}};Ep=new WeakMap,ko=new WeakMap,We=new WeakMap,Au=new WeakMap,_u=new WeakMap,Pu=new WeakMap,$a=new WeakMap,Bp=new WeakMap,Fp=new WeakMap,Da=new WeakMap,Su=new WeakMap,Eu=new WeakMap,Bu=new WeakMap,Fu=new WeakMap,Nu=new WeakMap,qr=new WeakSet,mi=function(){H(this,Fp,"f")||(H(this,Bp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var xn=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},me=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},$o,yg,Do,rt,kp,Np,Iu,Ip,bn,ps=class r{constructor(e,t){$o.add(this),this.type="note-region",yg.set(this,new R),Do.set(this,void 0),rt.set(this,void 0),kp.set(this,void 0),Np.set(this,void 0),Iu.set(this,void 0),Ip.set(this,Z.Empty),xn(this,Do,e,"f"),xn(this,rt,t,"f"),xn(this,kp,new te,"f"),xn(this,Iu,!1,"f"),xn(this,Np,!0,"f"),me(this,yg,"f").ownAll(me(this,rt,"f").pointerHub.subscribe({onAdded:()=>me(this,$o,"m",bn).call(this),onRemoved:()=>me(this,$o,"m",bn).call(this)}),me(this,rt,"f").subscribe(Se.Children,o=>{if(!this.trackBoxAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let i=this.trackBoxAdapter.unwrap();me(this,rt,"f").position.address.equals(o.address)?(i.regions.onIndexingChanged(),me(this,$o,"m",bn).call(this)):me(this,$o,"m",bn).call(this)}}),me(this,rt,"f").events.catchupAndSubscribe(({targetVertex:o})=>{me(this,Ip,"f").terminate(),xn(this,Ip,o.match({none:()=>Z.Empty,some:({box:i})=>me(this,Do,"f").boxAdapters.adapterFor(i,fi).subscribeChange(()=>me(this,$o,"m",bn).call(this))}),"f"),me(this,$o,"m",bn).call(this)})),xn(this,Np,!1,"f")}set position(e){me(this,rt,"f").position.setValue(e)}set duration(e){me(this,rt,"f").duration.setValue(e)}set loopOffset(e){me(this,rt,"f").loopOffset.setValue(e)}set loopDuration(e){me(this,rt,"f").loopDuration.setValue(e)}subscribeChange(e){return me(this,kp,"f").subscribe(e)}accept(e){return _(e.visitNoteRegionBoxAdapter,this)}onSelected(){xn(this,Iu,!0,"f"),me(this,$o,"m",bn).call(this)}onDeselected(){xn(this,Iu,!1,"f"),me(this,$o,"m",bn).call(this)}get isSelected(){return me(this,Iu,"f")}*iterateActiveNotesAt(e){let t=this.optCollection;if(t.isEmpty())return;let o=t.unwrap(),i=Yt.globalToLocal(this,e);for(let n of o.events.iterateFrom(i-o.maxDuration)){if(i<n.position)return;i<n.complete&&(yield n.copyAsNoteEvent())}}terminate(){me(this,Ip,"f").terminate(),me(this,yg,"f").terminate()}get box(){return me(this,rt,"f")}get uuid(){return me(this,rt,"f").address.uuid}get address(){return me(this,rt,"f").address}get position(){return me(this,rt,"f").position.getValue()}get duration(){return me(this,rt,"f").duration.getValue()}get loopOffset(){return me(this,rt,"f").loopOffset.getValue()}get loopDuration(){return me(this,rt,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}resolveDuration(e){return this.duration}resolveComplete(e){return e+this.duration}resolveLoopOffset(e){return this.loopOffset}resolveLoopDuration(e){return this.loopDuration}get mute(){return me(this,rt,"f").mute.getValue()}get hue(){return me(this,rt,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return me(this,rt,"f").events.targetVertex.map(e=>me(this,Do,"f").boxAdapters.adapterFor(e.box,fi))}get label(){return me(this,rt,"f").label.getValue()}get trackBoxAdapter(){return me(this,Np,"f")?m.None:me(this,rt,"f").regions.targetVertex.map(e=>me(this,Do,"f").boxAdapters.adapterFor(e.box,xt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),o=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return me(this,Do,"f").boxAdapters.adapterFor(ua.create(me(this,Do,"f").boxGraph,b.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(o),i.regions.refer(e?.track??me(this,rt,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let t=me(this,Do,"f").boxGraph,o=fn.create(t,b.generate());e.events.asArray().forEach(i=>i.copyTo({events:o.events})),me(this,rt,"f").events.refer(o.owners)})}canFlatten(e){return e.length>0&&T.satisfy(e,(t,o)=>t.trackBoxAdapter.contains(o.trackBoxAdapter.unwrap()))&&e.every(t=>t.isSelected&&t instanceof r)}flatten(e){if(!this.canFlatten(e))return m.None;let t=me(this,Do,"f").boxGraph,o=e.toSorted(Vn.Comparator),i=T.getFirst(o,"Internal error (no first)"),n=T.getLast(o,"Internal error (no last)"),s=i.position,a=n.position+n.duration,l=i.trackBoxAdapter.unwrap(),u=fn.create(t,b.generate()),d=Array.from(l.regions.collection.iterateRange(s,a));return d.filter(p=>p.isSelected).forEach(p=>{let h=p;for(let{resultStart:g,resultEnd:v,rawStart:y}of Yt.locateLoops(h,h.position,h.complete)){let x=Math.floor(g-y),$=Math.floor(v-y);for(let D of h.optCollection.unwrap().events.iterateRange(x,$))D.copyTo({position:D.position+y-i.position,events:u.events})}}),d.forEach(({box:p})=>p.delete()),m.wrap(ua.create(t,b.generate(),p=>{p.position.setValue(s),p.duration.setValue(a-s),p.loopDuration.setValue(a-s),p.loopOffset.setValue(0),p.hue.setValue(this.hue),p.mute.setValue(this.mute),p.label.setValue(this.label),p.events.refer(u.owners),p.regions.refer(l.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${b.toString(me(this,rt,"f").address.uuid)} p: ${q.toString(this.position)}, c: ${q.toString(this.complete)}}`}};yg=new WeakMap,Do=new WeakMap,rt=new WeakMap,kp=new WeakMap,Np=new WeakMap,Iu=new WeakMap,Ip=new WeakMap,$o=new WeakSet,bn=function(){me(this,kp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var wn=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ce=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Ji,ku,Mo,it,Mp,$u,$p,Dp,Co,An=class r{constructor(e,t){Ji.add(this),this.type="value-region",ku.set(this,new R),Mo.set(this,void 0),it.set(this,void 0),Mp.set(this,void 0),$u.set(this,void 0),$p.set(this,void 0),Dp.set(this,Z.Empty),wn(this,Mo,e,"f"),wn(this,it,t,"f"),wn(this,$p,!0,"f"),wn(this,Mp,new te,"f"),wn(this,$u,!1,"f"),ce(this,ku,"f").own(ce(this,it,"f").pointerHub.subscribe({onAdded:()=>ce(this,Ji,"m",Co).call(this),onRemoved:()=>ce(this,Ji,"m",Co).call(this)})),ce(this,ku,"f").own(ce(this,it,"f").subscribe(Se.Children,o=>{if(!this.trackBoxAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let i=this.trackBoxAdapter.unwrap();ce(this,it,"f").position.address.equals(o.address)?(i.regions.onIndexingChanged(),ce(this,Ji,"m",Co).call(this)):ce(this,Ji,"m",Co).call(this)}})),ce(this,ku,"f").own(ce(this,it,"f").events.catchupAndSubscribe(({targetVertex:o})=>{ce(this,Dp,"f").terminate(),wn(this,Dp,o.match({none:()=>Z.Empty,some:({box:i})=>ce(this,Mo,"f").boxAdapters.adapterFor(i,qt).subscribeChange(()=>ce(this,Ji,"m",Co).call(this))}),"f"),ce(this,Ji,"m",Co).call(this)})),wn(this,$p,!1,"f")}valueAt(e,t){let o=this.optCollection;return o.isEmpty()?t:o.unwrap().valueAt(Yt.globalToLocal(this,e),t)}incomingValue(e){return this.valueAt(this.position,e)}outgoingValue(e){let t=this.optCollection;if(t.isEmpty())return e;let o=t.unwrap();return(this.complete-this.offset)%this.loopDuration===0?o.valueAt(this.loopDuration,e):o.valueAt(Yt.globalToLocal(this,this.complete),e)}subscribeChange(e){return ce(this,Mp,"f").subscribe(e)}accept(e){return _(e.visitValueRegionBoxAdapter,this)}onSelected(){wn(this,$u,!0,"f"),ce(this,Ji,"m",Co).call(this)}onDeselected(){wn(this,$u,!1,"f"),ce(this,Ji,"m",Co).call(this)}get isSelected(){return ce(this,$u,"f")}onValuesPropertyChanged(){ce(this,Ji,"m",Co).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){ce(this,Dp,"f").terminate(),ce(this,ku,"f").terminate()}get box(){return ce(this,it,"f")}get uuid(){return ce(this,it,"f").address.uuid}get address(){return ce(this,it,"f").address}get position(){return ce(this,it,"f").position.getValue()}get duration(){return ce(this,it,"f").duration.getValue()}get loopOffset(){return ce(this,it,"f").loopOffset.getValue()}get loopDuration(){return ce(this,it,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}resolveDuration(e){return this.duration}resolveComplete(e){return e+this.duration}resolveLoopOffset(e){return this.loopOffset}resolveLoopDuration(e){return this.loopDuration}get mute(){return ce(this,it,"f").mute.getValue()}get hue(){return ce(this,it,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return ce(this,it,"f").events.targetVertex.map(e=>ce(this,Mo,"f").boxAdapters.adapterFor(e.box,qt))}get label(){return ce(this,it,"f").label.getValue()}get trackBoxAdapter(){return ce(this,$p,"f")?m.None:ce(this,it,"f").regions.targetVertex.map(e=>ce(this,Mo,"f").boxAdapters.adapterFor(e.box,xt))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}set position(e){ce(this,it,"f").position.setValue(e)}set duration(e){ce(this,it,"f").duration.setValue(e)}set loopOffset(e){ce(this,it,"f").loopOffset.setValue(e)}set loopDuration(e){ce(this,it,"f").loopDuration.setValue(e)}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),o=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return ce(this,Mo,"f").boxAdapters.adapterFor(ca.create(ce(this,Mo,"f").boxGraph,b.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(o),i.regions.refer(e?.track??ce(this,it,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let t=ce(this,Mo,"f").boxGraph,o=Li.create(t,b.generate());e.asArray().forEach(i=>i.copyTo({events:o.events})),ce(this,it,"f").events.refer(o.owners)})}canFlatten(e){return!1}flatten(e){if(!this.canFlatten(e))return m.None;let t=ce(this,Mo,"f").boxGraph,o=e.toSorted(Vn.Comparator),i=T.getFirst(o,"Internal error (no first)"),n=T.getLast(o,"Internal error (no last)"),s=i.position,a=n.position+n.duration,l=i.trackBoxAdapter.unwrap(),u=Li.create(t,b.generate()),d=Array.from(l.regions.collection.iterateRange(s,a));return d.filter(p=>p.isSelected).forEach(p=>{let h=p;for(let{resultStart:g,resultEnd:v,rawStart:y}of Yt.locateLoops(h,h.position,h.complete)){let x=Math.floor(g-y),$=Math.floor(v-y);for(let D of h.events.unwrap().iterateRange(x,$));}}),d.forEach(({box:p})=>p.delete()),m.wrap(ca.create(t,b.generate(),p=>{p.position.setValue(s),p.duration.setValue(a-s),p.loopDuration.setValue(a-s),p.loopOffset.setValue(0),p.hue.setValue(this.hue),p.mute.setValue(this.mute),p.label.setValue(this.label),p.events.refer(u.owners),p.regions.refer(l.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${b.toString(ce(this,it,"f").address.uuid)} p: ${q.toString(this.position)}, c: ${q.toString(this.complete)}}`}};ku=new WeakMap,Mo=new WeakMap,it=new WeakMap,Mp=new WeakMap,$u=new WeakMap,$p=new WeakMap,Dp=new WeakMap,Ji=new WeakSet,Co=function(){ce(this,Mp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var iE=(r,e)=>r.position-e.position,oE={for:(r,e)=>oe(e.accept({visitNoteRegionBox:t=>r.adapterFor(t,ps),visitAudioRegionBox:t=>r.adapterFor(t,ds),visitValueRegionBox:t=>r.adapterFor(t,An)}),"")};var Du=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Zt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Cp,Ma,Tp,Mu,Ca,Cu,xg=class{constructor(e,t){Cp.set(this,void 0),Ma.set(this,void 0),Tp.set(this,void 0),Mu.set(this,void 0),Ca.set(this,void 0),Cu.set(this,void 0),Du(this,Cp,e,"f"),Du(this,Ma,new R,"f"),Du(this,Tp,Zt(this,Ma,"f").own(new te),"f"),Du(this,Mu,Zt(this,Ma,"f").own(new Rt),"f"),Du(this,Ca,Vn.create(iE),"f"),Du(this,Cu,b.newSet(o=>o.uuid),"f"),Zt(this,Ma,"f").ownAll(Zt(this,Cp,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:o})=>{let i=oE.for(t,o),n=Zt(this,Cu,"f").add(i);M(n,`Cannot add ${o}`),Zt(this,Ca,"f").add(i),Zt(this,Mu,"f").forEach(s=>s.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:o}}})=>{let i=Zt(this,Cu,"f").removeByKey(o);Zt(this,Ca,"f").remove(i),Zt(this,Mu,"f").forEach(n=>n.onRemoved(i)),this.dispatchChange()}},c.RegionCollection))}get trackBoxAdapter(){return Zt(this,Cp,"f")}get collection(){return Zt(this,Ca,"f")}get adapters(){return Zt(this,Cu,"f")}onIndexingChanged(){Zt(this,Ca,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),Zt(this,Mu,"f").subscribe(e)}subscribeChanges(e){return Zt(this,Tp,"f").subscribe(e)}dispatchChange(){Zt(this,Tp,"f").notify()}terminate(){Zt(this,Ma,"f").terminate()}};Cp=new WeakMap,Ma=new WeakMap,Tp=new WeakMap,Mu=new WeakMap,Ca=new WeakMap,Cu=new WeakMap;var ne;(function(r){r[r.Undefined=0]="Undefined",r[r.Notes=1]="Notes",r[r.Audio=2]="Audio",r[r.Value=3]="Value"})(ne||(ne={}));(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 $e.Waveform;case r.Notes:return $e.Piano;case r.Value:return $e.Automation;case r.Undefined:return $e.AudioBus;default:return $e.Unknown}}})(ne||(ne={}));var bg;(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,I)&&"minimized"in e&&Te(e.minimized,I),r.isInstrumentDeviceBox=e=>r.isDeviceBox(e)&&e.host.pointerType===c.InstrumentHost,r.isEffectDeviceBox=e=>r.isDeviceBox(e)&&"index"in e&&Te(e.index,P)&&(e.host.pointerType===c.MIDIEffectHost||e.host.pointerType===c.AudioEffectHost),r.lookupHostField=e=>G(e)&&"host"in e&&Te(e.host,B)?e.host:F(`Could not find 'host' field in '${e?.name}'`),r.lookupLabelField=e=>G(e)&&"label"in e&&Te(e.label,C)?e.label:F(`Could not find 'label' field in '${e?.name}'`),r.lookupEnabledField=e=>G(e)&&"enabled"in e&&Te(e.enabled,I)?e.enabled:F(`Could not find 'enabled' field in '${e?.name}'`),r.lookupMinimizedField=e=>G(e)&&"minimized"in e&&Te(e.minimized,I)?e.minimized:F(`Could not find 'minimized' field in '${e?.name}'`),r.lookupIndexField=e=>G(e)&&"index"in e&&Te(e.index,P)?e.index:F(`Could not find 'index' field in '${e?.name}'`)})(bg||(bg={}));var nE;(function(r){r.toTrackType=e=>{switch(e){case"midi":return ne.Notes;case"audio":return ne.Audio;default:return F()}}})(nE||(nE={}));var se;(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;M(T.satisfy(e,(i,n)=>i.deviceHost().address.equals(n.deviceHost().address)),"Devices are not connected to the same host");let t=e[0];(t.accepts==="audio"?t.deviceHost().audioEffects.field().pointerHub.filter(c.AudioEffectHost):t.accepts==="midi"?t.deviceHost().midiEffects.field().pointerHub.filter(c.MIDIEffectHost):F("unknown type")).map(({box:i})=>bg.lookupIndexField(i)).filter(i=>e.some(n=>b.Comparator(n.uuid,i.address.uuid)!==0)).sort((i,n)=>i.getValue()-n.getValue()).forEach((i,n)=>i.setValue(n)),e.forEach(i=>i.box.delete())}})(se||(se={}));var wg=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Jt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Rp,Ag,Qi,Ta,_g,Pg=class{constructor(e,t){Rp.set(this,void 0),Ag.set(this,new te),Qi.set(this,void 0),Ta.set(this,void 0),_g.set(this,void 0),wg(this,Rp,e,"f"),wg(this,Qi,Ot.create(e.box.tracks,o=>t.adapterFor(o,xt),c.TrackCollection),"f"),wg(this,Ta,b.newSet(({uuid:o})=>o),"f"),wg(this,_g,Jt(this,Qi,"f").catchupAndSubscribe({onAdd:o=>Jt(this,Ta,"f").add({uuid:o.uuid,subscription:o.regions.subscribeChanges(()=>Jt(this,Ag,"f").notify())}),onRemove:({uuid:o})=>Jt(this,Ta,"f").removeByKey(o).subscription.terminate(),onReorder:o=>{}}),"f")}create(e,t,o){let i=Jt(this,Rp,"f").box.graph,n=Jt(this,Rp,"f").box.tracks;fr.create(i,b.generate(),s=>{s.index.setValue(o??Jt(this,Qi,"f").getMinFreeIndex()),s.type.setValue(e),s.tracks.refer(n),s.target.refer(t)})}controls(e){return m.wrap(Jt(this,Qi,"f").adapters().find(t=>t.target.targetVertex.contains(e),!1))}delete(e){let t=Jt(this,Qi,"f").adapters(),o=t.indexOf(e);if(o===-1)return F(`Cannot delete ${e}. Does not exist.`);for(let i=o+1;i<t.length;i++)t[i].indexField.setValue(i-1);e.box.delete()}get collection(){return Jt(this,Qi,"f")}values(){return Jt(this,Qi,"f").adapters()}catchupAndSubscribe(e){return Jt(this,Qi,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return Jt(this,Ag,"f").subscribe(e)}terminate(){Jt(this,Qi,"f").terminate(),Jt(this,_g,"f").terminate(),Jt(this,Ta,"f").forEach(({subscription:e})=>e.terminate()),Jt(this,Ta,"f").clear()}};Rp=new WeakMap,Ag=new WeakMap,Qi=new WeakMap,Ta=new WeakMap,_g=new WeakMap;var sE=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Xi=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Sg,Hr,vr=class{constructor(e,t){this.type="bus",this.accepts="audio",Sg.set(this,void 0),Hr.set(this,void 0),sE(this,Sg,e,"f"),sE(this,Hr,t,"f")}catchupAndSubscribe(e){return e(this),Xi(this,Hr,"f").subscribe(Se.Children,()=>e(this))}get uuid(){return Xi(this,Hr,"f").address.uuid}get address(){return Xi(this,Hr,"f").address}get box(){return Xi(this,Hr,"f")}get enabledField(){return Xi(this,Hr,"f").enabled}get minimizedField(){return Xi(this,Hr,"f").minimized}get iconField(){return Xi(this,Hr,"f").icon}get labelField(){return Xi(this,Hr,"f").label}get colorField(){return Xi(this,Hr,"f").color}get iconSymbol(){return $e.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return Xi(this,Sg,"f").boxAdapters.adapterFor(Xi(this,Hr,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){}toString(){return`{${this.constructor.name}}`}};Sg=new WeakMap,Hr=new WeakMap;var Op=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},mt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},_n,Tu,Ru,gi,Vp,Eg=class{constructor(e,t){_n.set(this,void 0),Tu.set(this,void 0),Ru.set(this,void 0),gi.set(this,void 0),Vp.set(this,Z.Empty),Op(this,_n,new R,"f"),Op(this,Tu,mt(this,_n,"f").own(new te),"f"),Op(this,Ru,mt(this,_n,"f").own(new Wr($e.Unknown)),"f"),Op(this,gi,mt(this,_n,"f").own(new Wr(m.None)),"f"),mt(this,_n,"f").own(mt(this,gi,"f").subscribe(o=>{mt(this,Vp,"f").terminate(),Op(this,Vp,o.getValue().match({none:()=>(mt(this,Tu,"f").notify(m.None),Z.Empty),some:({labelField:i,iconField:n})=>Z.many(n.catchupAndSubscribe(s=>mt(this,Ru,"f").setValue($e.fromName(s.getValue()))),i.catchupAndSubscribe(s=>mt(this,Tu,"f").notify(m.wrap(s.getValue()))))}),"f")})),mt(this,_n,"f").own(e.catchupAndSubscribe({onAdded:({box:o})=>{M(mt(this,gi,"f").getValue().isEmpty(),"Already set");let i=o instanceof Ki?t.adapterFor(o,vr):t.adapterFor(o,se.isInstrument);mt(this,gi,"f").getValue().unwrapOrNull()!==i&&mt(this,gi,"f").setValue(m.wrap(i))},onRemoved:({box:o})=>{M(mt(this,gi,"f").getValue().unwrap("Cannot remove").box.address.equals(o.address),"Unexpected value to remove"),mt(this,gi,"f").setValue(m.None)}},c.InstrumentHost,c.AudioOutput))}getValue(){return mt(this,gi,"f").getValue()}subscribe(e){return mt(this,gi,"f").subscribe(e)}catchupAndSubscribe(e){return e(mt(this,gi,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),mt(this,Tu,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return mt(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($e.toName(e)))}get icon(){return this.getValue().match({none:()=>$e.Unknown,some:e=>$e.fromName(e.iconField.getValue())})}get iconValue(){return mt(this,Ru,"f")}terminate(){mt(this,_n,"f").terminate(),mt(this,Vp,"f").terminate()}};_n=new WeakMap,Tu=new WeakMap,Ru=new WeakMap,gi=new WeakMap,Vp=new WeakMap;var aE=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ra=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Bg,Pn,ge=class{constructor(e){Bg.set(this,void 0),Pn.set(this,void 0),aE(this,Bg,e,"f"),aE(this,Pn,xe.newSet(t=>t.address),"f")}terminate(){Ra(this,Pn,"f").forEach(e=>e.terminate()),Ra(this,Pn,"f").clear()}parameters(){return Ra(this,Pn,"f").values()}parameterAt(e){return Ra(this,Pn,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,t,o,i,n){let s=new Oa(Ra(this,Bg,"f"),e,t,o,i,n),a=Ra(this,Pn,"f").add(s);return M(a,`Could not add adapter for ${e}`),s}removeParameter(e){return Ra(this,Pn,"f").removeByKey(e)}};Bg=new WeakMap,Pn=new WeakMap;var Va=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},at=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},za,vi,hs,Ou,Fg,Ng,zp,Vu=class{constructor(e,t){za.set(this,void 0),vi.set(this,void 0),hs.set(this,void 0),Ou.set(this,void 0),Fg.set(this,void 0),Ng.set(this,void 0),zp.set(this,Z.Empty),Va(this,za,e,"f"),Va(this,vi,t,"f"),Va(this,hs,new R,"f"),Va(this,Ou,at(this,hs,"f").own(new te),"f"),at(this,hs,"f").own(t.targetBus.catchupAndSubscribe(()=>{at(this,zp,"f").terminate(),Va(this,zp,this.optTargetBus.match({none:()=>(at(this,Ou,"f").notify(m.None),Z.Empty),some:o=>o.catchupAndSubscribe(i=>at(this,Ou,"f").notify(m.wrap(i)))}),"f")})),Va(this,Fg,at(this,hs,"f").own(new Oa(at(this,za,"f"),at(this,vi,"f").sendPan,S.bipolar(),E.percent({unit:"%",fractionDigits:0}),"panning")),"f"),Va(this,Ng,at(this,hs,"f").own(new Oa(at(this,za,"f"),at(this,vi,"f").sendGain,S.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),at(this,Ou,"f").subscribe(e)}get uuid(){return at(this,vi,"f").address.uuid}get address(){return at(this,vi,"f").address}get box(){return at(this,vi,"f")}get indexField(){return at(this,vi,"f").index}get sendPan(){return at(this,Fg,"f")}get sendGain(){return at(this,Ng,"f")}get targetBus(){return at(this,za,"f").boxAdapters.adapterFor(at(this,vi,"f").targetBus.targetVertex.unwrap("no audioUnit").box,vr)}get optTargetBus(){return at(this,vi,"f").targetBus.targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>at(this,za,"f").boxAdapters.adapterFor(t,vr)})))}delete(){at(this,vi,"f").delete()}terminate(){at(this,hs,"f").terminate(),at(this,zp,"f").terminate()}};za=new WeakMap,vi=new WeakMap,hs=new WeakMap,Ou=new WeakMap,Fg=new WeakMap,Ng=new WeakMap,zp=new WeakMap;var Up=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},To=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Ig,kg,zu,Uu,jp,$g=class{constructor(e,t){Ig.set(this,void 0),kg.set(this,void 0),zu.set(this,void 0),Uu.set(this,void 0),jp.set(this,Z.Empty),Up(this,Ig,e,"f"),Up(this,kg,t,"f"),Up(this,zu,new R,"f"),Up(this,Uu,To(this,zu,"f").own(new te),"f"),To(this,zu,"f").own(e.catchupAndSubscribe(()=>{To(this,jp,"f").terminate(),Up(this,jp,this.adapter.match({none:()=>(To(this,Uu,"f").notify(m.None),Z.Empty),some:o=>o.catchupAndSubscribe(i=>To(this,Uu,"f").notify(m.wrap(i)))}),"f")}))}subscribe(e){return To(this,Uu,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return To(this,Ig,"f").targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>To(this,kg,"f").adapterFor(t,vr)})))}terminate(){To(this,zu,"f").terminate(),To(this,jp,"f").terminate()}};Ig=new WeakMap,kg=new WeakMap,zu=new WeakMap,Uu=new WeakMap,jp=new WeakMap;var Sn=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ae=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Dg,lE,Ro,Jr,wt,ja,ju,Ua,Mg,Lp,Cg,Tg,uE,cE,yi=class{constructor(e,t){Dg.add(this),this.class="device-host",Ro.set(this,new R),Jr.set(this,void 0),wt.set(this,void 0),ja.set(this,void 0),ju.set(this,void 0),Ua.set(this,void 0),Mg.set(this,void 0),Lp.set(this,void 0),Cg.set(this,void 0),Tg.set(this,void 0),Sn(this,Jr,e,"f"),Sn(this,wt,t,"f"),Sn(this,ja,ae(this,Ro,"f").own(new ge(ae(this,Jr,"f"))),"f"),Sn(this,ju,ae(this,Ro,"f").own(new Pg(this,ae(this,Jr,"f").boxAdapters)),"f"),Sn(this,Ua,ae(this,Ro,"f").own(new Eg(ae(this,wt,"f").input.pointerHub,ae(this,Jr,"f").boxAdapters)),"f"),Sn(this,Mg,ae(this,Ro,"f").own(Ot.create(ae(this,wt,"f").midiEffects,o=>ae(this,Jr,"f").boxAdapters.adapterFor(o,se.isMidiEffect),c.MIDIEffectHost)),"f"),Sn(this,Lp,ae(this,Ro,"f").own(Ot.create(ae(this,wt,"f").audioEffects,o=>ae(this,Jr,"f").boxAdapters.adapterFor(o,se.isAudioEffect),c.AudioEffectHost)),"f"),Sn(this,Cg,ae(this,Ro,"f").own(Ot.create(ae(this,wt,"f").auxSends,o=>ae(this,Jr,"f").boxAdapters.adapterFor(o,Vu),c.AuxSend)),"f"),Sn(this,Tg,ae(this,Ro,"f").own(new $g(ae(this,wt,"f").output,ae(this,Jr,"f").boxAdapters)),"f"),this.namedParameter=ae(this,Dg,"m",uE).call(this,t),ae(this,Dg,"m",cE).call(this)}get box(){return ae(this,wt,"f")}get uuid(){return ae(this,wt,"f").address.uuid}get address(){return ae(this,wt,"f").address}get indexField(){return ae(this,wt,"f").index}get type(){return ae(this,wt,"f").type.getValue()}get captureBox(){return ae(this,wt,"f").capture.targetVertex}get tracks(){return ae(this,ju,"f")}get input(){return ae(this,Ua,"f")}get midiEffects(){return ae(this,Mg,"f")}get audioEffects(){return ae(this,Lp,"f")}get inputAdapter(){return ae(this,Ua,"f").getValue()}get auxSends(){return ae(this,Cg,"f")}get output(){return ae(this,Tg,"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 ae(this,wt,"f").output.targetVertex.mapOr(e=>e.box.address.equals(ae(this,Jr,"f").rootBoxAdapter.address),!1)}get midiEffectsField(){return ae(this,wt,"f").midiEffects}get inputField(){return ae(this,wt,"f").input}get audioEffectsField(){return ae(this,wt,"f").audioEffects}get tracksField(){return ae(this,wt,"f").tracks}get minimizedField(){return ae(this,Ua,"f").getValue().unwrap().minimizedField}get isAudioUnit(){return!0}get label(){return ae(this,Ua,"f").getValue().mapOr(e=>e.labelField.getValue(),"")}audioUnitBoxAdapter(){return this}*labeledAudioOutputs(){let e=this.input.getValue();e.nonEmpty()&&(yield*e.unwrap().labeledAudioOutputs());for(let t of ae(this,Lp,"f").adapters())yield*t.labeledAudioOutputs();yield{address:this.address,label:"Channelstrip",children:()=>m.None}}indicesLimit(){let e=ae(this,Jr,"f").rootBoxAdapter.audioUnits.adapters(),t=this.indexField.getValue(),o=this.type,i=t,n=t;for(;i>0&&e[i-1].type===o;)i--;for(;n<e.length-1&&e[n+1].type===o;)n++;return[i,n+1]}move(e){ae(this,Jr,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,t){ae(this,ju,"f").collection.move(e,t)}deleteTrack(e){ae(this,ju,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){ae(this,Ro,"f").terminate()}};lE=yi,Ro=new WeakMap,Jr=new WeakMap,wt=new WeakMap,ja=new WeakMap,ju=new WeakMap,Ua=new WeakMap,Mg=new WeakMap,Lp=new WeakMap,Cg=new WeakMap,Tg=new WeakMap,Dg=new WeakSet,uE=function(e){return{volume:ae(this,ja,"f").createParameter(e.volume,lE.VolumeMapper,E.decible,"volume"),panning:ae(this,ja,"f").createParameter(e.panning,S.bipolar(),E.panning,"panning",.5),mute:ae(this,ja,"f").createParameter(e.mute,S.bool,E.bool,"mute"),solo:ae(this,ja,"f").createParameter(e.solo,S.bool,E.bool,"solo")}},cE=function(){let e=this.address.toString(),t=ae(this,wt,"f").capture.targetAddress.unwrapOrUndefined(),o=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${ae(this,wt,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${t}`;M(this.type!==Nt.Instrument||ae(this,wt,"f").capture.targetAddress.nonEmpty(),o)};yi.VolumeMapper=S.decibel(-96,-9,6);var Lu=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},qe=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Rg,En,yr,La,Og,Vg,Kp,dE,pE,xt=class{constructor(e,t){Rg.add(this),En.set(this,void 0),yr.set(this,void 0),La.set(this,void 0),Og.set(this,void 0),Vg.set(this,void 0),Kp.set(this,void 0),Lu(this,En,e,"f"),Lu(this,yr,t,"f"),Lu(this,La,new R,"f"),Lu(this,Og,qe(this,La,"f").own(new vg(this,e.boxAdapters)),"f"),Lu(this,Vg,qe(this,La,"f").own(new xg(this,e.boxAdapters)),"f"),Lu(this,Kp,qe(this,La,"f").own(new Wr(-1)),"f")}catchupAndSubscribePath(e){let t=[m.None,m.None],o=()=>{t.every(i=>i.nonEmpty())?e(m.wrap(t.map(i=>i.unwrap()))):e(m.None)};return Z.many(qe(this,Rg,"m",dE).call(this,i=>{t[0].equals(i)||(t[0]=i,o())}),qe(this,Rg,"m",pE).call(this,i=>{t[1].equals(i)||(t[1]=i,o())}))}get context(){return qe(this,En,"f")}set targetDeviceName(e){qe(this,yr,"f").target.targetVertex.ifSome(t=>{let o=t.box;if(o instanceof st)return qe(this,En,"f").boxAdapters.adapterFor(o,yi).input.getValue().ifSome(({labelField:n})=>n.setValue(e));if("label"in o&&o.label instanceof C)return o.label.setValue(e)})}get targetDeviceName(){return qe(this,yr,"f").target.targetVertex.flatMap(e=>{let t=e.box;return t instanceof st?qe(this,En,"f").boxAdapters.adapterFor(t,yi).input.label:"label"in t&&t.label instanceof C?m.wrap(t.label.getValue()):m.wrap(t.name)})}terminate(){qe(this,La,"f").terminate()}get audioUnit(){return Ie(qe(this,yr,"f").tracks.targetVertex.unwrap().box,st)}get target(){return qe(this,yr,"f").target}get clips(){return qe(this,Og,"f")}get regions(){return qe(this,Vg,"f")}get enabled(){return qe(this,yr,"f").enabled}get indexField(){return qe(this,yr,"f").index}get type(){return qe(this,yr,"f").type.getValue()}get box(){return qe(this,yr,"f")}get uuid(){return qe(this,yr,"f").address.uuid}get address(){return qe(this,yr,"f").address}get listIndex(){return qe(this,Kp,"f").getValue()}set listIndex(e){qe(this,Kp,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===ne.Audio;case"note-clip":return this.type===ne.Notes;case"value-clip":return this.type===ne.Value;case"audio-region":return this.type===ne.Audio;case"note-region":return this.type===ne.Notes;case"value-region":return this.type===ne.Value}}valueAt(e,t){if(!this.enabled.getValue())return t;let o=t,i=qe(this,En,"f").clipSequencing.iterate(this.uuid,e,e+im);for(let{optClip:n,sectionFrom:s}of i)o=n.match({none:()=>{let a=this.regions.collection.lowerEqual(e,l=>!l.mute);if(a===null){let l=this.regions.collection.optAt(0);return Te(l,An)?l.incomingValue(t):t}else if(Te(a,An))return e<a.complete?a.valueAt(e,t):a.outgoingValue(t);return t},some:a=>s===e&&Te(a,ns)?a.valueAt(e,t):t});return o}};En=new WeakMap,yr=new WeakMap,La=new WeakMap,Og=new WeakMap,Vg=new WeakMap,Kp=new WeakMap,Rg=new WeakSet,dE=function(e){let t=qe(this,yr,"f").target.targetVertex;if(t.nonEmpty()){let o=t.unwrap().box;return o instanceof st?qe(this,En,"f").boxAdapters.adapterFor(o,yi).input.catchupAndSubscribeLabelChange(n=>e(n)):"label"in o&&o.label instanceof C?o.label.catchupAndSubscribe(i=>e(m.wrap(i.getValue()))):(e(m.wrap(o.name)),Z.Empty)}return e(m.None),Z.Empty},pE=function(e){let t=this.type;switch(t){case ne.Audio:case ne.Notes:return e(m.wrap(ne[t])),Z.Empty;case ne.Value:{let o=qe(this,yr,"f").target.targetVertex.unwrap();if(o.isField())e(qe(this,En,"f").parameterFieldAdapters.opt(o.address).map(i=>i.name));else if(o.isBox())e(m.wrap(o.name));else return F("Illegal State. Vertex is not a field nor box.");return Z.Empty}case ne.Undefined:return e(m.wrap("")),Z.Empty;default:return e(m.None),Z.Empty}};var Qt=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},de=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},fs,Qr,ms,Ka,zg,Ug,Wa,Za,gs,vs,Ga,Ku,Wp,hE=[c.Automation,c.Modulation,c.MIDIControl,c.ParameterController],Oa=class{constructor(e,t,o,i,n,s){fs.set(this,void 0),Qr.set(this,void 0),ms.set(this,void 0),Ka.set(this,void 0),zg.set(this,void 0),Ug.set(this,void 0),Wa.set(this,new R),Za.set(this,void 0),gs.set(this,void 0),vs.set(this,m.None),Ga.set(this,m.None),Ku.set(this,null),Wp.set(this,!1),Qt(this,fs,e,"f"),Qt(this,Qr,t,"f"),Qt(this,ms,o,"f"),Qt(this,Ka,i,"f"),Qt(this,zg,n,"f"),Qt(this,Ug,s??0,"f"),de(this,Wa,"f").own(de(this,fs,"f").parameterFieldAdapters.register(this)),Qt(this,Za,de(this,Wa,"f").own(new te),"f"),Qt(this,gs,new Rt,"f"),de(this,Wa,"f").own(de(this,Qr,"f").subscribe(()=>de(this,Za,"f").notify(this))),de(this,Wa,"f").own(de(this,Qr,"f").pointerHub.catchupAndSubscribe({onAdded:a=>{de(this,gs,"f").proxy.onControlSourceAdd(bw(a.pointerType)),a.box.accept({visitTrackBox:l=>{M(de(this,vs,"f").isEmpty(),"Already assigned");let u=de(this,fs,"f").boxAdapters.adapterFor(l,xt);Qt(this,vs,m.wrap(u),"f"),de(this,fs,"f").isMainThread&&Qt(this,Ga,m.wrap(de(this,fs,"f").liveStreamReceiver.subscribeFloat(de(this,Qr,"f").address,d=>{de(this,Ku,"f")!==d&&(Qt(this,Ku,d,"f"),de(this,Za,"f").notify(this))})),"f")}})},onRemoved:a=>{de(this,gs,"f").proxy.onControlSourceRemove(bw(a.pointerType)),a.box.accept({visitTrackBox:l=>{M(de(this,vs,"f").unwrapOrNull()?.address?.equals(l.address)===!0,`Unknown ${l}`),Qt(this,vs,m.None,"f"),de(this,fs,"f").isMainThread&&(de(this,Ga,"f").ifSome(u=>u.terminate()),Qt(this,Ga,m.None,"f"),Qt(this,Ku,null,"f"),de(this,Za,"f").notify(this))}})}},...hE)),t.getValue(),o.clamp(t.getValue())}registerMidiControl(){return de(this,gs,"f").proxy.onControlSourceAdd("midi"),Qt(this,Wp,!0,"f"),{terminate:()=>{Qt(this,Wp,!1,"f"),de(this,gs,"f").proxy.onControlSourceRemove("midi")}}}get field(){return de(this,Qr,"f")}get valueMapping(){return de(this,ms,"f")}get stringMapping(){return de(this,Ka,"f")}get name(){return de(this,zg,"f")}get anchor(){return de(this,Ug,"f")}get type(){return de(this,Qr,"f").type}get address(){return de(this,Qr,"f").address}get track(){return de(this,vs,"f")}valueAt(e){let t=de(this,vs,"f");if(t.nonEmpty()){let o=t.unwrap();if(o.enabled)return this.valueMapping.y(o.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return de(this,Za,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return de(this,Wp,"f")&&e.onControlSourceAdd("midi"),de(this,Qr,"f").pointerHub.filter(...hE).forEach(t=>e.onControlSourceAdd(bw(t.pointerType))),de(this,gs,"f").subscribe(e)}getValue(){return de(this,Qr,"f").getValue()}setValue(e){de(this,Qr,"f").setValue(e)}setUnitValue(e){this.setValue(de(this,ms,"f").y(e))}getUnitValue(){return de(this,ms,"f").x(this.getValue())}getControlledValue(){return de(this,ms,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return de(this,Ku,"f")??this.getUnitValue()}getControlledPrintValue(){return de(this,Ka,"f").x(this.getControlledValue())}getPrintValue(){return de(this,Ka,"f").x(this.getValue())}setPrintValue(e){let t=de(this,Ka,"f").y(e);t.type==="unitValue"?this.setUnitValue(he(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(de(this,ms,"f").clamp(de(this,Qr,"f").initValue))}terminate(){de(this,Ga,"f").ifSome(e=>e.terminate()),Qt(this,Ga,m.None,"f"),de(this,Wa,"f").terminate()}};fs=new WeakMap,Qr=new WeakMap,ms=new WeakMap,Ka=new WeakMap,zg=new WeakMap,Ug=new WeakMap,Wa=new WeakMap,Za=new WeakMap,gs=new WeakMap,vs=new WeakMap,Ga=new WeakMap,Ku=new WeakMap,Wp=new WeakMap;var bw=r=>{switch(r){case c.Automation:return"automated";case c.Modulation:return"modulated";case c.MIDIControl:return"midi";case c.ParameterController:return"external";default:return F(`${r.toString()} is an unknown pointer type`)}};var ww=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Yi=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Bn,qa,jg,Lg=class{constructor(e,t,o){Bn.set(this,void 0),qa.set(this,void 0),jg.set(this,void 0),ww(this,Bn,b.newSet(i=>i.uuid),"f"),ww(this,qa,new Rt,"f"),ww(this,jg,e.catchupAndSubscribe({onAdded:i=>{let n=t(i.box),s=Yi(this,Bn,"f").add(n);M(s,`Could not add ${n}`),Yi(this,qa,"f").proxy.onAdd(n)},onRemoved:i=>{let n=i.box.address.uuid;Yi(this,qa,"f").proxy.onRemove(Yi(this,Bn,"f").removeByKey(n))}},o),"f")}subscribe(e){return Yi(this,qa,"f").subscribe(e)}catchupAndSubscribe(e){return Yi(this,Bn,"f").forEach(t=>e.onAdd(t)),this.subscribe(e)}adapters(){return Yi(this,Bn,"f").values()}size(){return Yi(this,Bn,"f").size()}isEmpty(){return this.size()===0}terminate(){Yi(this,Bn,"f").clear(),Yi(this,qa,"f").terminate(),Yi(this,jg,"f").terminate()}};Bn=new WeakMap,qa=new WeakMap,jg=new WeakMap;var Aw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},zt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},_w,Kg,Zp,xi,Oo,fE,bi=class{constructor(e,t){_w.add(this),this.type="audio-effect",this.accepts="audio",Zp.set(this,void 0),xi.set(this,void 0),Oo.set(this,void 0),Aw(this,Zp,e,"f"),Aw(this,xi,t,"f"),Aw(this,Oo,new ge(zt(this,Zp,"f")),"f"),this.namedParameter=zt(this,_w,"m",fE).call(this,t)}get box(){return zt(this,xi,"f")}get uuid(){return zt(this,xi,"f").address.uuid}get address(){return zt(this,xi,"f").address}get indexField(){return zt(this,xi,"f").index}get labelField(){return zt(this,xi,"f").label}get enabledField(){return zt(this,xi,"f").enabled}get minimizedField(){return zt(this,xi,"f").minimized}get host(){return zt(this,xi,"f").host}deviceHost(){return zt(this,Zp,"f").boxAdapters.adapterFor(zt(this,xi,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){zt(this,Oo,"f").terminate()}};Kg=bi,Zp=new WeakMap,xi=new WeakMap,Oo=new WeakMap,_w=new WeakSet,fE=function(e){return{delay:zt(this,Oo,"f").createParameter(e.delay,S.linearInteger(0,Kg.OffsetFractions.length-1),Kg.OffsetStringMapping,"delay"),feedback:zt(this,Oo,"f").createParameter(e.feedback,S.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:zt(this,Oo,"f").createParameter(e.cross,S.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"cross"),filter:zt(this,Oo,"f").createParameter(e.filter,S.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:zt(this,Oo,"f").createParameter(e.dry,S.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"dry"),wet:zt(this,Oo,"f").createParameter(e.wet,S.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"wet")}};bi.OffsetFractions=hr.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();bi.OffsetStringMapping=E.indices("",Kg.OffsetFractions.map(([r,e])=>`${r}/${e}`));var Pw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ut=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Sw,Gp,wi,Vo,mE,Wu=class{constructor(e,t){Sw.add(this),this.type="audio-effect",this.accepts="audio",Gp.set(this,void 0),wi.set(this,void 0),Vo.set(this,void 0),Pw(this,Gp,e,"f"),Pw(this,wi,t,"f"),Pw(this,Vo,new ge(Ut(this,Gp,"f")),"f"),this.namedParameter=Ut(this,Sw,"m",mE).call(this,t)}get box(){return Ut(this,wi,"f")}get uuid(){return Ut(this,wi,"f").address.uuid}get address(){return Ut(this,wi,"f").address}get indexField(){return Ut(this,wi,"f").index}get labelField(){return Ut(this,wi,"f").label}get enabledField(){return Ut(this,wi,"f").enabled}get minimizedField(){return Ut(this,wi,"f").minimized}get host(){return Ut(this,wi,"f").host}deviceHost(){return Ut(this,Gp,"f").boxAdapters.adapterFor(Ut(this,wi,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Ut(this,Vo,"f").terminate()}};Gp=new WeakMap,wi=new WeakMap,Vo=new WeakMap,Sw=new WeakSet,mE=function(e){return{decay:Ut(this,Vo,"f").createParameter(e.decay,S.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:Ut(this,Vo,"f").createParameter(e.preDelay,S.exponential(.001,.5),E.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:Ut(this,Vo,"f").createParameter(e.damp,S.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"damping"),filter:Ut(this,Vo,"f").createParameter(e.filter,S.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"filter"),dry:Ut(this,Vo,"f").createParameter(e.dry,S.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"dry"),wet:Ut(this,Vo,"f").createParameter(e.wet,S.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"wet")}};var Ew=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},St=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Fw,qp,Xr,eo,yE,Zu=class{constructor(e,t){Fw.add(this),this.type="audio-effect",this.accepts="audio",qp.set(this,void 0),Xr.set(this,void 0),eo.set(this,void 0),Ew(this,qp,e,"f"),Ew(this,Xr,t,"f"),Ew(this,eo,new ge(St(this,qp,"f")),"f"),this.namedParameter=St(this,Fw,"m",yE).call(this,t)}get box(){return St(this,Xr,"f")}get uuid(){return St(this,Xr,"f").address.uuid}get address(){return St(this,Xr,"f").address}get indexField(){return St(this,Xr,"f").index}get labelField(){return St(this,Xr,"f").label}get enabledField(){return St(this,Xr,"f").enabled}get minimizedField(){return St(this,Xr,"f").minimized}get host(){return St(this,Xr,"f").host}get spectrum(){return St(this,Xr,"f").address.append(4095)}deviceHost(){return St(this,qp,"f").boxAdapters.adapterFor(St(this,Xr,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){St(this,eo,"f").terminate()}};qp=new WeakMap,Xr=new WeakMap,eo=new WeakMap,Fw=new WeakSet,yE=function(e){return{highPass:gE(St(this,eo,"f"),e.highPass,"High-Pass"),lowShelf:vE(St(this,eo,"f"),e.lowShelf,"Low-Shelf"),lowBell:Bw(St(this,eo,"f"),e.lowBell,"Low-Bell"),midBell:Bw(St(this,eo,"f"),e.midBell,"Mid-Bell"),highBell:Bw(St(this,eo,"f"),e.highBell,"High-Bell"),highShelf:vE(St(this,eo,"f"),e.highShelf,"High-Shelf"),lowPass:gE(St(this,eo,"f"),e.lowPass,"Low-Pass")}};var Nw=S.exponential(20,2e4),xE=S.linear(-24,24),bE=S.exponential(.01,10),gE=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,E.bool,"enabled"),frequency:r.createParameter(e.frequency,Nw,E.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),order:r.createParameter(e.order,S.linearInteger(0,3),E.indices("db",["12","24","36","48"]),`${t} Order`),q:r.createParameter(e.q,bE,E.numeric({fractionDigits:3}),`${t} Q`)}),vE=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,E.bool,"enabled"),frequency:r.createParameter(e.frequency,Nw,E.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,xE,E.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5)}),Bw=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,E.bool,"enabled"),frequency:r.createParameter(e.frequency,Nw,E.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,xE,E.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5),q:r.createParameter(e.q,bE,E.numeric({fractionDigits:3}),`${t} Q`)});var wE=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},kr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Wg,Zg,$r,ys=class{constructor(e,t){this.type="marker-event",Wg.set(this,new R),Zg.set(this,void 0),$r.set(this,void 0),wE(this,Zg,e,"f"),wE(this,$r,t,"f"),kr(this,Wg,"f").own(kr(this,$r,"f").subscribe(Se.Children,o=>{if(!this.trackAdapter.isEmpty()&&(o.type==="primitive"||o.type==="pointer")){let i=this.trackAdapter.unwrap();kr(this,$r,"f").position.address.equals(o.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return kr(this,$r,"f")}get uuid(){return kr(this,$r,"f").address.uuid}get address(){return kr(this,$r,"f").address}get position(){return kr(this,$r,"f").position.getValue()}get plays(){return kr(this,$r,"f").plays.getValue()}get hue(){return kr(this,$r,"f").hue.getValue()}get label(){return kr(this,$r,"f").label.getValue()}get trackAdapter(){return kr(this,$r,"f").track.targetVertex.map(e=>kr(this,Zg,"f").boxAdapters.adapterFor(e.box,Ai).markerTrack)}terminate(){kr(this,Wg,"f").terminate()}toString(){return`{MarkerBoxAdapter ${b.toString(kr(this,$r,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};Wg=new WeakMap,Zg=new WeakMap,$r=new WeakMap;ys.Comparator=(r,e)=>r.position-e.position;var Hp=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},_i=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Jp,Gu,Qp,Ha,Gg,qg=class{constructor(e,t){Jp.set(this,void 0),Gu.set(this,void 0),Qp.set(this,void 0),Ha.set(this,void 0),Gg.set(this,void 0),Hp(this,Jp,e,"f"),Hp(this,Gu,t,"f"),this.changeNotifier=new te,Hp(this,Qp,b.newSet(o=>o.uuid),"f"),Hp(this,Ha,Fr.create(ys.Comparator),"f"),Hp(this,Gg,_i(this,Gu,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:o})=>{if(o instanceof Jl){let i=_i(this,Jp,"f").boxAdapters.adapterFor(o,ys),n=_i(this,Qp,"f").add(i);M(n,"Could not add adapter"),_i(this,Ha,"f").add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:o}}})=>{_i(this,Ha,"f").remove(_i(this,Qp,"f").removeByKey(o)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return _i(this,Jp,"f")}get enabled(){return _i(this,Gu,"f").enabled.getValue()}get events(){return _i(this,Ha,"f")}get object(){return _i(this,Gu,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){_i(this,Ha,"f").onIndexingChanged(),this.dispatchChange()}terminate(){_i(this,Gg,"f").terminate()}};Jp=new WeakMap,Gu=new WeakMap,Qp=new WeakMap,Ha=new WeakMap,Gg=new WeakMap;var AE=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Yr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Hg,Jg,ei,Ja=class{constructor(e,t){this.type="signature-event",Hg.set(this,new R),Jg.set(this,void 0),ei.set(this,void 0),AE(this,Jg,e,"f"),AE(this,ei,t,"f"),Yr(this,Hg,"f").own(Yr(this,ei,"f").subscribe(Se.Children,o=>this.trackAdapter.ifSome(i=>i.dispatchChange())))}get box(){return Yr(this,ei,"f")}get uuid(){return Yr(this,ei,"f").address.uuid}get address(){return Yr(this,ei,"f").address}get index(){return Yr(this,ei,"f").index.getValue()}get indexField(){return Yr(this,ei,"f").index}get relativePosition(){return Yr(this,ei,"f").relativePosition.getValue()}get nominator(){return Yr(this,ei,"f").nominator.getValue()}get denominator(){return Yr(this,ei,"f").denominator.getValue()}get trackAdapter(){return Yr(this,ei,"f").events.targetVertex.map(e=>Yr(this,Jg,"f").boxAdapters.adapterFor(e.box,Ai).signatureTrack)}terminate(){Yr(this,Hg,"f").terminate()}toString(){return`{SignatureEventBoxAdapter ${this.nominator}/${this.denominator}}`}};Hg=new WeakMap,Jg=new WeakMap,ei=new WeakMap;Ja.Comparator=(r,e)=>r.index-e.index;var Qg=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},dt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Qa,Xp,Yp,Xa,Fn,Ya,_E,eh,Xg=class{constructor(e,t,o){Qa.add(this),Xp.set(this,new R),Yp.set(this,void 0),Xa.set(this,void 0),Fn.set(this,void 0),Ya.set(this,void 0),Qg(this,Yp,e,"f"),Qg(this,Xa,t,"f"),Qg(this,Fn,o,"f"),this.changeNotifier=new te,Qg(this,Ya,dt(this,Xp,"f").own(Ot.create(dt(this,Fn,"f").events,i=>e.boxAdapters.adapterFor(i,Ja),c.SignatureAutomation)),"f"),dt(this,Xp,"f").ownAll(dt(this,Xa,"f").subscribe(()=>this.dispatchChange()),dt(this,Fn,"f").enabled.subscribe(()=>this.dispatchChange()),dt(this,Ya,"f").subscribe({onAdd:i=>this.changeNotifier.notify(),onRemove:i=>this.changeNotifier.notify(),onReorder:i=>this.changeNotifier.notify()}))}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return dt(this,Yp,"f")}get enabled(){return dt(this,Fn,"f").enabled.getValue()}get object(){return dt(this,Fn,"f")}get size(){return dt(this,Ya,"f").size()}get storageSignature(){let{nominator:e,denominator:t}=dt(this,Xa,"f");return[e.getValue(),t.getValue()]}dispatchChange(){this.changeNotifier.notify()}signatureAt(e){e=Math.max(0,e);let t=this.storageSignature;for(let{accumulatedPpqn:o,nominator:i,denominator:n}of this.iterateAll()){if(o>e)break;t=[i,n]}return t}*iterateAll(){let e=0,t=0,[o,i]=this.storageSignature;if(yield{index:-1,accumulatedPpqn:e,accumulatedBars:t,nominator:o,denominator:i},!!dt(this,Fn,"f").enabled.getValue())for(let n of dt(this,Ya,"f").adapters())e+=q.fromSignature(o,i)*n.relativePosition,t+=n.relativePosition,o=n.nominator,i=n.denominator,yield{index:n.index,accumulatedPpqn:e,accumulatedBars:t,nominator:o,denominator:i}}changeSignature(e,t){let o=Array.from(this.iterateAll()).slice(1),i=o.map(l=>l.accumulatedPpqn);dt(this,Xa,"f").nominator.setValue(e),dt(this,Xa,"f").denominator.setValue(t);let n=0,s=0,a=q.fromSignature(e,t);for(let l=0;l<o.length;l++){let u=o[l],d=this.adapterAt(u.index);if(d.isEmpty())continue;let h=(i[l]-n)/a,g=Math.floor(h),v=h-g;s+=v;let y=g;s>=1&&(y++,s--),y=Math.max(1,y),d.unwrap().box.relativePosition.setValue(y),n+=y*a,a=q.fromSignature(u.nominator,u.denominator)}}deleteAdapter(e){let t=e.index,o=Array.from(this.iterateAll()).slice(1),i=o.findIndex(g=>g.index===t);if(i===-1)return;let n=o.slice(i+1),s=n.map(g=>g.accumulatedPpqn),a=i>0?o[i-1]:null,[l,u]=a!==null?[a.nominator,a.denominator]:this.storageSignature,d=a!==null?a.accumulatedPpqn:0;e.box.delete();let p=d,h=q.fromSignature(l,u);for(let g=0;g<n.length;g++){let v=n[g],y=this.adapterAt(v.index);if(y.isEmpty())continue;let $=(s[g]-p)/h,D=Math.max(1,Math.round($));y.unwrap().box.relativePosition.setValue(D),p+=D*h,h=q.fromSignature(v.nominator,v.denominator)}}createEvent(e,t,o){let i=Array.from(this.iterateAll()),n=i[0],s=0;for(let y=1;y<i.length&&!(i[y].accumulatedPpqn>e);y++)n=i[y],s=y;let a=q.fromSignature(n.nominator,n.denominator),l=(e-n.accumulatedPpqn)/a,u=Math.max(1,Math.round(l)),d=n.index+1,p=i.slice(s+1),h=n.accumulatedPpqn+u*a,g=q.fromSignature(t,o),v=p.map(y=>({event:y,adapter:this.adapterAt(y.index)})).filter(({adapter:y})=>y.nonEmpty()).map(({event:y,adapter:x})=>({event:y,adapter:x.unwrap()}));for(let y=0;y<v.length;y++){let{event:x,adapter:$}=v[y];if($.box.index.setValue(x.index+1),y===0){let D=(x.accumulatedPpqn-h)/g;$.box.relativePosition.setValue(Math.max(1,Math.round(D)))}}Wl.create(dt(this,Yp,"f").boxGraph,b.generate(),y=>{y.index.setValue(d),y.relativePosition.setValue(u),y.nominator.setValue(t),y.denominator.setValue(o),y.events.refer(dt(this,Fn,"f").events)})}adapterAt(e){return dt(this,Ya,"f").getAdapterByIndex(e)}moveEvent(e,t){let o=Array.from(this.iterateAll()).slice(1),i=o.findIndex(h=>h.index===e.index);if(i===-1)return;let n=o[i];if(t===n.accumulatedPpqn)return;let s=o.map(h=>h.accumulatedBars),a=dt(this,Qa,"m",_E).call(this,t,n.index);if(a===n.accumulatedBars)return;let l=[...s];l[i]=a;let u=l.map((h,g)=>({bar:h,i:g})).sort((h,g)=>h.bar-g.bar).map(h=>h.i),d=o.map(h=>this.adapterAt(h.index).unwrap());for(let h=0;h<u.length;h++)d[u[h]].box.index.setValue(h);let p=0;for(let h=0;h<u.length;h++){let g=u[h],v=d[g],y=l[g],x=Math.max(1,y-p);v.box.relativePosition.setValue(x),p=y}}floorToBar(e){let{event:t,barPpqn:o}=dt(this,Qa,"m",eh).call(this,e),i=Math.floor((e-t.accumulatedPpqn)/o);return t.accumulatedPpqn+i*o}ceilToBar(e){let{event:t,barPpqn:o}=dt(this,Qa,"m",eh).call(this,e),i=Math.ceil((e-t.accumulatedPpqn)/o);return t.accumulatedPpqn+i*o}roundToBar(e){let{event:t,barPpqn:o}=dt(this,Qa,"m",eh).call(this,e),i=Math.round((e-t.accumulatedPpqn)/o);return t.accumulatedPpqn+i*o}barLengthAt(e){let[t,o]=this.signatureAt(e);return q.fromSignature(t,o)}getBarInterval(e){let{event:t,barPpqn:o}=dt(this,Qa,"m",eh).call(this,e),i=Math.floor((e-t.accumulatedPpqn)/o),n=t.accumulatedPpqn+i*o;return{position:n,complete:n+o}}terminate(){dt(this,Xp,"f").terminate()}};Xp=new WeakMap,Yp=new WeakMap,Xa=new WeakMap,Fn=new WeakMap,Ya=new WeakMap,Qa=new WeakSet,_E=function(e,t){let o=null;for(let s of this.iterateAll())if(s.index!==t){if(s.accumulatedPpqn>e)break;o=s}if(mo(o)){let[s,a]=this.storageSignature,l=q.fromSignature(s,a);return Math.max(1,Math.round(e/l))}let i=q.fromSignature(o.nominator,o.denominator),n=Math.round((e-o.accumulatedPpqn)/i);return Math.max(1,o.accumulatedBars+n)},eh=function(e){let t=null;for(let o of this.iterateAll()){if(o.accumulatedPpqn>e)break;t=o}if(mo(t)){let[o,i]=this.storageSignature;return{event:{index:-1,accumulatedPpqn:0,accumulatedBars:0,nominator:o,denominator:i},barPpqn:q.fromSignature(o,i)}}return{event:t,barPpqn:q.fromSignature(t.nominator,t.denominator)}};var th=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},At=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},rh,zo,Yg,ev,Nn,ih,tv,Ai=class{constructor(e,t){rh.set(this,new R),zo.set(this,void 0),Yg.set(this,void 0),ev.set(this,void 0),Nn.set(this,void 0),ih.set(this,void 0),tv.set(this,()=>{let{tempoTrack:{enabled:a}}=At(this,zo,"f");return a.getValue()?At(this,Nn,"f").isEmpty()?m.None:At(this,Nn,"f").unwrap().events.isEmpty()?m.None:At(this,Nn,"f"):m.None}),th(this,zo,t,"f"),th(this,Yg,new qg(e,t.markerTrack),"f"),th(this,ev,new Xg(e,t.signature,t.signatureTrack),"f"),th(this,Nn,new Br,"f"),th(this,ih,new te,"f");let o=At(this,rh,"f").own(new R),i=()=>At(this,ih,"f").notify(At(this,tv,"f").call(this)),{tempoTrack:{events:n,enabled:s}}=t;At(this,rh,"f").own(n.catchupAndSubscribe(({targetVertex:a})=>{o.terminate(),a.match({none:()=>At(this,Nn,"f").clear(),some:({box:l})=>{let u=e.boxAdapters.adapterFor(l,qt);At(this,Nn,"f").wrap(u),o.ownAll(u.subscribeChange(i),s.subscribe(i))}})}))}catchupAndSubscribeTempoAutomation(e){return e(At(this,tv,"f").call(this)),At(this,ih,"f").subscribe(e)}get box(){return At(this,zo,"f")}get uuid(){return At(this,zo,"f").address.uuid}get address(){return At(this,zo,"f").address}get markerTrack(){return At(this,Yg,"f")}get signatureTrack(){return At(this,ev,"f")}get tempoTrackEvents(){return At(this,Nn,"f")}get signature(){let{nominator:e,denominator:t}=At(this,zo,"f").signature;return[e.getValue(),t.getValue()]}get signatureDuration(){let{nominator:e,denominator:t}=At(this,zo,"f").signature;return q.fromSignature(e.getValue(),t.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),At(this,zo,"f").signature.subscribe(()=>e(this.signature))}terminate(){At(this,rh,"f").terminate()}};rh=new WeakMap,zo=new WeakMap,Yg=new WeakMap,ev=new WeakMap,Nn=new WeakMap,ih=new WeakMap,tv=new WeakMap;var xI=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},oh=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},xs,bs=class{constructor(e,t){xs.set(this,void 0),xI(this,xs,t,"f")}get box(){return oh(this,xs,"f")}get uuid(){return oh(this,xs,"f").address.uuid}get address(){return oh(this,xs,"f").address}get source(){return oh(this,xs,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return oh(this,xs,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};xs=new WeakMap;var el=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Pi=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},rv,tl,rl,iv,ov,nh,Si=class{constructor(e,t){rv.set(this,void 0),tl.set(this,void 0),rl.set(this,void 0),iv.set(this,void 0),ov.set(this,void 0),nh.set(this,!1),el(this,rv,e,"f"),el(this,tl,t,"f"),el(this,rl,new R,"f"),el(this,iv,t.attributes,"f"),el(this,ov,Pi(this,rl,"f").own(new ge(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return Pi(this,rl,"f").own(e)}ownAll(...e){Pi(this,rl,"f").ownAll(...e)}onSelected(){el(this,nh,!0,"f")}onDeselected(){el(this,nh,!1,"f")}isSelected(){return Pi(this,nh,"f")}get box(){return Pi(this,tl,"f")}get attributes(){return Pi(this,iv,"f")}get uuid(){return Pi(this,tl,"f").address.uuid}get address(){return Pi(this,tl,"f").address}get parameters(){return Pi(this,ov,"f")}get modular(){return Pi(this,rv,"f").boxAdapters.adapterFor(Pi(this,tl,"f").attributes.collection.targetVertex.unwrap().box,ws)}terminate(){Pi(this,rl,"f").terminate()}};rv=new WeakMap,tl=new WeakMap,rl=new WeakMap,iv=new WeakMap,ov=new WeakMap,nh=new WeakMap;var nv=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},In=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},sv,As,sh,av,ir;(function(r){r.Input="input",r.Output="output"})(ir||(ir={}));var or=class r{static create(e,t,o,i){return new r(e,t,o,i??t.fieldName)}constructor(e,t,o,i){sv.set(this,void 0),As.set(this,void 0),sh.set(this,void 0),av.set(this,void 0),nv(this,sv,e,"f"),nv(this,As,t,"f"),nv(this,sh,o,"f"),nv(this,av,i,"f")}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(t=>e.field.pointerRules.accepts.some(o=>o===t))}get connections(){return In(this,As,"f").pointerHub.isEmpty()?T.empty():In(this,As,"f").pointerHub.filter(c.VoltageConnection).map(({box:e})=>In(this,sv,"f").adapterFor(e,bs))}get field(){return In(this,As,"f")}get address(){return In(this,As,"f").address}get direction(){return In(this,sh,"f")}get name(){return In(this,av,"f")}toString(){return`{ModuleConnectorAdapter address: ${In(this,As,"f").address.toString()}, direction: ${In(this,sh,"f")}}`}};sv=new WeakMap,As=new WeakMap,sh=new WeakMap,av=new WeakMap;var Iw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ah=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},lv,lh,uh,qu=class extends Si{constructor(e,t){super(e,t),lv.set(this,void 0),lh.set(this,void 0),uh.set(this,void 0),Iw(this,lv,this.parameters.createParameter(t.time,S.exponential(1,1e4),E.numeric({unit:"ms"}),"Time"),"f"),Iw(this,lh,or.create(e.boxAdapters,t.voltageInput,ir.Input,"Input"),"f"),Iw(this,uh,or.create(e.boxAdapters,t.voltageOutput,ir.Output,"Output"),"f")}get parameterTime(){return ah(this,lv,"f")}get voltageInput(){return ah(this,lh,"f")}get voltageOutput(){return ah(this,uh,"f")}get inputs(){return[ah(this,lh,"f")]}get outputs(){return[ah(this,uh,"f")]}};lv=new WeakMap,lh=new WeakMap,uh=new WeakMap;var bI=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},PE=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},ch,Hu=class extends Si{constructor(e,t){super(e,t),ch.set(this,void 0),bI(this,ch,or.create(e.boxAdapters,t.input,ir.Input,"Input"),"f")}get voltageInput(){return PE(this,ch,"f")}get inputs(){return[PE(this,ch,"f")]}get outputs(){return T.empty()}};ch=new WeakMap;var kw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},dh=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},uv,ph,hh,Ju=class extends Si{constructor(e,t){super(e,t),uv.set(this,void 0),ph.set(this,void 0),hh.set(this,void 0),kw(this,uv,this.parameters.createParameter(t.gain,S.DefaultDecibel,E.numeric({unit:"db"}),"Gain"),"f"),kw(this,ph,or.create(e.boxAdapters,t.voltageInput,ir.Input,"Input"),"f"),kw(this,hh,or.create(e.boxAdapters,t.voltageOutput,ir.Output,"Output"),"f")}get parameterGain(){return dh(this,uv,"f")}get voltageInput(){return dh(this,ph,"f")}get voltageOutput(){return dh(this,hh,"f")}get inputs(){return[dh(this,ph,"f")]}get outputs(){return[dh(this,hh,"f")]}};uv=new WeakMap,ph=new WeakMap,hh=new WeakMap;var $w=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Dw=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},cv,dv,pv,Qu=class extends Si{constructor(e,t){super(e,t),cv.set(this,void 0),dv.set(this,void 0),pv.set(this,void 0),$w(this,cv,or.create(e.boxAdapters,t.voltageInputX,ir.Input,"X"),"f"),$w(this,dv,or.create(e.boxAdapters,t.voltageInputY,ir.Input,"Y"),"f"),$w(this,pv,or.create(e.boxAdapters,t.voltageOutput,ir.Output,"Result"),"f")}get inputs(){return[Dw(this,cv,"f"),Dw(this,dv,"f")]}get outputs(){return[Dw(this,pv,"f")]}};cv=new WeakMap,dv=new WeakMap,pv=new WeakMap;var wI=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},SE=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},fh,Xu=class extends Si{constructor(e,t){super(e,t),fh.set(this,void 0),wI(this,fh,or.create(e.boxAdapters,t.output,ir.Output,"Output"),"f")}get voltageOutput(){return SE(this,fh,"f")}get inputs(){return T.empty()}get outputs(){return[SE(this,fh,"f")]}};fh=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)=>oe(t.accept({visitModuleGainBox:o=>e.adapterFor(o,Ju),visitModuleDelayBox:o=>e.adapterFor(o,qu),visitModuleMultiplierBox:o=>e.adapterFor(o,Qu),visitModularAudioInputBox:o=>e.adapterFor(o,Xu),visitModularAudioOutputBox:o=>e.adapterFor(o,Hu)}),`Could not find ModuleAdapter for ${t.name}`)})(Yu||(Yu={}));var EE=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},il=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},hv,fv,ol,Mw,ec=class{constructor(e,t){hv.add(this),fv.set(this,void 0),ol.set(this,void 0),EE(this,fv,e,"f"),EE(this,ol,t,"f")}get box(){return il(this,ol,"f")}get uuid(){return il(this,ol,"f").address.uuid}get address(){return il(this,ol,"f").address}get moduleAdapter(){return Yu.adapterFor(il(this,fv,"f").boxAdapters,il(this,hv,"a",Mw).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(il(this,hv,"a",Mw).address)}terminate(){}};fv=new WeakMap,ol=new WeakMap,hv=new WeakSet,Mw=function(){return il(this,ol,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var BE=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Dr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},tc,Mr,_s=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",tc.set(this,void 0),Mr.set(this,void 0),BE(this,tc,e,"f"),BE(this,Mr,t,"f")}get box(){return Dr(this,Mr,"f")}get uuid(){return Dr(this,Mr,"f").address.uuid}get address(){return Dr(this,Mr,"f").address}get indexField(){return Dr(this,Mr,"f").index}get labelField(){return Dr(this,Mr,"f").label}get enabledField(){return Dr(this,Mr,"f").enabled}get minimizedField(){return Dr(this,Mr,"f").minimized}get host(){return Dr(this,Mr,"f").host}parameterAt(e){return F("Not yet implemented")}deviceHost(){return Dr(this,tc,"f").boxAdapters.adapterFor(Dr(this,Mr,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return Dr(this,tc,"f").boxAdapters.adapterFor(Dr(this,Mr,"f").modularSetup.targetVertex.unwrap("No Modular found").box,ws)}elements(){return Dr(this,Mr,"f").userInterface.elements.pointerHub.filter(c.DeviceUserInterface).map(e=>Dr(this,tc,"f").boxAdapters.adapterFor(e.box,ec))}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){}};tc=new WeakMap,Mr=new WeakMap;var mh=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ue=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},rc,Ps,ic,ti,nl,sl,ws=class{constructor(e,t){rc.set(this,new R),Ps.set(this,void 0),ic.set(this,void 0),ti.set(this,void 0),nl.set(this,void 0),sl.set(this,void 0),mh(this,ic,e,"f"),mh(this,ti,t,"f"),mh(this,Ps,Ue(this,rc,"f").own(new Rt),"f"),mh(this,nl,b.newSet(a=>a.uuid),"f"),mh(this,sl,b.newSet(a=>a.uuid),"f");let o=a=>{let l=Yu.adapterFor(Ue(this,ic,"f").boxAdapters,a.box);Ue(this,nl,"f").add(l)&&Ue(this,Ps,"f").proxy.onModuleAdded(l)},i=a=>Ue(this,Ps,"f").proxy.onModuleRemoved(Ue(this,nl,"f").removeByKey(a.address.uuid)),n=a=>{let l=Ue(this,ic,"f").boxAdapters.adapterFor(a.box,bs);Ue(this,sl,"f").add(l)&&Ue(this,Ps,"f").proxy.onConnectionAdded(l)},s=a=>Ue(this,Ps,"f").proxy.onConnectionRemoved(Ue(this,sl,"f").removeByKey(a.address.uuid));Ue(this,ti,"f").modules.pointerHub.filter(c.ModuleCollection).forEach(o),Ue(this,ti,"f").connections.pointerHub.filter(c.ConnectionCollection).forEach(n),Ue(this,rc,"f").own(Ue(this,ti,"f").modules.pointerHub.subscribe({onAdded:o,onRemoved:i},c.ModuleCollection)),Ue(this,rc,"f").own(Ue(this,ti,"f").connections.pointerHub.subscribe({onAdded:n,onRemoved:s},c.ConnectionCollection))}catchupAndSubscribe(e){return Hb(e.onModuleAdded,t=>Ue(this,nl,"f").forEach(o=>t(o))),Hb(e.onConnectionAdded,t=>Ue(this,sl,"f").forEach(o=>t(o))),Ue(this,Ps,"f").subscribe(e)}get box(){return Ue(this,ti,"f")}get address(){return Ue(this,ti,"f").address}get uuid(){return Ue(this,ti,"f").address.uuid}get editingField(){return Ue(this,ti,"f").editing}get labelField(){return Ue(this,ti,"f").label}get modules(){return Ue(this,nl,"f").values()}get connections(){return Ue(this,sl,"f").values()}get device(){return Ue(this,ic,"f").boxAdapters.adapterFor(oe(Ue(this,ti,"f").device.pointerHub.incoming().at(0),"No device found").box,_s)}terminate(){console.debug(`terminate ${this}`),Ue(this,rc,"f").terminate()}};rc=new WeakMap,Ps=new WeakMap,ic=new WeakMap,ti=new WeakMap,nl=new WeakMap,sl=new WeakMap;var gh=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},xr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Cw,nc,vh,mv,oc,xh,gv,yh,vv,FE,Uo=class{constructor(e,t){Cw.add(this),this.type="groove-adapter",vh.set(this,new R),mv.set(this,void 0),oc.set(this,void 0),xh.set(this,void 0),gv.set(this,new Qf({duration:()=>xr(this,vv,"f"),fx:o=>Yb(o,xr(this,yh,"f")),fy:o=>Yb(o,1-xr(this,yh,"f"))})),yh.set(this,0),vv.set(this,q.SemiQuaver*2),gh(this,mv,e,"f"),gh(this,oc,t,"f"),gh(this,xh,xr(this,vh,"f").own(new ge(xr(this,mv,"f"))),"f"),this.namedParameter=xr(this,Cw,"m",FE).call(this,t),xr(this,vh,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(o=>gh(this,vv,o.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(o=>gh(this,yh,TS(o.getValue(),.01),"f")))}unwarp(e){return xr(this,gv,"f").unwarp(e)}warp(e){return xr(this,gv,"f").warp(e)}get box(){return xr(this,oc,"f")}get uuid(){return xr(this,oc,"f").address.uuid}get address(){return xr(this,oc,"f").address}terminate(){xr(this,vh,"f").terminate()}};nc=Uo,vh=new WeakMap,mv=new WeakMap,oc=new WeakMap,xh=new WeakMap,gv=new WeakMap,yh=new WeakMap,vv=new WeakMap,Cw=new WeakSet,FE=function(e){return{duration:xr(this,xh,"f").createParameter(e.duration,S.values(nc.DurationPPQNs),E.values("",nc.DurationPPQNs,nc.DurationStrings),"duration"),amount:xr(this,xh,"f").createParameter(e.amount,S.unipolar(),E.percent({fractionDigits:0}),"amount")}};Uo.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];Uo.DurationPPQNs=nc.Durations.map(([r,e])=>q.fromSignature(r,e));Uo.DurationStrings=nc.Durations.map(([r,e])=>`${r}/${e}`);var sc=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},gt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},jo,Ss,ac,yv,xv,bh,wh,Tw,Es=class{constructor(e,t,o,i,n){jo.set(this,void 0),Ss.set(this,void 0),ac.set(this,void 0),yv.set(this,void 0),xv.set(this,void 0),bh.set(this,new R),wh.set(this,void 0),Tw.set(this,m.None),sc(this,jo,e,"f"),sc(this,Ss,t,"f"),sc(this,ac,o,"f"),sc(this,yv,i,"f"),sc(this,xv,n??0,"f"),sc(this,wh,gt(this,bh,"f").own(new te),"f"),gt(this,bh,"f").own(gt(this,jo,"f").subscribe(()=>gt(this,wh,"f").notify(this))),e.getValue(),t.clamp(e.getValue())}get field(){return gt(this,jo,"f")}get valueMapping(){return gt(this,Ss,"f")}get stringMapping(){return gt(this,ac,"f")}get name(){return gt(this,yv,"f")}get anchor(){return gt(this,xv,"f")}get type(){return gt(this,jo,"f").type}get address(){return gt(this,jo,"f").address}get track(){return gt(this,Tw,"f")}subscribe(e){return gt(this,wh,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return gt(this,jo,"f").getValue()}setValue(e){gt(this,jo,"f").setValue(gt(this,Ss,"f").clamp(e))}setUnitValue(e){this.setValue(gt(this,Ss,"f").y(e))}getUnitValue(){return gt(this,Ss,"f").x(this.getValue())}getPrintValue(){return gt(this,ac,"f").x(this.getValue())}setPrintValue(e){let t=gt(this,ac,"f").y(e);t.type==="unitValue"?this.setUnitValue(he(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(gt(this,Ss,"f").clamp(gt(this,jo,"f").initValue))}terminate(){gt(this,bh,"f").terminate()}};jo=new WeakMap,Ss=new WeakMap,ac=new WeakMap,yv=new WeakMap,xv=new WeakMap,bh=new WeakMap,wh=new WeakMap,Tw=new WeakMap;var lc=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ei=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Lo,bv,wv,Av,_v,Pv,Sv=class{constructor(e){Lo.set(this,void 0),bv.set(this,void 0),wv.set(this,void 0),Av.set(this,void 0),_v.set(this,void 0),Pv.set(this,void 0),lc(this,Lo,e,"f"),lc(this,bv,new Es(Ei(this,Lo,"f").keyboard,S.values([88,76,61,49]),E.numeric({fractionDigits:1}),"Keyboard Type"),"f"),lc(this,wv,new Es(Ei(this,Lo,"f").timeRangeInQuarters,S.exponential(1,64),E.numeric({fractionDigits:1}),"Time-Range"),"f"),lc(this,Av,new Es(Ei(this,Lo,"f").noteScale,S.exponential(.5,2),E.numeric({fractionDigits:1}),"Note Scale"),"f"),lc(this,_v,new Es(Ei(this,Lo,"f").noteLabels,S.bool,E.bool,"Note Labels"),"f"),lc(this,Pv,new Es(Ei(this,Lo,"f").transpose,S.linearInteger(-48,48),E.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return Ei(this,Lo,"f").box.subscribe(Se.Children,()=>e(this))}get object(){return Ei(this,Lo,"f")}get keyboard(){return Ei(this,bv,"f")}get timeRangeInQuarters(){return Ei(this,wv,"f")}get noteScale(){return Ei(this,Av,"f")}get noteLabels(){return Ei(this,_v,"f")}get transpose(){return Ei(this,Pv,"f")}};Lo=new WeakMap,bv=new WeakMap,wv=new WeakMap,Av=new WeakMap,_v=new WeakMap,Pv=new WeakMap;var Ah=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Dt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},al,ri,ll,Ev,Bv,uc=class{constructor(e,t){al.set(this,void 0),ri.set(this,void 0),ll.set(this,void 0),Ev.set(this,void 0),Bv.set(this,void 0),Ah(this,al,e,"f"),Ah(this,ri,t,"f"),Ah(this,ll,Ot.create(Dt(this,ri,"f").audioUnits,o=>Dt(this,al,"f").boxAdapters.adapterFor(o,yi),c.AudioUnits),"f"),Ah(this,Ev,new Lg(Dt(this,ri,"f").audioBusses.pointerHub,o=>Dt(this,al,"f").boxAdapters.adapterFor(o,vr),c.AudioBusses),"f"),Ah(this,Bv,new Sv(Dt(this,ri,"f").pianoMode),"f")}get uuid(){return Dt(this,ri,"f").address.uuid}get address(){return Dt(this,ri,"f").address}get box(){return Dt(this,ri,"f")}get audioBusses(){return Dt(this,Ev,"f")}get audioUnits(){return Dt(this,ll,"f")}get clips(){return Dt(this,ll,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return Dt(this,al,"f").boxAdapters.adapterFor(Dt(this,ri,"f").groove.targetVertex.unwrap("no groove").box,Uo)}get timeline(){return Dt(this,al,"f").boxAdapters.adapterFor(Dt(this,ri,"f").timeline.targetVertex.unwrap("no timeline").box,Ai)}get pianoMode(){return Dt(this,Bv,"f")}get created(){return new Date(Dt(this,ri,"f").created.getValue())}get midiOutputDevices(){return Dt(this,ri,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>Ie(e,Wi))}*labeledAudioOutputs(){for(let e of Dt(this,ll,"f").adapters())yield{label:e.label,address:e.address,children:()=>m.wrap(e.labeledAudioOutputs())}}terminate(){Dt(this,ll,"f").terminate()}};al=new WeakMap,ri=new WeakMap,ll=new WeakMap,Ev=new WeakMap,Bv=new WeakMap;var Rw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},nr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Ow,_h,to,Bs,NE,cc=class{constructor(e,t){Ow.add(this),this.type="instrument",this.accepts="audio",_h.set(this,void 0),to.set(this,void 0),Bs.set(this,void 0),Rw(this,_h,e,"f"),Rw(this,to,t,"f"),Rw(this,Bs,new ge(nr(this,_h,"f")),"f"),this.namedParameter=nr(this,Ow,"m",NE).call(this,t)}get box(){return nr(this,to,"f")}get uuid(){return nr(this,to,"f").address.uuid}get address(){return nr(this,to,"f").address}get labelField(){return nr(this,to,"f").label}get iconField(){return nr(this,to,"f").icon}get defaultTrackType(){return ne.Audio}get enabledField(){return nr(this,to,"f").enabled}get minimizedField(){return nr(this,to,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return nr(this,_h,"f").boxAdapters.adapterFor(nr(this,to,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){nr(this,Bs,"f").terminate()}};_h=new WeakMap,to=new WeakMap,Bs=new WeakMap,Ow=new WeakSet,NE=function(e){return{flutter:nr(this,Bs,"f").createParameter(e.flutter,S.unipolar(),E.percent(),"flutter"),wow:nr(this,Bs,"f").createParameter(e.wow,S.unipolar(),E.percent(),"wow"),noise:nr(this,Bs,"f").createParameter(e.noise,S.unipolar(),E.percent(),"noise"),saturation:nr(this,Bs,"f").createParameter(e.saturation,S.unipolar(),E.percent(),"saturation")}};var Ko=(()=>{let t=[1,2,3,4],o=["12","24","36","48"],i=[Ke.sine,Ke.triangle,Ke.saw,Ke.square],n=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:S.exponential(20,2e4),CUTOFF_STRING_MAPPING:E.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:t,FILTER_ORDER_STRINGS:o,FILTER_ORDER_VALUE_MAPPING:S.values(t),FILTER_ORDER_STRING_MAPPING:E.values("db",t,o),LFO_WAVEFORM_VALUES:i,LFO_WAVEFORM_STRINGS:n,LFO_WAVEFORM_VALUE_MAPPING:S.values(i),LFO_WAVEFORM_STRING_MAPPING:E.values("",i,n)}})();var Vw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Fe=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},zw,Ph,ro,ze,IE,dc=class{constructor(e,t){zw.add(this),this.type="instrument",this.accepts="midi",Ph.set(this,void 0),ro.set(this,void 0),ze.set(this,void 0),Vw(this,Ph,e,"f"),Vw(this,ro,t,"f"),Vw(this,ze,new ge(Fe(this,Ph,"f")),"f"),this.namedParameter=Fe(this,zw,"m",IE).call(this,t)}get box(){return Fe(this,ro,"f")}get uuid(){return Fe(this,ro,"f").address.uuid}get address(){return Fe(this,ro,"f").address}get labelField(){return Fe(this,ro,"f").label}get iconField(){return Fe(this,ro,"f").icon}get defaultTrackType(){return ne.Notes}get enabledField(){return Fe(this,ro,"f").enabled}get minimizedField(){return Fe(this,ro,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Fe(this,Ph,"f").boxAdapters.adapterFor(Fe(this,ro,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Fe(this,ze,"f").terminate()}};Ph=new WeakMap,ro=new WeakMap,ze=new WeakMap,zw=new WeakSet,IE=function(e){let t=[_o.Monophonic,_o.Polyphonic];return{oscillators:e.oscillators.fields().map(o=>({waveform:Fe(this,ze,"f").createParameter(o.waveform,S.linearInteger(0,3),E.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:Fe(this,ze,"f").createParameter(o.volume,S.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:Fe(this,ze,"f").createParameter(o.octave,S.linearInteger(-3,3),E.numeric({unit:"oct"}),"Octave",.5),tune:Fe(this,ze,"f").createParameter(o.tune,S.linear(-1200,1200),E.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:Fe(this,ze,"f").createParameter(e.noise.volume,S.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:Fe(this,ze,"f").createParameter(e.noise.attack,S.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:Fe(this,ze,"f").createParameter(e.noise.hold,S.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Hold"),release:Fe(this,ze,"f").createParameter(e.noise.release,S.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:Fe(this,ze,"f").createParameter(e.filterOrder,Ko.FILTER_ORDER_VALUE_MAPPING,Ko.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:Fe(this,ze,"f").createParameter(e.cutoff,Ko.CUTOFF_VALUE_MAPPING,Ko.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:Fe(this,ze,"f").createParameter(e.resonance,S.exponential(.01,10),E.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:Fe(this,ze,"f").createParameter(e.attack,S.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:Fe(this,ze,"f").createParameter(e.decay,S.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:Fe(this,ze,"f").createParameter(e.sustain,S.unipolar(),E.percent({fractionDigits:1}),"Sustain"),release:Fe(this,ze,"f").createParameter(e.release,S.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:Fe(this,ze,"f").createParameter(e.filterEnvelope,S.bipolar(),E.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:Fe(this,ze,"f").createParameter(e.filterKeyboard,S.bipolar(),E.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:Fe(this,ze,"f").createParameter(e.voicingMode,S.values(t),E.values("",t,["mono","poly"]),"Play Mode",.5),glideTime:Fe(this,ze,"f").createParameter(e.glideTime,S.unipolar(),E.percent({fractionDigits:1}),"Glide time",0),unisonCount:Fe(this,ze,"f").createParameter(e.unisonCount,S.values([1,3,5]),E.values("#",[1,3,5],[1,3,5].map(o=>String(o))),"Unisono",0),unisonDetune:Fe(this,ze,"f").createParameter(e.unisonDetune,S.exponential(1,1200),E.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:Fe(this,ze,"f").createParameter(e.unisonStereo,S.unipolar(),E.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:Fe(this,ze,"f").createParameter(e.lfo.waveform,Ko.LFO_WAVEFORM_VALUE_MAPPING,Ko.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:Fe(this,ze,"f").createParameter(e.lfo.rate,S.exponential(1e-4,30),E.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:Fe(this,ze,"f").createParameter(e.lfo.targetTune,S.bipolar(),E.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:Fe(this,ze,"f").createParameter(e.lfo.targetVolume,S.bipolar(),E.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:Fe(this,ze,"f").createParameter(e.lfo.targetCutoff,S.bipolar(),E.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};var Uw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},jt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},jw,Fv,Sh,Bi,Wo,kE,io=class{constructor(e,t){jw.add(this),this.type="midi-effect",this.accepts="midi",Sh.set(this,void 0),Bi.set(this,void 0),Wo.set(this,void 0),Uw(this,Sh,e,"f"),Uw(this,Bi,t,"f"),Uw(this,Wo,new ge(jt(this,Sh,"f")),"f"),this.namedParameter=jt(this,jw,"m",kE).call(this,t)}get box(){return jt(this,Bi,"f")}get uuid(){return jt(this,Bi,"f").address.uuid}get address(){return jt(this,Bi,"f").address}get indexField(){return jt(this,Bi,"f").index}get labelField(){return jt(this,Bi,"f").label}get enabledField(){return jt(this,Bi,"f").enabled}get minimizedField(){return jt(this,Bi,"f").minimized}get host(){return jt(this,Bi,"f").host}deviceHost(){return jt(this,Sh,"f").boxAdapters.adapterFor(jt(this,Bi,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){jt(this,Wo,"f").terminate()}};Fv=io,Sh=new WeakMap,Bi=new WeakMap,Wo=new WeakMap,jw=new WeakSet,kE=function(e){return{modeIndex:jt(this,Wo,"f").createParameter(e.modeIndex,S.linearInteger(0,2),E.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:jt(this,Wo,"f").createParameter(e.numOctaves,S.linearInteger(1,5),E.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:jt(this,Wo,"f").createParameter(e.rateIndex,S.linearInteger(0,Fv.RateFractions.length-1),Fv.RateStringMapping,"Rate"),gate:jt(this,Wo,"f").createParameter(e.gate,S.linear(0,2),E.percent({fractionDigits:0}),"Gate"),repeat:jt(this,Wo,"f").createParameter(e.repeat,S.linearInteger(1,16),E.numeric({fractionDigits:0}),"Repeat"),velocity:jt(this,Wo,"f").createParameter(e.velocity,S.bipolar(),E.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};io.RateFractions=hr.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();io.RateStringMapping=E.indices("",Fv.RateFractions.map(([r,e])=>`${r}/${e}`));var Lw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},sr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Kw,Eh,Fi,ul,$E,pc=class{constructor(e,t){Kw.add(this),this.type="midi-effect",this.accepts="midi",Eh.set(this,void 0),Fi.set(this,void 0),ul.set(this,void 0),Lw(this,Eh,e,"f"),Lw(this,Fi,t,"f"),Lw(this,ul,new ge(sr(this,Eh,"f")),"f"),this.namedParameter=sr(this,Kw,"m",$E).call(this,t)}get box(){return sr(this,Fi,"f")}get uuid(){return sr(this,Fi,"f").address.uuid}get address(){return sr(this,Fi,"f").address}get indexField(){return sr(this,Fi,"f").index}get labelField(){return sr(this,Fi,"f").label}get enabledField(){return sr(this,Fi,"f").enabled}get minimizedField(){return sr(this,Fi,"f").minimized}get host(){return sr(this,Fi,"f").host}deviceHost(){return sr(this,Eh,"f").boxAdapters.adapterFor(sr(this,Fi,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){sr(this,ul,"f").terminate()}};Eh=new WeakMap,Fi=new WeakMap,ul=new WeakMap,Kw=new WeakSet,$E=function(e){return{octaves:sr(this,ul,"f").createParameter(e.octaves,S.linearInteger(-7,7),E.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:sr(this,ul,"f").createParameter(e.semiTones,S.linearInteger(-36,36),E.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:sr(this,ul,"f").createParameter(e.cents,S.linear(-50,50),E.numeric({unit:"cents",fractionDigits:1}),"cents")}};var Ww=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Cr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Zw,Bh,oo,hc,DE,fc=class{constructor(e,t){Zw.add(this),this.type="instrument",this.accepts="midi",Bh.set(this,void 0),oo.set(this,void 0),hc.set(this,void 0),Ww(this,Bh,e,"f"),Ww(this,oo,t,"f"),Ww(this,hc,new ge(Cr(this,Bh,"f")),"f"),this.namedParameter=Cr(this,Zw,"m",DE).call(this,t)}get box(){return Cr(this,oo,"f")}get uuid(){return Cr(this,oo,"f").address.uuid}get address(){return Cr(this,oo,"f").address}get labelField(){return Cr(this,oo,"f").label}get iconField(){return Cr(this,oo,"f").icon}get defaultTrackType(){return ne.Notes}get enabledField(){return Cr(this,oo,"f").enabled}get minimizedField(){return Cr(this,oo,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Cr(this,Bh,"f").boxAdapters.adapterFor(Cr(this,oo,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Cr(this,hc,"f").terminate()}};Bh=new WeakMap,oo=new WeakMap,hc=new WeakMap,Zw=new WeakSet,DE=function(e){return{volume:Cr(this,hc,"f").createParameter(e.volume,S.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"volume"),release:Cr(this,hc,"f").createParameter(e.release,S.exponential(.001,8),E.numeric({unit:"s",fractionDigits:3}),"release")}};var mc=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Q=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Gw,cl,Fs,we,Nv,Fh,ii,dl,ME,gc=class{constructor(e,t){Gw.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",cl.set(this,new R),Fs.set(this,void 0),we.set(this,void 0),Nv.set(this,void 0),Fh.set(this,void 0),ii.set(this,void 0),dl.set(this,m.None),mc(this,Fs,e,"f"),mc(this,we,t,"f"),mc(this,Nv,Q(this,cl,"f").own(Ot.create(Q(this,we,"f").midiEffects,o=>Q(this,Fs,"f").boxAdapters.adapterFor(o,se.isMidiEffect),c.MIDIEffectHost)),"f"),mc(this,Fh,Q(this,cl,"f").own(Ot.create(Q(this,we,"f").audioEffects,o=>Q(this,Fs,"f").boxAdapters.adapterFor(o,se.isAudioEffect),c.AudioEffectHost)),"f"),mc(this,ii,Q(this,cl,"f").own(new ge(Q(this,Fs,"f"))),"f"),this.namedParameter=Q(this,Gw,"m",ME).call(this,t),Q(this,cl,"f").own(Q(this,we,"f").file.catchupAndSubscribe(o=>{mc(this,dl,o.targetVertex.map(({box:i})=>Q(this,Fs,"f").boxAdapters.adapterFor(i,Gi)),"f"),Q(this,dl,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return Q(this,we,"f")}get uuid(){return Q(this,we,"f").address.uuid}get address(){return Q(this,we,"f").address}get peakAddress(){return Q(this,we,"f").address.append(1001)}get indexField(){return Q(this,we,"f").index}get gate(){return Q(this,we,"f").gate.getValue()}get exclude(){return Q(this,we,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${Q(this,dl,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get fileLabel(){return`${Q(this,dl,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return Q(this,we,"f").icon}get defaultTrackType(){return ne.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return Q(this,we,"f").midiEffects}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return Q(this,we,"f").audioEffects}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}file(){return Q(this,dl,"f")}fileUUID(){return Q(this,we,"f").file.targetAddress.unwrap().uuid}resetParameters(){Q(this,we,"f").mute.reset(),Q(this,we,"f").solo.reset(),Q(this,we,"f").exclude.reset(),Q(this,we,"f").polyphone.reset(),Q(this,we,"f").pitch.reset(),Q(this,we,"f").attack.reset(),Q(this,we,"f").release.reset(),Q(this,we,"f").sampleStart.reset(),Q(this,we,"f").sampleEnd.reset(),Q(this,we,"f").gate.reset()}copyToIndex(e){Yn.create(Q(this,we,"f").graph,b.generate(),t=>{t.file.refer(Q(this,we,"f").file.targetVertex.unwrap()),t.device.refer(Q(this,we,"f").device.targetVertex.unwrap()),t.index.setValue(e),t.mute.setValue(Q(this,we,"f").mute.getValue()),t.solo.setValue(Q(this,we,"f").solo.getValue()),t.sampleStart.setValue(Q(this,we,"f").sampleStart.getValue()),t.sampleEnd.setValue(Q(this,we,"f").sampleEnd.getValue()),t.attack.setValue(Q(this,we,"f").attack.getValue()),t.release.setValue(Q(this,we,"f").release.getValue()),t.pitch.setValue(Q(this,we,"f").pitch.getValue()),t.exclude.setValue(Q(this,we,"f").exclude.getValue()),t.gate.setValue(Q(this,we,"f").gate.getValue())})}get midiEffects(){return Q(this,Nv,"f")}get inputAdapter(){return m.wrap(this)}get audioEffects(){return Q(this,Fh,"f")}get labelField(){return Q(this,we,"f").label}get enabledField(){return Q(this,we,"f").enabled}get minimizedField(){return Q(this,we,"f").minimized}device(){return Q(this,Fs,"f").boxAdapters.adapterFor(Q(this,we,"f").device.targetVertex.unwrap().box,Ns)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.fileLabel,children:()=>m.None};for(let e of Q(this,Fh,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){Q(this,cl,"f").terminate()}};cl=new WeakMap,Fs=new WeakMap,we=new WeakMap,Nv=new WeakMap,Fh=new WeakMap,ii=new WeakMap,dl=new WeakMap,Gw=new WeakSet,ME=function(e){return{gate:Q(this,ii,"f").createParameter(e.gate,S.linearInteger(0,2),E.indices("",["Off","On","Loop"]),"Gate"),mute:Q(this,ii,"f").createParameter(e.mute,S.bool,E.bool,"Mute"),solo:Q(this,ii,"f").createParameter(e.solo,S.bool,E.bool,"Solo"),polyphone:Q(this,ii,"f").createParameter(e.polyphone,S.bool,E.bool,"Polyphone"),exclude:Q(this,ii,"f").createParameter(e.exclude,S.bool,E.bool,"Exclude"),pitch:Q(this,ii,"f").createParameter(e.pitch,S.linear(-1200,1200),E.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:Q(this,ii,"f").createParameter(e.sampleStart,S.unipolar(),E.percent(),"Start",0),sampleEnd:Q(this,ii,"f").createParameter(e.sampleEnd,S.unipolar(),E.percent(),"End",1),attack:Q(this,ii,"f").createParameter(e.attack,S.exponential(.001,5),E.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:Q(this,ii,"f").createParameter(e.release,S.exponential(.001,5),E.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release")}};var Iv=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},br=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},vc,no,yc,kv,Ns=class{constructor(e,t){this.type="instrument",this.accepts="midi",vc.set(this,void 0),no.set(this,void 0),yc.set(this,void 0),kv.set(this,void 0),Iv(this,vc,e,"f"),Iv(this,no,t,"f"),Iv(this,yc,Ot.create(t.samples,o=>e.boxAdapters.adapterFor(o,gc),c.Sample),"f"),Iv(this,kv,new ge(br(this,vc,"f")),"f")}reset(){br(this,yc,"f").adapters().forEach(e=>e.box.delete())}get box(){return br(this,no,"f")}get uuid(){return br(this,no,"f").address.uuid}get address(){return br(this,no,"f").address}get labelField(){return br(this,no,"f").label}get iconField(){return br(this,no,"f").icon}get defaultTrackType(){return ne.Notes}get enabledField(){return br(this,no,"f").enabled}get minimizedField(){return br(this,no,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return br(this,yc,"f")}get context(){return br(this,vc,"f")}deviceHost(){return br(this,vc,"f").boxAdapters.adapterFor(br(this,no,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None};for(let e of br(this,yc,"f").adapters())yield{address:e.address,label:e.fileLabel,children:()=>m.wrap(e.labeledAudioOutputs())}}terminate(){br(this,kv,"f").terminate()}};vc=new WeakMap,no=new WeakMap,yc=new WeakMap,kv=new WeakMap;var qw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Lt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Hw,Nh,Ni,Zo,CE,xc=class{constructor(e,t){Hw.add(this),this.type="audio-effect",this.accepts="audio",Nh.set(this,void 0),Ni.set(this,void 0),Zo.set(this,void 0),qw(this,Nh,e,"f"),qw(this,Ni,t,"f"),qw(this,Zo,new ge(Lt(this,Nh,"f")),"f"),this.namedParameter=Lt(this,Hw,"m",CE).call(this,t)}get box(){return Lt(this,Ni,"f")}get uuid(){return Lt(this,Ni,"f").address.uuid}get address(){return Lt(this,Ni,"f").address}get indexField(){return Lt(this,Ni,"f").index}get labelField(){return Lt(this,Ni,"f").label}get enabledField(){return Lt(this,Ni,"f").enabled}get minimizedField(){return Lt(this,Ni,"f").minimized}get host(){return Lt(this,Ni,"f").host}deviceHost(){return Lt(this,Nh,"f").boxAdapters.adapterFor(Lt(this,Ni,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Lt(this,Zo,"f").terminate()}};Nh=new WeakMap,Ni=new WeakMap,Zo=new WeakMap,Hw=new WeakSet,CE=function(e){return{volume:Lt(this,Zo,"f").createParameter(e.volume,S.decibel(-72,0,12),E.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:Lt(this,Zo,"f").createParameter(e.panning,S.bipolar(),E.panning,"Panning",.5),stereo:Lt(this,Zo,"f").createParameter(e.stereo,S.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:Lt(this,Zo,"f").createParameter(e.invertL,S.bool,E.bool,"Invert Left"),invertR:Lt(this,Zo,"f").createParameter(e.invertR,S.bool,E.bool,"Invert Right"),swap:Lt(this,Zo,"f").createParameter(e.swap,S.bool,E.bool,"Swap")}};var pl;(function(r){r.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(pl||(pl={}));var TE=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Tr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},bc,Rr,wc=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",bc.set(this,void 0),Rr.set(this,void 0),TE(this,bc,e,"f"),TE(this,Rr,t,"f"),this.groove()}get box(){return Tr(this,Rr,"f")}get uuid(){return Tr(this,Rr,"f").address.uuid}get address(){return Tr(this,Rr,"f").address}get indexField(){return Tr(this,Rr,"f").index}get labelField(){return Tr(this,Rr,"f").label}get enabledField(){return Tr(this,Rr,"f").enabled}get minimizedField(){return Tr(this,Rr,"f").minimized}get host(){return Tr(this,Rr,"f").host}deviceHost(){return Tr(this,bc,"f").boxAdapters.adapterFor(Tr(this,Rr,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}groove(){return Tr(this,bc,"f").boxAdapters.adapterFor(Tr(this,Rr,"f").groove.targetVertex.unwrap("no groove").box,pl.checkType)}catchupAndSubscribeGroove(e){return Tr(this,Rr,"f").groove.catchupAndSubscribe(t=>e(Tr(this,bc,"f").boxAdapters.adapterFor(t.targetVertex.unwrap("No groove found").box,pl.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};bc=new WeakMap,Rr=new WeakMap;var RE=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},so=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},$v,oi,Ac=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",$v.set(this,void 0),oi.set(this,void 0),RE(this,$v,e,"f"),RE(this,oi,t,"f")}get box(){return so(this,oi,"f")}get uuid(){return so(this,oi,"f").address.uuid}get address(){return so(this,oi,"f").address}get indexField(){return so(this,oi,"f").index}get labelField(){return so(this,oi,"f").label}get enabledField(){return so(this,oi,"f").enabled}get minimizedField(){return so(this,oi,"f").minimized}get host(){return so(this,oi,"f").host}get commentField(){return so(this,oi,"f").comment}deviceHost(){return so(this,$v,"f").boxAdapters.adapterFor(so(this,oi,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){}};$v=new WeakMap,oi=new WeakMap;var OE=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ao=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Dv,ni,_c=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",Dv.set(this,void 0),ni.set(this,void 0),OE(this,Dv,e,"f"),OE(this,ni,t,"f")}get box(){return ao(this,ni,"f")}get uuid(){return ao(this,ni,"f").address.uuid}get address(){return ao(this,ni,"f").address}get indexField(){return ao(this,ni,"f").index}get labelField(){return ao(this,ni,"f").label}get enabledField(){return ao(this,ni,"f").enabled}get minimizedField(){return ao(this,ni,"f").minimized}get host(){return ao(this,ni,"f").host}get commentField(){return ao(this,ni,"f").comment}deviceHost(){return ao(this,Dv,"f").boxAdapters.adapterFor(ao(this,ni,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};Dv=new WeakMap,ni=new WeakMap;var Is=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ne=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Jw,Qw,Ih,Or,Mv,Pc,lo,Ii,Sc,VE,Xw,Ec=class{constructor(e,t){Jw.add(this),this.type="instrument",this.accepts="midi",Qw.set(this,new R),Ih.set(this,void 0),Or.set(this,void 0),Mv.set(this,void 0),Pc.set(this,void 0),lo.set(this,void 0),Ii.set(this,void 0),Sc.set(this,Z.Empty),Xw.set(this,o=>o.match({none:()=>{Ne(this,Ii,"f").clear(),Ne(this,lo,"f").clear()},some:i=>i.soundfont.match({none:()=>{Ne(this,Ii,"f").clear(),Ne(this,lo,"f").clear(),Ne(this,Sc,"f").terminate(),Is(this,Sc,i.subscribe(n=>{if(n.type==="loaded"){let s=i.soundfont.unwrap();Ne(this,Ii,"f").wrap(s.presets[this.presetIndex]??s.presets[0]),Ne(this,lo,"f").wrap(s)}else n.type==="error"?(Ne(this,Ii,"f").clear(),Ne(this,lo,"f").clear()):n.type==="idle"&&(Ne(this,Ii,"f").clear(),Ne(this,lo,"f").clear())}),"f")},some:n=>{Ne(this,lo,"f").wrap(n),Ne(this,Ii,"f").wrap(n.presets[this.presetIndex]??n.presets[0])}})})),Is(this,Ih,e,"f"),Is(this,Or,t,"f"),Is(this,Mv,new ge(Ne(this,Ih,"f")),"f"),this.namedParameter=Ne(this,Jw,"m",VE).call(this,t),Is(this,Pc,new Br,"f"),Is(this,lo,new Br,"f"),Is(this,Ii,new Br,"f"),Ne(this,Qw,"f").ownAll(Ne(this,Pc,"f").subscribe(Ne(this,Xw,"f")),Ne(this,Or,"f").file.catchupAndSubscribe(({targetVertex:o})=>Ne(this,Pc,"f").wrapOption(o.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),Ne(this,Or,"f").presetIndex.catchupAndSubscribe(o=>Ne(this,lo,"f").match({none:()=>Ne(this,Ii,"f").clear(),some:i=>Ne(this,Ii,"f").wrap(i.presets[o.getValue()]??i.presets[0])})))}get loader(){return Ne(this,Pc,"f")}get soundfont(){return Ne(this,lo,"f")}get preset(){return Ne(this,Ii,"f")}get presetIndex(){return Ne(this,Or,"f").presetIndex.getValue()}get box(){return Ne(this,Or,"f")}get uuid(){return Ne(this,Or,"f").address.uuid}get address(){return Ne(this,Or,"f").address}get labelField(){return Ne(this,Or,"f").label}get iconField(){return Ne(this,Or,"f").icon}get defaultTrackType(){return ne.Notes}get enabledField(){return Ne(this,Or,"f").enabled}get minimizedField(){return Ne(this,Or,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ne(this,Ih,"f").boxAdapters.adapterFor(Ne(this,Or,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Ne(this,Sc,"f").terminate(),Is(this,Sc,Z.Empty,"f"),Ne(this,Mv,"f").terminate()}};Qw=new WeakMap,Ih=new WeakMap,Or=new WeakMap,Mv=new WeakMap,Pc=new WeakMap,lo=new WeakMap,Ii=new WeakMap,Sc=new WeakMap,Xw=new WeakMap,Jw=new WeakSet,VE=function(e){return{}};var zE=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},kh=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Cv,hl,Tv=class{constructor(e,t){Cv.set(this,void 0),hl.set(this,void 0),zE(this,Cv,e,"f"),zE(this,hl,t,"f")}get box(){return kh(this,hl,"f")}get uuid(){return kh(this,hl,"f").address.uuid}get address(){return kh(this,hl,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return kh(this,Cv,"f").soundfontManager.getOrCreate(kh(this,hl,"f").address.uuid)}terminate(){}};Cv=new WeakMap,hl=new WeakMap;var Yw=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ot=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},e0,$h,si,ar,UE,Bc=class{constructor(e,t){e0.add(this),this.type="audio-effect",this.accepts="audio",$h.set(this,void 0),si.set(this,void 0),ar.set(this,void 0),Yw(this,$h,e,"f"),Yw(this,si,t,"f"),Yw(this,ar,new ge(ot(this,$h,"f")),"f"),this.namedParameter=ot(this,e0,"m",UE).call(this,t)}get box(){return ot(this,si,"f")}get uuid(){return ot(this,si,"f").address.uuid}get address(){return ot(this,si,"f").address}get indexField(){return ot(this,si,"f").index}get labelField(){return ot(this,si,"f").label}get enabledField(){return ot(this,si,"f").enabled}get minimizedField(){return ot(this,si,"f").minimized}get host(){return ot(this,si,"f").host}get sideChain(){return ot(this,si,"f").sideChain}deviceHost(){return ot(this,$h,"f").boxAdapters.adapterFor(ot(this,si,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){ot(this,ar,"f").terminate()}};$h=new WeakMap,si=new WeakMap,ar=new WeakMap,e0=new WeakSet,UE=function(e){return{lookahead:ot(this,ar,"f").createParameter(e.lookahead,S.bool,E.bool,"Lookahead"),automakeup:ot(this,ar,"f").createParameter(e.automakeup,S.bool,E.bool,"Auto Makeup"),autoattack:ot(this,ar,"f").createParameter(e.autoattack,S.bool,E.bool,"Auto Attack"),autorelease:ot(this,ar,"f").createParameter(e.autorelease,S.bool,E.bool,"Auto Release"),inputgain:ot(this,ar,"f").createParameter(e.inputgain,S.linear(-30,30),E.decible,"Input Gain"),threshold:ot(this,ar,"f").createParameter(e.threshold,S.linear(-60,0),E.decible,"Threshold"),ratio:ot(this,ar,"f").createParameter(e.ratio,S.exponential(1,24),E.numeric({fractionDigits:1}),"Ratio"),knee:ot(this,ar,"f").createParameter(e.knee,S.linear(0,24),E.decible,"Knee"),attack:ot(this,ar,"f").createParameter(e.attack,S.linear(0,100),E.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:ot(this,ar,"f").createParameter(e.release,S.linear(5,1500),E.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:ot(this,ar,"f").createParameter(e.makeup,S.linear(-40,40),E.decible,"Makeup Gain"),mix:ot(this,ar,"f").createParameter(e.mix,S.unipolar(),E.percent(),"Dry/Wet")}};var t0=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Xt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},r0,Dh,ki,ks,jE,Fc=class{constructor(e,t){r0.add(this),this.type="audio-effect",this.accepts="audio",Dh.set(this,void 0),ki.set(this,void 0),ks.set(this,void 0),t0(this,Dh,e,"f"),t0(this,ki,t,"f"),t0(this,ks,new ge(Xt(this,Dh,"f")),"f"),this.namedParameter=Xt(this,r0,"m",jE).call(this,t)}get box(){return Xt(this,ki,"f")}get uuid(){return Xt(this,ki,"f").address.uuid}get address(){return Xt(this,ki,"f").address}get indexField(){return Xt(this,ki,"f").index}get labelField(){return Xt(this,ki,"f").label}get enabledField(){return Xt(this,ki,"f").enabled}get minimizedField(){return Xt(this,ki,"f").minimized}get host(){return Xt(this,ki,"f").host}deviceHost(){return Xt(this,Dh,"f").boxAdapters.adapterFor(Xt(this,ki,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Xt(this,ks,"f").terminate()}};Dh=new WeakMap,ki=new WeakMap,ks=new WeakMap,r0=new WeakSet,jE=function(e){return{crush:Xt(this,ks,"f").createParameter(e.crush,S.unipolar(),E.percent(),"Crush"),bits:Xt(this,ks,"f").createParameter(e.bits,S.linearInteger(1,16),E.numeric(),"Bits"),boost:Xt(this,ks,"f").createParameter(e.boost,S.linear(0,24),E.decible,"Boost"),mix:Xt(this,ks,"f").createParameter(e.mix,S.exponential(.001,1),E.percent(),"Mix")}};var i0=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},wr=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},o0,Mh,$i,Nc,LE,Ic=class{constructor(e,t){o0.add(this),this.type="audio-effect",this.accepts="audio",Mh.set(this,void 0),$i.set(this,void 0),Nc.set(this,void 0),i0(this,Mh,e,"f"),i0(this,$i,t,"f"),i0(this,Nc,new ge(wr(this,Mh,"f")),"f"),this.namedParameter=wr(this,o0,"m",LE).call(this,t)}get box(){return wr(this,$i,"f")}get uuid(){return wr(this,$i,"f").address.uuid}get address(){return wr(this,$i,"f").address}get indexField(){return wr(this,$i,"f").index}get labelField(){return wr(this,$i,"f").label}get enabledField(){return wr(this,$i,"f").enabled}get minimizedField(){return wr(this,$i,"f").minimized}get host(){return wr(this,$i,"f").host}deviceHost(){return wr(this,Mh,"f").boxAdapters.adapterFor(wr(this,$i,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){wr(this,Nc,"f").terminate()}};Mh=new WeakMap,$i=new WeakMap,Nc=new WeakMap,o0=new WeakSet,LE=function(e){return{drive:wr(this,Nc,"f").createParameter(e.drive,S.linear(0,30),E.decible,"Drive"),volume:wr(this,Nc,"f").createParameter(e.volume,S.linear(-18,0),E.decible,"Volume")}};var Rv=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Mt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},Ch,Th,Di,kc,$c,Dc=class{constructor(e,t){Ch.set(this,new R),this.type="instrument",this.accepts="midi",Th.set(this,void 0),Di.set(this,void 0),kc.set(this,void 0),$c.set(this,void 0),Rv(this,Th,e,"f"),Rv(this,Di,t,"f"),Rv(this,kc,new Br,"f"),Rv(this,$c,Mt(this,Ch,"f").own(new ge(Mt(this,Th,"f"))),"f"),Mt(this,Ch,"f").ownAll(t.parameters.pointerHub.catchupAndSubscribe({onAdded:({box:o})=>Mt(this,$c,"f").createParameter(Ie(o,Zi).value,S.unipolar(),E.percent({fractionDigits:1}),"",0),onRemoved:({box:o})=>Mt(this,$c,"f").removeParameter(Ie(o,Zi).value.address)}),Mt(this,Di,"f").device.catchupAndSubscribe(({targetVertex:o})=>o.match({none:()=>Mt(this,kc,"f").clear(),some:({box:i})=>Mt(this,kc,"f").wrap(Ie(i,Wi))})))}get box(){return Mt(this,Di,"f")}get uuid(){return Mt(this,Di,"f").address.uuid}get address(){return Mt(this,Di,"f").address}get labelField(){return Mt(this,Di,"f").label}get iconField(){return Mt(this,Di,"f").icon}get defaultTrackType(){return ne.Notes}get enabledField(){return Mt(this,Di,"f").enabled}get minimizedField(){return Mt(this,Di,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return Mt(this,$c,"f")}get midiDevice(){return Mt(this,kc,"f")}deviceHost(){return Mt(this,Th,"f").boxAdapters.adapterFor(Mt(this,Di,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Mt(this,Ch,"f").terminate()}};Ch=new WeakMap,Th=new WeakMap,Di=new WeakMap,kc=new WeakMap,$c=new WeakMap;var Ov=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Et=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},n0,Rh,Mi,Go,Oh,KE,Mc=class{constructor(e,t){n0.add(this),this.type="midi-effect",this.accepts="midi",Rh.set(this,void 0),Mi.set(this,void 0),Go.set(this,void 0),Oh.set(this,void 0),Ov(this,Rh,e,"f"),Ov(this,Mi,t,"f"),Ov(this,Go,new ge(Et(this,Rh,"f")),"f"),Ov(this,Oh,$l.create(),"f"),this.namedParameter=Et(this,n0,"m",KE).call(this,t)}computeVelocity(e,t){let{magnetPosition:o,magnetStrength:i,randomSeed:n,randomAmount:s,offset:a,mix:l}=this.namedParameter;Et(this,Oh,"f").setSeed(n.valueAt(e)+e);let u=t+(o.valueAt(e)-t)*i.valueAt(e),d=(Et(this,Oh,"f").uniform()*2-1)*s.valueAt(e),p=a.valueAt(e),h=l.valueAt(e);return t*(1-h)+ci(u+d+p)*h}get box(){return Et(this,Mi,"f")}get uuid(){return Et(this,Mi,"f").address.uuid}get address(){return Et(this,Mi,"f").address}get indexField(){return Et(this,Mi,"f").index}get labelField(){return Et(this,Mi,"f").label}get enabledField(){return Et(this,Mi,"f").enabled}get minimizedField(){return Et(this,Mi,"f").minimized}get host(){return Et(this,Mi,"f").host}deviceHost(){return Et(this,Rh,"f").boxAdapters.adapterFor(Et(this,Mi,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){Et(this,Go,"f").terminate()}};Rh=new WeakMap,Mi=new WeakMap,Go=new WeakMap,Oh=new WeakMap,n0=new WeakSet,KE=function(e){return{magnetPosition:Et(this,Go,"f").createParameter(e.magnetPosition,S.unipolar(),E.percent(),"Position"),magnetStrength:Et(this,Go,"f").createParameter(e.magnetStrength,S.unipolar(),E.percent(),"Strength"),randomSeed:Et(this,Go,"f").createParameter(e.randomSeed,S.linearInteger(0,65535),E.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:Et(this,Go,"f").createParameter(e.randomAmount,S.unipolar(),E.percent(),"Amount"),offset:Et(this,Go,"f").createParameter(e.offset,S.bipolar(),E.percent(),"Offset"),mix:Et(this,Go,"f").createParameter(e.mix,S.unipolar(),E.percent(),"Mix")}};var s0=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Kt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},a0,l0,Vh,Ci,qo,WE,uo=class{constructor(e,t){a0.add(this),this.type="audio-effect",this.accepts="audio",Vh.set(this,void 0),Ci.set(this,void 0),qo.set(this,void 0),s0(this,Vh,e,"f"),s0(this,Ci,t,"f"),s0(this,qo,new ge(Kt(this,Vh,"f")),"f"),this.namedParameter=Kt(this,a0,"m",WE).call(this,t)}get box(){return Kt(this,Ci,"f")}get uuid(){return Kt(this,Ci,"f").address.uuid}get address(){return Kt(this,Ci,"f").address}get indexField(){return Kt(this,Ci,"f").index}get labelField(){return Kt(this,Ci,"f").label}get enabledField(){return Kt(this,Ci,"f").enabled}get minimizedField(){return Kt(this,Ci,"f").minimized}get host(){return Kt(this,Ci,"f").host}deviceHost(){return Kt(this,Vh,"f").boxAdapters.adapterFor(Kt(this,Ci,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Kt(this,qo,"f").terminate()}};l0=uo,Vh=new WeakMap,Ci=new WeakMap,qo=new WeakMap,a0=new WeakSet,WE=function(e){let{RateFractions:t,RateStringMapping:o}=l0;return{slope:Kt(this,qo,"f").createParameter(e.slope,S.bipolar(),E.percent({fractionDigits:1}),"Slope",.5),symmetry:Kt(this,qo,"f").createParameter(e.symmetry,S.unipolar(),E.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:Kt(this,qo,"f").createParameter(e.rate,S.values(t.map((i,n)=>n)),o,"Rate",0),depth:Kt(this,qo,"f").createParameter(e.depth,S.unipolar(),E.percent({fractionDigits:1}),"Depth",0),offset:Kt(this,qo,"f").createParameter(e.offset,S.linear(-180,180),E.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:Kt(this,qo,"f").createParameter(e.channelOffset,S.linear(-180,180),E.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};uo.RateFractions=hr.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();uo.RateStringMapping=E.indices("",l0.RateFractions.map(([r,e])=>`${r}/${e}`));var u0=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},lt=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},c0,zh,Ti,lr,ZE,Cc=class{constructor(e,t){c0.add(this),this.type="audio-effect",this.accepts="audio",zh.set(this,void 0),Ti.set(this,void 0),lr.set(this,void 0),u0(this,zh,e,"f"),u0(this,Ti,t,"f"),u0(this,lr,new ge(lt(this,zh,"f")),"f"),this.namedParameter=lt(this,c0,"m",ZE).call(this,t)}get box(){return lt(this,Ti,"f")}get uuid(){return lt(this,Ti,"f").address.uuid}get address(){return lt(this,Ti,"f").address}get indexField(){return lt(this,Ti,"f").index}get labelField(){return lt(this,Ti,"f").label}get enabledField(){return lt(this,Ti,"f").enabled}get minimizedField(){return lt(this,Ti,"f").minimized}get host(){return lt(this,Ti,"f").host}deviceHost(){return lt(this,zh,"f").boxAdapters.adapterFor(lt(this,Ti,"f").host.targetVertex.unwrap("no device-host").box,se.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){lt(this,lr,"f").terminate()}};zh=new WeakMap,Ti=new WeakMap,lr=new WeakMap,c0=new WeakSet,ZE=function(e){return{preDelay:lt(this,lr,"f").createParameter(e.preDelay,S.linear(0,1e3),E.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:lt(this,lr,"f").createParameter(e.bandwidth,S.unipolar(),E.percent(),"Bandwidth"),inputDiffusion1:lt(this,lr,"f").createParameter(e.inputDiffusion1,S.unipolar(),E.percent(),"Tank 1"),inputDiffusion2:lt(this,lr,"f").createParameter(e.inputDiffusion2,S.unipolar(),E.percent(),"Tank 2"),decay:lt(this,lr,"f").createParameter(e.decay,S.unipolar(),E.percent(),"Decay"),decayDiffusion1:lt(this,lr,"f").createParameter(e.decayDiffusion1,S.unipolar(),E.percent(),"Tank 1"),decayDiffusion2:lt(this,lr,"f").createParameter(e.decayDiffusion2,S.unipolar(),E.percent(),"Tank 2"),damping:lt(this,lr,"f").createParameter(e.damping,S.unipolar(),E.percent(),"Damping"),excursionRate:lt(this,lr,"f").createParameter(e.excursionRate,S.unipolar(),E.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:lt(this,lr,"f").createParameter(e.excursionDepth,S.unipolar(),E.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:lt(this,lr,"f").createParameter(e.wet,S.DefaultDecibel,E.decible,"Wet"),dry:lt(this,lr,"f").createParameter(e.dry,S.DefaultDecibel,E.decible,"Dry")}};var Vv=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},X=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},d0,ee,kn,Uh,zv,GE,Uv=class{constructor(e){d0.add(this),ee.set(this,void 0),kn.set(this,void 0),Uh.set(this,void 0),zv.set(this,void 0),Vv(this,ee,e,"f"),Vv(this,kn,b.newSet(t=>t.uuid),"f"),Vv(this,Uh,new Set,"f"),Vv(this,zv,X(this,ee,"f").boxGraph.subscribeToAllUpdates({onUpdate:t=>{if(t.type==="delete"){let o=X(this,kn,"f").getOrNull(t.uuid);G(o)&&(X(this,Uh,"f").add(o.box),X(this,kn,"f").removeByValue(o).terminate())}}}),"f")}terminate(){X(this,kn,"f").values().forEach(e=>e.terminate()),X(this,kn,"f").clear(),X(this,zv,"f").terminate()}adapterFor(e,t){if(X(this,Uh,"f").has(e))return F(`Cannot resolve adapter for already deleted box: ${e}`);let o=X(this,kn,"f").getOrNull(e.address.uuid);if(o===null){o=X(this,d0,"m",GE).call(this,e);let i=X(this,kn,"f").add(o);M(i,`Could not add adapter for ${e}`)}return typeof t=="function"?Object.hasOwn(t,"prototype")?o instanceof t?o:F(`${o} is not instance of ${t}`):t(o)?o:F(`${o} did not pass custom type guard`):F("Unknown checkType method")}};ee=new WeakMap,kn=new WeakMap,Uh=new WeakMap,zv=new WeakMap,d0=new WeakSet,GE=function(e){return oe(e.accept({visitArpeggioDeviceBox:t=>new io(X(this,ee,"f"),t),visitAudioBusBox:t=>new vr(X(this,ee,"f"),t),visitAudioClipBox:t=>new as(X(this,ee,"f"),t),visitAudioFileBox:t=>new Gi(X(this,ee,"f"),t),visitAudioTimeStretchBox:t=>new No(X(this,ee,"f"),t),visitAudioPitchStretchBox:t=>new Fo(X(this,ee,"f"),t),visitTransientMarkerBox:t=>new uu(t),visitWarpMarkerBox:t=>new ss(X(this,ee,"f"),t),visitAudioRegionBox:t=>new ds(X(this,ee,"f"),t),visitAudioUnitBox:t=>new yi(X(this,ee,"f"),t),visitAuxSendBox:t=>new Vu(X(this,ee,"f"),t),visitCompressorDeviceBox:t=>new Bc(X(this,ee,"f"),t),visitCrusherDeviceBox:t=>new Fc(X(this,ee,"f"),t),visitDattorroReverbDeviceBox:t=>new Cc(X(this,ee,"f"),t),visitDelayDeviceBox:t=>new bi(X(this,ee,"f"),t),visitDeviceInterfaceKnobBox:t=>new ec(X(this,ee,"f"),t),visitTidalDeviceBox:t=>new uo(X(this,ee,"f"),t),visitFoldDeviceBox:t=>new Ic(X(this,ee,"f"),t),visitGrooveShuffleBox:t=>new Uo(X(this,ee,"f"),t),visitMarkerBox:t=>new ys(X(this,ee,"f"),t),visitSignatureEventBox:t=>new Ja(X(this,ee,"f"),t),visitMIDIOutputDeviceBox:t=>new Dc(X(this,ee,"f"),t),visitModularAudioInputBox:t=>new Xu(X(this,ee,"f"),t),visitModularAudioOutputBox:t=>new Hu(X(this,ee,"f"),t),visitModularBox:t=>new ws(X(this,ee,"f"),t),visitModularDeviceBox:t=>new _s(X(this,ee,"f"),t),visitModuleConnectionBox:t=>new bs(X(this,ee,"f"),t),visitModuleDelayBox:t=>new qu(X(this,ee,"f"),t),visitModuleGainBox:t=>new Ju(X(this,ee,"f"),t),visitModuleMultiplierBox:t=>new Qu(X(this,ee,"f"),t),visitNanoDeviceBox:t=>new fc(X(this,ee,"f"),t),visitNoteClipBox:t=>new bu(X(this,ee,"f"),t),visitNoteEventBox:t=>new Ea(X(this,ee,"f"),t),visitNoteEventCollectionBox:t=>new fi(X(this,ee,"f"),t),visitNoteRegionBox:t=>new ps(X(this,ee,"f"),t),visitPitchDeviceBox:t=>new pc(X(this,ee,"f"),t),visitPlayfieldDeviceBox:t=>new Ns(X(this,ee,"f"),t),visitPlayfieldSampleBox:t=>new gc(X(this,ee,"f"),t),visitRevampDeviceBox:t=>new Zu(X(this,ee,"f"),t),visitReverbDeviceBox:t=>new Wu(X(this,ee,"f"),t),visitRootBox:t=>new uc(X(this,ee,"f"),t),visitSoundfontDeviceBox:t=>new Ec(X(this,ee,"f"),t),visitSoundfontFileBox:t=>new Tv(X(this,ee,"f"),t),visitStereoToolDeviceBox:t=>new xc(X(this,ee,"f"),t),visitTapeDeviceBox:t=>new cc(X(this,ee,"f"),t),visitTimelineBox:t=>new Ai(X(this,ee,"f"),t),visitTrackBox:t=>new xt(X(this,ee,"f"),t),visitUnknownAudioEffectDeviceBox:t=>new Ac(X(this,ee,"f"),t),visitUnknownMidiEffectDeviceBox:t=>new _c(X(this,ee,"f"),t),visitValueClipBox:t=>new ns(X(this,ee,"f"),t),visitValueEventBox:t=>new mn(X(this,ee,"f"),t),visitValueEventCollectionBox:t=>new qt(X(this,ee,"f"),t),visitValueRegionBox:t=>new An(X(this,ee,"f"),t),visitVaporisateurDeviceBox:t=>new dc(X(this,ee,"f"),t),visitVelocityDeviceBox:t=>new Mc(X(this,ee,"f"),t),visitZeitgeistDeviceBox:t=>new wc(X(this,ee,"f"),t)}),`Could not find factory for ${e}`)};var Tc;(function(r){r.PEAKS=xe.compose(b.Lowest).append(0),r.SPECTRUM=xe.compose(b.Lowest).append(1),r.WAVEFORM=xe.compose(b.Lowest).append(2)})(Tc||(Tc={}));var qE;(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,o=i=>{let n=t.get(i)??0,s=i;for(;t.has(s);)n++,s=`${i} ${n}`;return t.set(i,n),t.set(s,1),s};Object.keys(e).forEach(i=>{let n=e[i];n.fileName=o(r.sanitizeFileName(n.fileName))})}})(qE||(qE={}));var HE=pr.createBuilder({position:pr.float,bpm:pr.float,playbackTimestamp:pr.float,countInBeatsRemaining:pr.float,isPlaying:pr.bool,isCountingIn:pr.bool,isRecording:pr.bool});var JE;(function(r){r.store=(e,t,o)=>{if(o==="")return F("MetaData.store: origin must be unique to your app.");let i=e.pointerHub.filter(c.MetaData).map(({box:s})=>s).find(s=>s instanceof hn&&s.origin.getValue()===o),n=s=>{s.target.refer(e),s.origin.setValue(o),s.value.setValue(JSON.stringify(t))};Js(i)?n(i):hn.create(e.graph,b.generate(),n)},r.read=(e,t)=>{if(t==="")return F("MetaData.read: origin must be unique to your app.");let o=e.pointerHub.filter(c.MetaData).map(({box:i})=>i).find(i=>i instanceof hn&&i.origin.getValue()===t);if(Js(o)){let{status:i,value:n,error:s}=rn(()=>JSON.parse(o.value.getValue()));if(i==="success")return n;console.warn(s)}return null},r.clear=(e,t)=>{if(t==="")return F("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(c.MetaData).map(({box:o})=>o).filter(o=>o instanceof hn&&o.origin.getValue()===t).forEach(o=>o.delete())}})(JE||(JE={}));var p0=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},$s=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},jv,Lv,Kv,fl,Ri=class{constructor(e,t){jv.set(this,new R),Lv.set(this,void 0),Kv.set(this,void 0),fl.set(this,void 0),p0(this,Lv,e,"f"),p0(this,Kv,t,"f"),p0(this,fl,new nt(128),"f"),$s(this,jv,"f").own($s(this,Lv,"f").broadcastIntegers($s(this,Kv,"f"),new Int32Array($s(this,fl,"f").buffer),o=>{}))}noteOn(e){e>=0&&e<128&&$s(this,fl,"f").setBit(e,!0)}noteOff(e){e>=0&&e<128&&$s(this,fl,"f").setBit(e,!1)}reset(){}clear(){$s(this,fl,"f").clear()}terminate(){$s(this,jv,"f").terminate()}toString(){return`{${this.constructor.name}}`}};jv=new WeakMap,Lv=new WeakMap,Kv=new WeakMap,fl=new WeakMap;var ut;(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 o=r.readParam1(t)&127,i=r.readParam2(t)&127,n=o|i<<7;return 8192>=n?n/8192-1:(n-8191)/8192},r.asValue=t=>{let o=r.readParam2(t);return o>64?.5+(o-63)/128:o<64?o/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,o,i)=>new Uint8Array([e.NoteOn|t,o,i]),r.noteOff=(t,o)=>new Uint8Array([e.NoteOff|t,o,0]),r.control=(t,o,i)=>new Uint8Array([e.Controller|t,o&127,i&127]),r.position=(t,o)=>new Uint8Array([e.Position,t&127,o&127]),r.positionInPPQN=t=>{let o=Math.floor(t/96),i=o&127,n=o>>7&127;return new Uint8Array([e.Position,i,n])},r.accept=(t,o)=>{mo(t)||(r.isNoteOn(t)?_(o.noteOn,r.readPitch(t),r.readVelocity(t)):r.isNoteOff(t)?_(o.noteOff,r.readPitch(t)):r.isPitchWheel(t)?_(o.pitchBend,r.asPitchBend(t)):r.isController(t)?_(o.controller,r.readParam1(t),r.readParam2(t)/127):r.isClock(t)?_(o.clock):r.isStart(t)?_(o.start):r.isContinue(t)?_(o.continue):r.isStop(t)?_(o.stop):r.isPosition(t)&&_(o.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"})(ut||(ut={}));var $n;(function(r){r.on=(e,t,o)=>({type:"note-on",uuid:e,pitch:t,velocity:o}),r.off=(e,t)=>({type:"note-off",uuid:e,pitch:t}),r.audition=(e,t,o,i)=>({type:"note-audition",uuid:e,pitch:t,duration:o,velocity:i}),r.isOn=e=>e.type==="note-on",r.isOff=e=>e.type==="note-off",r.isAudition=e=>e.type==="note-audition",r.fromEvent=(e,t)=>{let o=e.data;if(ut.isNoteOn(o)){let i=ut.readPitch(o),n=ut.readVelocity(o);return{type:"note-on",uuid:t,pitch:i,velocity:n}}else if(ut.isNoteOff(o)){let i=ut.readPitch(o);return{type:"note-off",uuid:t,pitch:i}}return F("Unknown MIDI event")}})($n||($n={}));var QE;(function(r){r.start=(e,t,o,i=1)=>{let n=!0;return e($n.on(t,o,i)),{terminate:()=>{n&&(e($n.off(t,o)),n=!1)}}}})(QE||(QE={}));var AI,_I,PI,SI,EI;AI=new WeakMap,_I=new WeakMap,PI=new WeakMap,SI=new WeakMap,EI=new WeakMap;var BI=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Wv=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},ml,Zv=class{constructor(){ml.set(this,void 0),BI(this,ml,xe.newSet(e=>e.field.address),"f")}register(e){return Wv(this,ml,"f").add(e),{terminate:()=>Wv(this,ml,"f").removeByValue(e)}}get(e){return Wv(this,ml,"f").get(e)}opt(e){return Wv(this,ml,"f").opt(e)}};ml=new WeakMap;var Ds={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 h0={min:30,max:1e3};var Gv;(function(r){r.isTimeSignatureValid=(e,t)=>!Number.isInteger(e)||e<1||e>31?vo.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(t)||t<1||t>32||t&t-1?vo.err("Denominator must be a power of two between 1 and 32"):vo.ok([e,t]),r.clampBpm=e=>Number.isFinite(e)?he(e,h0.min,h0.max):120,r.hasOverlappingRegions=e=>e.boxes().some(t=>t.accept({visitTrackBox:o=>{for(let[i,n]of T.iterateAdjacent(o.regions.pointerHub.incoming().map(({box:s})=>Ds.asRegionBox(s)).sort(({position:s},{position:a})=>s.getValue()-a.getValue()))){if(i instanceof Hn&&i.timeBase.getValue()===Nr.Seconds)return!1;if(i.position.getValue()+i.duration.getValue()>n.position.getValue())return!0}return!1}})??!1)})(Gv||(Gv={}));var XE;(function(r){r.parseTimeSignature=e=>{let[t,o]=e.split("/"),i=parseInt(t,10),n=parseInt(o,10);return Gv.isTimeSignatureValid(i,n)}})(XE||(XE={}));var qv;(function(r){r.reader=({sab:e,numChunks:t,numberOfChannels:o,bufferSize:i},n)=>{let s=!0,a=new Int32Array(e,0,2),l=new Float32Array(e,8),u=new Float32Array(o*i),d=typeof document>"u",p=()=>{if(!s)return;let h=Atomics.load(a,1),g=Atomics.load(a,0);if(h===g){if(d)Atomics.wait(a,0,g);else{setTimeout(p,1);return}g=Atomics.load(a,0)}for(;h!==g;){let v=h*o*i;u.set(l.subarray(v,v+o*i));let y=[];for(let x=0;x<o;x++){let $=x*i,D=$+i;y.push(u.slice($,D))}if(h=(h+1)%t,Atomics.store(a,1,h),!s)return;n(y)}p()};return p(),{stop:()=>s=!1}},r.writer=({sab:e,numChunks:t,numberOfChannels:o,bufferSize:i})=>{let n=new Int32Array(e,0,2),s=new Float32Array(e,8);return Object.freeze({write:a=>{if(a.length!==o)return;for(let d of a)if(d.length!==i)return F("Each channel buffer must contain 'bufferSize' samples");let l=Atomics.load(n,0),u=l*o*i;a.forEach((d,p)=>s.set(d,u+p*i)),Atomics.store(n,0,(l+1)%t),Atomics.notify(n,0)}})}})(qv||(qv={}));var f0={isRegion:r=>Ds.isRegionBox(r.box),isLoopableRegion:r=>Ds.isLoopableRegionBox(r.box)};var FI=function(r,e,t,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},co=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},jh,po,Hv,Jv=class{constructor(e){jh.add(this),po.set(this,void 0),FI(this,po,e,"f")}getTempoAt(e){let t=co(this,po,"f").box.bpm.getValue();return co(this,po,"f").tempoTrackEvents.mapOr(o=>o.valueAt(e,t),t)}ppqnToSeconds(e){return this.intervalToSeconds(0,e)}secondsToPPQN(e){return co(this,jh,"m",Hv).call(this,e)}intervalToSeconds(e,t){if(e>=t)return 0;let o=co(this,po,"f").box.bpm.getValue(),i=co(this,po,"f").tempoTrackEvents;if(i.isEmpty())return q.pulsesToSeconds(t-e,o);let n=i.unwrap();if(n.events.isEmpty())return q.pulsesToSeconds(t-e,o);let s=0,a=e;for(;a<t;){let l=n.valueAt(a,o),u=Bd(a,Ys),d=u<=a?u+Ys:u,p=Math.min(d,t);s+=q.pulsesToSeconds(p-a,l),a=p}return s}intervalToPPQN(e,t){if(e>=t)return 0;let o=co(this,jh,"m",Hv).call(this,e);return co(this,jh,"m",Hv).call(this,t)-o}subscribe(e){let t=new R;return t.ownAll(co(this,po,"f").box.bpm.subscribe(()=>e(this)),co(this,po,"f").catchupAndSubscribeTempoAutomation(()=>e(this))),t}};po=new WeakMap,jh=new WeakSet,Hv=function(e){if(e<=0)return 0;let t=co(this,po,"f").box.bpm.getValue(),o=co(this,po,"f").tempoTrackEvents;if(o.isEmpty())return q.secondsToPulses(e,t);let i=o.unwrap();if(i.events.isEmpty())return q.secondsToPulses(e,t);let n=0,s=0;for(;n<e;){let a=i.valueAt(s,t),l=Bd(s,Ys),u=l<=s?l+Ys:l,d=u-s,p=q.pulsesToSeconds(d,a);if(n+p>=e){let h=e-n;s+=q.secondsToPulses(h,a);break}n+=p,s=u}return s};var Ho;(function(r){r[r.Off=0]="Off",r[r.On=1]="On",r[r.Loop=2]="Loop"})(Ho||(Ho={}));var NI,II,kI,$I;NI=new WeakMap,II=new WeakMap,kI=new WeakMap,$I=new WeakMap;var DI,MI,CI,TI;DI=new WeakMap,MI=new WeakMap,CI=new WeakMap,TI=new WeakMap;var Rc={[Nt.Instrument]:0,[Nt.Aux]:1,[Nt.Bus]:2,[Nt.Output]:3};var Qv;(function(r){r.create=({boxGraph:e,mandatoryBoxes:{rootBox:t,primaryAudioBus:o}},i,n,s)=>{let a=s??r.orderAndGetIndex(t,i);return console.debug(`createAudioUnit type: ${i}, insertIndex: ${a}`),st.create(e,b.generate(),l=>{l.collection.refer(t.audioUnits),l.output.refer(o.input),l.index.setValue(a),l.type.setValue(i),n.ifSome(u=>l.capture.refer(u))})},r.orderAndGetIndex=(e,t)=>{let o=Ul.collectIndexedBoxes(e.audioUnits,st),i=Rc[t],n=0;for(;n<o.length&&!(Rc[o[n].type.getValue()]>i);n++);let s=n;for(;n<o.length;)o[n].index.setValue(++n);return s},r.trackTypeToCapture=(e,t)=>{switch(t){case ne.Audio:return m.wrap(Qn.create(e,b.generate()));case ne.Notes:return m.wrap(Xn.create(e,b.generate()));default:return m.None}}})(Qv||(Qv={}));var YE;(function(r){r.create=(e,t,o,i,n)=>{console.debug(`createAudioBus '${t}', type: ${i}, color: ${n}`);let{boxGraph:s,mandatoryBoxes:{rootBox:a}}=e;M(a.isAttached(),"rootBox not attached");let l=b.generate(),u=Ki.create(s,l,p=>{p.collection.refer(a.audioBusses),p.label.setValue(t),p.icon.setValue($e.toName(o)),p.color.setValue(n.toString())}),d=Qv.create(e,i,m.None);return fr.create(s,b.generate(),p=>{p.tracks.refer(d.tracks),p.target.refer(d),p.index.setValue(0),p.type.setValue(ne.Undefined)}),u.output.refer(d.input),u}})(YE||(YE={}));var eB;(function(r){r.forAudioType=e=>{switch(e){case Nt.Output:return Ln.blue;case Nt.Aux:return Ln.purple;case Nt.Bus:return Ln.orange;case Nt.Instrument:return Ln.green;default:return Ln.dark}},r.forTrackType=e=>{switch(e){case ne.Audio:return 200;case ne.Notes:return 45;case ne.Value:return 156;default:return 0}}})(eB||(eB={}));var tB;(function(r){r.Tape={defaultName:"Tape",defaultIcon:$e.Tape,description:"Plays audio regions & clips",trackType:ne.Audio,create:(o,i,n,s,a)=>ou.create(o,b.generate(),l=>{l.label.setValue(n),l.icon.setValue($e.toName(s)),l.flutter.setValue(.2),l.wow.setValue(.05),l.noise.setValue(.02),l.saturation.setValue(.5),l.host.refer(i)})},r.Nano={defaultName:"Nano",defaultIcon:$e.NanoWave,description:"Simple sampler",trackType:ne.Notes,create:(o,i,n,s,a)=>{let l;if(G(a))l=a;else{let u=b.parse("c1678daa-4a47-4cba-b88f-4f4e384663c3"),d=5.34;l=o.findBox(u).unwrapOrElse(()=>mr.create(o,u,p=>{p.fileName.setValue("Rhode"),p.endInSeconds.setValue(d)}))}return ru.create(o,b.generate(),u=>{u.label.setValue(n),u.icon.setValue($e.toName(s)),u.file.refer(l),u.host.refer(i)})}},r.Playfield={defaultName:"Playfield",defaultIcon:$e.Playfield,description:"Drum computer",trackType:ne.Notes,create:(o,i,n,s,a)=>{let l=iu.create(o,b.generate(),u=>{u.label.setValue(n),u.icon.setValue($e.toName(s)),u.host.refer(i)});return G(a)&&a.filter(({note:u,uuid:d,name:p,durationInSeconds:h,exclude:g})=>{let v=e(o,d,p,h);Yn.create(o,b.generate(),y=>{y.device.refer(l.samples),y.file.refer(v),y.index.setValue(u),y.exclude.setValue(g)})}),l}},r.Vaporisateur={defaultName:"Vaporisateur",defaultIcon:$e.Piano,description:"Classic subtractive synthesizer",trackType:ne.Notes,create:(o,i,n,s,a)=>Yl.create(o,b.generate(),l=>{l.label.setValue(n),l.icon.setValue($e.toName(s)),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(_o.Polyphonic),l.lfo.rate.setInitValue(1),l.oscillators.fields()[0].waveform.setInitValue(Ke.saw),l.oscillators.fields()[0].volume.setInitValue(-6),l.oscillators.fields()[1].volume.setInitValue(Number.NEGATIVE_INFINITY),l.oscillators.fields()[1].waveform.setInitValue(Ke.square),l.host.refer(i),l.version.setValue(2)})},r.MIDIOutput={defaultName:"MIDIOutput",defaultIcon:$e.Midi,description:"MIDI Output",trackType:ne.Notes,create:(o,i,n,s,a)=>eu.create(o,b.generate(),l=>{l.label.setValue(n),l.icon.setValue($e.toName(s)),l.host.refer(i)})},r.Soundfont={defaultName:"Soundfont",defaultIcon:$e.SoundFont,description:"Soundfont Player",trackType:ne.Notes,create:(o,i,n,s,a)=>{a??(a={uuid:"d9f51577-2096-4671-9067-27ca2e12b329",name:"Upright Piano KW"});let l=a.uuid,u=b.parse(l),d=t(o,u,a.name);return tu.create(o,b.generate(),p=>{p.label.setValue(n),p.icon.setValue($e.toName(s)),p.host.refer(i),p.file.refer(d)})}},r.Named={Vaporisateur:r.Vaporisateur,Playfield:r.Playfield,Nano:r.Nano,Tape:r.Tape,Soundfont:r.Soundfont,MIDIOutput:r.MIDIOutput};let e=(o,i,n,s)=>o.findBox(i).unwrapOrElse(()=>mr.create(o,i,a=>{a.fileName.setValue(n),a.endInSeconds.setValue(s)})),t=(o,i,n)=>o.findBox(i).unwrapOrElse(()=>Ir.create(o,i,s=>s.fileName.setValue(n)))})(tB||(tB={}));var Ms;(function(r){r.empty=o=>{let i=new na(m.wrap(sa.create)),n=new Date().toISOString();console.debug(`New Project created on ${n}`),i.beginTransaction();let s=Ql.create(i,b.generate(),h=>{h.label.setValue("Groove Shuffle")}),a=jl.create(i,b.generate(),h=>{h.groove.refer(s),h.created.setValue(n)}),l=Ki.create(i,b.generate(),h=>{h.collection.refer(a.audioBusses),h.label.setValue("Output"),h.icon.setValue($e.toName($e.SpeakerHeadphone)),h.color.setValue(Ln.blue.toString())}),u=st.create(i,b.generate(),h=>{h.type.setValue(Nt.Output),h.collection.refer(a.audioUnits),h.output.refer(a.outputDevice),h.index.setValue(0)});o.createOutputCompressor&&Xl.create(i,b.generate(),h=>{h.label.setValue("Master Compressor"),h.index.setValue(0),h.host.refer(u.audioEffects),h.threshold.setValue(0),h.ratio.setValue(24)});let d=la.create(i,b.generate());Li.create(i,b.generate(),h=>d.tempoTrack.events.refer(h.owners)),a.timeline.refer(d.root),l.output.refer(u.input);let p=[];if(o.createDefaultUser){let h=aa.create(i,b.generate());h.root.refer(a.users),p.push(h)}return i.endTransaction(),{boxGraph:i,mandatoryBoxes:{rootBox:a,primaryAudioBus:l,primaryAudioOutputUnit:u,timelineBox:d,userInterfaceBoxes:p}}},r.encode=o=>{let i=Tt.create();i.writeInt(1330660686),i.writeInt(2);let n=o.toArrayBuffer();return i.writeInt(n.byteLength),i.writeBytes(new Int8Array(n)),i.toArrayBuffer()},r.decode=o=>{let i=new ct(o);M(i.readInt()===1330660686,"Corrupt header. Probably not an openDAW project file."),M(i.readInt()===2,"Deprecated Format");let n=i.readInt(),s=new Int8Array(n);i.readBytes(s);let a=new na(m.wrap(sa.create));return a.fromArrayBuffer(s.buffer),{boxGraph:a,mandatoryBoxes:r.findMandatoryBoxes(a)}},r.findMandatoryBoxes=o=>{let i=o.boxes().find(n=>n.accept({visitRootBox:()=>!0}));if(G(i)){let n=Ie(i.outputDevice.pointerHub.incoming().at(0)?.box,st),s=Ie(n.input.pointerHub.incoming().at(0)?.box,Ki),a=Ie(i.timeline.targetVertex.unwrap("TimelineBox not found").box,la),l=i.users.pointerHub.incoming().map(({box:u})=>Ie(u,aa));return{rootBox:i,primaryAudioBus:s,primaryAudioOutputUnit:n,timelineBox:a,userInterfaceBoxes:l}}return F("Could not find mandatory boxes")}})(Ms||(Ms={}));var Oc;(function(r){let e=({graph:a},{graph:l})=>a===l,t=(a,l)=>a.index.getValue()-l.index.getValue(),o=a=>a.accept({visitTrackBox:l=>!0})===!0;r.extractAudioUnits=(a,{boxGraph:l,mandatoryBoxes:{primaryAudioBus:u,rootBox:d}},p={})=>{M(T.satisfy(a,e),"AudioUnits must share the same BoxGraph"),M(!p.includeAux&&!p.includeBus,"Options are not yet implemented");let h=p?.excludeTimeline===!0?o:Rn.alwaysFalse,g=a.flatMap(D=>Array.from(D.graph.dependenciesOf(D,{alwaysFollowMandatory:!1,excludeBox:h}).boxes)),v=a.flatMap(D=>D.input.pointerHub.incoming().map(({box:V})=>V)),y=b.newSet(D=>D),x=[...g,...v].filter(D=>D.name!==Po.ClassName&&D.name!==da.ClassName).filter(D=>y.opt(D.address.uuid).nonEmpty()?!1:(y.add(D.address.uuid),!0)),$=i(a,x,d.audioUnits.address.uuid,u.address.uuid);return n($,l,a,x),s($,a,d),console.debug("inTransaction",l.inTransaction()),a.map(D=>Ie(d.graph.findBox($.get(D.address.uuid).target).unwrap("Target Track has not been copied"),st))},r.extractRegions=(a,{boxGraph:l,mandatoryBoxes:{primaryAudioBus:u,rootBox:d}},p=0)=>{M(T.satisfy(a,e),"Region smust be from the same BoxGraph");let h=new Set(a),g=new Set,v=new kl;a.forEach(j=>{let Y=Ie(j.regions.targetVertex.unwrap().box,fr);g.add(Y);let K=Ie(Y.tracks.targetVertex.unwrap().box,st);v.add(K,Y)}),console.debug(`Found ${v.keyCount()} audioUnits`),console.debug(`Found ${g.size} tracks`);let y=[...v.keys()],x=j=>Te(j,fr)&&!g.has(j)||Ds.isRegionBox(j)&&!h.has(j),$=y.flatMap(j=>Array.from(j.graph.dependenciesOf(j,{excludeBox:x,alwaysFollowMandatory:!0}).boxes)).filter(j=>j.name!==Po.ClassName&&j.name!==da.ClassName),D=i(y,$,d.audioUnits.address.uuid,u.address.uuid);n(D,l,y,$),s(D,y,d),v.forEach((j,Y)=>[...Y].sort(t).forEach((K,ie)=>{let re=l.findBox(D.get(K.address.uuid).target).unwrap("Target Track has not been copied");Ie(re,fr).index.setValue(ie)}));let V=a.reduce((j,Y)=>Math.min(j,Y.position.getValue()),Number.MAX_VALUE),O=p-V;a.forEach(j=>{let Y=l.findBox(D.get(j.address.uuid).target).unwrap("Target Track has not been copied"),K=Ds.asRegionBox(Y).position;K.setValue(K.getValue()+O)})};let i=(a,l,u,d)=>{let p=b.newSet(({source:h})=>h);return p.addMany([...a.filter(({output:{targetAddress:h}})=>h.nonEmpty()).map(h=>({source:h.output.targetAddress.unwrap().uuid,target:d})),...a.map(h=>({source:h.collection.targetAddress.unwrap("AudioUnitBox was not connected to a RootBox").uuid,target:u})),...a.map(h=>({source:h.address.uuid,target:b.generate()})),...l.map(({address:{uuid:h},name:g})=>({source:h,target:g===mr.ClassName||g===Ir.ClassName?h:b.generate()}))]),p},n=(a,l,u,d)=>{let p=b.newSet(h=>h);d.forEach(h=>{(h instanceof mr||h instanceof Ir)&&l.findBox(h.address.uuid).nonEmpty()&&p.add(h.address.uuid)}),B.decodeWith({map:(h,g)=>g.map(v=>a.opt(v.uuid).match({none:()=>v,some:({target:y})=>v.moveTo(y)}))},()=>{u.forEach(h=>{let g=new ct(h.toArrayBuffer()),v=h.name,y=a.get(h.address.uuid).target;l.createBox(v,y,x=>x.read(g))}),d.forEach(h=>{if((h instanceof mr||h instanceof Ir)&&p.opt(h.address.uuid).nonEmpty())return;if(h instanceof Hl){let x=h.owner.targetAddress.unwrap().uuid;if(p.opt(x).nonEmpty())return}let g=new ct(h.toArrayBuffer()),v=h.name,y=a.get(h.address.uuid).target;l.createBox(v,y,x=>x.read(g))})})},s=(a,l,u)=>l.toSorted(t).map(d=>Ie(u.graph.findBox(a.get(d.address.uuid).target).unwrap("Target Track has not been copied"),st)).forEach(d=>Ul.collectIndexedBoxes(u.audioUnits,st).toSorted((p,h)=>{let g=Rc[p.type.getValue()],v=Rc[h.type.getValue()],y=g-v;return y===0?h===d?-1:1:y}).forEach((p,h)=>p.index.setValue(h)))})(Oc||(Oc={}));var Cs;(function(r){r.MAGIC_HEADER_OPEN=1330664005,r.FORMAT_VERSION=1})(Cs||(Cs={}));var rB;(function(r){r.decode=(e,t)=>{let o=new ct(e.slice(0,8));if(o.readInt()!==Cs.MAGIC_HEADER_OPEN){Ml.info({headline:"Could Not Import Preset",message:"Invalid preset file"}).then();return}if(o.readInt()!==Cs.FORMAT_VERSION){Ml.info({headline:"Could Not Import Preset",message:"Invalid preset version"}).then();return}let i=new na(m.wrap(sa.create));try{i.fromArrayBuffer(e.slice(8))}catch(s){Ml.info({headline:"Could Not Import Preset",message:String(s)}).then();return}let n=i.boxes().filter(s=>Te(s,st)).filter(s=>s.type.getValue()!==Nt.Output);Oc.extractAudioUnits(n,t,{excludeTimeline:!0}).filter(s=>s.type.getValue()!==Nt.Output).forEach(s=>{let a=s.input.pointerHub.incoming().at(0)?.box;G(a)&&s.capture.targetVertex.ifSome(({box:l})=>{l instanceof Xn?fr.create(t.boxGraph,b.generate(),u=>{u.index.setValue(0),u.type.setValue(ne.Notes),u.target.refer(s),u.tracks.refer(s.tracks)}):l instanceof Qn&&fr.create(t.boxGraph,b.generate(),u=>{u.index.setValue(0),u.type.setValue(ne.Audio),u.target.refer(s),u.tracks.refer(s.tracks)})})})},r.replaceAudioUnit=(e,t,o)=>{console.debug("ReplaceAudioUnit with preset...");let i=Ms.empty({createDefaultUser:!1,createOutputCompressor:!1}),n=i.boxGraph,s=t.graph;n.beginTransaction(),r.decode(e,i),n.endTransaction();let a=i.mandatoryBoxes.rootBox.audioUnits.pointerHub.incoming().map(({box:x})=>Ie(x,st)).find(x=>x.type.getValue()!==Nt.Output);if(Tf(a))return vo.err("Preset contains no valid audio unit. Please send the file to the developers.");let l=a.capture.targetVertex.mapOr(({box:x})=>x.name,""),u=t.capture.targetVertex.mapOr(({box:x})=>x.name,"");if(l!==u)return vo.err("Cannot replace incompatible instruments");let d=o?.keepMIDIEffects!==!0,p=o?.keepAudioEffects!==!0;console.debug("replaceMIDIEffects",d),console.debug("replaceAudioEffects",p),oe(t.input.pointerHub.incoming().at(0)?.box,"Target has no input").delete(),d?t.midiEffects.pointerHub.incoming().forEach(({box:x})=>x.delete()):(n.beginTransaction(),a.midiEffects.pointerHub.incoming().forEach(({box:x})=>x.delete()),n.endTransaction()),p?t.audioEffects.pointerHub.incoming().forEach(({box:x})=>x.delete()):(n.beginTransaction(),a.audioEffects.pointerHub.incoming().forEach(({box:x})=>x.delete()),n.endTransaction());let h=x=>x.accept({visitTrackBox:$=>!0,visitCaptureMidiBox:$=>!0,visitCaptureAudioBox:$=>!0})===!0,g=b.newSet(({source:x})=>x),v=Array.from(n.dependenciesOf(a,{excludeBox:h,alwaysFollowMandatory:!1}).boxes);g.addMany([{source:a.address.uuid,target:t.address.uuid},...v.map(({address:{uuid:x},name:$})=>({source:x,target:$===mr.ClassName||$===Ir.ClassName?x:b.generate()}))]);let y=b.newSet(x=>x);return v.forEach(x=>{(x instanceof mr||x instanceof Ir)&&s.findBox(x.address.uuid).nonEmpty()&&y.add(x.address.uuid)}),B.decodeWith({map:(x,$)=>$.map(D=>g.opt(D.uuid).match({none:()=>D,some:({target:V})=>D.moveTo(V)}))},()=>{v.forEach(x=>{if((x instanceof mr||x instanceof Ir)&&y.opt(x.address.uuid).nonEmpty())return;let $=new ct(x.toArrayBuffer()),D=x.name,V=g.get(x.address.uuid).target;s.createBox(D,V,O=>O.read($))})}),vo.Ok}})(rB||(rB={}));var iB;(function(r){r.encode=e=>{let t=Tt.create();t.writeInt(Cs.MAGIC_HEADER_OPEN),t.writeInt(Cs.FORMAT_VERSION);let o=Ms.empty({createOutputCompressor:!1,createDefaultUser:!1});return o.boxGraph.beginTransaction(),Oc.extractAudioUnits([e],o,{excludeTimeline:!0}),o.boxGraph.endTransaction(),console.debug("SAVING..."),o.boxGraph.debugBoxes(),T.concatArrayBuffers(t.toArrayBuffer(),o.boxGraph.toArrayBuffer())}})(iB||(iB={}));var oB;(function(r){r.existingInstrumentNames=e=>e.audioUnits.pointerHub.incoming().map(({box:t})=>{let o=oe(Ie(t,st).input.pointerHub.incoming().at(0)).box;return"label"in o&&o.label instanceof C?o.label.getValue():"N/A"})})(oB||(oB={}));var Ct={};tn(Ct,{$brand:()=>Xv,$input:()=>C_,$output:()=>M_,NEVER:()=>m0,TimePrecision:()=>V_,ZodAny:()=>N1,ZodArray:()=>D1,ZodBase64:()=>Ax,ZodBase64URL:()=>_x,ZodBigInt:()=>fd,ZodBigIntFormat:()=>Ex,ZodBoolean:()=>hd,ZodCIDRv4:()=>bx,ZodCIDRv6:()=>wx,ZodCUID:()=>hx,ZodCUID2:()=>fx,ZodCatch:()=>Y1,ZodCodec:()=>Mx,ZodCustom:()=>Af,ZodCustomStringFormat:()=>dd,ZodDate:()=>vf,ZodDefault:()=>G1,ZodDiscriminatedUnion:()=>C1,ZodE164:()=>Px,ZodEmail:()=>cx,ZodEmoji:()=>dx,ZodEnum:()=>ud,ZodError:()=>mD,ZodFile:()=>K1,ZodFirstPartyTypeKind:()=>dS,ZodFunction:()=>lS,ZodGUID:()=>pf,ZodIPv4:()=>yx,ZodIPv6:()=>xx,ZodISODate:()=>ox,ZodISODateTime:()=>ix,ZodISODuration:()=>sx,ZodISOTime:()=>nx,ZodIntersection:()=>T1,ZodIssueCode:()=>vD,ZodJWT:()=>Sx,ZodKSUID:()=>vx,ZodLazy:()=>nS,ZodLiteral:()=>L1,ZodMAC:()=>A1,ZodMap:()=>U1,ZodNaN:()=>tS,ZodNanoID:()=>px,ZodNever:()=>k1,ZodNonOptional:()=>$x,ZodNull:()=>B1,ZodNullable:()=>Z1,ZodNumber:()=>pd,ZodNumberFormat:()=>_l,ZodObject:()=>xf,ZodOptional:()=>kx,ZodPipe:()=>Dx,ZodPrefault:()=>H1,ZodPromise:()=>aS,ZodReadonly:()=>rS,ZodRealError:()=>Ur,ZodRecord:()=>wf,ZodSet:()=>j1,ZodString:()=>cd,ZodStringFormat:()=>Je,ZodSuccess:()=>X1,ZodSymbol:()=>S1,ZodTemplateLiteral:()=>oS,ZodTransform:()=>W1,ZodTuple:()=>O1,ZodType:()=>Pe,ZodULID:()=>mx,ZodURL:()=>gf,ZodUUID:()=>Xo,ZodUndefined:()=>E1,ZodUnion:()=>bf,ZodUnknown:()=>I1,ZodVoid:()=>$1,ZodXID:()=>gx,ZodXor:()=>M1,_ZodString:()=>ux,_default:()=>q1,_function:()=>MN,any:()=>pN,array:()=>yf,base64:()=>HF,base64url:()=>JF,bigint:()=>aN,boolean:()=>P1,catch:()=>eS,check:()=>CN,cidrv4:()=>GF,cidrv6:()=>qF,clone:()=>Ar,codec:()=>kN,coerce:()=>pS,config:()=>_t,core:()=>Mn,cuid:()=>VF,cuid2:()=>zF,custom:()=>TN,date:()=>fN,decode:()=>m1,decodeAsync:()=>v1,describe:()=>RN,discriminatedUnion:()=>bN,e164:()=>QF,email:()=>NF,emoji:()=>RF,encode:()=>f1,encodeAsync:()=>g1,endsWith:()=>Yc,enum:()=>Nx,file:()=>BN,flattenError:()=>Qh,float32:()=>iN,float64:()=>oN,formatError:()=>Xh,fromJSONSchema:()=>KN,function:()=>MN,getErrorMap:()=>xD,globalRegistry:()=>_r,gt:()=>Qo,gte:()=>Pr,guid:()=>IF,hash:()=>rN,hex:()=>tN,hostname:()=>eN,httpUrl:()=>TF,includes:()=>Qc,instanceof:()=>VN,int:()=>lx,int32:()=>nN,int64:()=>lN,intersection:()=>R1,ipv4:()=>KF,ipv6:()=>ZF,iso:()=>ld,json:()=>UN,jwt:()=>XF,keyof:()=>mN,ksuid:()=>LF,lazy:()=>sS,length:()=>wl,literal:()=>EN,locales:()=>lf,looseObject:()=>yN,looseRecord:()=>AN,lowercase:()=>Hc,lt:()=>Jo,lte:()=>li,mac:()=>WF,map:()=>_N,maxLength:()=>bl,maxSize:()=>xl,meta:()=>ON,mime:()=>ed,minLength:()=>Dn,minSize:()=>Ls,multipleOf:()=>js,nan:()=>IN,nanoid:()=>OF,nativeEnum:()=>SN,negative:()=>qy,never:()=>Bx,nonnegative:()=>Jy,nonoptional:()=>Q1,nonpositive:()=>Hy,normalize:()=>td,null:()=>F1,nullable:()=>ff,nullish:()=>FN,number:()=>_1,object:()=>gN,optional:()=>hf,overwrite:()=>fo,parse:()=>c1,parseAsync:()=>d1,partialRecord:()=>wN,pipe:()=>mf,positive:()=>Gy,prefault:()=>J1,preprocess:()=>jN,prettifyError:()=>B0,promise:()=>DN,property:()=>Qy,readonly:()=>iS,record:()=>z1,refine:()=>uS,regex:()=>qc,regexes:()=>Vi,registry:()=>Ey,safeDecode:()=>x1,safeDecodeAsync:()=>w1,safeEncode:()=>y1,safeEncodeAsync:()=>b1,safeParse:()=>p1,safeParseAsync:()=>h1,set:()=>PN,setErrorMap:()=>yD,size:()=>Gc,slugify:()=>nd,startsWith:()=>Xc,strictObject:()=>vN,string:()=>ax,stringFormat:()=>YF,stringbool:()=>zN,success:()=>NN,superRefine:()=>cS,symbol:()=>cN,templateLiteral:()=>$N,toJSONSchema:()=>ex,toLowerCase:()=>id,toUpperCase:()=>od,transform:()=>Ix,treeifyError:()=>E0,trim:()=>rd,tuple:()=>V1,uint32:()=>sN,uint64:()=>uN,ulid:()=>UF,undefined:()=>dN,union:()=>Fx,unknown:()=>Al,uppercase:()=>Jc,url:()=>CF,util:()=>U,uuid:()=>kF,uuidv4:()=>$F,uuidv6:()=>DF,uuidv7:()=>MF,void:()=>hN,xid:()=>jF,xor:()=>xN});var Mn={};tn(Mn,{$ZodAny:()=>r_,$ZodArray:()=>a_,$ZodAsyncError:()=>ho,$ZodBase64:()=>ZA,$ZodBase64URL:()=>GA,$ZodBigInt:()=>by,$ZodBigIntFormat:()=>XA,$ZodBoolean:()=>rf,$ZodCIDRv4:()=>LA,$ZodCIDRv6:()=>KA,$ZodCUID:()=>kA,$ZodCUID2:()=>$A,$ZodCatch:()=>S_,$ZodCheck:()=>Ye,$ZodCheckBigIntFormat:()=>aA,$ZodCheckEndsWith:()=>xA,$ZodCheckGreaterThan:()=>hy,$ZodCheckIncludes:()=>vA,$ZodCheckLengthEquals:()=>hA,$ZodCheckLessThan:()=>py,$ZodCheckLowerCase:()=>mA,$ZodCheckMaxLength:()=>dA,$ZodCheckMaxSize:()=>lA,$ZodCheckMimeType:()=>wA,$ZodCheckMinLength:()=>pA,$ZodCheckMinSize:()=>uA,$ZodCheckMultipleOf:()=>nA,$ZodCheckNumberFormat:()=>sA,$ZodCheckOverwrite:()=>AA,$ZodCheckProperty:()=>bA,$ZodCheckRegex:()=>fA,$ZodCheckSizeEquals:()=>cA,$ZodCheckStartsWith:()=>yA,$ZodCheckStringFormat:()=>Zc,$ZodCheckUpperCase:()=>gA,$ZodCodec:()=>nf,$ZodCustom:()=>D_,$ZodCustomStringFormat:()=>JA,$ZodDate:()=>s_,$ZodDefault:()=>w_,$ZodDiscriminatedUnion:()=>c_,$ZodE164:()=>qA,$ZodEmail:()=>BA,$ZodEmoji:()=>NA,$ZodEncodeError:()=>Ts,$ZodEnum:()=>m_,$ZodError:()=>Jh,$ZodFile:()=>v_,$ZodFunction:()=>I_,$ZodGUID:()=>SA,$ZodIPv4:()=>zA,$ZodIPv6:()=>UA,$ZodISODate:()=>RA,$ZodISODateTime:()=>TA,$ZodISODuration:()=>VA,$ZodISOTime:()=>OA,$ZodIntersection:()=>d_,$ZodJWT:()=>HA,$ZodKSUID:()=>CA,$ZodLazy:()=>$_,$ZodLiteral:()=>g_,$ZodMAC:()=>jA,$ZodMap:()=>h_,$ZodNaN:()=>E_,$ZodNanoID:()=>IA,$ZodNever:()=>o_,$ZodNonOptional:()=>__,$ZodNull:()=>t_,$ZodNullable:()=>b_,$ZodNumber:()=>xy,$ZodNumberFormat:()=>QA,$ZodObject:()=>kB,$ZodObjectJIT:()=>l_,$ZodOptional:()=>x_,$ZodPipe:()=>B_,$ZodPrefault:()=>A_,$ZodPromise:()=>k_,$ZodReadonly:()=>F_,$ZodRealError:()=>zr,$ZodRecord:()=>p_,$ZodRegistry:()=>Sy,$ZodSet:()=>f_,$ZodString:()=>yl,$ZodStringFormat:()=>He,$ZodSuccess:()=>P_,$ZodSymbol:()=>YA,$ZodTemplateLiteral:()=>N_,$ZodTransform:()=>y_,$ZodTuple:()=>wy,$ZodType:()=>ve,$ZodULID:()=>DA,$ZodURL:()=>FA,$ZodUUID:()=>EA,$ZodUndefined:()=>e_,$ZodUnion:()=>of,$ZodUnknown:()=>i_,$ZodVoid:()=>n_,$ZodXID:()=>MA,$ZodXor:()=>u_,$brand:()=>Xv,$constructor:()=>w,$input:()=>C_,$output:()=>M_,Doc:()=>tf,JSONSchema:()=>BF,JSONSchemaGenerator:()=>tx,NEVER:()=>m0,TimePrecision:()=>V_,_any:()=>sP,_array:()=>hP,_base64:()=>Ly,_base64url:()=>Ky,_bigint:()=>Y_,_boolean:()=>Q_,_catch:()=>aD,_check:()=>EF,_cidrv4:()=>Uy,_cidrv6:()=>jy,_coercedBigint:()=>eP,_coercedBoolean:()=>X_,_coercedDate:()=>dP,_coercedNumber:()=>W_,_coercedString:()=>R_,_cuid:()=>My,_cuid2:()=>Cy,_custom:()=>mP,_date:()=>cP,_decode:()=>oy,_decodeAsync:()=>sy,_default:()=>oD,_discriminatedUnion:()=>Z$,_e164:()=>Wy,_email:()=>By,_emoji:()=>$y,_encode:()=>iy,_encodeAsync:()=>ny,_endsWith:()=>Yc,_enum:()=>X$,_file:()=>fP,_float32:()=>G_,_float64:()=>q_,_gt:()=>Qo,_gte:()=>Pr,_guid:()=>uf,_includes:()=>Qc,_int:()=>Z_,_int32:()=>H_,_int64:()=>tP,_intersection:()=>G$,_ipv4:()=>Vy,_ipv6:()=>zy,_isoDate:()=>U_,_isoDateTime:()=>z_,_isoDuration:()=>L_,_isoTime:()=>j_,_jwt:()=>Zy,_ksuid:()=>Oy,_lazy:()=>dD,_length:()=>wl,_literal:()=>eD,_lowercase:()=>Hc,_lt:()=>Jo,_lte:()=>li,_mac:()=>O_,_map:()=>J$,_max:()=>li,_maxLength:()=>bl,_maxSize:()=>xl,_mime:()=>ed,_min:()=>Pr,_minLength:()=>Dn,_minSize:()=>Ls,_multipleOf:()=>js,_nan:()=>pP,_nanoid:()=>Dy,_nativeEnum:()=>Y$,_negative:()=>qy,_never:()=>lP,_nonnegative:()=>Jy,_nonoptional:()=>nD,_nonpositive:()=>Hy,_normalize:()=>td,_null:()=>nP,_nullable:()=>iD,_number:()=>K_,_optional:()=>rD,_overwrite:()=>fo,_parse:()=>jc,_parseAsync:()=>Lc,_pipe:()=>lD,_positive:()=>Gy,_promise:()=>pD,_property:()=>Qy,_readonly:()=>uD,_record:()=>H$,_refine:()=>gP,_regex:()=>qc,_safeDecode:()=>ly,_safeDecodeAsync:()=>cy,_safeEncode:()=>ay,_safeEncodeAsync:()=>uy,_safeParse:()=>Kc,_safeParseAsync:()=>Wc,_set:()=>Q$,_size:()=>Gc,_slugify:()=>nd,_startsWith:()=>Xc,_string:()=>T_,_stringFormat:()=>sd,_stringbool:()=>bP,_success:()=>sD,_superRefine:()=>vP,_symbol:()=>iP,_templateLiteral:()=>cD,_toLowerCase:()=>id,_toUpperCase:()=>od,_transform:()=>tD,_trim:()=>rd,_tuple:()=>q$,_uint32:()=>J_,_uint64:()=>rP,_ulid:()=>Ty,_undefined:()=>oP,_union:()=>K$,_unknown:()=>aP,_uppercase:()=>Jc,_url:()=>cf,_uuid:()=>Fy,_uuidv4:()=>Ny,_uuidv6:()=>Iy,_uuidv7:()=>ky,_void:()=>uP,_xid:()=>Ry,_xor:()=>W$,clone:()=>Ar,config:()=>_t,createStandardJSONSchemaMethod:()=>ad,createToJSONSchemaMethod:()=>wP,decode:()=>ck,decodeAsync:()=>pk,describe:()=>yP,encode:()=>uk,encodeAsync:()=>dk,extractDefs:()=>Ws,finalize:()=>Zs,flattenError:()=>Qh,formatError:()=>Xh,globalConfig:()=>Lh,globalRegistry:()=>_r,initializeContext:()=>Ks,isValidBase64:()=>WA,isValidBase64URL:()=>BB,isValidJWT:()=>FB,locales:()=>lf,meta:()=>xP,parse:()=>ty,parseAsync:()=>ry,prettifyError:()=>B0,process:()=>Ze,regexes:()=>Vi,registry:()=>Ey,safeDecode:()=>fk,safeDecodeAsync:()=>gk,safeEncode:()=>hk,safeEncodeAsync:()=>mk,safeParse:()=>F0,safeParseAsync:()=>N0,toDotPath:()=>uB,toJSONSchema:()=>ex,treeifyError:()=>E0,util:()=>U,version:()=>_A});var m0=Object.freeze({status:"aborted"});function w(r,e,t){function o(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(r))return;a._zod.traits.add(r),e(a,l);let u=s.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){let h=d[p];h in a||(a[h]=u[h].bind(a))}}let i=t?.Parent??Object;class n extends i{}Object.defineProperty(n,"name",{value:r});function s(a){var l;let u=t?.Parent?new n:this;o(u,a),(l=u._zod).deferred??(l.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>t?.Parent&&a instanceof t.Parent?!0:a?._zod?.traits?.has(r)}),Object.defineProperty(s,"name",{value:r}),s}var Xv=Symbol("zod_brand"),ho=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ts=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},Lh={};function _t(r){return r&&Object.assign(Lh,r),Lh}var U={};tn(U,{BIGINT_FORMAT_RANGES:()=>S0,Class:()=>v0,NUMBER_FORMAT_RANGES:()=>P0,aborted:()=>Us,allowsEval:()=>b0,assert:()=>UI,assertEqual:()=>RI,assertIs:()=>VI,assertNever:()=>zI,assertNotEqual:()=>OI,assignProp:()=>Os,base64ToUint8Array:()=>sB,base64urlToUint8Array:()=>ok,cached:()=>zc,captureStackTrace:()=>ey,cleanEnum:()=>ik,cleanRegex:()=>Zh,clone:()=>Ar,cloneDef:()=>LI,createTransparentProxy:()=>HI,defineLazy:()=>ke,esc:()=>Yv,escapeRegex:()=>Oi,extend:()=>XI,finalizeIssue:()=>Vr,floatSafeRemainder:()=>y0,getElementAtPath:()=>KI,getEnumValues:()=>Wh,getLengthableOrigin:()=>Hh,getParsedType:()=>qI,getSizableOrigin:()=>qh,hexToUint8Array:()=>sk,isObject:()=>gl,isPlainObject:()=>zs,issue:()=>Uc,joinValues:()=>k,jsonStringifyReplacer:()=>Vc,merge:()=>ek,mergeDefs:()=>Vs,normalizeParams:()=>L,nullish:()=>Rs,numKeys:()=>GI,objectClone:()=>jI,omit:()=>QI,optionalKeys:()=>_0,partial:()=>tk,pick:()=>JI,prefixIssues:()=>ai,primitiveTypes:()=>A0,promiseAllObject:()=>WI,propertyKeyTypes:()=>Gh,randomString:()=>ZI,required:()=>rk,safeExtend:()=>YI,shallowClone:()=>w0,slugify:()=>x0,stringifyPrimitive:()=>z,uint8ArrayToBase64:()=>aB,uint8ArrayToBase64url:()=>nk,uint8ArrayToHex:()=>ak,unwrapMessage:()=>Kh});function RI(r){return r}function OI(r){return r}function VI(r){}function zI(r){throw new Error("Unexpected value in exhaustive check")}function UI(r){}function Wh(r){let e=Object.values(r).filter(o=>typeof o=="number");return Object.entries(r).filter(([o,i])=>e.indexOf(+o)===-1).map(([o,i])=>i)}function k(r,e="|"){return r.map(t=>z(t)).join(e)}function Vc(r,e){return typeof e=="bigint"?e.toString():e}function zc(r){return{get value(){{let t=r();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}function Rs(r){return r==null}function Zh(r){let e=r.startsWith("^")?1:0,t=r.endsWith("$")?r.length-1:r.length;return r.slice(e,t)}function y0(r,e){let t=(r.toString().split(".")[1]||"").length,o=e.toString(),i=(o.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(o)){let l=o.match(/\d?e-(\d?)/);l?.[1]&&(i=Number.parseInt(l[1]))}let n=t>i?t:i,s=Number.parseInt(r.toFixed(n).replace(".","")),a=Number.parseInt(e.toFixed(n).replace(".",""));return s%a/10**n}var nB=Symbol("evaluating");function ke(r,e,t){let o;Object.defineProperty(r,e,{get(){if(o!==nB)return o===void 0&&(o=nB,o=t()),o},set(i){Object.defineProperty(r,e,{value:i})},configurable:!0})}function jI(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function Os(r,e,t){Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Vs(...r){let e={};for(let t of r){let o=Object.getOwnPropertyDescriptors(t);Object.assign(e,o)}return Object.defineProperties({},e)}function LI(r){return Vs(r._zod.def)}function KI(r,e){return e?e.reduce((t,o)=>t?.[o],r):r}function WI(r){let e=Object.keys(r),t=e.map(o=>r[o]);return Promise.all(t).then(o=>{let i={};for(let n=0;n<e.length;n++)i[e[n]]=o[n];return i})}function ZI(r=10){let e="abcdefghijklmnopqrstuvwxyz",t="";for(let o=0;o<r;o++)t+=e[Math.floor(Math.random()*e.length)];return t}function Yv(r){return JSON.stringify(r)}function x0(r){return r.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ey="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function gl(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var b0=zc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let r=Function;return new r(""),!0}catch{return!1}});function zs(r){if(gl(r)===!1)return!1;let e=r.constructor;if(e===void 0||typeof e!="function")return!0;let t=e.prototype;return!(gl(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function w0(r){return zs(r)?{...r}:Array.isArray(r)?[...r]:r}function GI(r){let e=0;for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&e++;return e}var qI=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}`)}},Gh=new Set(["string","number","symbol"]),A0=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Oi(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ar(r,e,t){let o=new r._zod.constr(e??r._zod.def);return(!e||t?.parent)&&(o._zod.parent=r),o}function L(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 HI(r){let e;return new Proxy({},{get(t,o,i){return e??(e=r()),Reflect.get(e,o,i)},set(t,o,i,n){return e??(e=r()),Reflect.set(e,o,i,n)},has(t,o){return e??(e=r()),Reflect.has(e,o)},deleteProperty(t,o){return e??(e=r()),Reflect.deleteProperty(e,o)},ownKeys(t){return e??(e=r()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(t,o){return e??(e=r()),Reflect.getOwnPropertyDescriptor(e,o)},defineProperty(t,o,i){return e??(e=r()),Reflect.defineProperty(e,o,i)}})}function z(r){return typeof r=="bigint"?r.toString()+"n":typeof r=="string"?`"${r}"`:`${r}`}function _0(r){return Object.keys(r).filter(e=>r[e]._zod.optin==="optional"&&r[e]._zod.optout==="optional")}var P0={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]},S0={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function JI(r,e){let t=r._zod.def,o=Vs(r._zod.def,{get shape(){let i={};for(let n in e){if(!(n in t.shape))throw new Error(`Unrecognized key: "${n}"`);e[n]&&(i[n]=t.shape[n])}return Os(this,"shape",i),i},checks:[]});return Ar(r,o)}function QI(r,e){let t=r._zod.def,o=Vs(r._zod.def,{get shape(){let i={...r._zod.def.shape};for(let n in e){if(!(n in t.shape))throw new Error(`Unrecognized key: "${n}"`);e[n]&&delete i[n]}return Os(this,"shape",i),i},checks:[]});return Ar(r,o)}function XI(r,e){if(!zs(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 i=Vs(r._zod.def,{get shape(){let n={...r._zod.def.shape,...e};return Os(this,"shape",n),n},checks:[]});return Ar(r,i)}function YI(r,e){if(!zs(e))throw new Error("Invalid input to safeExtend: expected a plain object");let t={...r._zod.def,get shape(){let o={...r._zod.def.shape,...e};return Os(this,"shape",o),o},checks:r._zod.def.checks};return Ar(r,t)}function ek(r,e){let t=Vs(r._zod.def,{get shape(){let o={...r._zod.def.shape,...e._zod.def.shape};return Os(this,"shape",o),o},get catchall(){return e._zod.def.catchall},checks:[]});return Ar(r,t)}function tk(r,e,t){let o=Vs(e._zod.def,{get shape(){let i=e._zod.def.shape,n={...i};if(t)for(let s in t){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(n[s]=r?new r({type:"optional",innerType:i[s]}):i[s])}else for(let s in i)n[s]=r?new r({type:"optional",innerType:i[s]}):i[s];return Os(this,"shape",n),n},checks:[]});return Ar(e,o)}function rk(r,e,t){let o=Vs(e._zod.def,{get shape(){let i=e._zod.def.shape,n={...i};if(t)for(let s in t){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(n[s]=new r({type:"nonoptional",innerType:i[s]}))}else for(let s in i)n[s]=new r({type:"nonoptional",innerType:i[s]});return Os(this,"shape",n),n},checks:[]});return Ar(e,o)}function Us(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 ai(r,e){return e.map(t=>{var o;return(o=t).path??(o.path=[]),t.path.unshift(r),t})}function Kh(r){return typeof r=="string"?r:r?.message}function Vr(r,e,t){let o={...r,path:r.path??[]};if(!r.message){let i=Kh(r.inst?._zod.def?.error?.(r))??Kh(e?.error?.(r))??Kh(t.customError?.(r))??Kh(t.localeError?.(r))??"Invalid input";o.message=i}return delete o.inst,delete o.continue,e?.reportInput||delete o.input,o}function qh(r){return r instanceof Set?"set":r instanceof Map?"map":r instanceof File?"file":"unknown"}function Hh(r){return Array.isArray(r)?"array":typeof r=="string"?"string":"unknown"}function Uc(...r){let[e,t,o]=r;return typeof e=="string"?{message:e,code:"custom",input:t,inst:o}:{...e}}function ik(r){return Object.entries(r).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function sB(r){let e=atob(r),t=new Uint8Array(e.length);for(let o=0;o<e.length;o++)t[o]=e.charCodeAt(o);return t}function aB(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e)}function ok(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t="=".repeat((4-e.length%4)%4);return sB(e+t)}function nk(r){return aB(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function sk(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 o=0;o<e.length;o+=2)t[o/2]=Number.parseInt(e.slice(o,o+2),16);return t}function ak(r){return Array.from(r).map(e=>e.toString(16).padStart(2,"0")).join("")}var v0=class{constructor(...e){}};var lB=(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,Vc,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},Jh=w("$ZodError",lB),zr=w("$ZodError",lB,{Parent:Error});function Qh(r,e=t=>t.message){let t={},o=[];for(let i of r.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:t}}function Xh(r,e=t=>t.message){let t={_errors:[]},o=i=>{for(let n of i.issues)if(n.code==="invalid_union"&&n.errors.length)n.errors.map(s=>o({issues:s}));else if(n.code==="invalid_key")o({issues:n.issues});else if(n.code==="invalid_element")o({issues:n.issues});else if(n.path.length===0)t._errors.push(e(n));else{let s=t,a=0;for(;a<n.path.length;){let l=n.path[a];a===n.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(e(n))):s[l]=s[l]||{_errors:[]},s=s[l],a++}}};return o(r),t}function E0(r,e=t=>t.message){let t={errors:[]},o=(i,n=[])=>{var s,a;for(let l of i.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>o({issues:u},l.path));else if(l.code==="invalid_key")o({issues:l.issues},l.path);else if(l.code==="invalid_element")o({issues:l.issues},l.path);else{let u=[...n,...l.path];if(u.length===0){t.errors.push(e(l));continue}let d=t,p=0;for(;p<u.length;){let h=u[p],g=p===u.length-1;typeof h=="string"?(d.properties??(d.properties={}),(s=d.properties)[h]??(s[h]={errors:[]}),d=d.properties[h]):(d.items??(d.items=[]),(a=d.items)[h]??(a[h]={errors:[]}),d=d.items[h]),g&&d.errors.push(e(l)),p++}}};return o(r),t}function uB(r){let e=[],t=r.map(o=>typeof o=="object"?o.key:o);for(let o of t)typeof o=="number"?e.push(`[${o}]`):typeof o=="symbol"?e.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?e.push(`[${JSON.stringify(o)}]`):(e.length&&e.push("."),e.push(o));return e.join("")}function B0(r){let e=[],t=[...r.issues].sort((o,i)=>(o.path??[]).length-(i.path??[]).length);for(let o of t)e.push(`\u2716 ${o.message}`),o.path?.length&&e.push(` \u2192 at ${uB(o.path)}`);return e.join(`
4
- `)}var jc=r=>(e,t,o,i)=>{let n=o?Object.assign(o,{async:!1}):{async:!1},s=e._zod.run({value:t,issues:[]},n);if(s instanceof Promise)throw new ho;if(s.issues.length){let a=new(i?.Err??r)(s.issues.map(l=>Vr(l,n,_t())));throw ey(a,i?.callee),a}return s.value},ty=jc(zr),Lc=r=>async(e,t,o,i)=>{let n=o?Object.assign(o,{async:!0}):{async:!0},s=e._zod.run({value:t,issues:[]},n);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(i?.Err??r)(s.issues.map(l=>Vr(l,n,_t())));throw ey(a,i?.callee),a}return s.value},ry=Lc(zr),Kc=r=>(e,t,o)=>{let i=o?{...o,async:!1}:{async:!1},n=e._zod.run({value:t,issues:[]},i);if(n instanceof Promise)throw new ho;return n.issues.length?{success:!1,error:new(r??Jh)(n.issues.map(s=>Vr(s,i,_t())))}:{success:!0,data:n.value}},F0=Kc(zr),Wc=r=>async(e,t,o)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},n=e._zod.run({value:t,issues:[]},i);return n instanceof Promise&&(n=await n),n.issues.length?{success:!1,error:new r(n.issues.map(s=>Vr(s,i,_t())))}:{success:!0,data:n.value}},N0=Wc(zr),iy=r=>(e,t,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return jc(r)(e,t,i)},uk=iy(zr),oy=r=>(e,t,o)=>jc(r)(e,t,o),ck=oy(zr),ny=r=>async(e,t,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Lc(r)(e,t,i)},dk=ny(zr),sy=r=>async(e,t,o)=>Lc(r)(e,t,o),pk=sy(zr),ay=r=>(e,t,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Kc(r)(e,t,i)},hk=ay(zr),ly=r=>(e,t,o)=>Kc(r)(e,t,o),fk=ly(zr),uy=r=>async(e,t,o)=>{let i=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Wc(r)(e,t,i)},mk=uy(zr),cy=r=>async(e,t,o)=>Wc(r)(e,t,o),gk=cy(zr);var Vi={};tn(Vi,{base64:()=>W0,base64url:()=>dy,bigint:()=>Q0,boolean:()=>eA,browserEmail:()=>Pk,cidrv4:()=>L0,cidrv6:()=>K0,cuid:()=>I0,cuid2:()=>k0,date:()=>G0,datetime:()=>H0,domain:()=>Bk,duration:()=>T0,e164:()=>Z0,email:()=>O0,emoji:()=>V0,extendedDuration:()=>vk,guid:()=>R0,hex:()=>Fk,hostname:()=>Ek,html5Email:()=>wk,idnEmail:()=>_k,integer:()=>X0,ipv4:()=>z0,ipv6:()=>U0,ksuid:()=>M0,lowercase:()=>iA,mac:()=>j0,md5_base64:()=>Ik,md5_base64url:()=>kk,md5_hex:()=>Nk,nanoid:()=>C0,null:()=>tA,number:()=>Y0,rfc5322Email:()=>Ak,sha1_base64:()=>Dk,sha1_base64url:()=>Mk,sha1_hex:()=>$k,sha256_base64:()=>Tk,sha256_base64url:()=>Rk,sha256_hex:()=>Ck,sha384_base64:()=>Vk,sha384_base64url:()=>zk,sha384_hex:()=>Ok,sha512_base64:()=>jk,sha512_base64url:()=>Lk,sha512_hex:()=>Uk,string:()=>J0,time:()=>q0,ulid:()=>$0,undefined:()=>rA,unicodeEmail:()=>cB,uppercase:()=>oA,uuid:()=>vl,uuid4:()=>yk,uuid6:()=>xk,uuid7:()=>bk,xid:()=>D0});var I0=/^[cC][^\s-]{8,}$/,k0=/^[0-9a-z]+$/,$0=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,D0=/^[0-9a-vA-V]{20}$/,M0=/^[A-Za-z0-9]{27}$/,C0=/^[a-zA-Z0-9_-]{21}$/,T0=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,vk=/^[-+]?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)?)??$/,R0=/^([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})$/,vl=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)$/,yk=vl(4),xk=vl(6),bk=vl(7),O0=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,wk=/^[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])?)*$/,Ak=/^(([^<>()\[\]\\.,;:\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,}))$/,cB=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,_k=cB,Pk=/^[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])?)*$/,Sk="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function V0(){return new RegExp(Sk,"u")}var z0=/^(?:(?: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])$/,U0=/^(([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}|:))$/,j0=r=>{let e=Oi(r??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},L0=/^((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])$/,K0=/^(([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])$/,W0=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dy=/^[A-Za-z0-9_-]*$/,Ek=/^(?=.{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])?)*\.?$/,Bk=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Z0=/^\+(?:[0-9]){6,14}[0-9]$/,dB="(?:(?:\\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])))",G0=new RegExp(`^${dB}$`);function pB(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 q0(r){return new RegExp(`^${pB(r)}$`)}function H0(r){let e=pB({precision:r.precision}),t=["Z"];r.local&&t.push(""),r.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${e}(?:${t.join("|")})`;return new RegExp(`^${dB}T(?:${o})$`)}var J0=r=>{let e=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Q0=/^-?\d+n?$/,X0=/^-?\d+$/,Y0=/^-?\d+(?:\.\d+)?/,eA=/^(?:true|false)$/i,tA=/^null$/i;var rA=/^undefined$/i;var iA=/^[^A-Z]*$/,oA=/^[^a-z]*$/,Fk=/^[0-9a-fA-F]*$/;function Yh(r,e){return new RegExp(`^[A-Za-z0-9+/]{${r}}${e}$`)}function ef(r){return new RegExp(`^[A-Za-z0-9_-]{${r}}$`)}var Nk=/^[0-9a-fA-F]{32}$/,Ik=Yh(22,"=="),kk=ef(22),$k=/^[0-9a-fA-F]{40}$/,Dk=Yh(27,"="),Mk=ef(27),Ck=/^[0-9a-fA-F]{64}$/,Tk=Yh(43,"="),Rk=ef(43),Ok=/^[0-9a-fA-F]{96}$/,Vk=Yh(64,""),zk=ef(64),Uk=/^[0-9a-fA-F]{128}$/,jk=Yh(86,"=="),Lk=ef(86);var Ye=w("$ZodCheck",(r,e)=>{var t;r._zod??(r._zod={}),r._zod.def=e,(t=r._zod).onattach??(t.onattach=[])}),fB={number:"number",bigint:"bigint",object:"date"},py=w("$ZodCheckLessThan",(r,e)=>{Ye.init(r,e);let t=fB[typeof e.value];r._zod.onattach.push(o=>{let i=o._zod.bag,n=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<n&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),r._zod.check=o=>{(e.inclusive?o.value<=e.value:o.value<e.value)||o.issues.push({origin:t,code:"too_big",maximum:e.value,input:o.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),hy=w("$ZodCheckGreaterThan",(r,e)=>{Ye.init(r,e);let t=fB[typeof e.value];r._zod.onattach.push(o=>{let i=o._zod.bag,n=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>n&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),r._zod.check=o=>{(e.inclusive?o.value>=e.value:o.value>e.value)||o.issues.push({origin:t,code:"too_small",minimum:e.value,input:o.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),nA=w("$ZodCheckMultipleOf",(r,e)=>{Ye.init(r,e),r._zod.onattach.push(t=>{var o;(o=t._zod.bag).multipleOf??(o.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):y0(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})}}),sA=w("$ZodCheckNumberFormat",(r,e)=>{Ye.init(r,e),e.format=e.format||"float64";let t=e.format?.includes("int"),o=t?"int":"number",[i,n]=P0[e.format];r._zod.onattach.push(s=>{let a=s._zod.bag;a.format=e.format,a.minimum=i,a.maximum=n,t&&(a.pattern=X0)}),r._zod.check=s=>{let a=s.value;if(t){if(!Number.isInteger(a)){s.issues.push({expected:o,format:e.format,code:"invalid_type",continue:!1,input:a,inst:r});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:o,continue:!e.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:o,continue:!e.abort});return}}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:r,continue:!e.abort}),a>n&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:n,inst:r})}}),aA=w("$ZodCheckBigIntFormat",(r,e)=>{Ye.init(r,e);let[t,o]=S0[e.format];r._zod.onattach.push(i=>{let n=i._zod.bag;n.format=e.format,n.minimum=t,n.maximum=o}),r._zod.check=i=>{let n=i.value;n<t&&i.issues.push({origin:"bigint",input:n,code:"too_small",minimum:t,inclusive:!0,inst:r,continue:!e.abort}),n>o&&i.issues.push({origin:"bigint",input:n,code:"too_big",maximum:o,inst:r})}}),lA=w("$ZodCheckMaxSize",(r,e)=>{var t;Ye.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!Rs(i)&&i.size!==void 0}),r._zod.onattach.push(o=>{let i=o._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(o._zod.bag.maximum=e.maximum)}),r._zod.check=o=>{let i=o.value;i.size<=e.maximum||o.issues.push({origin:qh(i),code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),uA=w("$ZodCheckMinSize",(r,e)=>{var t;Ye.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!Rs(i)&&i.size!==void 0}),r._zod.onattach.push(o=>{let i=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(o._zod.bag.minimum=e.minimum)}),r._zod.check=o=>{let i=o.value;i.size>=e.minimum||o.issues.push({origin:qh(i),code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),cA=w("$ZodCheckSizeEquals",(r,e)=>{var t;Ye.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!Rs(i)&&i.size!==void 0}),r._zod.onattach.push(o=>{let i=o._zod.bag;i.minimum=e.size,i.maximum=e.size,i.size=e.size}),r._zod.check=o=>{let i=o.value,n=i.size;if(n===e.size)return;let s=n>e.size;o.issues.push({origin:qh(i),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:o.value,inst:r,continue:!e.abort})}}),dA=w("$ZodCheckMaxLength",(r,e)=>{var t;Ye.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!Rs(i)&&i.length!==void 0}),r._zod.onattach.push(o=>{let i=o._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(o._zod.bag.maximum=e.maximum)}),r._zod.check=o=>{let i=o.value;if(i.length<=e.maximum)return;let s=Hh(i);o.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),pA=w("$ZodCheckMinLength",(r,e)=>{var t;Ye.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!Rs(i)&&i.length!==void 0}),r._zod.onattach.push(o=>{let i=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(o._zod.bag.minimum=e.minimum)}),r._zod.check=o=>{let i=o.value;if(i.length>=e.minimum)return;let s=Hh(i);o.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),hA=w("$ZodCheckLengthEquals",(r,e)=>{var t;Ye.init(r,e),(t=r._zod.def).when??(t.when=o=>{let i=o.value;return!Rs(i)&&i.length!==void 0}),r._zod.onattach.push(o=>{let i=o._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),r._zod.check=o=>{let i=o.value,n=i.length;if(n===e.length)return;let s=Hh(i),a=n>e.length;o.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:o.value,inst:r,continue:!e.abort})}}),Zc=w("$ZodCheckStringFormat",(r,e)=>{var t,o;Ye.init(r,e),r._zod.onattach.push(i=>{let n=i._zod.bag;n.format=e.format,e.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(e.pattern))}),e.pattern?(t=r._zod).check??(t.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:r,continue:!e.abort})}):(o=r._zod).check??(o.check=()=>{})}),fA=w("$ZodCheckRegex",(r,e)=>{Zc.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})}}),mA=w("$ZodCheckLowerCase",(r,e)=>{e.pattern??(e.pattern=iA),Zc.init(r,e)}),gA=w("$ZodCheckUpperCase",(r,e)=>{e.pattern??(e.pattern=oA),Zc.init(r,e)}),vA=w("$ZodCheckIncludes",(r,e)=>{Ye.init(r,e);let t=Oi(e.includes),o=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=o,r._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(o)}),r._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:r,continue:!e.abort})}}),yA=w("$ZodCheckStartsWith",(r,e)=>{Ye.init(r,e);let t=new RegExp(`^${Oi(e.prefix)}.*`);e.pattern??(e.pattern=t),r._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),r._zod.check=o=>{o.value.startsWith(e.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:o.value,inst:r,continue:!e.abort})}}),xA=w("$ZodCheckEndsWith",(r,e)=>{Ye.init(r,e);let t=new RegExp(`.*${Oi(e.suffix)}$`);e.pattern??(e.pattern=t),r._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),r._zod.check=o=>{o.value.endsWith(e.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:o.value,inst:r,continue:!e.abort})}});function hB(r,e,t){r.issues.length&&e.issues.push(...ai(t,r.issues))}var bA=w("$ZodCheckProperty",(r,e)=>{Ye.init(r,e),r._zod.check=t=>{let o=e.schema._zod.run({value:t.value[e.property],issues:[]},{});if(o instanceof Promise)return o.then(i=>hB(i,t,e.property));hB(o,t,e.property)}}),wA=w("$ZodCheckMimeType",(r,e)=>{Ye.init(r,e);let t=new Set(e.mime);r._zod.onattach.push(o=>{o._zod.bag.mime=e.mime}),r._zod.check=o=>{t.has(o.value.type)||o.issues.push({code:"invalid_value",values:e.mime,input:o.value.type,inst:r,continue:!e.abort})}}),AA=w("$ZodCheckOverwrite",(r,e)=>{Ye.init(r,e),r._zod.check=t=>{t.value=e.tx(t.value)}});var tf=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 o=e.split(`
5
- `).filter(s=>s),i=Math.min(...o.map(s=>s.length-s.trimStart().length)),n=o.map(s=>s.slice(i)).map(s=>" ".repeat(this.indent*2)+s);for(let s of n)this.content.push(s)}compile(){let e=Function,t=this?.args,i=[...(this?.content??[""]).map(n=>` ${n}`)];return new e(...t,i.join(`
6
- `))}};var _A={major:4,minor:2,patch:1};var ve=w("$ZodType",(r,e)=>{var t;r??(r={}),r._zod.def=e,r._zod.bag=r._zod.bag||{},r._zod.version=_A;let o=[...r._zod.def.checks??[]];r._zod.traits.has("$ZodCheck")&&o.unshift(r);for(let i of o)for(let n of i._zod.onattach)n(r);if(o.length===0)(t=r._zod).deferred??(t.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{let i=(s,a,l)=>{let u=Us(s),d;for(let p of a){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(u)continue;let h=s.issues.length,g=p._zod.check(s);if(g instanceof Promise&&l?.async===!1)throw new ho;if(d||g instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await g,s.issues.length!==h&&(u||(u=Us(s,h)))});else{if(s.issues.length===h)continue;u||(u=Us(s,h))}}return d?d.then(()=>s):s},n=(s,a,l)=>{if(Us(s))return s.aborted=!0,s;let u=i(a,o,l);if(u instanceof Promise){if(l.async===!1)throw new ho;return u.then(d=>r._zod.parse(d,l))}return r._zod.parse(u,l)};r._zod.run=(s,a)=>{if(a.skipChecks)return r._zod.parse(s,a);if(a.direction==="backward"){let u=r._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(d=>n(d,s,a)):n(u,s,a)}let l=r._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new ho;return l.then(u=>i(u,o,a))}return i(l,o,a)}}r["~standard"]={validate:i=>{try{let n=F0(r,i);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return N0(r,i).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),yl=w("$ZodString",(r,e)=>{ve.init(r,e),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??J0(r._zod.bag),r._zod.parse=(t,o)=>{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}}),He=w("$ZodStringFormat",(r,e)=>{Zc.init(r,e),yl.init(r,e)}),SA=w("$ZodGUID",(r,e)=>{e.pattern??(e.pattern=R0),He.init(r,e)}),EA=w("$ZodUUID",(r,e)=>{if(e.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(o===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=vl(o))}else e.pattern??(e.pattern=vl());He.init(r,e)}),BA=w("$ZodEmail",(r,e)=>{e.pattern??(e.pattern=O0),He.init(r,e)}),FA=w("$ZodURL",(r,e)=>{He.init(r,e),r._zod.check=t=>{try{let o=t.value.trim(),i=new URL(o);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.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(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.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=i.href:t.value=o;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:r,continue:!e.abort})}}}),NA=w("$ZodEmoji",(r,e)=>{e.pattern??(e.pattern=V0()),He.init(r,e)}),IA=w("$ZodNanoID",(r,e)=>{e.pattern??(e.pattern=C0),He.init(r,e)}),kA=w("$ZodCUID",(r,e)=>{e.pattern??(e.pattern=I0),He.init(r,e)}),$A=w("$ZodCUID2",(r,e)=>{e.pattern??(e.pattern=k0),He.init(r,e)}),DA=w("$ZodULID",(r,e)=>{e.pattern??(e.pattern=$0),He.init(r,e)}),MA=w("$ZodXID",(r,e)=>{e.pattern??(e.pattern=D0),He.init(r,e)}),CA=w("$ZodKSUID",(r,e)=>{e.pattern??(e.pattern=M0),He.init(r,e)}),TA=w("$ZodISODateTime",(r,e)=>{e.pattern??(e.pattern=H0(e)),He.init(r,e)}),RA=w("$ZodISODate",(r,e)=>{e.pattern??(e.pattern=G0),He.init(r,e)}),OA=w("$ZodISOTime",(r,e)=>{e.pattern??(e.pattern=q0(e)),He.init(r,e)}),VA=w("$ZodISODuration",(r,e)=>{e.pattern??(e.pattern=T0),He.init(r,e)}),zA=w("$ZodIPv4",(r,e)=>{e.pattern??(e.pattern=z0),He.init(r,e),r._zod.bag.format="ipv4"}),UA=w("$ZodIPv6",(r,e)=>{e.pattern??(e.pattern=U0),He.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})}}}),jA=w("$ZodMAC",(r,e)=>{e.pattern??(e.pattern=j0(e.delimiter)),He.init(r,e),r._zod.bag.format="mac"}),LA=w("$ZodCIDRv4",(r,e)=>{e.pattern??(e.pattern=L0),He.init(r,e)}),KA=w("$ZodCIDRv6",(r,e)=>{e.pattern??(e.pattern=K0),He.init(r,e),r._zod.check=t=>{let o=t.value.split("/");try{if(o.length!==2)throw new Error;let[i,n]=o;if(!n)throw new Error;let s=Number(n);if(`${s}`!==n)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${i}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:r,continue:!e.abort})}}});function WA(r){if(r==="")return!0;if(r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}var ZA=w("$ZodBase64",(r,e)=>{e.pattern??(e.pattern=W0),He.init(r,e),r._zod.bag.contentEncoding="base64",r._zod.check=t=>{WA(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:r,continue:!e.abort})}});function BB(r){if(!dy.test(r))return!1;let e=r.replace(/[-_]/g,o=>o==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return WA(t)}var GA=w("$ZodBase64URL",(r,e)=>{e.pattern??(e.pattern=dy),He.init(r,e),r._zod.bag.contentEncoding="base64url",r._zod.check=t=>{BB(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:r,continue:!e.abort})}}),qA=w("$ZodE164",(r,e)=>{e.pattern??(e.pattern=Z0),He.init(r,e)});function FB(r,e=null){try{let t=r.split(".");if(t.length!==3)return!1;let[o]=t;if(!o)return!1;let i=JSON.parse(atob(o));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}var HA=w("$ZodJWT",(r,e)=>{He.init(r,e),r._zod.check=t=>{FB(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:r,continue:!e.abort})}}),JA=w("$ZodCustomStringFormat",(r,e)=>{He.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})}}),xy=w("$ZodNumber",(r,e)=>{ve.init(r,e),r._zod.pattern=r._zod.bag.pattern??Y0,r._zod.parse=(t,o)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}let i=t.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return t;let n=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:i,inst:r,...n?{received:n}:{}}),t}}),QA=w("$ZodNumberFormat",(r,e)=>{sA.init(r,e),xy.init(r,e)}),rf=w("$ZodBoolean",(r,e)=>{ve.init(r,e),r._zod.pattern=eA,r._zod.parse=(t,o)=>{if(e.coerce)try{t.value=!!t.value}catch{}let i=t.value;return typeof i=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:r}),t}}),by=w("$ZodBigInt",(r,e)=>{ve.init(r,e),r._zod.pattern=Q0,r._zod.parse=(t,o)=>{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}}),XA=w("$ZodBigIntFormat",(r,e)=>{aA.init(r,e),by.init(r,e)}),YA=w("$ZodSymbol",(r,e)=>{ve.init(r,e),r._zod.parse=(t,o)=>{let i=t.value;return typeof i=="symbol"||t.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:r}),t}}),e_=w("$ZodUndefined",(r,e)=>{ve.init(r,e),r._zod.pattern=rA,r._zod.values=new Set([void 0]),r._zod.optin="optional",r._zod.optout="optional",r._zod.parse=(t,o)=>{let i=t.value;return typeof i>"u"||t.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:r}),t}}),t_=w("$ZodNull",(r,e)=>{ve.init(r,e),r._zod.pattern=tA,r._zod.values=new Set([null]),r._zod.parse=(t,o)=>{let i=t.value;return i===null||t.issues.push({expected:"null",code:"invalid_type",input:i,inst:r}),t}}),r_=w("$ZodAny",(r,e)=>{ve.init(r,e),r._zod.parse=t=>t}),i_=w("$ZodUnknown",(r,e)=>{ve.init(r,e),r._zod.parse=t=>t}),o_=w("$ZodNever",(r,e)=>{ve.init(r,e),r._zod.parse=(t,o)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:r}),t)}),n_=w("$ZodVoid",(r,e)=>{ve.init(r,e),r._zod.parse=(t,o)=>{let i=t.value;return typeof i>"u"||t.issues.push({expected:"void",code:"invalid_type",input:i,inst:r}),t}}),s_=w("$ZodDate",(r,e)=>{ve.init(r,e),r._zod.parse=(t,o)=>{if(e.coerce)try{t.value=new Date(t.value)}catch{}let i=t.value,n=i instanceof Date;return n&&!Number.isNaN(i.getTime())||t.issues.push({expected:"date",code:"invalid_type",input:i,...n?{received:"Invalid Date"}:{},inst:r}),t}});function gB(r,e,t){r.issues.length&&e.issues.push(...ai(t,r.issues)),e.value[t]=r.value}var a_=w("$ZodArray",(r,e)=>{ve.init(r,e),r._zod.parse=(t,o)=>{let i=t.value;if(!Array.isArray(i))return t.issues.push({expected:"array",code:"invalid_type",input:i,inst:r}),t;t.value=Array(i.length);let n=[];for(let s=0;s<i.length;s++){let a=i[s],l=e.element._zod.run({value:a,issues:[]},o);l instanceof Promise?n.push(l.then(u=>gB(u,t,s))):gB(l,t,s)}return n.length?Promise.all(n).then(()=>t):t}});function yy(r,e,t,o){r.issues.length&&e.issues.push(...ai(t,r.issues)),r.value===void 0?t in o&&(e.value[t]=void 0):e.value[t]=r.value}function NB(r){let e=Object.keys(r.shape);for(let o of e)if(!r.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let t=_0(r.shape);return{...r,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function IB(r,e,t,o,i,n){let s=[],a=i.keySet,l=i.catchall._zod,u=l.def.type;for(let d in e){if(a.has(d))continue;if(u==="never"){s.push(d);continue}let p=l.run({value:e[d],issues:[]},o);p instanceof Promise?r.push(p.then(h=>yy(h,t,d,e))):yy(p,t,d,e)}return s.length&&t.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:n}),r.length?Promise.all(r).then(()=>t):t}var kB=w("$ZodObject",(r,e)=>{if(ve.init(r,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let l={...a};return Object.defineProperty(e,"shape",{value:l}),l}})}let o=zc(()=>NB(e));ke(r._zod,"propValues",()=>{let a=e.shape,l={};for(let u in a){let d=a[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(let p of d.values)l[u].add(p)}}return l});let i=gl,n=e.catchall,s;r._zod.parse=(a,l)=>{s??(s=o.value);let u=a.value;if(!i(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:r}),a;a.value={};let d=[],p=s.shape;for(let h of s.keys){let v=p[h]._zod.run({value:u[h],issues:[]},l);v instanceof Promise?d.push(v.then(y=>yy(y,a,h,u))):yy(v,a,h,u)}return n?IB(d,u,a,l,o.value,r):d.length?Promise.all(d).then(()=>a):a}}),l_=w("$ZodObjectJIT",(r,e)=>{kB.init(r,e);let t=r._zod.parse,o=zc(()=>NB(e)),i=h=>{let g=new tf(["shape","payload","ctx"]),v=o.value,y=V=>{let O=Yv(V);return`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`};g.write("const input = payload.value;");let x=Object.create(null),$=0;for(let V of v.keys)x[V]=`key_${$++}`;g.write("const newResult = {};");for(let V of v.keys){let O=x[V],j=Yv(V);g.write(`const ${O} = ${y(V)};`),g.write(`
7
- if (${O}.issues.length) {
8
- payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
1
+ var Rk=Object.defineProperty;var po=(r,e)=>{for(var t in e)Rk(r,t,{get:e[t],enumerable:!0})};var Tl=class r{static DEFAULT_SIZE=512;static DECAY=.9;#e;#t;#r;#i;#n;#o;#a;#s;#l=0;decay=!1;constructor(e=r.DEFAULT_SIZE){this.#e=e<<1,this.#r=new qf(this.#e),this.#i=new Float32Array(this.#e),this.#n=new Float32Array(this.#e),this.#o=Td.create(Td.Type.Blackman,this.#e),this.#t=e,this.#a=new Float32Array(e),this.#s=new Float32Array(e)}clear(){this.#a.fill(0),this.#i.fill(0),this.#s.fill(0),this.#l=0}reset(){this.#l=0}numBins(){return this.#t}bins(){return this.#a}waveform(){return this.#s}process(e,t,n,i){for(let o=n;o<i;++o)this.#i[this.#l]=e[o]+t[o],++this.#l===this.#e&&this.#c()}#c(){for(let t=0;t<this.#t;++t)this.#s[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 n=this.#i[t],i=this.#n[t],o=Math.sqrt(n*n+i*i)*e;this.#a[t]<o?this.#a[t]=o:this.decay&&(this.#a[t]*=r.DECAY)}this.#l=0,this.#n.fill(0),this.decay=!1}};var Cd=r=>r,Z=r=>r!=null,_n=r=>r===null,wt=r=>r!==null,Cl=r=>r===void 0,ns=r=>r!==void 0,Gf=r=>r==null,hw=(r,e)=>r!=null?e(r):void 0,se=(r,e="asDefined failed")=>r??B(Pn(e)),Ke=(r,e)=>r instanceof e,Te=(r,e)=>r instanceof e?r:B(`${r} is not instance of ${e}`),fw=(r,e)=>{r instanceof e||B(`${r} is not instance of ${e}`)};var Pn=r=>r instanceof Function?r():r;var P=(r,...e)=>r?.apply(null,e),Hf=r=>Z(r)&&typeof r=="object";var Jf=r=>{throw new Error(`Unhandled ${r}`)},B=r=>{throw typeof r=="string"?new Error(r):r},T=(r,e)=>r?void 0:B(Pn(e));var os=r=>new Proxy({},{get(){return B(r)}});var dw=class{value;status="success";constructor(e){this.value=e}error=os("Cannot access error when succeeded")},pw=class{error;status="failure";constructor(e){this.error=e}value=os("Cannot access value when failed")},ho=r=>{try{return new dw(r())}catch(e){return new pw(e)}};var vi=(r,e)=>Object.keys(e).length===0?B("Empty enum object (are you using `const enum`?)"):Object.keys(e).filter(i=>isNaN(Number(i))).map(i=>e[i]).includes(r)?r:B(`Invalid enum value: ${String(r)}`),fo=()=>{};var mw;(function(r){r[r.Ascending=1]="Ascending",r[r.Descending=-1]="Descending"})(mw||(mw={}));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 n=0;n<e.length;)t(e[n])?e.splice(n,1):n++};static peekFirst=e=>e.at(0)??null;static peekLast=e=>e.at(-1)??null;static getFirst=(e,t)=>se(e.at(0),t);static getLast=(e,t)=>se(e.at(-1),t);static getPrev=(e,t)=>{let n=e.indexOf(t);return n===-1?B(`${t} not found in ${e}`):se(e.at((n-1)%e.length),"Internal Error")};static getNext=(e,t)=>{let n=e.indexOf(t);return n===-1?B(`${t} not found in ${e}`):se(e.at((n+1)%e.length),"Internal Error")};static removeLast=(e,t)=>se(e.pop(),t);static create=(e,t)=>{let n=new Array(t);for(let i=0;i<t;i++)n[i]=e(i);return n};static equals=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0};static satisfy=(e,t)=>{if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++)if(!t(n,e[i]))return!1;return!0};static remove=(e,t)=>{let n=e.indexOf(t);if(n===-1)return B(`${t} not found in ${e}`);e.splice(n,1)};static removeIf=(e,t)=>{for(let n=e.length-1;n>=0;n--)t(e[n])&&e.splice(n,1)};static removeOpt=(e,t)=>{let n=e.indexOf(t);return n===-1?!1:(e.splice(n,1),!0)};static hasDuplicates=e=>new Set(e).size<e.length;static removeDuplicates=e=>{let t=0,n=new Set;for(let i of e)n.has(i)||(n.add(i),e[t++]=i);return e.length=t,e};static removeDuplicateKeys=(e,t)=>{let n=0,i=new Set;for(let o of e){let a=o[t];i.has(a)||(i.add(a),e[n++]=o)}return e.length=n,e};static subtract(e,t,n){return e.filter(i=>!t.some(o=>n(i,o)))}static intersect(e,t,n){return e.filter(i=>t.some(o=>n(i,o)))}static merge(e,t,n){return[...e.filter(i=>!t.some(o=>n(i,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 n=0;n<=t;n++)yield{value:e[n],isFirst:n===0,isLast:n===t}}static*iterateAdjacent(e){if(!(e.length<=1))for(let t=1,n=e[0];t<e.length;t++){let i=e[t];yield[n,i],n=i}}static isSorted(e,t=mw.Ascending){if(e.length<2)return!0;let n=e[0];for(let i=1;i<e.length;i++){let o=e[i];if(Math.sign(n-o)===t)return!1;n=o}return!0}static toRecord(e,t){return e.reduce((n,i)=>(n[t(i)]=i,n),{})}static concatArrayBuffers(e,t){let n=new ArrayBuffer(e.byteLength+t.byteLength),i=new Uint8Array(n);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(t),e.byteLength),n}};var m;(function(r){r.wrap=t=>Z(t)?new e(t):r.None,r.from=t=>r.wrap(t()),r.tryCatch=t=>{try{return r.wrap(t())}catch{return r.None}},r.execute=(t,...n)=>r.wrap(t?.apply(null,n)),r.async=t=>t.then(n=>r.wrap(n),()=>r.None);class e{#e;constructor(n){this.#e=se(n)}unwrap(){return this.#e}unwrapOrElse(n){return this.#e}unwrapOrNull(){return this.#e}unwrapOrUndefined(){return this.#e}contains(n){return n===this.#e}match(n){return n.some(this.#e)}ifSome(n){return n(this.#e)}ifAbsent(n){}isEmpty(){return!1}nonEmpty(){return!0}map(n){return r.wrap(n(this.#e))}mapOr(n,i){return n(this.#e)}flatMap(n){return n(this.#e)}equals(n){return this.unwrapOrNull()===n.unwrapOrNull()}assert(n){return this}toString(){return`{Option.Some(${this.#e})}`}get[Symbol.toStringTag](){return this.toString()}}r.Some=e,r.None=new class{unwrap=t=>B(Z(t)?Pn(t):"unwrap failed");unwrapOrElse=t=>Pn(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,n)=>Pn(n);flatMap=t=>r.None;equals=t=>t.isEmpty();assert=t=>B(Pn(t)??"assert failed");toString=()=>"{Option.None}";get[Symbol.toStringTag](){return this.toString()}}})(m||(m={}));var Sn;(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=()=>m.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(n){return r.err(n)}};mapOr=(t,n)=>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=()=>m.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=()=>m.None;failureReason=()=>this.reason;isFailure=()=>!0;isSuccess=()=>!1;result=()=>B(`'${this.reason}'`);map=()=>this;mapOr=(t,n)=>Pn(n);unwrapOrElse=t=>Pn(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)})(Sn||(Sn={}));var nt;(function(r){r.exact=(e,t,n)=>{let i=0,o=e.length-1;for(;i<=o;){let a=i+o>>>1,s=n(e[a],t);if(s===0)return a;s<0?i=a+1:o=a-1}return-1},r.exactMapped=(e,t,n,i)=>{let o=0,a=e.length-1;for(;o<=a;){let s=o+a>>>1,l=n(i(e[s]),t);if(l===0)return s;l<0?o=s+1:a=s-1}return-1},r.leftMost=(e,t,n)=>{let i=0,o=e.length;for(;i<o;){let a=i+o>>>1;n(e[a],t)<0?i=a+1:o=a}return i},r.rightMost=(e,t,n)=>{let i=0,o=e.length;for(;i<o;){let a=i+o>>>1;n(e[a],t)<=0?i=a+1:o=a}return o-1},r.stableInsert=(e,t,n)=>{let i=0,o=e.length;for(;i<o;){let a=i+o>>>1;n(e[a],t)<0?i=a+1:o=a}for(;i<e.length&&n(e[i],t)===0;)i++;return i},r.leftMostMapped=(e,t,n,i)=>{let o=0,a=e.length;for(;o<a;){let s=o+a>>>1;n(i(e[s]),t)<0?o=s+1:a=s}return o},r.rightMostMapped=(e,t,n,i)=>{let o=0,a=e.length;for(;o<a;){let s=o+a>>>1;n(i(e[s]),t)<=0?o=s+1:a=s}return a-1},r.rangeMapped=(e,t,n,i)=>[r.leftMostMapped(e,t,n,i),r.rightMostMapped(e,t,n,i)]})(nt||(nt={}));var ct=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,n=1<<e-(t<<5);return(this.#t[t]&n)!==0}setBit(e,t){let n=e>>>5,i=1<<e-(n<<5),o=this.#t[n],a=t?o|i:o&~i;return a===o?!1:(this.#t[n]=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),n=!1;for(let i=0;i<t.length;i++)this.#t[i]!==t[i]&&(this.#t[i]=t[i],n=!0);return n}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 Qf=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 Nt=class r{static parseCssRgbOrRgba(e){let t=e.match(/\(([^)]+)\)/)?.at(1)?.split(",")?.map(Number);if(Z(t)&&t.every(n=>!isNaN(n))){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,n){let i=l=>(l+e/30)%12,o=t*Math.min(n,1-n),a=l=>n-o*Math.max(-1,Math.min(i(l)-3,Math.min(9-i(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,n=parseInt(t.slice(0,2),16)/255,i=parseInt(t.slice(2,4),16)/255,o=parseInt(t.slice(4,6),16)/255,a=Math.max(n,i,o),s=Math.min(n,i,o),l=(a+s)/2,u=0,d=0;if(a!==s){let p=a-s;switch(d=l>.5?p/(2-a-s):p/(a+s),a){case n:u=((i-o)/p+(i<o?6:0))*60;break;case i:u=((o-n)/p+2)*60;break;case o:u=((n-i)/p+4)*60;break}}return{h:u,s:d,l}}static hslStringToHex(e){let[t,n,i]=e.match(/\d+(\.\d+)?/g).map(Number);return r.hslToHex(t,n/100,i/100)}#e;#t;#r;#i;constructor(e,t,n,i=1){this.#e=e,this.#t=t,this.#r=n,this.#i=i}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)),n=this.#r+(100-this.#r)*e**3;return new r(this.#e,t,n,this.#i)}toString(){return this.#i===1?`hsl(${this.#e}, ${this.#t}%, ${this.#r}%)`:`hsla(${this.#e}, ${this.#t}%, ${this.#r}%, ${this.#i})`}};var Rd=(r,e)=>r-e;var Gi=Math.PI*2,VM=Math.PI/2,gw=Math.PI/4,zM=1/Math.sqrt(2),pe=(r,e,t)=>Math.max(e,Math.min(r,t)),yi=r=>Math.max(0,Math.min(r,1)),eE=(r,e)=>e+(1-2*e)*Math.max(0,Math.min(r,1)),mo=(r,e)=>Math.floor(r/e)*e,Od=(r,e)=>Math.ceil(r/e)*e;var Xf=(r,e,t)=>r+(e-r)*t,tE=(r,e,t)=>r*Math.pow(e/r,t);var Vd=(r,e)=>Ok(r/e)*e,Ok=r=>r-Math.floor(r),En=r=>Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));var vw=(r,e)=>r*e/((2*e-1)*(r-1)+e);var xi;(function(r){r.valueAt=({slope:i,steps:o,y0:a,y1:s},l)=>r.normalizedAt(l/o,i)*(s-a)+a,r.normalizedAt=(i,o)=>{if(o>.499999&&o<.500001)return i;{let a=pe(o,1e-15,.999999999999999);return a*a/(1-a*2)*(Math.pow((1-a)/a,2*i)-1)}},r.inverseAt=(i,o)=>{let a=pe(o,1e-15,.999999999999999);return Math.log(i*(1-2*a)/(a*a)+1)/(2*Math.log((1-a)/a))},r.coefficients=i=>{let o=r.valueAt(i,1),s=(r.valueAt(i,2)-o)/(o-i.y0),l=o-s*i.y0;return{m:s,q:l}};function*t(i,o,a,s){let{m:l,q:u}=r.coefficients({slope:i,steps:o,y0:a,y1:s});for(let d=0,p=a;d<o;d++)yield p=l*p+u}r.walk=t;function*n(i,o){let a=1/o,s=r.normalizedAt(a,i),u=(r.normalizedAt(2*a,i)-s)/s;for(let d=0,p=0;d<o;d++)yield p=u*p+s}r.walkNormalized=n,r.byHalf=(i,o,a,s)=>({slope:r.slopeByHalf(o,a,s),steps:i,y0:o,y1:s}),r.slopeByHalf=(i,o,a)=>Math.abs(a-i)<1e-6?.5:(o-i)/(a-i)})(xi||(xi={}));var Fn=new DataView(new ArrayBuffer(8)),xr;(function(r){r.MIN_VALUE=-2147483648,r.MAX_VALUE=2147483647,r.toByte=e=>(Fn.setInt8(0,e),Fn.getInt8(0)),r.toShort=e=>(Fn.setInt16(0,e),Fn.getInt16(0)),r.toInt=e=>(Fn.setInt32(0,e),Fn.getInt32(0))})(xr||(xr={}));var go;(function(r){let n=new ArrayBuffer(Float32Array.BYTES_PER_ELEMENT),i=new Float32Array(n),o=new Int32Array(n);r.floatToIntBits=a=>{let s=r.floatToRawIntBits(a);return(s&2139095040)===2139095040&&s&8388607?2143289344:s},r.intBitsToFloat=a=>(o[0]=a,i[0]),r.floatToRawIntBits=a=>(i[0]=a,o[0]),r.toFloat32=a=>(Fn.setFloat32(0,a),Fn.getFloat32(0))})(go||(go={}));var rE;(function(r){r.floatToIntBits=e=>{let t=go.floatToIntBits(e),n=t>>>16&32768,i=(t&2147483647)+4096;return i>=1199570944?(t&2147483647)>=1199570944?i<2139095040?n|31744:n|31744|(t&8388607)>>>13:n|31743:i>=947912704?n|i-939524096>>>13:i<855638016?n:(i=(t&2147483647)>>>23,n|(t&8388607|8388608)+(8388608>>>i-102)>>>126-i)},r.intBitsToFloat=e=>{let t=e&1023,n=e&31744;if(n===31744)n=261120;else if(n!==0){if(n+=114688,t===0&&n>115712)return go.intBitsToFloat((e&32768)<<16|n<<13|1023)}else if(t!==0){n=115712;do t<<=1,n-=1024;while(!(t&1024));t&=1023}return go.intBitsToFloat((e&32768)<<16|(n|t)<<13)}})(rE||(rE={}));var Yf;(function(r){let e=9218868437227405312n,t=4503599627370495n,n=new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT),i=new Float64Array(n),o=new BigInt64Array(n);r.float64ToLongBits=a=>{let s=r.float64ToRawLongBits(a);return(s&e)===e&&(s&t)!==0n?0x7ff8000000000000n:s},r.longBitsToFloat64=a=>(o[0]=a,i[0]),r.float64ToRawLongBits=a=>(i[0]=a,o[0]),r.clamp=a=>(Fn.setFloat64(0,a),Fn.getFloat64(0))})(Yf||(Yf={}));var Ye=class{static*empty(){}static one(e){return[e]}static count(e){let t=0;for(let n of e)t++;return t}static some(e,t){for(let n of e)if(t(n))return!0;return!1}static every(e,t){for(let n of e)if(!t(n))return!1;return!0}static reduce(e,t,n){let i=n,o=0;for(let a of e)i=t(i,a,o++);return i}static includes(e,t){for(let n of e)if(n===t)return!0;return!1}static forEach(e,t){for(let n of e)t(n)}static*map(e,t){let n=0;for(let i of e)yield t(i,n++)}static*take(e,t){let n=0;for(let i of e){if(n++>=t)return;yield i}}static filter(e,t){let n=[];for(let i of e)t(i)&&n.push(i);return n}static filterMap(e,t){let n=[];for(let i of e){let o=t(i);Z(o)&&n.push(o)}return n}static reverse(e){let t=[];for(let n of e)t.push(n);return t.reverse()}static*pairWise(e){let t=e[Symbol.iterator](),{done:n,value:i}=t.next(),o=i;if(n!==!0)for(;;){let{done:a,value:s}=t.next();if(a===!0){yield[o,null];return}yield[o,s],o=s}}};var Ut=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?B(`position(${e}) cannot be negative.`):e>this.#e.byteLength?B(`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 n=0;n<t;n++)this.writeShort(e.charCodeAt(n))}toArrayBuffer(){return this.#e.buffer.slice(0,this.#t)}#r(e){let t=this.#e.byteLength;if(this.#t+e>t){let n=this.#e;this.#e=new DataView(new ArrayBuffer(En(t+e)));for(let i=0;i<this.#t;i++)this.#e.setInt8(i,n.getInt8(i))}}},Rl=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}},em=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,n)=>e.#e[n]===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(go.floatToIntBits(e))}writeDouble(e){this.writeLong(Yf.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(Ye.map(this.#e.values(),e=>(e&255).toString(16).padStart(2,"0"))).join("")}},mt=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?B(`position(${e}) cannot be negative.`):e>this.#e.byteLength?B(`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 n=0;n<e;n++)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 Vk=r=>Z(r)?r.value!==void 0?"value":r.get!==void 0?"get":B(`Cannot resolve method key of ${r}`):B("Cannot resolve method key of undefined descriptor"),Ol=(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 B(`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 n=Vk(t),i=se(t[n]);return{[n]:function(...o){if(o.length>0)return B("lazy accessory must not have any construction parameters");let a=i.apply(this);return Object.defineProperty(this,e,{value:n==="get"?a:()=>a,configurable:!1,writable:!1,enumerable:!1}),a}}};var vo;(function(r){function*e(){}r.empty=e;function*t(...n){for(let i of n)for(let o of i)yield o}r.flatten=t})(vo||(vo={}));var jt=class{#e=new Set;#t;constructor(){this.#t=new Proxy({},{get:(e,t)=>(...n)=>this.#e.forEach(i=>Object.getPrototypeOf(i)===Object.getPrototypeOf({})?P(i[t],...n):i[t]?.apply(i,n))})}get proxy(){return this.#t}get size(){return this.#e.size}subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}forEach(e){this.#e.forEach(e)}terminate(){this.#e.clear()}};var iE=(r,...e)=>new Proxy([],{get(t,n){if(typeof n=="string"){let i=Number(n);if(!isNaN(i)&&i>=0&&Number.isInteger(i))return new r(...e)}return n===Symbol.iterator?function*(){for(;;)yield new r(...e)}:t[n]},has(t,n){if(typeof n=="string"){let i=Number(n);if(!isNaN(i)&&i>=0)return!0}return n in t}});var as=class{static createIfAbsent(e,t,n){let i=e.get(t);return i===void 0&&(i=n(t),e.set(t,i)),i}};var zd=class r{static#e=Object.freeze(new Set);static empty=()=>r.#e};var tm=class r{#e;#t;constructor(e,t){this.#e=new Map(e),this.#t=m.wrap(t),this.#t.ifSome(n=>Array.from(this.#e.values()).forEach(i=>i.sort(n)))}[Symbol.iterator](){return this.#e.entries()}clear(){this.#e.clear()}containsEntry(e,t){return Ye.some(this.#e.entries(),n=>e===n[0]&&n[1].includes(t))}containsKey(e){return Ye.includes(this.#e.keys(),e)}containsValue(e){return Ye.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 n=as.createIfAbsent(this.#e,e,()=>[]);if(this.#t.isEmpty())n.push(t);else{let i=nt.stableInsert(n,t,this.#t.unwrap());n.splice(i,0,t)}}addAll(e,t){let n=as.createIfAbsent(this.#e,e,()=>[]);n.push(...t),this.#t.nonEmpty()&&n.sort(this.#t.unwrap())}remove(e,t){let n=this.#e.get(e);if(n===void 0)return!1;{let i=n.indexOf(t);return i===-1?!1:(n.splice(i,1),n.length===0&&this.#e.delete(e),!0)}}removeFromKeyIf(e,t){let n=this.#e.get(e);if(n===void 0)return null;{let i=n.findIndex(t);if(i===-1)return null;{let o=n.splice(i,1)[0];return n.length===0&&this.#e.delete(e),o}}}removeValueIf(e){let t=[];for(let[n,i]of this.#e.entries())for(let o of i.filter(a=>e(a)))t.push([n,o]);for(let[n,i]of t)this.remove(n,i);return new Set(t.map(([,n])=>n))}removeKey(e){let t=this.#e.get(e);return this.#e.delete(e),t??O.empty()}forEach(e){Ye.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(),n=Array.from(this.keys()).sort(e);this.#e.clear();for(let i of n)this.addAll(i,t.get(i));return this}clone(){let e=new r;return this.#e.forEach((t,n)=>{e.#e.set(n,t.map(i=>i))}),e}},Vl=class r{map;constructor(e){this.map=new Map(e?.map(t=>{let n=t[0],i=t[1];return[n,new Set(i)]}))}clear(){this.map.clear()}containsEntry(e,t){return Ye.some(this.map.entries(),n=>e===n[0]&&n[1].has(t))}containsKey(e){return Ye.includes(this.map.keys(),e)}containsValue(e){return Ye.some(this.map.values(),t=>t.has(e))}get(e){return this.map.get(e)??zd.empty()}isEmpty(){return this.keyCount()===0}add(e,t){as.createIfAbsent(this.map,e,()=>new Set).add(t)}addAll(e,t){let n=as.createIfAbsent(this.map,e,()=>new Set);for(let i of t)n.add(i)}remove(e,t){let n=this.map.get(e);return n===void 0?!1:n.delete(t)?(n.size===0&&this.map.delete(e),!0):!1}removeValueIf(e){let t=new Set;for(let[n,i]of this.map.entries()){for(let o of i)e(o)&&(i.delete(o),t.add(o));i.size===0&&this.map.delete(n)}return t}removeFromKeyIf(e,t){let n=this.map.get(e);if(n===void 0)return null;for(let i of n)if(t(i))return n.delete(i),n.size===0&&this.map.delete(e),i;return null}removeKey(e){let t=this.map.get(e);return this.map.delete(e),t??zd.empty()}forEach(e){Ye.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(),n=Array.from(this.keys()).sort(e);this.map.clear();for(let i of n)this.addAll(i,t.get(i));return this}clone(){let e=new r;return this.map.forEach((t,n)=>{e.map.set(n,new Set(Array.from(t)))}),e}};var q=Object.freeze({Empty:{terminate:fo},create:r=>({terminate:r}),many:(...r)=>({terminate:()=>{for(;r.length>0;)r.pop().terminate()}})}),R=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 te=class{static subscribeMany(e,...t){return q.many(...t.map(n=>n.subscribe(()=>e(n))))}#e=new Set;subscribe(e){return this.#e.add(e),{terminate:()=>this.#e.delete(e)}}isEmpty(){return this.#e.size===0}notify(e){this.#e.forEach(t=>t(e))}observers(){return this.#e}terminate(){this.#e.clear()}};var Jr;(function(r){let e=Object.freeze({});r.empty=()=>e,r.mergeNoOverlap=(t,n)=>{let i=new Set(Object.keys(t));for(let o of Object.keys(n))if(i.has(o))return B(`'${o}' is an overlapping key`);return{...t,...n}},r.include=(t,...n)=>{let i={};for(let o of n)i[o]=t[o];return i},r.exclude=(t,...n)=>{let i=new Set(n);return Object.entries(t).reduce((o,[a,s])=>(i.has(a)||(o[a]=s),o),{})},r.overwrite=(t,n)=>Object.assign(t,n),r.entries=t=>Object.entries(t)})(Jr||(Jr={}));var nE;(function(r){r.seal=e=>new class{getValue(){return e}subscribe(t){return q.Empty}catchupAndSubscribe(t){return t(this),q.Empty}}})(nE||(nE={}));var oE;(function(r){r.False=new class{getValue(){return!1}setValue(e){}subscribe(e){return q.Empty}catchupAndSubscribe(e){return e(this),q.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)}}})(oE||(oE={}));var $r=class{#e;#t=m.None;constructor(e){this.#e=new te,this.wrap(e)}wrap(e){this.wrapOption(m.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=m.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 Qr=class{#e;#t=m.None;#r;constructor(e,t){this.#e=new te,this.#r=t?.guard(e)??e,this.#t=m.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 yw=class{#e;#t;constructor(e,t){T(e<t,"Linear is inverse"),this.#e=e,this.#t=t}x(e){return e<=this.#e?0:e>=this.#t?1:(e-this.#e)/(this.#t-this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:this.#e+e*(this.#t-this.#e)}clamp(e){return pe(e,this.#e,this.#t)}floating(){return!0}},xw=class{#e;#t;#r;constructor(e,t){this.#e=pe(Math.round(e),xr.MIN_VALUE,xr.MAX_VALUE),this.#t=pe(Math.round(t),xr.MIN_VALUE,xr.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(pe(e,0,1)*this.#r)}clamp(e){return pe(Math.round(e),this.#e,this.#t)}floating(){return!1}},bw=class{#e;#t;constructor(e,t){T(e<t,"Exponential is inverse"),this.#e=e,this.#t=t}x(e){return e<=this.#e?0:e>=this.#t?1:Math.log(e/this.#e)/Math.log(this.#t/this.#e)}y(e){return e<=0?this.#e:e>=1?this.#t:Math.exp(e*Math.log(this.#t/this.#e))*this.#e}clamp(e){return Math.min(this.#t,Math.max(this.#e,e))}floating(){return!0}},rm=class{#e;#t;#r;#i;constructor(e,t,n){T(t!==n,"Power min === max"),this.#e=e,this.#t=t,this.#r=n,this.#i=n-t}x(e){return e<=this.#t?0:e>=this.#r?1:Math.pow((e-this.#t)/this.#i,1/this.#e)}y(e){return e<=0?this.#t:e>=1?this.#r:this.#t+Math.pow(e,this.#e)*this.#i}clamp(e){return Math.min(this.#r,Math.max(this.#t,e))}floating(){return!0}},ww=class{#e;constructor(e){this.#e=e}x(e){let t=this.#e.findIndex(n=>n===e);return t===-1?B(`Could not find index for ${e}`):t/(this.#e.length-1)}y(e){let t=Math.round(pe(e,0,1)*(this.#e.length-1));return t>-1?se(this.#e.at(t),`Could not find value for ${e}`):B(`Index ${t} is out of box.`)}clamp(e){return e}floating(){return!1}},Aw=class{#e;#t;#r;#i;#n;constructor(e,t,n){this.#e=e,this.#t=n;let i=e*e,o=n*n,a=t*t,s=e+n-2*t,l=n-t;this.#r=((2*n-t)*e-t*n)/s,this.#i=(l*i+(a-o)*e+t*o-a*n)/(i+(2*n-4*t)*e+o-4*t*n+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 yw(o,a),r.linearInteger=(o,a)=>new xw(o,a),r.exponential=(o,a)=>new bw(o,a),r.power=(o,a,s)=>new rm(o,a,s),r.powerByCenter=(o,a,s)=>{let l=Math.log((s-a)/(o-a))/Math.log(2);if(Number.isNaN(l))throw new Error(`powerByCenter: invalid center=${o}, min=${a}, max=${s}`);return new rm(l,a,s)},r.values=o=>new ww(o),r.decibel=(o,a,s)=>new Aw(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),n=r.linear(-1,1);r.bool=e;let i=r.decibel(-72,-12,0);r.unipolar=()=>t,r.bipolar=()=>n,r.DefaultDecibel=i})(S||(S={}));var E;(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 u=s.indexOf(l);return u===-1?{type:"unknown",value:"\u{1F4A3}"}:{type:"explicit",value:a[u]}}},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,u){this.#e=a??"",this.#t=s??0,this.#r=l??!1,this.#i=u??!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?pe(l/200+.5,0,1):pe(l/100,0,1)};{s.endsWith(this.#e)&&this.#e.length>0&&(s=s.slice(0,-this.#e.length));let p=/(\d+)(\D+)/.exec(s)?.at(2)?.at(0);if(Z(p)){let h=t.indexOf(p);if(h>-1)return{type:"explicit",value:l*Math.pow(10,(h-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}=i(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"]),n=o=>Math.log(o)/Math.log(9.999999999999998),i=o=>{let a=Math.floor(n(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:2}),r.panning=r.percent({unit:"%",fractionDigits:0})})(E||(E={}));var Wo;(function(r){r.alwaysTrue=()=>!0,r.alwaysFalse=()=>!1,r.definedPredicate=e=>e!=null})(Wo||(Wo={}));var zl;(function(r){r.create=(e=252854082)=>new _w(e),r.monotoneAscending=(e,t=128,n=r.create())=>{let i=e.length;if(i<2)return B("Array must have at least 2 elements");let o=0;for(let s=1;s<i;s++){let l=Math.floor(n.uniform()*(1+t))+1;e[s]=l,o+=l}let a=0;e[0]=0;for(let s=1;s<i;s++)a+=e[s],e[s]=a/o;return e}})(zl||(zl={}));var _w=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 br;(function(r){class e{}r.createBuilder=n=>{let i=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]=i(l))}),a};return()=>new t(n,Object.seal(i(n)))},r.bool=new class extends e{read(n){return n.readByte()===1}write(n,i){n.writeByte(i?1:0)}initialValue(){return!1}},r.int8=new class extends e{read(n){return n.readByte()}write(n,i){n.writeByte(i)}initialValue(){return 0}},r.int16=new class extends e{read(n){return n.readShort()}write(n,i){n.writeShort(i)}initialValue(){return 0}},r.int32=new class extends e{read(n){return n.readInt()}write(n,i){n.writeInt(i)}initialValue(){return 0}},r.float=new class extends e{read(n){return n.readFloat()}write(n,i){n.writeFloat(i)}initialValue(){return 0}},r.double=new class extends e{read(n){return n.readDouble()}write(n,i){n.writeDouble(i)}initialValue(){return 0}},r.int64=new class extends e{read(n){return n.readLong()}write(n,i){n.writeLong(i)}initialValue(){return 0n}},r.floats=n=>new class extends e{read(i,o){for(let a=0;a<o.length;a++)o[a]=i.readFloat();return o}write(i,o){for(let a=0;a<o.length;a++)i.writeFloat(o[a])}initialValue(){return new Float32Array(n)}},r.doubles=n=>new class extends e{read(i,o){for(let a=0;a<o.length;a++)o[a]=i.readDouble();return o}write(i,o){for(let a=0;a<o.length;a++)i.writeDouble(o[a])}initialValue(){return new Float64Array(n)}};class t{#e;#t;#r;constructor(i,o){this.#e=i,this.#t=o,this.#r=this.#i()}get object(){return this.#t}get bytesTotal(){return this.#r}read(i){let o=(a,s)=>{Object.entries(a).forEach(([l,u])=>{let d=s;u instanceof e?d[l]=u.read(i,d[l]):typeof u=="object"&&o(u,d[l])})};o(this.#e,this.#t)}write(i){let o=(a,s)=>{Object.entries(a).forEach(([l,u])=>{let d=s;u instanceof e?u.write(i,d[l]):typeof u=="object"&&o(u,d[l])})};o(this.#e,this.#t)}#i(){let i=new Rl;return this.write(i),i.count}}})(br||(br={}));var Ul=class{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=[]}add(e,t=!1){let n=this.#e(e),i=nt.leftMostMapped(this.#r,n,this.#t,this.#e),o=this.#r[i];return Z(o)&&this.#t(this.#e(o),n)===0?t?(this.#r.splice(i,1,e),!0):!1:(this.#r.splice(i,0,e),!0)}getOrCreate(e,t){let n=nt.leftMostMapped(this.#r,e,this.#t,this.#e),i=this.#r[n];if(Z(i)&&this.#t(this.#e(i),e)===0)return i;let o=t(e);return this.#r.splice(n,0,o),o}addMany(e){for(let t of e)this.#r.push(t);try{return this.#r.sort((t,n)=>{let i=this.#t(this.#e(t),this.#e(n));if(i===0)throw"cancel";return i}),!0}catch(t){if(t==="cancel"){let n=new Map(this.entries());return this.#r.splice(0,this.#r.length,...n.values()),this.#r.sort((i,o)=>this.#t(this.#e(i),this.#e(o))),!1}return B(t)}}removeByValue(e){return this.removeByKey(this.#e(e))}removeByKey(e){let t=nt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[t];return Z(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(t,1),n):B(`Could not remove ${e}`)}removeByKeyIfExist(e){let t=nt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[t];return Z(n)&&this.#t(this.#e(n),e)===0?(this.#r.splice(t,1),n):null}removeRange(e,t){this.#r.splice(e,(t??this.#r.length)-e)}removeByPredicate(e){let t=0,n=this.#r.length;for(;--n>=0;)e(this.#r[n])&&(this.#r.splice(n,1),t++);return t}get(e){return se(this.#i(e),`Unknown key: ${e}`)}getOrThrow(e,t){let n=this.#i(e);if(Z(n))return n;throw t()}opt(e){return m.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=nt.leftMostMapped(this.#r,e,this.#t,this.#e),n=this.#r[t];return Z(n)&&this.#t(this.#e(n),e)===0?n:void 0}};var jl=(()=>{let r=m.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:fo}),some:t=>t.progress(e)}),install:e=>{T(r.isEmpty(),"RuntimeNotification already installed"),r=m.wrap(e)}}})();var Ud=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,n=Math.floor(Math.abs(this.#n)/1e3),i=Math.floor(n/60),o=Math.floor(i/60),a=Math.floor(o/24);return n<60?(e=n,t="second"):i<60?(e=i,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:n,s:i}=this.split();return e>0?[r.#o("d",e),r.#o("h",t),r.#o("m",n),r.#o("s",i)].join(", "):t>0?[r.#o("h",t),r.#o("m",n),r.#o("s",i)].join(", "):n>0?[r.#o("m",n),r.#o("s",i)].join(", "):i>0?r.#o("s",i):"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 Jf(e)}}};var Ll;(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,n,i)=>{if(t.bytesTotal+1>n.byteLength)return B("Insufficient memory allocated.");let o=new Uint8Array(n),a=Ut.use(n,1);return Atomics.store(o,0,e.READ),{tryWrite:()=>Atomics.compareExchange(o,0,e.READ,e.WRITING)===e.WRITING?(i(t.object),a.position=0,t.write(a),Atomics.store(o,0,e.WRITTEN),!0):!1}},r.reader=(t,n)=>{let i=new SharedArrayBuffer(t.bytesTotal+1),o=new Uint8Array(i),a=new mt(i,1);return{buffer:i,tryRead:()=>Atomics.compareExchange(o,0,e.WRITTEN,e.READING)===e.READING?(a.position=0,t.read(a),n(t.object),Atomics.store(o,0,e.READ),!0):!1}}})(Ll||(Ll={}));var w;(function(r){r.length=16,r.generate=()=>e(crypto.getRandomValues(new Uint8Array(r.length))),r.sha256=async t=>{let n=typeof process<"u"&&process.env?.VITEST==="true";return crypto.subtle.digest("SHA-256",n?new Uint8Array(t.slice(0)):t).then(i=>e(new Uint8Array(i.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:B(`Invalid UUID format: ${t}`),r.fromDataInput=t=>{let n=new Uint8Array(r.length);return t.readBytes(new Int8Array(n.buffer)),n},r.toDataOutput=(t,n)=>t.writeBytes(new Int8Array(n.buffer)),r.toString=t=>{let n=O.create(i=>(i+256).toString(16).substring(1),256);return n[t[0]]+n[t[1]]+n[t[2]]+n[t[3]]+"-"+n[t[4]]+n[t[5]]+"-"+n[t[6]]+n[t[7]]+"-"+n[t[8]]+n[t[9]]+"-"+n[t[10]]+n[t[11]]+n[t[12]]+n[t[13]]+n[t[14]]+n[t[15]]},r.parse=t=>{let n=t.replace(/-/g,"").toLowerCase();if(n.length!==32)return B("Invalid UUID format");let i=new Uint8Array(r.length);for(let o=0,a=0;o<32;o+=2,a++)i[a]=parseInt(n.slice(o,o+2),16);return i},r.Comparator=(t,n)=>{if(t.length!==r.length||n.length!==r.length)return B("Unexpected array length for uuid(v4)");for(let i=0;i<r.length;i++){let o=t[i]-n[i];if(o!==0)return o}return 0},r.equals=(t,n)=>r.Comparator(t,n)===0,r.newSet=t=>new Ul(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 n=new Uint8Array(r.Lowest),i=new Uint8Array(new Uint32Array([t]).buffer);for(let o=0;o<4;o++)n[o]=i[o];return n},r.zType=t=>t.string().refine(n=>r.validateString(n),{message:"Invalid UUID format"}).transform(n=>n);let e=t=>(T(t.length===r.length,"UUID must be 16 bytes long"),t[6]=t[6]&15|64,t[8]=t[8]&63|128,t)})(w||(w={}));var im=class{#e=new R;#t;#r;#i;constructor(e){this.#r=e,this.#t=this.#e.own(new te),this.#i=this.#a(e,[])}get data(){return this.#r}get proxy(){return this.#i}subscribe(e,...t){let n=()=>t.reduce((i,o)=>i[o],this.#i);return this.#t.subscribe(i=>{this.#n(i,t)&&e(n())})}catchupAndSubscribe(e,...t){return e(t.reduce((i,o)=>i[o],this.#i)),this.subscribe(e,...t)}subscribeAll(e){return this.#t.subscribe(t=>e(t[0]))}createMutableObservableValue(...e){let t=this.#e.own(new R),n=t.own(new te),i=()=>e.slice(0,-1).reduce((s,l)=>s[l],this.#i),o=e[e.length-1],a={getValue:()=>e.reduce((s,l)=>s[l],this.#i),setValue:s=>i()[o]=s,subscribe:s=>n.subscribe(s),catchupAndSubscribe:s=>(s(a),n.subscribe(s)),terminate:()=>t.terminate()};return t.own(this.subscribe(()=>n.notify(a),...e)),a}update(e){let t=new Set;this.#o(this.#r,e,t);for(let n of t)this.#t.notify([n])}terminate(){this.#e.terminate(),this.#t.terminate()}#n=(e,t)=>{let n=Math.min(e.length,t.length);for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0};#o=(e,t,n,i)=>{for(let o of Object.keys(t)){let a=i??o,s=t[o],l=e[o];s!==null&&typeof s=="object"&&!Array.isArray(s)?this.#o(e[o],s,n,a):l!==s&&(e[o]=s,n.add(a))}};#a=(e,t)=>new Proxy(e,{get:(n,i)=>{let o=n[i];return o!==null&&typeof o=="object"&&!Array.isArray(o)?this.#a(o,[...t,i]):o},set:(n,i,o)=>(n[i]=o,this.#t.notify([...t,i]),!0),preventExtensions:()=>!1})};var Pw=(r,e)=>Math.floor(3840/e)*r,aE=(r,e=4,t=4)=>{let n=Pw(1,t),i=Math.floor(r/n),o=Math.floor(i/e),s=(Math.floor(r)-Pw(o*e,t))%n,l=Math.floor(s/240),u=s%240;return{bars:o,beats:i-o*e,semiquavers:l,ticks:u}},sE=(r,e)=>r*e/60*960,lE=(r,e)=>r*60/960/e,zk=(r,e)=>e*60/960/r,Uk=(r,e,t)=>sE(r/t,e),jk=(r,e,t)=>lE(r,e)*t,G={Bar:3840,Quarter:960,SemiQuaver:240,fromSignature:Pw,toParts:aE,secondsToPulses:sE,pulsesToSeconds:lE,secondsToBpm:zk,samplesToPulses:Uk,pulsesToSamples:jk,toString:(r,e=4,t=4)=>{let{bars:n,beats:i,semiquavers:o,ticks:a}=aE(r|0,e,t);return`${n+1}.${i+1}.${o+1}:${a}`}};var he=128,ss=G.fromSignature(1,48),nm=1e-4;var xe=class r{static Empty=new r(2);#e;constructor(e=2){this.#e=O.create(()=>new Float32Array(he),e)}clear(e,t){this.#e.forEach(n=>n.fill(0,e,t))}numChannels(){return this.#e.length}getChannel(e){return e<this.numChannels()?this.#e[e]:this.#e[this.numChannels()-1]}assertSanity(){T(!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){T(e.length===2,"mixLayout: target.length must be 2"),T(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){T(e.length===2,"mixLayout: target.length must be 2"),T(this.#e.length===1||this.#e.length===2,"mixLayout: target.length must be 1 or 2");let[t,n]=e;if(this.#e.length===1){let[i]=this.#e;for(let o=0;o<he;o++)t[o]+=i[o],n[o]+=i[o]}else{let[i,o]=this.#e;for(let a=0;a<he;a++)t[a]+=i[a],n[a]+=o[a]}}};var gt;(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"})(gt||(gt={}));var Kl=class{#e;#t=gt.Idle;#r=0;#i=0;#n=0;#o=0;#a=0;#s=0;#l=0;#c=0;#u=0;constructor(e){this.#e=1/e}get gate(){return this.#t!==gt.Idle&&this.#t!==gt.Release}get complete(){return this.#t===gt.Idle}get value(){return this.#r}get phase(){return this.#i}set(e,t,n,i){this.#n=e,this.#o=t,this.#a=n,this.#s=i,this.#d()}#d(){switch(this.#t){case gt.Attack:{let e=1-this.#r;this.#l=e*this.#e/Math.max(this.#n,1e-6);break}case gt.Decay:{let e=this.#r-this.#a;this.#c=e*this.#e/Math.max(this.#o,1e-6);break}case gt.Release:{let e=this.#r;this.#u=e*this.#e/Math.max(this.#s,1e-6);break}case gt.Sustain:case gt.Idle:{this.#l=this.#e/Math.max(this.#n,1e-6),this.#c=(1-this.#a)*this.#e/Math.max(this.#o,1e-6),this.#u=this.#a*this.#e/Math.max(this.#s,1e-6);break}}}gateOn(){this.#t=gt.Attack}gateOff(){this.#t!==gt.Idle&&(this.#t=gt.Release,this.#d())}forceStop(){this.#t=gt.Idle,this.#r=0}process(e,t,n){for(let i=t;i<n;)switch(this.#t){case gt.Attack:for(;i<n;){if(this.#r+=this.#l,this.#r>=1){this.#r=1,this.#i=1,e[i++]=this.#r,this.#t=gt.Decay,this.#d();break}e[i++]=this.#i=this.#r}break;case gt.Decay:for(;i<n;){if(this.#r-=this.#c,this.#r<=this.#a){this.#r=this.#a,this.#i=2,e[i++]=this.#r,this.#t=gt.Sustain,this.#d();break}this.#i=1+(1-this.#r)/(1-this.#a),e[i++]=this.#r}break;case gt.Sustain:e.fill(this.#a,i,n);return;case gt.Release:for(;i<n;){if(this.#r-=this.#u,this.#r<=0){this.#r=0,this.#i=0,e[i++]=this.#r,this.#t=gt.Idle,this.#d();break}this.#i=3+(1-this.#r/this.#a),e[i++]=this.#r}break;case gt.Idle:e.fill(0,i,n);return}}};var Bn=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=pe(e,0,1),e>=.5)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let n=Gi*e,i=Math.sin(n)/(2*t),o=Math.cos(n),a=(1-o)/2,s=a,l=2*a,u=a,d=1+i,p=-2*o,h=1-i;this.setNormalizedCoefficients(s,l,u,d,p,h)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}setHighpassParams(e,t=Math.SQRT1_2){if(e=pe(e,0,1),e===1)this.setNormalizedCoefficients(0,0,0,1,0,0);else if(e>0){let n=Gi*e,i=Math.sin(n)/(2*t),o=Math.cos(n),a=(1+o)/2,s=a,l=-2*a,u=a,d=1+i,p=-2*o,h=1-i;this.setNormalizedCoefficients(s,l,u,d,p,h)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setNormalizedCoefficients(e,t,n,i,o,a){let s=1/i;return this.b0=e*s,this.b1=t*s,this.b2=n*s,this.a1=o*s,this.a2=a*s,this}setLowShelfParams(e,t){e=pe(e,0,1);let n=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(n*n,0,0,1,0,0);else if(e>0){let i=Gi*e,a=.5*Math.sin(i)*Math.sqrt((n+1/n)*(1/1-1)+2),s=Math.cos(i),l=2*Math.sqrt(n)*a,u=n+1,d=n-1,p=n*(u-d*s+l),h=2*n*(d-u*s),g=n*(u-d*s-l),v=u+d*s+l,y=-2*(d+u*s),x=u+d*s-l;this.setNormalizedCoefficients(p,h,g,v,y,x)}else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setHighShelfParams(e,t){e=pe(e,0,1);let n=Math.pow(10,t/40);if(e===1)this.setNormalizedCoefficients(1,0,0,1,0,0);else if(e>0){let i=Gi*e,a=.5*Math.sin(i)*Math.sqrt((n+1/n)*(1/1-1)+2),s=Math.cos(i),l=2*Math.sqrt(n)*a,u=n+1,d=n-1,p=n*(u+d*s+l),h=-2*n*(d+u*s),g=n*(u+d*s-l),v=u-d*s+l,y=2*(d-u*s),x=u-d*s-l;this.setNormalizedCoefficients(p,h,g,v,y,x)}else this.setNormalizedCoefficients(n*n,0,0,1,0,0);return this}setPeakingParams(e,t,n){e=pe(e,0,1),t=Math.max(0,t);let i=Math.pow(10,n/40);if(e>0&&e<1)if(t>0){let o=Gi*e,a=Math.sin(o)/(2*t),s=Math.cos(o),l=1+a*i,u=-2*s,d=1-a*i,p=1+a/i,h=-2*s,g=1-a/i;this.setNormalizedCoefficients(l,u,d,p,h,g)}else this.setNormalizedCoefficients(i*i,0,0,1,0,0);else this.setNormalizedCoefficients(1,0,0,1,0,0);return this}setAllpassParams(e,t){if(e=pe(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let n=Gi*e,i=Math.sin(n)/(2*t),o=Math.cos(n),a=1-i,s=-2*o,l=1+i,u=1+i,d=-2*o,p=1-i;this.setNormalizedCoefficients(a,s,l,u,d,p)}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=pe(e,0,1),t=Math.max(0,t),e>0&&e<1)if(t>0){let n=Gi*e,i=Math.sin(n)/(2*t),o=Math.cos(n),a=1,s=-2*o,l=1,u=1+i,d=-2*o,p=1-i;this.setNormalizedCoefficients(a,s,l,u,d,p)}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 n=Gi*e;if(t>0){let i=Math.sin(n)/(2*t),o=Math.cos(n),a=i,s=0,l=-i,u=1+i,d=-2*o,p=1-i;this.setNormalizedCoefficients(a,s,l,u,d,p)}else this.setNormalizedCoefficients(1,0,0,1,0,0)}else this.setNormalizedCoefficients(0,0,0,1,0,0);return this}getFrequencyResponse(e,t,n){T(e.length===t.length&&e.length===n.length,"Array lengths do not match");let i=this.b0,o=this.b1,a=this.b2,s=this.a1,l=this.a2;for(let u=0;u<e.length;++u){let d=-Math.PI*2*e[u],p=Math.cos(d),h=Math.sin(d),g=i+((o+a*p)*p-a*h*h),v=(o+a*p)*h+a*h*p,y=1+((s+l*p)*p-l*h*h),x=(s+l*p)*h+l*h*p,$=y*y+x*x,M=(g*y+v*x)/$,U=(v*y-g*x)/$;t[u]=Math.sqrt(M*M+U*U),n[u]=Math.atan2(U,M)}}};var $t=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:n,b1:i,b2:o},a,s,l,u){let d=this.#e,p=this.#t,h=this.#r,g=this.#i;for(let v=l;v<u;v++){let y=a[v],x=s[v]=n*y+i*d+o*p-e*h-t*g+1e-18-1e-18;p=d,d=y,g=h,h=x}this.#e=d,this.#t=p,this.#r=h,this.#i=g}processFrame({a1:e,a2:t,b0:n,b1:i,b2:o},a){let s=n*a+i*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}},Zo=class{#e;#t;constructor(e){this.#e=O.create(()=>new $t,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,n,i,o){for(let a=0;a<this.#t;a++)this.#e[a].process(e,t,n,i,o),t=n}processFrame(e,t){for(let n=0;n<this.#t;n++)t=this.#e[n].processFrame(e,t);return t}},jd=512,om=class{#e;#t=new Bn;#r;#i=-1;constructor(e,t,n){this.#r=new Zo(4),this.#e=new Float32Array(jd+1);let i=Math.log(t/e),o=1/n;for(let a=0;a<=jd;a++)this.#e[a]=e*Math.exp(a/jd*i)*o}get order(){return this.#r.order}set order(e){this.#r.order=e}reset(){this.#r.reset()}process(e,t,n,i,o,a){let s=this.#e,l=this.#r,u=this.#t,d=i/l.order**1.25,p=o,h=this.#i;for(;p<a;){let g=Math.floor(yi(n[p])*jd),v=p+1;for(;v<a&&Math.floor(yi(n[v])*jd)===g;)++v;g!==h&&(h=g,u.setLowpassParams(s[g],d)),l.process(u,e,t,p,v),p=v}this.#i=h}};var cE=Math.log(10)/20,Ld=(r=60,e=440)=>e*Math.pow(2,(r+3)/12-6);var Ce=r=>Math.exp(r*cE),Wl=r=>Math.log(r)/cE,Zl=r=>Ce(20*Math.log10(r));var Lk=.02,uE=1e3,am=class{#e;#t;#r;#i;#n;#o;#a=NaN;#s=NaN;#l=0;#c=0;#u=0;#d=8;#p=0;#h=1;#f=!1;constructor(e){this.#e=e,this.#t=Math.ceil(e*Lk)|0,this.#r=new Bn,this.#r.setLowpassParams(.5),this.#i=[new $t,new $t],this.#n=[new Float32Array(he),new Float32Array(he)],this.#o=new Float32Array(2)}process(e,t,n,i){let[o,a]=e,[s,l]=t,[u,d]=this.#n;this.#i[0].process(this.#r,o,u,n,i),this.#i[1].process(this.#r,a,d,n,i);let p=Ce(this.#p),h=Ce(-this.#p/2),g=this.#e/this.#a,v=Math.pow(2,this.#d)-1,y=1/v;for(let x=n;x<i;x++)this.#c>0&&(this.#a+=this.#l,--this.#c===0&&(this.#l=0,this.#a=this.#s),this.#r.setLowpassParams(Math.max(this.#a,uE)/this.#e)),this.#u+=1,this.#u>=g&&(this.#u-=g,this.#o[0]=pe(Math.round(u[x]*p*v)*y,-1,1),this.#o[1]=pe(Math.round(d[x]*p*v)*y,-1,1)),s[x]=(o[x]*(1-this.#h)+this.#o[0]*this.#h)*h,l[x]=(a[x]*(1-this.#h)+this.#o[1]*this.#h)*h;this.#f=!0}setCrush(e){let t=tE(20,this.#e*.5,e);this.#f&&isFinite(this.#a)?(this.#s=t,this.#l=(t-this.#a)/this.#t,this.#c=this.#t):(this.#a=t,this.#r.setLowpassParams(Math.max(this.#a,uE)/this.#e))}setBitDepth(e){this.#d=pe(e,1,16)}setBoost(e){this.#p=e}setMix(e){this.#h=yi(e)}reset(){this.#f=!1,this.#s=NaN,this.#l=0,this.#c=0,this.#u=0,this.#o.fill(0),this.#i[0].reset(),this.#i[1].reset()}};var Kd=class{#e;#t;#r;#i;#n=0;#o=0;#a=0;#s=0;#l=0;#c=!1;#u=!1;constructor(e,t){let n=En(e);this.#e=n,this.#t=n-1,this.#r=new Float32Array(n),this.#i=t}clear(){this.#n=0,this.#c&&(this.#r.fill(0),this.#c=!1),this.#d()}set offset(e){if(e<0||e>=this.#e)throw new Error(`MonoDelay offset ${e} out of bounds [0, ${this.#e})`);this.#a=e,this.#c?this.#p():this.#d()}get offset(){return this.#a}process(e,t,n,i){this.#u?this.#f(e,t,n,i):this.#h(e,t,n,i),this.#c=!0}#d(){this.#o=this.#a,this.#l=0,this.#u=!1}#p(){this.#a!==this.#o&&(this.#l=this.#i,this.#s=(this.#a-this.#o)/this.#l,this.#u=!0)}#h(e,t,n,i){let o=this.#r,a=this.#t,s=this.#n,l=s-Math.floor(this.#o);l<0&&(l+=this.#e);for(let u=n;u<i;++u)o[s]=t[u],e[u]=o[l],l=l+1&a,s=s+1&a;this.#n=s}#f(e,t,n,i){let o=this.#r,a=this.#t,s=this.#n;for(let l=n;l<i;++l){this.#l>0?(this.#o+=this.#s,this.#l--):(this.#o=this.#a,this.#u=!1),o[s]=t[l];let u=s-this.#o;u<0&&(u+=this.#e);let d=Math.floor(u),p=u-d,h=o[d];e[l]=h+p*(o[d+1&a]-h),s=s+1&a}this.#n=s}};var sm=class r{static#e=10;#t=1;#r=0;#i=0;#n=0;#o=0;#a=0;set(e,t,n){this.#t=e,this.#r=t*r.#e,this.#i=Xf(1e-5,1-1e-5,n),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),n,i,o,a;return this.#r<0?(n=1-t,i=1-this.#i,o=this.#a,a=this.#o):(n=t,i=this.#i,o=this.#o,a=this.#a),n<=i?1-(1-n*o)**this.#n*this.#t:((1-n)*a)**this.#n*this.#t-this.#t+1}};var Wd;(function(r){r.Comparator=(e,t)=>e.position-t.position,r.PositionExtractor=e=>e.position})(Wd||(Wd={}));var ls;(function(r){r.complete=e=>e.position+e.duration,r.DescendingComparator=(e,t)=>r.complete(t)-r.complete(e)})(ls||(ls={}));var lr;(function(r){r.globalToLocal=(t,n)=>Vd(n-t.position+t.loopOffset,t.loopDuration),r.locateLoop=({position:t,complete:n,loopOffset:i,loopDuration:o},a,s)=>{let l=t-i,u=l+o;if(l>=s||u<=a)return m.None;let d=Math.max(l,a),p=Math.min(u,s);return m.wrap({index:0,rawStart:l,rawEnd:u,regionStart:Math.max(l,t),regionEnd:Math.min(u,n),resultStart:d,resultEnd:p,resultStartValue:l<d?(d-l)/o:0,resultEndValue:u>p?(p-l)/o:1})};function*e({position:t,complete:n,loopOffset:i,loopDuration:o},a,s){let l=t-i,u=Math.max(t,a),d=Math.min(n,s),p=Math.floor((u-l)/o),h=l+p*o;for(;h<d;){let g=h+o,v=Math.max(h,t),y=Math.min(g,n),x=Math.max(h,u),$=Math.min(g,d),M=h<x?(x-h)/o:0,U=g>$?($-h)/o:1;yield{index:p++,rawStart:h,rawEnd:g,regionStart:v,regionEnd:y,resultStart:x,resultEnd:$,resultStartValue:M,resultEndValue:U},h=g}}r.locateLoops=e})(lr||(lr={}));var Dr=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 lm(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()?vo.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t,n){return this.#e.isEmpty()?vo.empty():this.#e.iterate(this.#e.ceilFirstIndex(e),t,n)}first(){return this.#e.optAt(0)}last(){return this.#e.optAt(this.#e.length()-1)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},qo=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 lm(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()?vo.empty():this.#e.iterateFrom(e,t)}iterateRange(e,t){if(this.#e.isEmpty())return vo.empty();let n=Math.max(0,this.#e.floorLastIndex(e)),i=this.#e.optAt(n);if(i===null)return vo.empty();for(;i.position+i.duration<=e;)if(i=this.#e.optAt(++n),i===null||i.position>=t)return vo.empty();return this.#e.iterate(n,t)}length(){return this.#e.length()}isEmpty(){return this.#e.isEmpty()}onIndexingChanged(){this.#e.onIndexingChanged()}},cs=class{#e;constructor(){this.#e=[]}addAndRetain(e){if(this.#e.length===0)this.#e.push(e);else{let t=nt.leftMost(this.#e,e,ls.DescendingComparator);this.#e.splice(t,0,e)}}*overlapping(e,t){let n=this.#e.filter(i=>i.position<=e&&e<i.position+i.duration);yield*Z(t)?n.sort(t):n}*releaseLinearCompleted(e){if(this.#e.length!==0)for(let t=this.#e.length-1;t>=0;t--){let n=this.#e[t];if(ls.complete(n)<e)this.#e.splice(t,1),yield n;else return}}*release(e){if(this.#e.length!==0)for(let t=this.#e.length-1;t>=0;t--){let n=this.#e[t];e(n)&&(this.#e.splice(t,1),yield n)}}*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)}},lm=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 n=e.position,i=nt.leftMostMapped(this.#e,n,Rd,Wd.PositionExtractor);for(let o=i;o<this.#e.length;o++){let a=this.#e[o];if(a===e)return!0;if(a.position!==n)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 n=this.floorLastIndex(e);for(;n>=0;){let i=this.#e[n--];if(t(i))return i}return null}greaterEqual(e,t){if(t===void 0)return this.optAt(this.ceilFirstIndex(e));let n=this.ceilFirstIndex(e);for(;n<this.#e.length;){let i=this.#e[n++];if(t(i))return i}return null}floorLastIndex(e){return this.#t&&this.#r(),nt.rightMostMapped(this.#e,e,Rd,Wd.PositionExtractor)}ceilFirstIndex(e){return this.#t&&this.#r(),nt.leftMostMapped(this.#e,e,Rd,Wd.PositionExtractor)}iterateFrom(e,t){let n=this.floorLastIndex(e),i=n;if(i<0)return this.iterate(0,xr.MAX_VALUE,t);for(;i>=0;){let o=this.optAt(i);if(o!==null&&t!==void 0&&t(o))return this.iterate(i,xr.MAX_VALUE,t);i--}return this.iterate(n,xr.MAX_VALUE,t)}length(){return this.#e.length}isEmpty(){return this.#e.length===0}onIndexingChanged(){this.#t=this.length()>1}*iterate(e,t,n=Wo.alwaysTrue){for(this.#t&&this.#r();e<this.#e.length;){let i=this.#e[e++];if(i.position>=t)return;n(i)&&(yield i)}}#r(){this.#e.sort(this.comparator),this.#t=!1}};var qf=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 n=0;n<t;n++){let i=2*Math.PI*n/e;this.#r[n]=Math.cos(i),this.#i[n]=Math.sin(i)}}process(e,t){let n,i,o,a;for(let u=0;u<this.#e;++u)i=r.reverse(u)>>>this.#t,i>u&&(a=e[u],e[u]=e[i],e[i]=a,a=t[u],t[u]=t[i],t[i]=a);let s=this.#r,l=this.#i;for(let u=2;u<=this.#e;u<<=1){let d=u>>1,p=this.#e/u;for(n=0;n<this.#e;n+=u){let h=n+d;for(i=n,o=0;i<h;i++,o=o+p|0){let g=i+d|0,v=s[o],y=l[o],x=e[g],$=t[g],M=x*v+$*y,U=$*v-x*y,C=e[i],V=t[i];e[g]=C-M,t[g]=V-U,e[i]=C+M,t[i]=V+U}}if(u===this.#e)break}}};var Sw=r=>{let e=.25*r+.25;return 4*(Math.abs(e-Math.round(e))-.25)};var Yt;(function(r){r.builder=()=>new e,r.toDouble=([t,n])=>t/n,r.toPPQN=([t,n])=>G.fromSignature(t,n);class e{#e=[];add(n){return this.#e.push(n),this}asArray(){return this.#e}asAscendingArray(){return this.#e.toSorted((n,i)=>r.toDouble(n)-r.toDouble(i))}asDescendingArray(){return this.#e.toSorted((n,i)=>r.toDouble(i)-r.toDouble(n))}}})(Yt||(Yt={}));var Go=class{static*iterate(e,t,n){let i=Math.ceil(e/n),o=i*n;for(;o<t;)yield o,o=++i*n}static*iterateWithIndex(e,t,n){let i=Math.ceil(e/n),o=i*n;for(;o<t;)yield{position:o,index:i},o=++i*n}};var ql=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,n,i){if(isNaN(this.#r)){for(let o=n;o<i;o++)e[o]*=this.#e;this.#t=this.#e}else{let o=G.samplesToPulses(1,t,sampleRate);for(let a=n;a<i;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<i;s++)e[s]*=this.#e;break}e[a]*=this.#t=this.#e+(this.#r-this.#e)*this.#i}}}advance(e,t,n){if(isNaN(this.#r))this.#t=this.#e;else{let i=G.samplesToPulses(n-t,e,sampleRate);this.#i+=i/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 cm=class{#e;#t;constructor(){this.#e=[],this.#t=new Map}addVertex(e){T(!this.#e.includes(e),"Vertex already exists"),this.#e.push(e),T(!this.#t.has(e),"Predecessor already exists"),this.#t.set(e,[])}removeVertex(e){O.remove(this.#e,e);let t=this.#t.delete(e);T(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]){se(this.#t.get(t),`[add] Edge has unannounced vertex. (${t})`).push(e)}removeEdge([e,t]){let n=se(this.#t.get(t),`[remove] Edge has unannounced vertex. (${t})`);T(n.includes(e),`${e} is not marked.`),O.remove(n,e)}isEmpty(){return this.#e.length===0}},um=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.#s();let e=new Map;for(let n of this.#e.vertices())this.#n.set(n,new Set),e.set(n,new Set);for(let n of this.#e.vertices())for(let i of this.#e.getPredecessors(n))se(this.#n.get(i),`Could not find Successor for ${i}`).add(n);let t;do{t=!1;for(let n of this.#e.vertices()){se(e.get(n)).clear();for(let i of se(this.#n.get(n)))for(let o of se(this.#n.get(i)))this.#n.get(n)?.has(o)||(t=!0,se(e.get(n)).add(o))}for(let n of this.#e.vertices()){let i=se(this.#n.get(n));se(e.get(n)).forEach(o=>i.add(o))}}while(t)}#a(e){if(!this.#r.has(e)){this.#r.add(e);for(let t of this.#e.getPredecessors(e)){if(se(this.#n.get(e)).has(t)){this.#i.add(e),this.#i.add(t);continue}this.#a(t)}this.#t.push(e)}}#s(){O.clear(this.#t),this.#r.clear(),this.#i.clear(),this.#n.clear()}};var Zd;(function(r){r.Identity={warp:e=>e,unwarp:e=>e}})(Zd||(Zd={}));var dm=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 n=this.#e.duration(),i=mo(t,n),o=(t-i)/n,a=e?this.#e.fx(o):this.#e.fy(o);return i+a*n}};var Qe;(function(r){r[r.sine=0]="sine",r[r.triangle=1]="triangle",r[r.saw=2]="saw",r[r.square=3]="square"})(Qe||(Qe={}));var pm=class{sampleRate;#e=0;constructor(e){this.sampleRate=e}fill(e,t,n,i,o){let a=n/this.sampleRate;switch(t){case Qe.sine:{for(let s=i;s<o;s++)e[s]=Math.sin(this.#e*Math.PI*2),this.#e+=a,this.#e>=1&&(this.#e-=1);break}case Qe.triangle:{for(let s=i;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 Qe.saw:{for(let s=i;s<o;s++){let l=this.#e%1;e[s]=2*l-1,this.#e+=a,this.#e>=1&&(this.#e-=1)}break}case Qe.square:{for(let s=i;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 In;(function(r){r[r.Linear=0]="Linear",r[r.EqualPower=1]="EqualPower"})(In||(In={}));var hm;(function(r){r.BlackKeyIndices=[1,3,6,8,10],r.BlackKeyBits=r.BlackKeyIndices.reduce((t,n)=>t|=1<<n,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,n)=>yi((t-60)*n);class e{#e;#t;constructor(n,...i){this.#e=n,this.#t=i.reduce((o,a)=>o|=1<<a,0)}get name(){return this.#e}get bits(){return this.#t}has(n){return(this.#t&1<<n%12)!==0}equals(n){return this.#t===n.bits}}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)]})(hm||(hm={}));var cr;(function(r){r.isOfType=e=>e.type==="note-event",r.Comparator=(e,t)=>{let n=e.position-t.position;if(n!==0)return n;let i=e.pitch-t.pitch;return i!==0?i: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 n=ls.complete(e)-ls.complete(t);return n!==0?n:e.pitch-t.pitch}})(cr||(cr={}));var qd=class{#e;#t=0;#r=0;constructor(e){this.#e=1/e}generate(e,t,n,i,o){let a=t*this.#e;switch(n){case Qe.sine:this.#i(e,a,i,o);break;case Qe.saw:this.#n(e,a,i,o);break;case Qe.square:this.#o(e,a,i,o);break;case Qe.triangle:this.#a(e,a,i,o);break}}generateFromFrequencies(e,t,n,i,o){switch(n){case Qe.sine:this.#s(e,t,i,o);break;case Qe.saw:this.#l(e,t,i,o);break;case Qe.square:this.#c(e,t,i,o);break;case Qe.triangle:this.#u(e,t,i,o);break}}#i(e,t,n,i){let o=this.#t;for(let a=n;a<i;a++)e[a]=Math.sin(2*Math.PI*(o%1)),o+=t;this.#t=o}#n(e,t,n,i){let o=this.#t;for(let a=n;a<i;a++){let s=o%1;e[a]=2*s-1-kn(s,t),o+=t}this.#t=o}#o(e,t,n,i){let o=this.#t;for(let a=n;a<i;a++){let s=o%1;e[a]=(s<.5?1:-1)+kn(s,t)-kn((s+.5)%1,t),o+=t}this.#t=o}#a(e,t,n,i){let o=this.#t,a=this.#r,s=4*t;for(let l=n;l<i;l++){let u=o%1,d=(u<.5?1:-1)+kn(u,t)-kn((u+.5)%1,t);a=a*.9995+d*s,e[l]=a,o+=t}this.#t=o,this.#r=a}#s(e,t,n,i){let o=this.#e,a=this.#t;for(let s=n;s<i;s++)e[s]=Math.sin(2*Math.PI*(a%1)),a+=t[s]*o;this.#t=a}#l(e,t,n,i){let o=this.#e,a=this.#t;for(let s=n;s<i;s++){let l=t[s]*o,u=a%1;e[s]=2*u-1-kn(u,l),a+=l}this.#t=a}#c(e,t,n,i){let o=this.#e,a=this.#t;for(let s=n;s<i;s++){let l=t[s]*o,u=a%1;e[s]=(u<.5?1:-1)+kn(u,l)-kn((u+.5)%1,l),a+=l}this.#t=a}#u(e,t,n,i){let o=this.#e,a=this.#t,s=this.#r;for(let l=n;l<i;l++){let u=t[l]*o,d=a%1,p=(d<.5?1:-1)+kn(d,u)-kn((d+.5)%1,u);s=s*.9995+p*(4*u),e[l]=s,a+=u}this.#t=a,this.#r=s}},kn=(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 yo;(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:n,invertL:i,invertR:o,stereo:a,swap:s},l=In.EqualPower)=>{let[u,d]=r.panningToGains(n,l),p=u*t,h=d*t;i&&(p*=-1),o&&(h*=-1);let g=Math.max(0,-a),v=Math.max(0,a),y=1-v,x=1+v,$=g*.5,M=1-g,U=(y+x)*.5,C=(y-x)*.5,V=(y-x)*.5,re=(y+x)*.5,Y=p*($+M)*U+h*$*C,de=p*($+M)*V+h*$*re,Q=p*$*U+h*($+M)*C,Pe=p*$*V+h*($+M)*re;s?(e.ll=de,e.rl=Y,e.lr=Pe,e.rr=Q):(e.ll=Y,e.lr=Q,e.rl=de,e.rr=Pe)},r.panningToGains=(e,t)=>{let n=pe(e,-1,1);switch(t){case In.Linear:return[Math.min(1-n,1),Math.min(n+1,1)];case In.EqualPower:return[Math.cos((n+1)*gw),Math.sin((n+1)*gw)]}},r.applyFrame=(e,t,n)=>[e.ll*t+e.rl*n,e.lr*t+e.rr*n],r.processFrames=(e,t,n,i,o)=>{let[a,s]=t,[l,u]=n;for(let d=i;d<o;d++){let p=a[d],h=s[d];l[d]=e.ll*p+e.rl*h,u[d]=e.lr*p+e.rr*h}},r.replaceFrames=(e,[t,n],i,o)=>{for(let a=i;a<o;a++){let s=t[a],l=n[a];t[a]=e.ll*s+e.rl*l,n[a]=e.lr*s+e.rr*l}}})(yo||(yo={}));var Qt;(function(r){r.linear=(n,i=.005)=>new e(Math.ceil(n*i)|0),r.stereoMatrix=(n,i=.005)=>new t(Math.ceil(n*i)|0);class e{#e;#t=0;#r=0;#i=0;#n=0;constructor(i){this.#e=i}set(i,o){this.#t!==i&&(o===!0?(this.#r=i,this.#i=(i-this.#t)/this.#e,this.#n=this.#e):(this.#t=this.#r=i,this.#i=0,this.#n=0))}get(){return this.#t}moveAndGet(){return 0<this.#n&&(this.#t+=this.#i,--this.#n===0&&(this.#i=0,this.#t=this.#r)),this.#t}isFixed(i){return this.#t===i&&this.#n===0}isInterpolating(){return this.#n>0}}class t{#e;#t=yo.zero();#r=yo.zero();#i=yo.zero();#n=0;constructor(i){this.#e=i}update(i,o,a){yo.update(this.#r,i,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(i,o,a,s){let[l,u]=i,[d,p]=o;if(this.isInterpolating())for(let h=a;h<s;h++){let g=l[h],v=u[h],y=this.moveAndGet();d[h]=y.ll*g+y.rl*v,p[h]=y.lr*g+y.rr*v}else{let h=this.#r;for(let g=a;g<s;g++){let v=l[g],y=u[g];d[g]=h.ll*v+h.rl*y,p[g]=h.lr*v+h.rr*y}}}set(i,o){this.#o(i)||(o===!0?(this.#r.ll=i.ll,this.#r.lr=i.lr,this.#r.rl=i.rl,this.#r.rr=i.rr,this.#i.ll=(i.ll-this.#t.ll)/this.#e,this.#i.lr=(i.lr-this.#t.lr)/this.#e,this.#i.rl=(i.rl-this.#t.rl)/this.#e,this.#i.rr=(i.rr-this.#t.rr)/this.#e,this.#n=this.#e):(this.#t.ll=this.#r.ll=i.ll,this.#t.lr=this.#r.lr=i.lr,this.#t.rl=this.#r.rl=i.rl,this.#t.rr=this.#r.rr=i.rr,this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#n=0))}get(){return this.#t}moveAndGet(){return 0<this.#n&&(this.#t.ll+=this.#i.ll,this.#t.lr+=this.#i.lr,this.#t.rl+=this.#i.rl,this.#t.rr+=this.#i.rr,--this.#n===0&&(this.#i.ll=0,this.#i.lr=0,this.#i.rl=0,this.#i.rr=0,this.#t.ll=this.#r.ll,this.#t.lr=this.#r.lr,this.#t.rl=this.#r.rl,this.#t.rr=this.#r.rr)),this.#t}isFixed(i){return this.#o(i)&&this.#n===0}isInterpolating(){return this.#n>0}#o(i){return this.#t.ll===i.ll&&this.#t.lr===i.lr&&this.#t.rl===i.rl&&this.#t.rr===i.rr}}r.StereoMatrixRamp=t})(Qt||(Qt={}));var Gd=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]),Ew=new Float32Array(12),dE=new Float32Array(11);for(let r=0,e=0,t=0;r<Gd.length;r++)r%2===0?Ew[e++]=Gd[r]:dE[t++]=Gd[r];var Fw=class{#e=new Float32Array(Ew.length);#t=new Float32Array(Gd.length);#r=0;#i=0;reset(){this.#e.fill(0),this.#t.fill(0),this.#r=0,this.#i=0}upsample(e,t,n,i){let o=this.#e,a=Ew,s=dE;for(let l=n;l<i;l++){let u=e[l],d=(l-n)*2;o[this.#r]=u;let p=0;for(let g=0;g<a.length;g++){let v=(this.#r-g+o.length)%o.length;p+=o[v]*a[g]}t[d]=p*2;let h=0;for(let g=0;g<s.length;g++){let v=(this.#r-g+o.length-1)%o.length;h+=o[v]*s[g]}t[d+1]=h*2,this.#r=(this.#r+1)%o.length}}downsample(e,t,n,i){let o=this.#t,a=Gd;for(let s=n;s<i;s++){let l=(s-n)*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 u=0;for(let d=0;d<a.length;d++){let p=(this.#i-1-d+o.length)%o.length;u+=o[p]*a[d]}t[s]=u}}},fm=class{#e;#t;#r;constructor(e){this.#e=e;let t=e===2?1:e===4?2:3;this.#t=O.create(()=>new Fw,t),this.#r=O.create(n=>new Float32Array(he*(2<<n)),t-1)}reset(){this.#t.forEach(e=>e.reset())}upsample(e,t,n,i){let o=i-n,a=e,s=n,l=i;for(let u=0;u<this.#t.length;u++){let p=u===this.#t.length-1?t:this.#r[u];this.#t[u].upsample(a,p,s,l),a=p,s=0,l=o*(2<<u)}}downsample(e,t,n,i){let o=i-n,a=e,s=o*this.#e;for(let l=this.#t.length-1;l>=0;l--){let u=l===0,d=u?t:this.#r[l-1],p=u?n:0,h=u?i:s/2;this.#t[l].downsample(a,d,p,h),a=d,s=h}}},mm=class{#e;#t;constructor(e){this.#e=new fm(e),this.#t=new fm(e)}reset(){this.#e.reset(),this.#t.reset()}upsample(e,t,n,i){this.#e.upsample(e[0],t[0],n,i),this.#t.upsample(e[1],t[1],n,i)}downsample(e,t,n,i){this.#e.downsample(e[0],t[0],n,i),this.#t.downsample(e[1],t[1],n,i)}};var Gl=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,n){let i=this.#e,o=i.length,a=this.#r,s=this.#i;for(let l=t;l<n;l++){let u=e[l]*e[l];s+=u-i[a],i[a]=u,++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 gm=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,n){let i=this.#r,o=this.#i,[a,s]=e.channels(),l=this.#n;for(let u=t;u<n;++u){let d=a[u],p=s[u],h=Math.max(Math.abs(d),Math.abs(p));if(l=h>l?i*(l-h)+h:o*(l-h)+h,l>1){let g=1/l;a[u]=d*g,s[u]=p*g}}this.#n=l}};var Xr=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 Mr;(function(r){r.Musical="musical",r.Seconds="seconds"})(Mr||(Mr={}));var Ho;(function(r){function e(t,n,i){return new Bw(t,n,i)}r.aware=e})(Ho||(Ho={}));var Bw=class{#e;#t;#r;constructor(e,t,n){this.#r=n,this.#t=t,this.#e=e}toPPQN(e){let t=this.#r.getValue();if(this.getTimeBase()===Mr.Musical)return t;let n=this.#e.ppqnToSeconds(e),i=n+t;return this.#e.intervalToPPQN(n,i)}fromPPQN(e,t){if(this.getTimeBase()===Mr.Musical)this.#r.setValue(e);else{let n=this.#e.intervalToSeconds(t,t+e);this.#r.setValue(n)}}toSeconds(e){let t=this.#r.getValue();return this.getTimeBase()===Mr.Seconds?t:this.#e.intervalToSeconds(e,e+t)}toSamples(e,t){return this.toSeconds(e)*t}rawValue(){return this.#r.getValue()}getTimeBase(){return vi(this.#t.getValue(),Mr)}};var vm=G.fromSignature(1,384);var xo={None:{type:"none"},Linear:{type:"linear"},Curve:r=>r===.5?xo.Linear:{type:"curve",slope:r}},ym;(function(r){r.Comparator=(i,o)=>{let a=i.position-o.position;if(a!==0)return a;let s=i.index-o.index;return s!==0?s:i===o?0:B(`${i} and ${o} are identical in terms of comparison`)};function*e(i,o,a){if(i.isEmpty())return Ye.empty();for(let s of i.iterateFrom(o))if(yield s,s.position>=a)return}r.iterateWindow=e,r.nextEvent=(i,o)=>{let a=i.asArray(),s=nt.rightMost(a,o,r.Comparator);return s===-1?null:a[s+1]??null},r.valueAt=(i,o,a)=>{if(i.isEmpty())return a;let s=i.iterateFrom(o),{done:l,value:u}=s.next();if(l)return a;if(u.position<=o){let{done:d,value:p}=s.next();if(d)return u.value;if(o<p.position)return n(u,p,o);if(u.interpolation===xo.None)return u.value}return u.value};function*t(i,o,a,s){if(i.isEmpty())return;let l=i.iterateFrom(o),{done:u,value:d}=l.next();if(u)return;let p=a/s,h=d;if(h.position>o){for(;o<h.position;)if(yield{position:o,value:h.value},o+=p,o>a)return;h.position<=a&&(yield h)}for(;o<=a;){let{done:g,value:v}=l.next();if(g)break;for(;o<v.position;){if(o>a)return;yield{position:o,value:n(h,v,o)},o+=p}v.position<a&&(h.interpolation===xo.None&&(yield{position:v.position,value:h.value}),yield v),h=v}for(;o<=a;)yield{position:o,value:h.value},o+=p}r.quantise=t;let n=({value:i,position:o,interpolation:a},s,l)=>a.type==="none"?i:a.type==="linear"?i+(l-o)/(s.position-o)*(s.value-i):a.type==="curve"?xi.valueAt({slope:a.slope,steps:s.position-o,y0:i,y1:s.value},l-o):B("Unknown interpolation")})(ym||(ym={}));var Td;(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,n)=>{let i=new Float32Array(n),o=Math.PI/(n-1);switch(t){case e.Bartlett:{let a=(n>>1)-1,s=0;for(;s<=a;++s)i[s]=2*s/(n-1);for(;s<n;++s)i[s]=2-2*s/(n-1);return i}case e.Blackman:{let a=2*o,s=4*o;for(let l=0;l<n;++l)i[l]=.42323-.49755*Math.cos(a*l)+.07922*Math.cos(s*l);return i}case e.BlackmanHarris:{let a=2*o,s=4*o,l=6*o;for(let u=0;u<n;++u)i[u]=.35875-.48829*Math.cos(a*u)+.14128*Math.cos(s*u)-.01168*Math.cos(l*u);return i}case e.Hamming:{let a=2*o;for(let s=0;s<n;++s)i[s]=.54-.46*Math.cos(a*s);return i}case e.Hanning:{let a=2*o;for(let s=0;s<n;++s)i[s]=.5-.5*Math.cos(a*s);return i}}}})(Td||(Td={}));var xm=class extends AudioWorkletProcessor{#e;#t;#r;#i;#n;#o=0;constructor({processorOptions:{sab:e,numberOfChannels:t,rmsWindowInSeconds:n,valueDecay:i}}){super(),this.#e=t,this.#t=new Float32Array(t),this.#r=new Float32Array(t),this.#i=O.create(()=>new Gl(sampleRate*n),t);let o=br.createBuilder({peak:br.floats(t),rms:br.floats(t)})();this.#n=Ll.writer(o,e,a=>{let s=Math.exp(-(128*this.#o)/(sampleRate*i));for(let l=0;l<t;++l){let u=this.#t[l],d=this.#r[l];a.peak[l]=u,a.rms[l]=Math.sqrt(d),this.#t[l]=u*s,this.#r[l]=d*s}this.#o=0})}process([e]){for(let t=0;t<this.#e;++t){let n=e[t];if(n===void 0)this.#t[t]=0,this.#r[t]=0;else{let i=this.#i[t],o=this.#t[t],a=this.#r[t];for(let s=0;s<he;++s){let l=n[s];o=Math.max(o,Math.abs(l)),a=Math.max(a,i.pushPop(l*l))}this.#t[t]=o,this.#r[t]=a}}return this.#o++,this.#n.tryWrite(),!0}};var Se=class r{static newSet(e){return new Ul(e,r.Comparator)}static compose=(e,...t)=>{let n=t.length===0?this.#e:new Int16Array(t);return T(n.every((i,o)=>i===t[o]),`fieldKeys (${n.join(",")}) only allows i16`),new r(e,n)};static decode(e){let t=e.split("/");return T(t.length>0,"Unable to parse Address"),r.compose(w.parse(t[0]),...t.slice(1).map(n=>parseInt(n)))}static reconstruct(e){return this.compose(e[0],...e[1])}static boxRange(e,t,n){let i=e.values(),o=nt.leftMostMapped(i,t,w.Comparator,n),a=i.length;if(o<0||o>=a)return null;for(let s=o;s<a;s++)if(w.Comparator(n(i[s]),t)!==0)return o<s?[o,s]:null;return[o,a]}static Comparator=(e,t)=>{let n=w.Comparator(e.#t,t.#t);if(n!==0)return n;let i=Math.min(e.#r.length,t.#r.length);for(let o=0;o<i;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 n=w.Comparator(e.#t,t.#t);if(n!==0)return n;let i=Math.min(e.#r.length,t.#r.length);for(let o=0;o<i;o++){let a=e.#r[o]-t.#r[o];if(a!==0)return a}return 0};static LengthComparator=(e,t)=>{let n=w.Comparator(e.#t,t.#t);return n!==0?n: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 w.Comparator(e.#t,this.#t)===0&&e.#r.length<=this.#r.length&&e.#r.every((t,n)=>this.#r[n]===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(w.length+this.#r.length);return e.set(this.#t,0),e.set(this.#r,w.length),e.buffer}toString(){return[w.toString(this.#t),...this.#r].join("/")}static read(e){let t=w.fromDataInput(e),n=e.readByte();return r.compose(t,...O.create(()=>e.readShort(),n))}},us;(function(r){r.AddressReader=e=>e.address,r.Comparator=({address:e},{address:t})=>Se.Comparator(e,t),r.equals=(e,t)=>{let[n,i]=nt.rangeMapped(t,e,Se.Comparator,r.AddressReader);return t.slice(n,i+1)},r.startsWith=(e,t)=>{let[n,i]=nt.rangeMapped(t,e,Se.MinimalComparator,r.AddressReader);return t.slice(n,i+1).filter(o=>o.address.startsWith(e))},r.endsWith=(e,t)=>{let n=nt.leftMostMapped(t,e,Se.LengthComparator,r.AddressReader),i=nt.rightMostMapped(t,e,Se.MinimalComparator,r.AddressReader);return t.slice(n,i+1).filter(o=>e.startsWith(o.address))}})(us||(us={}));var Nn=class r{static validate(e,t){if(e.address.equals(t.address))return m.wrap(`PointerField cannot point to itself: ${e}`);if(!t.pointerRules.accepts.some(n=>n===e.pointerType)){let n=t.pointerRules.accepts.join(", ");return m.wrap(`${String(e.pointerType)} does not satisfy any of the allowed types (${n}).`)}return m.None}#e;#t;constructor(e){this.#e=e,this.#t=new jt}subscribe(e,...t){return this.#r(this.#t,e,t)}catchupAndSubscribe(e,...t){let n=Se.newSet(i=>i.address);return n.addMany(this.filter(...t)),n.forEach(i=>e.onAdded(i)),this.subscribe({onAdded:i=>{n.add(i)&&e.onAdded(i)},onRemoved:i=>{n.removeByKey(i.address),e.onRemoved(i)}},...t)}filter(...e){return e.length===0?this.incoming():Ye.filter(this.incoming().values(),t=>e.some(n=>n===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 B(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,n){return e.subscribe({onAdded:i=>{(n.length===0||n.some(o=>o===i.pointerType))&&t.onAdded(i)},onRemoved:i=>{(n.length===0||n.some(o=>o===i.pointerType))&&t.onRemoved(i)}})}};var Iw=function(r,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Hl=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:n,pointerRules:i,deprecated:o}){this.#e=e,this.#t=t,this.#r=n,this.#i=i,this.#n=o,i.mandatory&&this.graph.edges().watchVertex(this)}accept(e){return P(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 Nn(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 Jr.empty()}getField(e){return B()}optField(e){return m.None}read(e){}write(e){}toJSON(){}fromJSON(e){return B("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()}`}};Iw([Ol,Hl("design:type",Nn),Hl("design:paramtypes",[])],W.prototype,"pointerHub",null);Iw([Ol,Hl("design:type",Se),Hl("design:paramtypes",[])],W.prototype,"address",null);Iw([Ol,Hl("design:type",String),Hl("design:paramtypes",[])],W.prototype,"debugPath",null);var f=Object.freeze({mandatory:!1,accepts:[]});var bm=class r extends W{static create(e,t,n){return new r(e,t,n)}#e;constructor(e,t,n){super(e),this.#e=O.create(i=>t({parent:this,fieldKey:i,fieldName:String(i),pointerRules:f,deprecated:e.deprecated}),n)}accept(e){return P(e.visitArrayField,this)}fields(){return this.#e}record(){return O.toRecord(this.#e,e=>String(e.fieldKey))}getField(e){return se(this.#e[e])}optField(e){return m.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,n)=>this.#e[n].fromJSON(t));else return B("Type mismatch")}};var Jo;(function(r){r.writeFields=(t,n)=>{let i=Object.entries(n).filter(([o,a])=>!a.deprecated);t.writeInt(1179403347),t.writeShort(i.length),i.forEach(([o,a])=>{let s=Ut.create();a.write(s);let l=new Int8Array(s.toArrayBuffer());t.writeShort(Number(o)),t.writeInt(l.length),t.writeBytes(l)})},r.readFields=(t,n)=>{T(t.readInt()===1179403347,"Serializer header is corrupt");let i=t.readShort();for(let o=0;o<i;o++){let a=t.readShort();if(Cl(n[a]))continue;let s=t.readInt(),l=new Int8Array(s);t.readBytes(l);let{status:u,error:d}=ho(()=>n[a]?.read(new mt(l.buffer)));u==="failure"&&console.warn(n,d)}}})(Jo||(Jo={}));var Kk=function(r,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,e,t,n);else for(var s=r.length-1;s>=0;s--)(a=r[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},pE=function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},I=class r{static DEBUG_DELETION=!1;static Index=0;#e;#t;#r;#i;#n;#o=r.Index++;constructor({uuid:e,graph:t,name:n,pointerRules:i}){this.#e=Se.compose(e),this.#t=t,this.#r=n,this.#i=i,this.#n=this.initializeFields(),i.mandatory&&this.graph.edges().watchVertex(this)}fields(){return Object.values(this.#n)}record(){return this.#n}getField(e){return se(this.#n[e],()=>`Field ${String(e)} not found in ${this.toString()}`)}optField(e){return m.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 Nn(this)}estimateMemory(){let e=new Rl;return this.write(e),e.count}isBox(){return!0}asBox(e){return Te(this,e)}isField(){return!1}isAttached(){return this.#t.findBox(this.address.uuid).nonEmpty()}read(e){Jo.readFields(e,this.#n)}write(e){Jo.writeFields(e,this.#n)}serialize(){let e=Ut.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=Ut.create();return this.write(e),e.toArrayBuffer()}toJSON(){return Object.entries(this.#n).reduce((e,[t,n])=>{let i=n.toJSON();return Z(i)&&(e[t]=i),e},{})}fromJSON(e){if(Hf(e))Object.entries(e).forEach(([t,n])=>{let i=this.#n[parseInt(t)];Z(n)&&i.fromJSON(n)});else return B("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 n=this.getField(t[0]),i=[e(n)];for(let o=1;o<t.length;o++)n=n.getField(t[o]),i.push(e(n));return i}searchVertex(e){if(e.length===0)return m.wrap(this);let t=this.optField(e[0]);if(t.isEmpty())return m.None;for(let n=1;n<e.length;n++)if(t=t.unwrap().optField(e[n]),t.isEmpty())return m.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(n=>n.toString()).join(`
2
+ `)),console.debug(" unstages",[...e].map(n=>n.toString()).join(`
3
+ `),this));for(let n of t)n.defer();for(let n of e)n.unstage();this.unstage()}unstage(){this.graph.unstageBox(this)}isValid(){if(this.#i.mandatory&&this.pointerHub.incoming().length===0)return!1;let e=t=>t.every(n=>n.accept({visitPointerField:i=>!i.mandatory||i.nonEmpty(),visitArrayField:i=>e(i.fields()),visitObjectField:i=>e(i.fields()),visitPrimitiveField:i=>!0,visitField:i=>!0})??!0);return e(this.fields())}toString(){return`${this.constructor.name} ${this.address.toString()}`}};Kk([Ol,pE("design:type",Nn),pE("design:paramtypes",[])],I.prototype,"pointerHub",null);var Hd;(function(r){r.clampInt32=(e,t)=>t,r.clampFloat32=(e,t)=>t})(Hd||(Hd={}));var ke;(function(r){r[r.This=0]="This",r[r.Parent=1]="Parent",r[r.Children=2]="Children"})(ke||(ke={}));var wm;(function(r){r.create=()=>new kw})(wm||(wm={}));var kw=class{#e=new Jd(us.equals);#t=new Jd(us.startsWith);#r=new Jd(us.endsWith);#i=[];#n=0;#o=!1;subscribe(e,t,n){let i=new Nw(t,e,this.#n++,n);if(this.#o){let o=new $w(i,e);return this.#i.push(o),o}else return this.subscribeMonitor(i,e)}dispatch(e){this.#o=!0,[...this.#e.filter(e),...this.#t.filter(e),...this.#r.filter(e)].sort(({order:n},{order:i})=>n-i).forEach(n=>n.procedure(e)),this.#o=!1,this.#i.forEach(n=>n.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 Jf(t)}}countStations(){return this.#e.count()+this.#t.count()+this.#r.count()}},Nw=class{address;propagation;order;procedure;constructor(e,t,n,i){this.address=e,this.propagation=t,this.order=n,this.procedure=i}toString(){return`{ Monitor address: ${this.address}, propagation: ${ke[this.propagation]}, order: ${this.order} }`}},Jd=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(us.Comparator),this.#t=!0),this.#e}filter(e){return this.filterStrategy(e.address,this.stations())}count(){return this.#e.length}},$w=class{monitor;propagation;#e=new R;#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 At;(function(r){r.Boolean="boolean",r.Float32="float32",r.Int32="int32",r.String="string",r.Bytes="bytes"})(At||(At={}));var ps={[At.Boolean]:{type:At.Boolean,encode:(r,e)=>r.writeBoolean(e),decode:r=>r.readBoolean()},[At.Float32]:{type:At.Float32,encode:(r,e)=>r.writeFloat(e),decode:r=>r.readFloat()},[At.Int32]:{type:At.Int32,encode:(r,e)=>r.writeInt(e),decode:r=>r.readInt()},[At.String]:{type:At.String,encode:(r,e)=>r.writeString(e),decode:r=>r.readString()},[At.Bytes]:{type:At.Bytes,encode:(r,e)=>{r.writeInt(e.length),r.writeBytes(e)},decode:r=>{let e=new Int8Array(r.readInt());return r.readBytes(e),e}}},ds=class extends W{#e;#t;#r;constructor(e,t,n){super(e),this.#e=t,this.#t=n,this.#r=this.#t}accept(e){return P(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){T(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,n=this.clamp(e);this.equals(n)||(this.#r=n,this.graph.onPrimitiveValueUpdate(this,t,n))}writeValue(e,t){T(!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)?B("not implemented"):e}fromJSON(e){return B("Type mismatch")}reset(){this.setValue(this.#t)}},k=class r extends ds{static create(e,t=!1){return new r(e,t)}constructor(e,t){super(e,At.Boolean,t)}toggle(){this.setValue(!this.getValue())}serialization(){return ps[At.Boolean]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readBoolean())}write(e){T(!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()))}},b=class r extends ds{static create(e,t,n,i=0){return new r(e,t,n,i)}#e;#t;constructor(e,t,n,i){super(e,At.Float32,i),this.#e=t,this.#t=n}serialization(){return ps[At.Float32]}equals(e){return this.getValue()===e}clamp(e){return Hd.clampFloat32(this.#e,go.toFloat32(e))}read(e){this.setValue(e.readFloat())}write(e){T(!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()))}},_=class r extends ds{static create(e,t,n,i=0){return new r(e,t,n,i)}#e;#t;constructor(e,t,n,i){super(e,At.Int32,i),this.#e=t,this.#t=n}serialization(){return ps[At.Int32]}equals(e){return this.getValue()===e}clamp(e){return Hd.clampInt32(this.#e,xr.toInt(e))}read(e){this.setValue(e.readInt())}write(e){T(!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>=xr.MIN_VALUE&&e<=xr.MAX_VALUE?this.setValue(e):console.warn("Int32Field Type mismatch",e,this.address.toString()))}},D=class r extends ds{static create(e,t=""){return new r(e,t)}constructor(e,t){super(e,At.String,t)}serialization(){return ps[At.String]}equals(e){return this.getValue()===e}clamp(e){return e}read(e){this.setValue(e.readString())}write(e){T(!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()))}},hE=class r extends ds{static create(e,t=this.#e){return new r(e,t)}static#e=Object.freeze(new Int8Array(0));constructor(e,t){super(e,At.Bytes,t)}serialization(){return ps[At.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){T(!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 fE;(function(r){r.decode=e=>{let t=e.readInt();return O.create(()=>{switch(e.readString()){case"new":{let i=w.fromDataInput(e),o=e.readString(),a=new Int8Array(e.readInt());return e.readBytes(a),new hs(i,o,a.buffer)}case"pointer":{let i=Se.read(e),o=e.readBoolean()?m.wrap(Se.read(e)):m.None,a=e.readBoolean()?m.wrap(Se.read(e)):m.None;return new Xd(i,o,a)}case"primitive":{let i=Se.read(e),o=e.readString(),a=ps[o],s=a.decode(e),l=a.decode(e);return new Qd(i,a,s,l)}case"delete":{let i=w.fromDataInput(e),o=e.readString(),a=new Int8Array(e.readInt());return e.readBytes(a),new fs(i,o,a.buffer)}}},t)}})(fE||(fE={}));var hs=class{type="new";#e;#t;#r;constructor(e,t,n){this.#e=e,this.#t=t,this.#r=n}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.createBox(this.#t,this.#e,t=>t.read(new mt(this.#r)))}inverse(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}write(e){e.writeString(this.type),w.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{NewUpdate uuid: ${w.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}toDebugString(e){return this.toString()}},Qd=class{type="primitive";#e;#t;#r;#i;constructor(e,t,n,i){this.#e=e,this.#t=t,this.#r=n,this.#i=i}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}`}},Xd=class{type="pointer";#e;#t;#r;constructor(e,t,n){this.#e=e,this.#t=t,this.#r=n}get address(){return this.#e}get oldAddress(){return this.#t}get newAddress(){return this.#r}matches(e){return e.address.equals(this.address)}inverse(e){this.field(e).targetAddress=this.#t}forward(e){this.field(e).targetAddress=this.#r}field(e){return e.findVertex(this.#e).unwrap(()=>`Could not find PointerField at ${this.#e}`)}write(e){e.writeString(this.type),this.#e.write(e),this.#t.match({none:()=>e.writeBoolean(!1),some: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()}`}},fs=class{type="delete";#e;#t;#r;constructor(e,t,n){this.#e=e,this.#t=t,this.#r=n}get uuid(){return this.#e}get name(){return this.#t}get settings(){return this.#r}forward(e){e.findBox(this.#e).unwrap(()=>`Could not find ${this.#t}`).unstage()}inverse(e){e.createBox(this.#t,this.#e,t=>t.read(new mt(this.#r)))}write(e){e.writeString(this.type),w.toDataOutput(e,this.#e),e.writeString(this.#t),e.writeInt(this.#r.byteLength),e.writeBytes(new Int8Array(this.#r))}toString(){return`{DeleteUpdate uuid: ${w.toString(this.#e)}, attachment: ${this.settings.byteLength}b`}};var xO=Symbol("Unreferenceable"),F=class r extends W{static create(e,t,n){return new r(e,t,n)}static encodeWith(e,t){T(this.#e.isEmpty(),"SerializationEncoder already in use"),this.#e=m.wrap(e);let n=ho(t);if(this.#e=m.None,n.status==="failure")throw n.error;return n.value}static decodeWith(e,t){T(this.#t.isEmpty(),"SerializationDecoder already in use"),this.#t=m.wrap(e);let n=ho(t);if(this.#t=m.None,n.status==="failure")throw n.error;return n.value}static#e=m.None;static#t=m.None;#r;#i;#n=m.None;#o=m.None;constructor(e,t,n){super(e),this.#r=t,this.#i=n,n&&this.graph.edges().watchVertex(this)}get pointerHub(){return B(`${this} cannot be pointed to`)}get pointerType(){return this.#r}get mandatory(){return this.#i}accept(e){return P(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=m.wrap(e)}defer(){this.targetVertex=m.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=Nn.validate(this,e.unwrap());t.nonEmpty()&&B(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()?m.wrap(Se.read(e)):m.None;this.targetAddress=r.#t.match({none:()=>t,some:n=>n.map(this,t)})}write(e){T(!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(_n(e)||typeof e=="string"){let t=m.wrap(_n(e)?null:Se.decode(e));this.targetAddress=r.#t.match({none:()=>t,some:n=>n.map(this,t)})}else return B(`Pointer: Type mismatch. value (${typeof e}) must be a string.`)}};var Am=class{#e;#t;#r;#i;constructor(){this.#e=Se.newSet(e=>e.address),this.#t=Se.newSet(e=>e.address),this.#r=Se.newSet(([e])=>e),this.#i=Se.newSet(([e])=>e.address)}watchVertex(e){if(Ke(e,F)){if(!e.mandatory)return B("watchVertex called but has no edge requirement");this.#e.add(e)}else{if(!e.pointerRules.mandatory)return B("watchVertex called but has no edge requirement");this.#t.add(e)}}unwatchVerticesOf(...e){let t=({box:{address:{uuid:n}}})=>n;for(let{address:{uuid:n}}of e)this.#o(this.#e,n,t),this.#o(this.#t,n,t);for(let n of e){let i=this.outgoingEdgesOf(n);if(i.length>0)return B(`${n} has outgoing edges: ${i.map(([a,s])=>`[${a.toString()}, ${s.toString()}]`)}`);let o=this.incomingEdgesOf(n);if(o.length>0)return B(`${n} 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:([,n])=>n.push(e)})}disconnect(e){let[,t]=this.#i.removeByKey(e.address),[,n]=this.#r.get(t);O.remove(n,e),n.length===0&&this.#r.removeByKey(t)}isConnected(e,t){return this.#i.opt(e.address).mapOr(([,n])=>n.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,n])=>n):this.#r.opt(e.address).mapOr(([t,n])=>n,O.empty())}validateRequirements(){this.#e.forEach(e=>{if(e.isEmpty())return e.mandatory?B(`Pointer ${e.toString()} requires an edge.`):B(`Illegal state: ${e} has no edge requirements.`)}),this.#t.forEach(e=>{if(e.pointerHub.isEmpty())return e.pointerRules.mandatory?B(`Target ${e.toString()} requires an edge.`):B(`Illegal state: ${e} has no edge requirements.`)})}#n(e,t,n){let i=Se.boxRange(e,t,n);return Z(i)?e.values().slice(i[0],i[1]):O.empty()}#o(e,t,n){let i=Se.boxRange(e,t,n);Z(i)&&e.removeRange(i[0],i[1])}};var ms=class{#e;#t;#r;#i;#n;#o;#a;#s;#l;#c;#u=!1;#d=!1;constructor(e=m.None){this.#e=e,this.#t=w.newSet(t=>t.address.uuid),this.#r=[],this.#a=wm.create(),this.#i=new jt,this.#n=new jt,this.#o=new jt,this.#s=new Am,this.#l=Se.newSet(({pointer:t})=>t.address),this.#c=[]}beginTransaction(){T(!this.#u,"Transaction already in progress"),this.#u=!0,this.#o.proxy.onBeginTransaction()}endTransaction(){for(T(this.#u,"No transaction in progress"),this.#r.length>0&&(this.#r.forEach(({pointerField:e,update:t})=>this.#p(e,t)),this.#r.length=0),this.#l.values().toSorted((e,t)=>e.index-t.index).forEach(({pointer:e,initial:t,final:n})=>{t.equals(n)||(t.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onRemoved(e)),n.ifSome(i=>this.findVertex(i).unwrapOrUndefined()?.pointerHub.onAdded(e)))}),this.#l.clear(),this.#u=!1;this.#c.length>0;)this.#c.splice(0).forEach(e=>e()),this.#c.length>0&&console.debug(`${this.#c.length} new observers while notifying`);this.#o.proxy.onEndTransaction()}inTransaction(){return this.#u}constructingBox(){return this.#d}createBox(e,t,n){return this.#e.unwrap("No box-factory installed")(e,this,t,n)}stageBox(e,t){this.#m(),T(!this.#d,"Cannot construct box while other box is constructing"),Z(t)&&(this.#d=!0,t(e),this.#d=!1);let n=this.#t.add(e);T(n,`${e} already staged`);let i=new hs(e.address.uuid,e.name,e.toArrayBuffer());return this.#i.proxy.onUpdate(i),this.#n.proxy.onUpdate(i),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,n){return this.#a.subscribe(e,t,n)}subscribeEndTransaction(e){this.#c.push(e)}unstageBox(e){this.#m();let t=this.#t.removeByKey(e.address.uuid);T(t===e,`${e} could not be found to unstage`),this.#s.unwatchVerticesOf(e);let n=new fs(e.address.uuid,e.name,e.toArrayBuffer());this.#i.proxy.onUpdate(n),this.#n.proxy.onUpdate(n)}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.#s}checksum(){let e=new em;return this.boxes().forEach(t=>t.write(e)),e.result()}onPrimitiveValueUpdate(e,t,n){if(this.#m(),e.isAttached()&&!this.#d){let i=new Qd(e.address,e.serialization(),t,n);this.#a.dispatch(i),this.#i.proxy.onUpdate(i),this.#n.proxy.onUpdate(i)}}onPointerAddressUpdated(e,t,n){this.#m(),t.nonEmpty()&&this.#s.disconnect(e),n.nonEmpty()&&this.#s.connect(e,n.unwrap());let i=new Xd(e.address,t,n);this.#d?this.#r.push({pointerField:e,update:i}):(this.#p(e,i),this.#n.proxy.onUpdate(i))}#p(e,t){let{oldAddress:n,newAddress:i}=t;e.resolvedTo(i.flatMap(a=>this.findVertex(a))),this.#l.opt(e.address).match({none:()=>this.#l.add({pointer:e,initial:n,final:i,index:this.#l.size()}),some:a=>a.final=i}),this.#a.dispatch(t),this.#i.proxy.onUpdate(t)}findOrphans(e){let t=this.#h(e);return this.boxes().filter(n=>!t.has(n))}#h(e){let t=new Set,n=[e];for(;n.length>0;){let i=n.pop();if(!t.has(i)){t.add(i),this.#f(i).forEach(o=>{o.targetAddress.ifSome(a=>{this.findBox(a.uuid).ifSome(s=>{t.has(s)||n.push(s)})})});for(let o of i.incomingEdges())t.has(o.box)||n.push(o.box)}}return t}#f(e){let t=[],n=i=>{for(let o of i)o.accept({visitPointerField:a=>t.push(a),visitObjectField:a=>n(a.fields()),visitArrayField:a=>n(a.fields())})};return n(e.fields()),t}dependenciesOf(e,t={}){let n=Z(t.excludeBox)?t.excludeBox:Wo.alwaysFalse,i=Z(t.alwaysFollowMandatory)?t.alwaysFollowMandatory:!1,o=new Set,a=new Set,s=l=>{o.has(l)||n(l)||(o.add(l),l.outgoingEdges().filter(([u])=>!a.has(u)).forEach(([u,d])=>{let p=this.findVertex(d).unwrap(`Could not find target of ${u.toString()}`);if(a.add(u),p.pointerRules.mandatory&&(i||p.pointerHub.incoming().filter(h=>h.targetAddress.mapOr(g=>g.equals(d),!1)).every(h=>a.has(h))))return s(p.box)}),l.incomingEdges().forEach(u=>{a.add(u),u.mandatory&&s(u.box)}))};return s(e),o.delete(e),{boxes:o,pointers:Array.from(a).reverse()}}verifyPointers(){this.#s.validateRequirements();let e=0,t=n=>{for(let i of n.fields())i.accept({visitPointerField:o=>{if(o.targetAddress.nonEmpty()){let a=o.targetVertex.nonEmpty(),s=this.findVertex(o.targetAddress.unwrap()).nonEmpty();T(a,`pointer ${o.address} is broken`),T(s,`Cannot find target for pointer ${o.address}`),e++}},visitObjectField:o=>t(o)})};return this.#t.forEach(n=>t(n)),console.debug("verification complete."),{count:e}}debugBoxes(){console.table(this.#t.values().reduce((e,t)=>(e[w.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(n=>n.name):this.findBox(t.uuid).flatMap(n=>n.searchVertex(t.fieldKeys).map(i=>i.isField()?i.debugPath:B("Unknown address"))))}toArrayBuffer(){let e=Ut.create(),t=this.#t.values();return e.writeInt(t.length),t.forEach(n=>{let i=n.serialize();e.writeInt(i.byteLength),e.writeBytes(new Int8Array(i))}),e.toArrayBuffer()}fromArrayBuffer(e){T(this.#t.isEmpty(),"Cannot call fromArrayBuffer if boxes is not empty");let t=new mt(e),n=t.readInt();this.beginTransaction();let i=[];for(let o=0;o<n;o++){let a=t.readInt(),s=new Int8Array(a);t.readBytes(s);let l=new mt(s.buffer),u=l.readInt(),d=l.readString(),p=w.fromDataInput(l);i.push({creationIndex:u,name:d,uuid:p,boxStream:l})}i.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:se(e.toJSON())}))}#m(){T(this.#u,()=>"Modification only prohibited in transaction mode.")}};var Jl;(function(r){r.insertOrder=(e,t=Number.MAX_SAFE_INTEGER)=>{let n=r.collectIndexedBoxes(e),i=pe(t,0,n.length);if(i<n.length)for(let o=i;o<n.length;o++)n[o].index.setValue(o+1);return i},r.removeOrder=(e,t)=>{let n=r.collectIndexedBoxes(e);if(t<n.length)for(let i=t+1;i<n.length;i++)n[i].index.setValue(i-1)},r.moveIndex=(e,t,n)=>{let i=r.collectIndexedBoxes(e),o=i[t];if(n<0){let a=pe(t+n,0,i.length-1);for(let s=a;s<t;s++)i[s].index.setValue(s+1);o.index.setValue(a)}else if(n>1){let a=pe(t+(n-1),0,i.length-1);for(let s=t;s<a;s++)i[s+1].index.setValue(s);o.index.setValue(a)}else console.warn(`moveIndex had no effect: startIndex: ${t}, delta: ${n}`)},r.isIndexedBox=e=>"index"in e&&e.index instanceof _,r.collectIndexedBoxes=(e,t)=>e.pointerHub.incoming().map(({box:n})=>r.isIndexedBox(n)&&(t===void 0||n instanceof t)?n:B(`${n} has no index field`)).sort((n,i)=>n.index.getValue()-i.index.getValue())})(Jl||(Jl={}));var Ve=class extends W{#e;constructor(e){super(e),this.#e=this.initializeFields()}accept(e){return P(e.visitObjectField,this)}fields(){return Object.values(this.#e)}record(){return this.#e}getField(e){return se(this.#e[e])}optField(e){return m.wrap(this.#e[e])}subscribe(e){return this.graph.subscribeVertexUpdates(ke.Children,this.address,()=>this.graph.subscribeEndTransaction(()=>e(this)))}read(e){Jo.readFields(e,this.#e)}write(e){Jo.writeFields(e,this.#e)}toJSON(){if(!this.deprecated)return Object.entries(this.#e).reduce((e,[t,n])=>(e[t]=n.toJSON(),e),{})}fromJSON(e){if(!this.deprecated)if(Hf(e))Object.entries(e).forEach(([t,n])=>{let i=this.#e[parseInt(t)];Z(n)&&i.fromJSON(n)});else return B("Type mismatch")}};var Hi;(function(r){r.sender=(i,o)=>o(new t(i)),r.executor=(i,o)=>new n(i,o);let e=i=>{let o=[];for(let a of i)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(Ye.map(a,l=>({value:l})))},s)};dispatchAndReturn=(o,...a)=>new Promise((s,l)=>{let u=Ye.reduce(a,(p,h,g)=>(typeof h=="function"&&p.push([g,h]),p),[]);this.#t.set(this.#i,{executorTuple:{resolve:s,reject:l},callbacks:new Map(u)});let d=e(a);this.#e.send({type:"send",returnId:this.#i,func:o.name,args:Array.from(Ye.map(a,(p,h)=>typeof p=="function"?{callback:h}:{value:p}))},d),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):B(`Promise has already been resolved. ${JSON.stringify(o)}`)}}class n{#e;#t;#r;constructor(o,a){this.#e=o,this.#t=a,this.#r=o.subscribe(this.#i)}terminate(){this.#r.terminate()}#i=o=>{T(o.type==="send",()=>"Message type must be 'send'");let a=Object.getPrototypeOf(this.#t)===Object.getPrototypeOf({})?this.#t:Object.getPrototypeOf(this.#t),s=se(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(u=>"value"in u?u.value:B(`${o.func.toString()} has no promise.`)));else try{s.apply(this.#t,o.args.map(d=>"callback"in d?(...p)=>this.#a(l,d.callback,p):d.value)).then(d=>{try{this.#n(l,d)}catch(p){this.#o(l,p)}},d=>this.#o(l,d))}catch(u){this.#o(l,u)}};#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=n})(Hi||(Hi={}));var mE={for:r=>new Dw(r)},Wk=[],Dw=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??Wk)}channel(e){return new Mw(this,e)}subscribe(e){return this.#t.subscribe(e)}terminate(){this.#t.terminate(),this.#e.onmessage=null,this.#e.onmessageerror=null}},Mw=class r{#e;#t;#r=new te;#i;constructor(e,t){this.#e=e,this.#t=t,this.#i=e.subscribe(n=>{"__id__"in n&&n.__id__==="42"&&"message"in n&&"channel"in n&&n.channel===t&&this.#r.notify(n.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 Yd;(function(r){r.frame=()=>new Promise(e=>requestAnimationFrame(()=>e())),r.frames=e=>new Promise(t=>{let n=e,i=()=>{--n<=0?t():requestAnimationFrame(i)};requestAnimationFrame(i)}),r.timeSpan=(e,...t)=>new Promise(n=>setTimeout(n,e.millis(),...t)),r.event=(e,t)=>new Promise(n=>e.addEventListener(t,n,{once:!0})),r.observable=e=>new Promise(t=>{let n=e.subscribe(()=>{n.terminate(),t()})}),r.complete=e=>new Promise((t,n)=>{let i=setInterval(()=>{let{status:o,value:a,error:s}=ho(()=>e.next());if(o==="success"){let{done:l,value:u}=a;l&&(clearInterval(i),t(u))}else clearInterval(i),n(s)},0)})})(Yd||(Yd={}));var Tw=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)}},_m;(function(r){class e{value;status="resolved";constructor(s){this.value=s}error=os("Cannot access error when promise is resolved")}r.ResolveResult=e;class t{error;status="rejected";constructor(s){this.error=s}value=os("Cannot access value when promise is rejected")}r.RejectedResult=t,r.makeAbortable=async(a,s)=>{let l=!0;return a.own(q.create(()=>l=!1)),new Promise((u,d)=>s.then(p=>{l&&u(p)},p=>{l&&d(p)}))},r.tryCatch=a=>a.then(s=>new e(s),s=>new t(s));let n=new Tw(3,Ud.seconds(3));r.retry=(a,s=n)=>a().catch(l=>new Promise((u,d)=>{let p=h=>{s.retry(h,()=>a().then(g=>u(g),p))||d(h)};p(l)})),r.guardedRetry=(a,s)=>{let l=async(u=0)=>{try{return await a()}catch(d){if(s(d,++u))return console.debug(`retry after failure (online: ${navigator.onLine}):`,d),await Yd.timeSpan(Ud.seconds(1)),l(u);throw new Error(`Failed after ${u} retries: ${d}`)}};return l()},r.approvedRetry=(a,s)=>{let l=async()=>{try{return await a()}catch(u){if(await jl.approve(s(u)))return l();throw u}};return l()},r.delay=(a,s)=>Promise.all([a,Yd.timeSpan(s)]).then(([l])=>l),r.fail=(a,s="fail")=>Promise.reject(s),r.timeout=(a,s,l)=>new Promise((u,d)=>{let p=!0,h=setTimeout(()=>{p=!1,d(new Error(l??"timeout"))},s.millis());a.then(g=>{p&&u(g)},g=>{p&&d(g)}).finally(()=>clearTimeout(h))}),r.sequentialAll=a=>a.reduce((s,l)=>s.then(async u=>[...u,await l()]),Promise.resolve([])),r.sequentialize=a=>{let s=Promise.resolve();return l=>{let u=()=>a(l),d=s.then(u,u);return s=d.catch(()=>{}),d}},r.memoizeAsync=(a,s)=>{let l=null,u=Date.now();return()=>{let d=Date.now();return(_n(l)||Z(s)&&d-u>s.millis())&&(u=d,l=a(),l.catch(p=>(l=null,p))),l}},r.allWithLimit=async(a,s=1)=>{let l=new Array(a.length),u=0,d=!1,p=async()=>{for(;u<a.length&&!d;){let h=u++;try{let g=await a[h]();d||(l[h]=g)}catch(g){throw d=!0,g}}};return await Promise.all(Array.from({length:Math.min(s,a.length)},p)),l},r.allSettledWithLimit=async(a,s=1)=>{let l=new Array(a.length),u=0,d=async()=>{for(;u<a.length;){let p=u++;try{let h=await a[p]();l[p]={status:"fulfilled",value:h}}catch(h){l[p]={status:"rejected",reason:h}}}};return await Promise.all(Array.from({length:Math.min(s,a.length)},d)),l};class i{max;#e;#t=0;constructor(s=1){this.max=s,this.#e=[]}async add(s){if(this.#t<this.max)return this.#t++,s().finally(()=>this.#r());{let l=Promise.withResolvers();return this.#e.push([s,l]),l.promise.finally(()=>this.#r())}}#r(){if(T(this.#t>0,"Internal Error in Promises.Limit"),--this.#t<this.max&&this.#e.length>0){let[s,{resolve:l,reject:u}]=this.#e.shift();this.#t++,s().then(l,u)}}}r.Limit=i;class o{#e;#t;#r;#i=m.None;constructor(s,l,u){this.#e=s,this.#t=l,this.#r=u}update(s){this.#i=m.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(),P(this.#r))})}terminate(){this.#i=m.None}}r.Latest=o})(_m||(_m={}));var gE=(r,e)=>Hi.executor(e,new class{sendUpdates(t){r.beginTransaction(),t.forEach(n=>{let i=n.type;i==="new"?r.createBox(n.name,n.uuid,o=>o.read(new mt(n.buffer))):i==="update-primitive"?r.findVertex(Se.reconstruct(n.address)).unwrap(()=>`Could not find primitive field ${n.address}`).setValue(n.value):i==="update-pointer"?r.findVertex(Se.reconstruct(n.address)).unwrap(()=>`Could not find pointer field ${n.address}`).targetAddress=Z(n.target)?m.wrap(Se.reconstruct(n.target)):m.None:n.type==="delete"&&r.unstageBox(r.findBox(n.uuid).unwrap(()=>`Could not find box ${w.toString(n.uuid)}`))}),r.endTransaction()}checksum(t){return O.equals(r.checksum(),t)?Promise.resolve():Promise.reject("Checksum mismatch")}});var gs;(function(r){r.create=(e,t,n,i)=>{switch(e){case"MetaDataBox":return bo.create(t,n,i);case"RootBox":return Ql.create(t,n,i);case"SelectionBox":return $n.create(t,n,i);case"UserInterfaceBox":return vs.create(t,n,i);case"UploadFileBox":return Pm.create(t,n,i);case"ShadertoyBox":return Sm.create(t,n,i);case"MIDIControllerBox":return Em.create(t,n,i);case"TimelineBox":return ys.create(t,n,i);case"TrackBox":return wr.create(t,n,i);case"NoteEventBox":return Qo.create(t,n,i);case"NoteEventRepeatBox":return Fm.create(t,n,i);case"NoteEventCollectionBox":return wo.create(t,n,i);case"NoteRegionBox":return xs.create(t,n,i);case"NoteClipBox":return Xl.create(t,n,i);case"ValueEventBox":return Xo.create(t,n,i);case"ValueEventCollectionBox":return Ji.create(t,n,i);case"ValueEventCurveBox":return Yo.create(t,n,i);case"ValueRegionBox":return bs.create(t,n,i);case"ValueClipBox":return Yl.create(t,n,i);case"SignatureEventBox":return ec.create(t,n,i);case"AudioRegionBox":return ea.create(t,n,i);case"AudioClipBox":return tc.create(t,n,i);case"AudioPitchStretchBox":return rc.create(t,n,i);case"AudioTimeStretchBox":return ic.create(t,n,i);case"TransientMarkerBox":return nc.create(t,n,i);case"WarpMarkerBox":return ta.create(t,n,i);case"MarkerBox":return oc.create(t,n,i);case"AudioFileBox":return Lt.create(t,n,i);case"SoundfontFileBox":return Tr.create(t,n,i);case"AudioUnitBox":return ut.create(t,n,i);case"CaptureAudioBox":return ra.create(t,n,i);case"CaptureMidiBox":return ia.create(t,n,i);case"AudioBusBox":return Qi.create(t,n,i);case"AuxSendBox":return ws.create(t,n,i);case"GrooveShuffleBox":return ac.create(t,n,i);case"UnknownAudioEffectDeviceBox":return Bm.create(t,n,i);case"UnknownMidiEffectDeviceBox":return Im.create(t,n,i);case"DeviceInterfaceKnobBox":return km.create(t,n,i);case"ModularDeviceBox":return Nm.create(t,n,i);case"StereoToolDeviceBox":return $m.create(t,n,i);case"MaximizerDeviceBox":return Dm.create(t,n,i);case"CompressorDeviceBox":return sc.create(t,n,i);case"DelayDeviceBox":return Mm.create(t,n,i);case"CrusherDeviceBox":return Tm.create(t,n,i);case"DattorroReverbDeviceBox":return Cm.create(t,n,i);case"VelocityDeviceBox":return Rm.create(t,n,i);case"FoldDeviceBox":return Om.create(t,n,i);case"TidalDeviceBox":return Vm.create(t,n,i);case"RevampDeviceBox":return zm.create(t,n,i);case"ReverbDeviceBox":return Um.create(t,n,i);case"VaporisateurDeviceBox":return lc.create(t,n,i);case"MIDIOutputDeviceBox":return cc.create(t,n,i);case"MIDIOutputBox":return Xi.create(t,n,i);case"MIDIOutputParameterBox":return Yi.create(t,n,i);case"SoundfontDeviceBox":return uc.create(t,n,i);case"NanoDeviceBox":return dc.create(t,n,i);case"PlayfieldDeviceBox":return pc.create(t,n,i);case"PlayfieldSampleBox":return na.create(t,n,i);case"TapeDeviceBox":return hc.create(t,n,i);case"ArpeggioDeviceBox":return jm.create(t,n,i);case"PitchDeviceBox":return Lm.create(t,n,i);case"ZeitgeistDeviceBox":return Km.create(t,n,i);case"ModularBox":return Wm.create(t,n,i);case"ModuleConnectionBox":return Zm.create(t,n,i);case"ModularAudioInputBox":return qm.create(t,n,i);case"ModularAudioOutputBox":return Gm.create(t,n,i);case"ModuleDelayBox":return Hm.create(t,n,i);case"ModuleMultiplierBox":return Jm.create(t,n,i);case"ModuleGainBox":return Qm.create(t,n,i);default:return B(`Unknown box class '${e}'`)}},r.deserialize=(e,t)=>{let n=new mt(t),i=n.readString(),o=w.fromDataInput(n),a=r.create(i,e,o);return a.read(n),a}})(gs||(gs={}));var vE;(function(r){r.NoSync="nosync",r.Pitch="pitch",r.Timestretch="timestretch",r.AudioFit="audiofit"})(vE||(vE={}));var yE;(function(r){r[r.Pre=0]="Pre",r[r.Post=1]="Post"})(yE||(yE={}));var Dt;(function(r){r.Instrument="instrument",r.Bus="bus",r.Aux="aux",r.Output="output"})(Dt||(Dt={}));var oa={white:new Nt(0,0,100),blue:new Nt(189,100,65),green:new Nt(150,77,69),yellow:new Nt(60,100,84),cream:new Nt(65,20,83),orange:new Nt(31,100,73),red:new Nt(354,100,65),purple:new Nt(314,100,78),bright:new Nt(197,0,100),gray:new Nt(197,31,85),dark:new Nt(197,15,60),shadow:new Nt(197,10,45),black:new Nt(197,10,16),background:new Nt(197,6,7),panelBackground:new Nt(197,14,10),panelBackgroundBright:new Nt(197,16,14),panelBackgroundDark:new Nt(197,14,9)};var Oe;(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.Maximizer=11]="Maximizer",r[r.Bug=12]="Bug",r[r.Fold=13]="Fold",r[r.Checkbox=14]="Checkbox",r[r.Clips=15]="Clips",r[r.Close=16]="Close",r[r.CloudFolder=17]="CloudFolder",r[r.CollapseDown=18]="CollapseDown",r[r.Compressor=19]="Compressor",r[r.Connected=20]="Connected",r[r.Cube=21]="Cube",r[r.Cursor=22]="Cursor",r[r.Curve=23]="Curve",r[r.Dattorro=24]="Dattorro",r[r.Delete=25]="Delete",r[r.Dial=26]="Dial",r[r.DinSlot=27]="DinSlot",r[r.Disconnected=28]="Disconnected",r[r.Divide=29]="Divide",r[r.DragConnections=30]="DragConnections",r[r.Dropdown=31]="Dropdown",r[r.Dropbox=32]="Dropbox",r[r.DrumSet=33]="DrumSet",r[r.Tidal=34]="Tidal",r[r.Duration=35]="Duration",r[r.EditBox=36]="EditBox",r[r.Effects=37]="Effects",r[r.Embed=38]="Embed",r[r.EQ=39]="EQ",r[r.Eraser=40]="Eraser",r[r.Exclude=41]="Exclude",r[r.Exit=42]="Exit",r[r.ExpandWidth=43]="ExpandWidth",r[r.FileList=44]="FileList",r[r.Flask=45]="Flask",r[r.Focus=46]="Focus",r[r.Generator=47]="Generator",r[r.GoogleDrive=48]="GoogleDrive",r[r.Groove=49]="Groove",r[r.Guitar=50]="Guitar",r[r.GuitarTab=51]="GuitarTab",r[r.Headphone=52]="Headphone",r[r.Heart=53]="Heart",r[r.Help=54]="Help",r[r.HighPass=55]="HighPass",r[r.HighShelf=56]="HighShelf",r[r.Insert=57]="Insert",r[r.Invert=58]="Invert",r[r.Loop=59]="Loop",r[r.LowPass=60]="LowPass",r[r.LowShelf=61]="LowShelf",r[r.Magnet=62]="Magnet",r[r.MainMenu=63]="MainMenu",r[r.Maximized=64]="Maximized",r[r.Menu=65]="Menu",r[r.Merge=66]="Merge",r[r.Metronome=67]="Metronome",r[r.Microphone=68]="Microphone",r[r.Midi=69]="Midi",r[r.Minimized=70]="Minimized",r[r.Mix=71]="Mix",r[r.Mixing=72]="Mixing",r[r.Mute=73]="Mute",r[r.NanoWave=74]="NanoWave",r[r.New=75]="New",r[r.NoAudio=76]="NoAudio",r[r.Note=77]="Note",r[r.NotePad=78]="NotePad",r[r.OpenDAW=79]="OpenDAW",r[r.Panel=80]="Panel",r[r.Peak=81]="Peak",r[r.Pencil=82]="Pencil",r[r.Piano=83]="Piano",r[r.Play=84]="Play",r[r.Playfield=85]="Playfield",r[r.PlayOnce=86]="PlayOnce",r[r.PlayRepeat=87]="PlayRepeat",r[r.PlayAlternate=88]="PlayAlternate",r[r.Pointer=89]="Pointer",r[r.Popout=90]="Popout",r[r.Primary=91]="Primary",r[r.Random=92]="Random",r[r.Record=93]="Record",r[r.Rectangle=94]="Rectangle",r[r.Redo=95]="Redo",r[r.Region=96]="Region",r[r.Robot=97]="Robot",r[r.RoundDown=98]="RoundDown",r[r.RoundUp=99]="RoundUp",r[r.Run=100]="Run",r[r.Sawtooth=101]="Sawtooth",r[r.Saxophone=102]="Saxophone",r[r.Scissors=103]="Scissors",r[r.Search=104]="Search",r[r.Shadertoy=105]="Shadertoy",r[r.Shutdown=106]="Shutdown",r[r.Sine=107]="Sine",r[r.Solo=108]="Solo",r[r.SoundFont=109]="SoundFont",r[r.SpeakerHeadphone=110]="SpeakerHeadphone",r[r.Square=111]="Square",r[r.Stack=112]="Stack",r[r.Start=113]="Start",r[r.Stereo=114]="Stereo",r[r.Stop=115]="Stop",r[r.Subtract=116]="Subtract",r[r.Sun=117]="Sun",r[r.Swap=118]="Swap",r[r.System=119]="System",r[r.Table=120]="Table",r[r.Tape=121]="Tape",r[r.TapeReel=122]="TapeReel",r[r.Time=123]="Time",r[r.Timeline=124]="Timeline",r[r.Tool=125]="Tool",r[r.Triangle=126]="Triangle",r[r.Undo=127]="Undo",r[r.Unknown=128]="Unknown",r[r.UserFolder=129]="UserFolder",r[r.Velocity=130]="Velocity",r[r.Vinyl=131]="Vinyl",r[r.Volume=132]="Volume",r[r.VUMeter=133]="VUMeter",r[r.Waveform=134]="Waveform",r[r.Zeitgeist=135]="Zeitgeist"})(Oe||(Oe={}));(function(r){r.toName=e=>r[e],r.fromName=e=>r[e]??r.Rectangle})(Oe||(Oe={}));var c;(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.MIDIControllers=23]="MIDIControllers",r[r.MIDIDevice=24]="MIDIDevice",r[r.MIDIEffectHost=25]="MIDIEffectHost",r[r.ModularSetup=26]="ModularSetup",r[r.Modulation=27]="Modulation",r[r.ModuleCollection=28]="ModuleCollection",r[r.NoteEventCollection=29]="NoteEventCollection",r[r.NoteEventFeature=30]="NoteEventFeature",r[r.NoteEvents=31]="NoteEvents",r[r.NotesConnection=32]="NotesConnection",r[r.Parameter=33]="Parameter",r[r.ParameterController=34]="ParameterController",r[r.PianoMode=35]="PianoMode",r[r.RegionCollection=36]="RegionCollection",r[r.Sample=37]="Sample",r[r.Selection=38]="Selection",r[r.Shadertoy=39]="Shadertoy",r[r.SideChain=40]="SideChain",r[r.SignatureAutomation=41]="SignatureAutomation",r[r.SoundfontFile=42]="SoundfontFile",r[r.StepAutomation=43]="StepAutomation",r[r.Timeline=44]="Timeline",r[r.TrackCollection=45]="TrackCollection",r[r.TransientMarkers=46]="TransientMarkers",r[r.User=47]="User",r[r.ValueEventCollection=48]="ValueEventCollection",r[r.ValueEvents=49]="ValueEvents",r[r.ValueInterpolation=50]="ValueInterpolation",r[r.VoltageConnection=51]="VoltageConnection",r[r.WarpMarkers=52]="WarpMarkers"})(c||(c={}));var aa;(function(r){r[r.Once=0]="Once",r[r.Repeat=1]="Repeat",r[r.Pingpong=2]="Pingpong"})(aa||(aa={}));var Dn;(function(r){r[r.Monophonic=0]="Monophonic",r[r.Polyphonic=1]="Polyphonic"})(Dn||(Dn={}));var bo=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MetaDataBox",pointerRules:f}),n)}static ClassName="MetaDataBox";constructor(e){super(e)}accept(e){return P(e.visitMetaDataBox,this)}get target(){return this.getField(1)}get origin(){return this.getField(2)}get value(){return this.getField(3)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"target",deprecated:!1,pointerRules:f},c.MetaData,!0),2:D.create({parent:this,fieldKey:2,fieldName:"origin",deprecated:!1,pointerRules:f}),3:D.create({parent:this,fieldKey:3,fieldName:"value",deprecated:!1,pointerRules:f})}}};var Xm=class r extends Ve{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:_.create({parent:this,fieldKey:1,fieldName:"keyboard",deprecated:!1,pointerRules:f},{length:4},"",0),2:b.create({parent:this,fieldKey:2,fieldName:"timeRangeInQuarters",deprecated:!1,pointerRules:f},{min:1,max:64,scaling:"linear"},"",8),3:b.create({parent:this,fieldKey:3,fieldName:"noteScale",deprecated:!1,pointerRules:f},{min:.5,max:2,scaling:"linear"},"",1),4:k.create({parent:this,fieldKey:4,fieldName:"noteLabels",deprecated:!1,pointerRules:f},!1),5:_.create({parent:this,fieldKey:5,fieldName:"transpose",deprecated:!1,pointerRules:f},{min:-48,max:48},"st",0)}}};var Ql=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"RootBox",pointerRules:f}),n)}static ClassName="RootBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"timeline",deprecated:!1,pointerRules:f},c.Timeline,!0),2:W.hook({parent:this,fieldKey:2,fieldName:"users",deprecated:!1,pointerRules:{accepts:[c.User],mandatory:!0}}),3:D.create({parent:this,fieldKey:3,fieldName:"created",deprecated:!1,pointerRules:f}),4:F.create({parent:this,fieldKey:4,fieldName:"groove",deprecated:!1,pointerRules:f},c.Groove,!0),10:W.hook({parent:this,fieldKey:10,fieldName:"modularSetups",deprecated:!1,pointerRules:{accepts:[c.ModularSetup],mandatory:!1}}),20:W.hook({parent:this,fieldKey:20,fieldName:"audioUnits",deprecated:!1,pointerRules:{accepts:[c.AudioUnits],mandatory:!1}}),21:W.hook({parent:this,fieldKey:21,fieldName:"audioBusses",deprecated:!1,pointerRules:{accepts:[c.AudioBusses],mandatory:!1}}),30:W.hook({parent:this,fieldKey:30,fieldName:"outputDevice",deprecated:!1,pointerRules:{accepts:[c.AudioOutput],mandatory:!0}}),35:W.hook({parent:this,fieldKey:35,fieldName:"outputMidiDevices",deprecated:!1,pointerRules:{accepts:[c.MIDIDevice],mandatory:!1}}),40:Xm.create({parent:this,fieldKey:40,fieldName:"pianoMode",deprecated:!1,pointerRules:f}),100:F.create({parent:this,fieldKey:100,fieldName:"shadertoy",deprecated:!1,pointerRules:f},c.Shadertoy,!1),111:F.create({parent:this,fieldKey:111,fieldName:"editingChannel",deprecated:!1,pointerRules:f},c.Editing,!1)}}};var $n=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SelectionBox",pointerRules:f}),n)}static ClassName="SelectionBox";constructor(e){super(e)}accept(e){return P(e.visitSelectionBox,this)}get selection(){return this.getField(1)}get selectable(){return this.getField(2)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"selection",deprecated:!1,pointerRules:f},c.Selection,!0),2:F.create({parent:this,fieldKey:2,fieldName:"selectable",deprecated:!1,pointerRules:f},c.Selection,!0)}}};var vs=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UserInterfaceBox",pointerRules:{accepts:[c.MetaData],mandatory:!1}}),n)}static ClassName="UserInterfaceBox";constructor(e){super(e)}accept(e){return P(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)}get midiControllers(){return this.getField(30)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:f},c.User,!0),10:W.hook({parent:this,fieldKey:10,fieldName:"selection",deprecated:!1,pointerRules:{accepts:[c.Selection],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"uploadStates",deprecated:!1,pointerRules:{accepts:[c.FileUploadState],mandatory:!1}}),21:F.create({parent:this,fieldKey:21,fieldName:"editingDeviceChain",deprecated:!1,pointerRules:f},c.Editing,!1),22:F.create({parent:this,fieldKey:22,fieldName:"editingTimelineRegion",deprecated:!1,pointerRules:f},c.Editing,!1),23:F.create({parent:this,fieldKey:23,fieldName:"editingModularSystem",deprecated:!1,pointerRules:f},c.Editing,!1),30:W.hook({parent:this,fieldKey:30,fieldName:"midiControllers",deprecated:!1,pointerRules:{accepts:[c.MIDIControllers],mandatory:!1}})}}};var Pm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UploadFileBox",pointerRules:f}),n)}static ClassName="UploadFileBox";constructor(e){super(e)}accept(e){return P(e.visitUploadFileBox,this)}get user(){return this.getField(1)}get file(){return this.getField(2)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"user",deprecated:!1,pointerRules:f},c.FileUploadState,!0),2:F.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:f},c.FileUploadState,!0)}}};var Sm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ShadertoyBox",pointerRules:{accepts:[c.Shadertoy],mandatory:!0}}),n)}static ClassName="ShadertoyBox";constructor(e){super(e)}accept(e){return P(e.visitShadertoyBox,this)}get shaderCode(){return this.getField(1)}get highres(){return this.getField(2)}initializeFields(){return{1:D.create({parent:this,fieldKey:1,fieldName:"shaderCode",deprecated:!1,pointerRules:f}),2:k.create({parent:this,fieldKey:2,fieldName:"highres",deprecated:!1,pointerRules:f},!0)}}};var Em=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIControllerBox",pointerRules:f}),n)}static ClassName="MIDIControllerBox";constructor(e){super(e)}accept(e){return P(e.visitMIDIControllerBox,this)}get controllers(){return this.getField(1)}get parameter(){return this.getField(2)}get deviceId(){return this.getField(3)}get deviceChannel(){return this.getField(4)}get controlId(){return this.getField(5)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"controllers",deprecated:!1,pointerRules:f},c.MIDIControllers,!0),2:F.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:f},c.MIDIControl,!0),3:D.create({parent:this,fieldKey:3,fieldName:"deviceId",deprecated:!1,pointerRules:f}),4:_.create({parent:this,fieldKey:4,fieldName:"deviceChannel",deprecated:!1,pointerRules:f},{min:0,max:127},""),5:_.create({parent:this,fieldKey:5,fieldName:"controlId",deprecated:!1,pointerRules:f},{min:0,max:127},"")}}};var Ym=class r extends Ve{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:_.create({parent:this,fieldKey:1,fieldName:"nominator",deprecated:!1,pointerRules:f},{min:1,max:32},"",4),2:_.create({parent:this,fieldKey:2,fieldName:"denominator",deprecated:!1,pointerRules:f},{min:1,max:32},"",4)}}};var eg=class r extends Ve{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:k.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),2:_.create({parent:this,fieldKey:2,fieldName:"from",deprecated:!1,pointerRules:f},"any","ppqn",0),3:_.create({parent:this,fieldKey:3,fieldName:"to",deprecated:!1,pointerRules:f},"any","ppqn",15360)}}};var tg=class r extends Ve{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:[c.MarkerTrack],mandatory:!1}}),10:_.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index","",0),20:k.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0)}}};var rg=class r extends Ve{static create(e){return new r(e)}constructor(e){super(e)}get events(){return this.getField(1)}get index(){return this.getField(10)}get minBpm(){return this.getField(15)}get maxBpm(){return this.getField(16)}get enabled(){return this.getField(20)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!1),10:_.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index","",2),15:_.create({parent:this,fieldKey:15,fieldName:"minBpm",deprecated:!1,pointerRules:f},{min:30,max:999},"bpm",60),16:_.create({parent:this,fieldKey:16,fieldName:"maxBpm",deprecated:!1,pointerRules:f},{min:31,max:1e3},"bpm",240),20:k.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0)}}};var ig=class r extends Ve{static create(e){return new r(e)}constructor(e){super(e)}get events(){return this.getField(1)}get index(){return this.getField(10)}get enabled(){return this.getField(20)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:{accepts:[c.SignatureAutomation],mandatory:!1}}),10:_.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index","",1),20:k.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0)}}};var ys=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TimelineBox",pointerRules:f}),n)}static ClassName="TimelineBox";constructor(e){super(e)}accept(e){return P(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 tempoTrack(){return this.getField(22)}get signatureTrack(){return this.getField(23)}get durationInPulses(){return this.getField(30)}get bpm(){return this.getField(31)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:{accepts:[c.Timeline],mandatory:!0}}),10:Ym.create({parent:this,fieldKey:10,fieldName:"signature",deprecated:!1,pointerRules:f}),11:eg.create({parent:this,fieldKey:11,fieldName:"loopArea",deprecated:!1,pointerRules:f}),20:W.hook({parent:this,fieldKey:20,fieldName:"deprecatedMarkerTrack",deprecated:!0,pointerRules:{accepts:[c.MarkerTrack],mandatory:!1}}),21:tg.create({parent:this,fieldKey:21,fieldName:"markerTrack",deprecated:!1,pointerRules:f}),22:rg.create({parent:this,fieldKey:22,fieldName:"tempoTrack",deprecated:!1,pointerRules:f}),23:ig.create({parent:this,fieldKey:23,fieldName:"signatureTrack",deprecated:!1,pointerRules:f}),30:_.create({parent:this,fieldKey:30,fieldName:"durationInPulses",deprecated:!1,pointerRules:f},"positive","ppqn",491520),31:b.create({parent:this,fieldKey:31,fieldName:"bpm",deprecated:!1,pointerRules:f},{min:30,max:999,scaling:"exponential"},"bpm",120)}}};var wr=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TrackBox",pointerRules:{accepts:[c.Selection,c.PianoMode,c.MetaData],mandatory:!1}}),n)}static ClassName="TrackBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"tracks",deprecated:!1,pointerRules:f},c.TrackCollection,!0),2:F.create({parent:this,fieldKey:2,fieldName:"target",deprecated:!1,pointerRules:f},c.Automation,!0),3:W.hook({parent:this,fieldKey:3,fieldName:"regions",deprecated:!1,pointerRules:{accepts:[c.RegionCollection],mandatory:!1}}),4:W.hook({parent:this,fieldKey:4,fieldName:"clips",deprecated:!1,pointerRules:{accepts:[c.ClipCollection],mandatory:!1}}),10:_.create({parent:this,fieldKey:10,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),11:_.create({parent:this,fieldKey:11,fieldName:"type",deprecated:!1,pointerRules:f},{values:[0,1,2,3]},""),20:k.create({parent:this,fieldKey:20,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),30:k.create({parent:this,fieldKey:30,fieldName:"excludePianoMode",deprecated:!1,pointerRules:f},!1)}}};var Qo=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventBox",pointerRules:{accepts:[c.Selection,c.NoteEventFeature],mandatory:!1}}),n)}static ClassName="NoteEventBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:f},c.NoteEvents,!0),10:_.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:_.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn",240),20:_.create({parent:this,fieldKey:20,fieldName:"pitch",deprecated:!1,pointerRules:f},{min:0,max:127},"",60),21:b.create({parent:this,fieldKey:21,fieldName:"velocity",deprecated:!1,pointerRules:f},"unipolar","%",.7874015748031497),22:_.create({parent:this,fieldKey:22,fieldName:"playCount",deprecated:!1,pointerRules:f},{min:1,max:128},"",1),23:b.create({parent:this,fieldKey:23,fieldName:"playCurve",deprecated:!1,pointerRules:f},"bipolar","%",0),24:b.create({parent:this,fieldKey:24,fieldName:"cent",deprecated:!1,pointerRules:f},{min:-50,max:50,scaling:"linear"},"ct",0),25:_.create({parent:this,fieldKey:25,fieldName:"chance",deprecated:!1,pointerRules:f},{min:0,max:100},"",100)}}};var Fm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventRepeatBox",pointerRules:f}),n)}static ClassName="NoteEventRepeatBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:f},c.NoteEventFeature,!0),2:_.create({parent:this,fieldKey:2,fieldName:"count",deprecated:!1,pointerRules:f},{min:1,max:128},"",1),3:b.create({parent:this,fieldKey:3,fieldName:"curve",deprecated:!1,pointerRules:f},"bipolar","%",0),4:b.create({parent:this,fieldKey:4,fieldName:"length",deprecated:!1,pointerRules:f},"unipolar","%",1)}}};var wo=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteEventCollectionBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="NoteEventCollectionBox";constructor(e){super(e)}accept(e){return P(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:[c.NoteEvents],mandatory:!1}}),2:W.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[c.NoteEventCollection],mandatory:!0}})}}};var xs=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteRegionBox",pointerRules:{accepts:[c.Selection,c.Editing,c.MetaData],mandatory:!1}}),n)}static ClassName="NoteRegionBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:f},c.RegionCollection,!0),2:F.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.NoteEventCollection,!0),10:_.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:_.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),12:_.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:f},"any","ppqn"),13:_.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:f},"positive","ppqn"),14:_.create({parent:this,fieldKey:14,fieldName:"eventOffset",deprecated:!1,pointerRules:f},"any","ppqn"),15:k.create({parent:this,fieldKey:15,fieldName:"mute",deprecated:!1,pointerRules:f}),16:D.create({parent:this,fieldKey:16,fieldName:"label",deprecated:!1,pointerRules:f}),17:_.create({parent:this,fieldKey:17,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var sa=class r extends Ve{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:k.create({parent:this,fieldKey:1,fieldName:"loop",deprecated:!1,pointerRules:f},!0),2:k.create({parent:this,fieldKey:2,fieldName:"reverse",deprecated:!1,pointerRules:f}),3:k.create({parent:this,fieldKey:3,fieldName:"mute",deprecated:!0,pointerRules:f}),4:_.create({parent:this,fieldKey:4,fieldName:"speed",deprecated:!1,pointerRules:f},"non-negative",""),5:_.create({parent:this,fieldKey:5,fieldName:"quantise",deprecated:!1,pointerRules:f},"non-negative",""),6:_.create({parent:this,fieldKey:6,fieldName:"trigger",deprecated:!1,pointerRules:f},"non-negative","")}}};var Xl=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NoteClipBox",pointerRules:{accepts:[c.Selection,c.Editing,c.MetaData],mandatory:!1}}),n)}static ClassName="NoteClipBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:f},c.ClipCollection,!0),2:F.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.NoteEventCollection,!0),3:_.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:sa.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:f}),10:_.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:f}),12:D.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:f}),13:_.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var Xo=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ValueEventBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEvents,!0),10:_.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:_.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),12:_.create({parent:this,fieldKey:12,fieldName:"interpolation",deprecated:!1,pointerRules:{accepts:[c.ValueInterpolation],mandatory:!1}},{values:[0,1]},"",1),13:b.create({parent:this,fieldKey:13,fieldName:"value",deprecated:!1,pointerRules:f},"any",""),14:b.create({parent:this,fieldKey:14,fieldName:"slope",deprecated:!0,pointerRules:f},"any","",NaN)}}};var Ji=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCollectionBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ValueEventCollectionBox";constructor(e){super(e)}accept(e){return P(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:[c.ValueEvents],mandatory:!1}}),2:W.hook({parent:this,fieldKey:2,fieldName:"owners",deprecated:!1,pointerRules:{accepts:[c.ValueEventCollection],mandatory:!0}})}}};var Yo=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueEventCurveBox",pointerRules:f}),n)}static ClassName="ValueEventCurveBox";constructor(e){super(e)}accept(e){return P(e.visitValueEventCurveBox,this)}get event(){return this.getField(1)}get slope(){return this.getField(2)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"event",deprecated:!1,pointerRules:f},c.ValueInterpolation,!0),2:b.create({parent:this,fieldKey:2,fieldName:"slope",deprecated:!1,pointerRules:f},"unipolar","%",.5)}}};var bs=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueRegionBox",pointerRules:{accepts:[c.Selection,c.Editing,c.MetaData],mandatory:!1}}),n)}static ClassName="ValueRegionBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:f},c.RegionCollection,!0),2:F.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),10:_.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:_.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),12:_.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:f},"any","ppqn"),13:_.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:f},"positive","ppqn"),14:k.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:f}),15:D.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:f}),16:_.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var Yl=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ValueClipBox",pointerRules:{accepts:[c.Selection,c.Editing,c.MetaData],mandatory:!1}}),n)}static ClassName="ValueClipBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:f},c.ClipCollection,!0),2:F.create({parent:this,fieldKey:2,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),3:_.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:sa.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:f}),10:_.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:f},"positive","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:f}),12:D.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:f}),13:_.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var ec=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SignatureEventBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="SignatureEventBox";constructor(e){super(e)}accept(e){return P(e.visitSignatureEventBox,this)}get events(){return this.getField(1)}get index(){return this.getField(9)}get relativePosition(){return this.getField(10)}get nominator(){return this.getField(21)}get denominator(){return this.getField(22)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"events",deprecated:!1,pointerRules:f},c.SignatureAutomation,!0),9:_.create({parent:this,fieldKey:9,fieldName:"index",deprecated:!1,pointerRules:f},"index","",0),10:_.create({parent:this,fieldKey:10,fieldName:"relativePosition",deprecated:!1,pointerRules:f},"positive","bars",1),21:_.create({parent:this,fieldKey:21,fieldName:"nominator",deprecated:!1,pointerRules:f},"positive","",4),22:_.create({parent:this,fieldKey:22,fieldName:"denominator",deprecated:!1,pointerRules:f},"positive","",4)}}};var ea=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioRegionBox",pointerRules:{accepts:[c.Selection,c.Editing,c.MetaData],mandatory:!1}}),n)}static ClassName="AudioRegionBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"regions",deprecated:!1,pointerRules:f},c.RegionCollection,!0),2:F.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!0),3:D.create({parent:this,fieldKey:3,fieldName:"playback",deprecated:!0,pointerRules:f}),4:D.create({parent:this,fieldKey:4,fieldName:"timeBase",deprecated:!1,pointerRules:f},"musical"),5:F.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),6:F.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:f},c.Deprecated,!1),7:b.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:f},"any","seconds"),8:F.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:f},c.AudioPlayMode,!1),10:_.create({parent:this,fieldKey:10,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),11:b.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:f},"any","mixed"),12:b.create({parent:this,fieldKey:12,fieldName:"loopOffset",deprecated:!1,pointerRules:f},"any","mixed"),13:b.create({parent:this,fieldKey:13,fieldName:"loopDuration",deprecated:!1,pointerRules:f},"any","mixed"),14:k.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:f}),15:D.create({parent:this,fieldKey:15,fieldName:"label",deprecated:!1,pointerRules:f}),16:_.create({parent:this,fieldKey:16,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0"),17:b.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!1,pointerRules:f},"decibel","db")}}};var tc=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioClipBox",pointerRules:{accepts:[c.Selection,c.Editing,c.MetaData],mandatory:!1}}),n)}static ClassName="AudioClipBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"clips",deprecated:!1,pointerRules:f},c.ClipCollection,!0),2:F.create({parent:this,fieldKey:2,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!0),3:_.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:sa.create({parent:this,fieldKey:4,fieldName:"triggerMode",deprecated:!1,pointerRules:f}),5:F.create({parent:this,fieldKey:5,fieldName:"events",deprecated:!1,pointerRules:f},c.ValueEventCollection,!0),6:F.create({parent:this,fieldKey:6,fieldName:"warping",deprecated:!0,pointerRules:f},c.Deprecated,!1),7:b.create({parent:this,fieldKey:7,fieldName:"waveformOffset",deprecated:!1,pointerRules:f},"any","seconds"),8:F.create({parent:this,fieldKey:8,fieldName:"playMode",deprecated:!1,pointerRules:f},c.AudioPlayMode,!1),10:b.create({parent:this,fieldKey:10,fieldName:"duration",deprecated:!1,pointerRules:f},"any","ppqn"),11:k.create({parent:this,fieldKey:11,fieldName:"mute",deprecated:!1,pointerRules:f}),12:D.create({parent:this,fieldKey:12,fieldName:"label",deprecated:!1,pointerRules:f}),13:_.create({parent:this,fieldKey:13,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0"),14:b.create({parent:this,fieldKey:14,fieldName:"gain",deprecated:!1,pointerRules:f},"decibel","db"),20:D.create({parent:this,fieldKey:20,fieldName:"playback",deprecated:!0,pointerRules:f}),21:D.create({parent:this,fieldKey:21,fieldName:"timeBase",deprecated:!1,pointerRules:f},"musical")}}};var rc=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioPitchStretchBox",pointerRules:{accepts:[c.AudioPlayMode],mandatory:!0}}),n)}static ClassName="AudioPitchStretchBox";constructor(e){super(e)}accept(e){return P(e.visitAudioPitchStretchBox,this)}get warpMarkers(){return this.getField(1)}initializeFields(){return{1:W.hook({parent:this,fieldKey:1,fieldName:"warpMarkers",deprecated:!1,pointerRules:{accepts:[c.WarpMarkers],mandatory:!0}})}}};var ic=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioTimeStretchBox",pointerRules:{accepts:[c.AudioPlayMode],mandatory:!0}}),n)}static ClassName="AudioTimeStretchBox";constructor(e){super(e)}accept(e){return P(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:[c.WarpMarkers],mandatory:!0}}),2:_.create({parent:this,fieldKey:2,fieldName:"transientPlayMode",deprecated:!1,pointerRules:f},"positive","enum",2),3:b.create({parent:this,fieldKey:3,fieldName:"playbackRate",deprecated:!1,pointerRules:f},"positive","ratio",1)}}};var nc=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TransientMarkerBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="TransientMarkerBox";constructor(e){super(e)}accept(e){return P(e.visitTransientMarkerBox,this)}get owner(){return this.getField(1)}get position(){return this.getField(2)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:f},c.TransientMarkers,!0),2:b.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:f},"non-negative","seconds")}}};var ta=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"WarpMarkerBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="WarpMarkerBox";constructor(e){super(e)}accept(e){return P(e.visitWarpMarkerBox,this)}get owner(){return this.getField(1)}get position(){return this.getField(2)}get seconds(){return this.getField(3)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:f},c.WarpMarkers,!0),2:_.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),3:b.create({parent:this,fieldKey:3,fieldName:"seconds",deprecated:!1,pointerRules:f},"non-negative","seconds")}}};var oc=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MarkerBox",pointerRules:{accepts:[c.Selection,c.MetaData],mandatory:!1}}),n)}static ClassName="MarkerBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"track",deprecated:!1,pointerRules:f},c.MarkerTrack,!0),2:_.create({parent:this,fieldKey:2,fieldName:"position",deprecated:!1,pointerRules:f},"any","ppqn"),3:_.create({parent:this,fieldKey:3,fieldName:"plays",deprecated:!1,pointerRules:f},"non-negative","",1),4:D.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:f}),5:_.create({parent:this,fieldKey:5,fieldName:"hue",deprecated:!1,pointerRules:f},{min:0,max:360},"\xB0")}}};var Lt=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioFileBox",pointerRules:{accepts:[c.AudioFile,c.FileUploadState,c.MetaData],mandatory:!0}}),n)}static ClassName="AudioFileBox";constructor(e){super(e)}accept(e){return P(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:b.create({parent:this,fieldKey:1,fieldName:"startInSeconds",deprecated:!1,pointerRules:f},"non-negative","s"),2:b.create({parent:this,fieldKey:2,fieldName:"endInSeconds",deprecated:!1,pointerRules:f},"non-negative","s"),3:D.create({parent:this,fieldKey:3,fieldName:"fileName",deprecated:!1,pointerRules:f}),10:W.hook({parent:this,fieldKey:10,fieldName:"transientMarkers",deprecated:!1,pointerRules:{accepts:[c.TransientMarkers],mandatory:!1}})}}};var Tr=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontFileBox",pointerRules:{accepts:[c.SoundfontFile],mandatory:!0}}),n)}static ClassName="SoundfontFileBox";constructor(e){super(e)}accept(e){return P(e.visitSoundfontFileBox,this)}get fileName(){return this.getField(1)}initializeFields(){return{1:D.create({parent:this,fieldKey:1,fieldName:"fileName",deprecated:!1,pointerRules:f})}}};var ut=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioUnitBox",pointerRules:{accepts:[c.Selection,c.Automation,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="AudioUnitBox";constructor(e){super(e)}accept(e){return P(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:D.create({parent:this,fieldKey:1,fieldName:"type",deprecated:!1,pointerRules:f},"instrument"),2:F.create({parent:this,fieldKey:2,fieldName:"collection",deprecated:!1,pointerRules:f},c.AudioUnits,!0),3:W.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[c.Editing],mandatory:!1}}),11:_.create({parent:this,fieldKey:11,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),12:b.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-96,mid:-9,max:6,scaling:"decibel"},"dB"),13:b.create({parent:this,fieldKey:13,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%"),14:k.create({parent:this,fieldKey:14,fieldName:"mute",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),15:k.create({parent:this,fieldKey:15,fieldName:"solo",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),20:W.hook({parent:this,fieldKey:20,fieldName:"tracks",deprecated:!1,pointerRules:{accepts:[c.TrackCollection],mandatory:!1}}),21:W.hook({parent:this,fieldKey:21,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[c.MIDIEffectHost],mandatory:!1}}),22:W.hook({parent:this,fieldKey:22,fieldName:"input",deprecated:!1,pointerRules:{accepts:[c.InstrumentHost,c.AudioOutput],mandatory:!1}}),23:W.hook({parent:this,fieldKey:23,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[c.AudioEffectHost],mandatory:!1}}),24:W.hook({parent:this,fieldKey:24,fieldName:"auxSends",deprecated:!1,pointerRules:{accepts:[c.AuxSend],mandatory:!1}}),25:F.create({parent:this,fieldKey:25,fieldName:"output",deprecated:!1,pointerRules:f},c.AudioOutput,!1),26:F.create({parent:this,fieldKey:26,fieldName:"capture",deprecated:!1,pointerRules:f},c.Capture,!1)}}};var ra=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureAudioBox",pointerRules:{accepts:[c.Capture],mandatory:!0}}),n)}static ClassName="CaptureAudioBox";constructor(e){super(e)}accept(e){return P(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:D.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:f}),2:D.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:f},"normal"),10:_.create({parent:this,fieldKey:10,fieldName:"requestChannels",deprecated:!1,pointerRules:f},"any","",1),11:b.create({parent:this,fieldKey:11,fieldName:"gainDb",deprecated:!1,pointerRules:f},"decibel","dB",0)}}};var ia=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CaptureMidiBox",pointerRules:{accepts:[c.Capture],mandatory:!0}}),n)}static ClassName="CaptureMidiBox";constructor(e){super(e)}accept(e){return P(e.visitCaptureMidiBox,this)}get deviceId(){return this.getField(1)}get recordMode(){return this.getField(2)}get channel(){return this.getField(10)}initializeFields(){return{1:D.create({parent:this,fieldKey:1,fieldName:"deviceId",deprecated:!1,pointerRules:f}),2:D.create({parent:this,fieldKey:2,fieldName:"recordMode",deprecated:!1,pointerRules:f},"normal"),10:_.create({parent:this,fieldKey:10,fieldName:"channel",deprecated:!1,pointerRules:f},"any","",-1)}}};var Qi=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AudioBusBox",pointerRules:{accepts:[c.SideChain],mandatory:!1}}),n)}static ClassName="AudioBusBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:f},c.AudioBusses,!0),2:F.create({parent:this,fieldKey:2,fieldName:"output",deprecated:!1,pointerRules:f},c.AudioOutput,!0),3:W.hook({parent:this,fieldKey:3,fieldName:"input",deprecated:!1,pointerRules:{accepts:[c.AudioOutput],mandatory:!1}}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:D.create({parent:this,fieldKey:5,fieldName:"icon",deprecated:!1,pointerRules:f}),6:D.create({parent:this,fieldKey:6,fieldName:"label",deprecated:!1,pointerRules:f}),7:D.create({parent:this,fieldKey:7,fieldName:"color",deprecated:!1,pointerRules:f},"red"),8:k.create({parent:this,fieldKey:8,fieldName:"minimized",deprecated:!1,pointerRules:f})}}};var ws=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"AuxSendBox",pointerRules:{accepts:[c.SideChain],mandatory:!1}}),n)}static ClassName="AuxSendBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"audioUnit",deprecated:!1,pointerRules:f},c.AuxSend,!0),2:F.create({parent:this,fieldKey:2,fieldName:"targetBus",deprecated:!1,pointerRules:f},c.AudioOutput,!0),3:_.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),4:_.create({parent:this,fieldKey:4,fieldName:"routing",deprecated:!1,pointerRules:f},{values:[0,1]},"",1),5:b.create({parent:this,fieldKey:5,fieldName:"sendGain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB"),6:b.create({parent:this,fieldKey:6,fieldName:"sendPan",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","")}}};var ac=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"GrooveShuffleBox",pointerRules:{accepts:[c.Groove],mandatory:!0}}),n)}static ClassName="GrooveShuffleBox";constructor(e){super(e)}accept(e){return P(e.visitGrooveShuffleBox,this)}get label(){return this.getField(1)}get amount(){return this.getField(10)}get duration(){return this.getField(11)}initializeFields(){return{1:D.create({parent:this,fieldKey:1,fieldName:"label",deprecated:!1,pointerRules:f}),10:b.create({parent:this,fieldKey:10,fieldName:"amount",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.6),11:_.create({parent:this,fieldKey:11,fieldName:"duration",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"non-negative","ppqn",480)}}};var Bm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownAudioEffectDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="UnknownAudioEffectDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.AudioEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:D.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:f})}}};var Im=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"UnknownMidiEffectDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData],mandatory:!1}}),n)}static ClassName="UnknownMidiEffectDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.MIDIEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:D.create({parent:this,fieldKey:10,fieldName:"comment",deprecated:!1,pointerRules:f})}}};var km=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"DeviceInterfaceKnobBox",pointerRules:f}),n)}static ClassName="DeviceInterfaceKnobBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"userInterface",deprecated:!1,pointerRules:f},c.DeviceUserInterface,!0),2:F.create({parent:this,fieldKey:2,fieldName:"parameter",deprecated:!1,pointerRules:f},c.ParameterController,!0),3:_.create({parent:this,fieldKey:3,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),10:b.create({parent:this,fieldKey:10,fieldName:"anchor",deprecated:!1,pointerRules:f},"unipolar","%"),11:D.create({parent:this,fieldKey:11,fieldName:"color",deprecated:!1,pointerRules:f})}}};var ng=class r extends Ve{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:[c.DeviceUserInterface],mandatory:!1}})}}};var Nm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="ModularDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.AudioEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:F.create({parent:this,fieldKey:10,fieldName:"modularSetup",deprecated:!1,pointerRules:f},c.ModularSetup,!0),11:ng.create({parent:this,fieldKey:11,fieldName:"userInterface",deprecated:!1,pointerRules:f})}}};var $m=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"StereoToolDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="StereoToolDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.AudioEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-72,mid:0,max:12,scaling:"decibel"},"dB",0),11:b.create({parent:this,fieldKey:11,fieldName:"panning",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%",0),12:b.create({parent:this,fieldKey:12,fieldName:"stereo",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%",0),13:k.create({parent:this,fieldKey:13,fieldName:"invertL",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),14:k.create({parent:this,fieldKey:14,fieldName:"invertR",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),15:k.create({parent:this,fieldKey:15,fieldName:"swap",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),20:_.create({parent:this,fieldKey:20,fieldName:"panningMixing",deprecated:!1,pointerRules:f},{values:[0,1]},"",1)}}};var Dm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MaximizerDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="MaximizerDeviceBox";constructor(e){super(e)}accept(e){return P(e.visitMaximizerDeviceBox,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 threshold(){return this.getField(11)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.AudioEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:k.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:f},!0),11:b.create({parent:this,fieldKey:11,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-30,max:0,scaling:"linear"},"dB",0)}}};var sc=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CompressorDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="CompressorDeviceBox";constructor(e){super(e)}accept(e){return P(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)}get sideChain(){return this.getField(30)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.AudioEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:k.create({parent:this,fieldKey:10,fieldName:"lookahead",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},!1),11:k.create({parent:this,fieldKey:11,fieldName:"automakeup",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},!0),12:k.create({parent:this,fieldKey:12,fieldName:"autoattack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},!1),13:k.create({parent:this,fieldKey:13,fieldName:"autorelease",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},!1),14:b.create({parent:this,fieldKey:14,fieldName:"inputgain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-30,max:30,scaling:"linear"},"dB",0),15:b.create({parent:this,fieldKey:15,fieldName:"threshold",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-60,max:0,scaling:"linear"},"dB",-10),16:b.create({parent:this,fieldKey:16,fieldName:"ratio",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:1,max:24,scaling:"exponential"},"",2),17:b.create({parent:this,fieldKey:17,fieldName:"knee",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:24,scaling:"linear"},"dB",0),18:b.create({parent:this,fieldKey:18,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:100,scaling:"linear"},"ms",0),19:b.create({parent:this,fieldKey:19,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:5,max:1500,scaling:"linear"},"ms",25),20:b.create({parent:this,fieldKey:20,fieldName:"makeup",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-40,max:40,scaling:"linear"},"dB",0),21:b.create({parent:this,fieldKey:21,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",1),30:F.create({parent:this,fieldKey:30,fieldName:"sideChain",deprecated:!1,pointerRules:f},c.SideChain,!1)}}};var Mm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"DelayDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="DelayDeviceBox";constructor(e){super(e)}accept(e){return P(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 delayMusical(){return this.getField(10)}get feedback(){return this.getField(11)}get cross(){return this.getField(12)}get filter(){return this.getField(13)}get wet(){return this.getField(14)}get dry(){return this.getField(15)}get preSyncTimeLeft(){return this.getField(16)}get preMillisTimeLeft(){return this.getField(17)}get preSyncTimeRight(){return this.getField(19)}get preMillisTimeRight(){return this.getField(20)}get delayMillis(){return this.getField(22)}get lfoSpeed(){return this.getField(23)}get lfoDepth(){return this.getField(24)}get version(){return this.getField(99)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.AudioEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"delayMusical",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"any","",13),11:b.create({parent:this,fieldKey:11,fieldName:"feedback",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.5),12:b.create({parent:this,fieldKey:12,fieldName:"cross",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",1),13:b.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%",0),14:b.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",-6),15:b.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",0),16:b.create({parent:this,fieldKey:16,fieldName:"preSyncTimeLeft",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"any","",8),17:b.create({parent:this,fieldKey:17,fieldName:"preMillisTimeLeft",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),19:b.create({parent:this,fieldKey:19,fieldName:"preSyncTimeRight",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"any","",0),20:b.create({parent:this,fieldKey:20,fieldName:"preMillisTimeRight",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),22:b.create({parent:this,fieldKey:22,fieldName:"delayMillis",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),23:b.create({parent:this,fieldKey:23,fieldName:"lfoSpeed",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.1,max:5,scaling:"exponential"},"Hz",.1),24:b.create({parent:this,fieldKey:24,fieldName:"lfoDepth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:50,scaling:"linear"},"ms",0),99:_.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:f},"any","")}}};var Tm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"CrusherDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="CrusherDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.AudioEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"crush",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",0),11:_.create({parent:this,fieldKey:11,fieldName:"bits",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:1,max:16},"bits",16),12:b.create({parent:this,fieldKey:12,fieldName:"boost",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:24,scaling:"linear"},"dB",0),13:b.create({parent:this,fieldKey:13,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",1)}}};var Cm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"DattorroReverbDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="DattorroReverbDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.AudioEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:1e3,scaling:"linear"},"ms",0),11:b.create({parent:this,fieldKey:11,fieldName:"bandwidth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.9999),12:b.create({parent:this,fieldKey:12,fieldName:"inputDiffusion1",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.75),13:b.create({parent:this,fieldKey:13,fieldName:"inputDiffusion2",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.625),14:b.create({parent:this,fieldKey:14,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.75),15:b.create({parent:this,fieldKey:15,fieldName:"decayDiffusion1",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.7),16:b.create({parent:this,fieldKey:16,fieldName:"decayDiffusion2",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.5),17:b.create({parent:this,fieldKey:17,fieldName:"damping",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.005),18:b.create({parent:this,fieldKey:18,fieldName:"excursionRate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.5),19:b.create({parent:this,fieldKey:19,fieldName:"excursionDepth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.7),20:b.create({parent:this,fieldKey:20,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",-6),21:b.create({parent:this,fieldKey:21,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",0)}}};var Rm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"VelocityDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData],mandatory:!1}}),n)}static ClassName="VelocityDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.MIDIEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"magnetPosition",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.5),11:b.create({parent:this,fieldKey:11,fieldName:"magnetStrength",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%"),12:_.create({parent:this,fieldKey:12,fieldName:"randomSeed",deprecated:!1,pointerRules:f},"any","",2048),13:b.create({parent:this,fieldKey:13,fieldName:"randomAmount",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%"),14:b.create({parent:this,fieldKey:14,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%",0),15:b.create({parent:this,fieldKey:15,fieldName:"mix",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",1)}}};var Om=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"FoldDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="FoldDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.AudioEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"drive",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:30,scaling:"linear"},"dB",0),11:_.create({parent:this,fieldKey:11,fieldName:"overSampling",deprecated:!1,pointerRules:f},{length:3},"",0),12:b.create({parent:this,fieldKey:12,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-18,max:0,scaling:"linear"},"dB",0)}}};var Vm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TidalDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="TidalDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.AudioEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"slope",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%",-.25),11:b.create({parent:this,fieldKey:11,fieldName:"symmetry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.5),20:b.create({parent:this,fieldKey:20,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",3),21:b.create({parent:this,fieldKey:21,fieldName:"depth",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","",1),22:b.create({parent:this,fieldKey:22,fieldName:"offset",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0),23:b.create({parent:this,fieldKey:23,fieldName:"channelOffset",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-180,max:180,scaling:"linear"},"\xB0",0)}}};var ep=class r extends Ve{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:k.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),10:b.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:_.create({parent:this,fieldKey:11,fieldName:"order",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{length:4},""),12:b.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var tp=class r extends Ve{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:k.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),10:b.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:b.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-24,max:24,scaling:"linear"},"dB")}}};var fc=class r extends Ve{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:k.create({parent:this,fieldKey:1,fieldName:"enabled",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}}),10:b.create({parent:this,fieldKey:10,fieldName:"frequency",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),11:b.create({parent:this,fieldKey:11,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-24,max:24,scaling:"linear"},"dB"),12:b.create({parent:this,fieldKey:12,fieldName:"q",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"")}}};var zm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"RevampDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="RevampDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.AudioEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:ep.create({parent:this,fieldKey:10,fieldName:"highPass",deprecated:!1,pointerRules:f}),11:tp.create({parent:this,fieldKey:11,fieldName:"lowShelf",deprecated:!1,pointerRules:f}),12:fc.create({parent:this,fieldKey:12,fieldName:"lowBell",deprecated:!1,pointerRules:f}),13:fc.create({parent:this,fieldKey:13,fieldName:"midBell",deprecated:!1,pointerRules:f}),14:fc.create({parent:this,fieldKey:14,fieldName:"highBell",deprecated:!1,pointerRules:f}),15:tp.create({parent:this,fieldKey:15,fieldName:"highShelf",deprecated:!1,pointerRules:f}),16:ep.create({parent:this,fieldKey:16,fieldName:"lowPass",deprecated:!1,pointerRules:f}),17:b.create({parent:this,fieldKey:17,fieldName:"gain",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-18,max:18,scaling:"linear"},"db")}}};var Um=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ReverbDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="ReverbDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.AudioEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.5),11:b.create({parent:this,fieldKey:11,fieldName:"preDelay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:.5,scaling:"exponential"},"s",0),12:b.create({parent:this,fieldKey:12,fieldName:"damp",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",.5),13:b.create({parent:this,fieldKey:13,fieldName:"filter",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%",0),14:b.create({parent:this,fieldKey:14,fieldName:"wet",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",-3),15:b.create({parent:this,fieldKey:15,fieldName:"dry",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",0)}}};var og=class r extends Ve{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:_.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{values:[0,1,2,3]},""),2:b.create({parent:this,fieldKey:2,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","db",-1/0),3:_.create({parent:this,fieldKey:3,fieldName:"octave",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-3,max:3},"oct",0),4:b.create({parent:this,fieldKey:4,fieldName:"tune",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-1200,max:1200,scaling:"linear"},"ct")}}};var ag=class r extends Ve{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:_.create({parent:this,fieldKey:1,fieldName:"waveform",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{values:[0,1,2,3]},""),2:b.create({parent:this,fieldKey:2,fieldName:"rate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:1e-4,max:30,scaling:"exponential"},"Hz",1e-4),3:k.create({parent:this,fieldKey:3,fieldName:"sync",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},!1),10:b.create({parent:this,fieldKey:10,fieldName:"targetTune",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%"),11:b.create({parent:this,fieldKey:11,fieldName:"targetCutoff",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%"),12:b.create({parent:this,fieldKey:12,fieldName:"targetVolume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%")}}};var sg=class r extends Ve{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:b.create({parent:this,fieldKey:1,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),2:b.create({parent:this,fieldKey:2,fieldName:"hold",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),3:b.create({parent:this,fieldKey:3,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),4:b.create({parent:this,fieldKey:4,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","db",.001)}}};var lc=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"VaporisateurDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="VaporisateurDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.InstrumentHost,!0),2:D.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:D.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",-6),11:_.create({parent:this,fieldKey:11,fieldName:"octave",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"any","oct"),12:b.create({parent:this,fieldKey:12,fieldName:"tune",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"any","ct"),13:_.create({parent:this,fieldKey:13,fieldName:"waveform",deprecated:!0,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"any",""),14:b.create({parent:this,fieldKey:14,fieldName:"cutoff",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:20,max:2e4,scaling:"exponential"},"Hz"),15:b.create({parent:this,fieldKey:15,fieldName:"resonance",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.01,max:10,scaling:"exponential"},"q"),16:b.create({parent:this,fieldKey:16,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s"),17:b.create({parent:this,fieldKey:17,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s"),18:b.create({parent:this,fieldKey:18,fieldName:"filterEnvelope",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%"),19:b.create({parent:this,fieldKey:19,fieldName:"decay",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),20:b.create({parent:this,fieldKey:20,fieldName:"sustain",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",1),21:b.create({parent:this,fieldKey:21,fieldName:"glideTime",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",0),22:_.create({parent:this,fieldKey:22,fieldName:"voicingMode",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{values:[0,1]},"",1),23:_.create({parent:this,fieldKey:23,fieldName:"unisonCount",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{values:[1,3,5]},"",1),24:b.create({parent:this,fieldKey:24,fieldName:"unisonDetune",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:1,max:1200,scaling:"exponential"},"ct",30),25:b.create({parent:this,fieldKey:25,fieldName:"unisonStereo",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",1),26:_.create({parent:this,fieldKey:26,fieldName:"filterOrder",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{values:[1,2,3,4]},"",1),27:b.create({parent:this,fieldKey:27,fieldName:"filterKeyboard",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","%"),30:ag.create({parent:this,fieldKey:30,fieldName:"lfo",deprecated:!1,pointerRules:f}),40:bm.create({parent:this,fieldKey:40,fieldName:"oscillators",deprecated:!1,pointerRules:f},e=>og.create(e),2),50:sg.create({parent:this,fieldKey:50,fieldName:"noise",deprecated:!1,pointerRules:f}),99:_.create({parent:this,fieldKey:99,fieldName:"version",deprecated:!1,pointerRules:f},"any","")}}};var lg=class r extends Ve{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:D.create({parent:this,fieldKey:1,fieldName:"id",deprecated:!1,pointerRules:f}),2:D.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f})}}};var cc=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="MIDIOutputDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.InstrumentHost,!0),2:D.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:D.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:lg.create({parent:this,fieldKey:10,fieldName:"deprecatedDevice",deprecated:!0,pointerRules:f}),11:_.create({parent:this,fieldKey:11,fieldName:"channel",deprecated:!1,pointerRules:f},{min:0,max:15},"ch"),12:_.create({parent:this,fieldKey:12,fieldName:"deprecatedDelay",deprecated:!0,pointerRules:f},"any","ms",10),13:W.hook({parent:this,fieldKey:13,fieldName:"parameters",deprecated:!1,pointerRules:{accepts:[c.Parameter],mandatory:!1}}),14:F.create({parent:this,fieldKey:14,fieldName:"device",deprecated:!1,pointerRules:f},c.MIDIDevice,!1)}}};var Xi=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputBox",pointerRules:f}),n)}static ClassName="MIDIOutputBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"root",deprecated:!1,pointerRules:f},c.MIDIDevice,!0),2:W.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[c.MIDIDevice],mandatory:!0}}),3:D.create({parent:this,fieldKey:3,fieldName:"id",deprecated:!1,pointerRules:f}),4:D.create({parent:this,fieldKey:4,fieldName:"label",deprecated:!1,pointerRules:f}),5:_.create({parent:this,fieldKey:5,fieldName:"delayInMs",deprecated:!1,pointerRules:f},{min:0,max:500},"ms",10),6:k.create({parent:this,fieldKey:6,fieldName:"sendTransportMessages",deprecated:!1,pointerRules:f},!0)}}};var Yi=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"MIDIOutputParameterBox",pointerRules:f}),n)}static ClassName="MIDIOutputParameterBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"owner",deprecated:!1,pointerRules:f},c.Parameter,!0),2:D.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f},""),3:_.create({parent:this,fieldKey:3,fieldName:"controller",deprecated:!1,pointerRules:f},{min:0,max:127},"#",64),4:b.create({parent:this,fieldKey:4,fieldName:"value",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!0}},"unipolar","%")}}};var uc=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"SoundfontDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="SoundfontDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.InstrumentHost,!0),2:D.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:D.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:F.create({parent:this,fieldKey:10,fieldName:"file",deprecated:!1,pointerRules:f},c.SoundfontFile,!1),11:_.create({parent:this,fieldKey:11,fieldName:"presetIndex",deprecated:!1,pointerRules:f},{min:0,max:65535},"")}}};var dc=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"NanoDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="NanoDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.InstrumentHost,!0),2:D.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:D.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"volume",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"decibel","dB",-3),15:F.create({parent:this,fieldKey:15,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!1),20:b.create({parent:this,fieldKey:20,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:8,scaling:"exponential"},"s",.1)}}};var pc=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain],mandatory:!1}}),n)}static ClassName="PlayfieldDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.InstrumentHost,!0),2:D.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:D.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:W.hook({parent:this,fieldKey:10,fieldName:"samples",deprecated:!1,pointerRules:{accepts:[c.Sample],mandatory:!1}})}}};var na=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"PlayfieldSampleBox",pointerRules:{accepts:[c.Editing,c.SideChain],mandatory:!1}}),n)}static ClassName="PlayfieldSampleBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:10,fieldName:"device",deprecated:!1,pointerRules:f},c.Sample,!0),11:F.create({parent:this,fieldKey:11,fieldName:"file",deprecated:!1,pointerRules:f},c.AudioFile,!0),12:W.hook({parent:this,fieldKey:12,fieldName:"midiEffects",deprecated:!1,pointerRules:{accepts:[c.MIDIEffectHost],mandatory:!1}}),13:W.hook({parent:this,fieldKey:13,fieldName:"audioEffects",deprecated:!1,pointerRules:{accepts:[c.AudioEffectHost],mandatory:!1}}),15:_.create({parent:this,fieldKey:15,fieldName:"index",deprecated:!1,pointerRules:f},{min:0,max:127},"",60),20:D.create({parent:this,fieldKey:20,fieldName:"label",deprecated:!1,pointerRules:f}),21:D.create({parent:this,fieldKey:21,fieldName:"icon",deprecated:!1,pointerRules:f}),22:k.create({parent:this,fieldKey:22,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),23:k.create({parent:this,fieldKey:23,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),40:k.create({parent:this,fieldKey:40,fieldName:"mute",deprecated:!1,pointerRules:f}),41:k.create({parent:this,fieldKey:41,fieldName:"solo",deprecated:!1,pointerRules:f}),42:k.create({parent:this,fieldKey:42,fieldName:"exclude",deprecated:!1,pointerRules:f}),43:k.create({parent:this,fieldKey:43,fieldName:"polyphone",deprecated:!1,pointerRules:f}),44:_.create({parent:this,fieldKey:44,fieldName:"gate",deprecated:!1,pointerRules:f},{length:3},"",0),45:b.create({parent:this,fieldKey:45,fieldName:"pitch",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-1200,max:1200,scaling:"linear"},"ct"),46:b.create({parent:this,fieldKey:46,fieldName:"sampleStart",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",0),47:b.create({parent:this,fieldKey:47,fieldName:"sampleEnd",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%",1),48:b.create({parent:this,fieldKey:48,fieldName:"attack",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.001),49:b.create({parent:this,fieldKey:49,fieldName:"release",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:.001,max:5,scaling:"exponential"},"s",.02)}}};var hc=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"TapeDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData,c.SideChain,c.Automation],mandatory:!1}}),n)}static ClassName="TapeDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.InstrumentHost,!0),2:D.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:D.create({parent:this,fieldKey:3,fieldName:"icon",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:b.create({parent:this,fieldKey:10,fieldName:"flutter",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%"),11:b.create({parent:this,fieldKey:11,fieldName:"wow",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%"),12:b.create({parent:this,fieldKey:12,fieldName:"noise",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%"),13:b.create({parent:this,fieldKey:13,fieldName:"saturation",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"unipolar","%")}}};var jm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ArpeggioDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData],mandatory:!1}}),n)}static ClassName="ArpeggioDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.MIDIEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:_.create({parent:this,fieldKey:10,fieldName:"modeIndex",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{length:3},"",0),11:_.create({parent:this,fieldKey:11,fieldName:"numOctaves",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:1,max:5},"oct",1),12:_.create({parent:this,fieldKey:12,fieldName:"rateIndex",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{length:17},"",9),13:b.create({parent:this,fieldKey:13,fieldName:"gate",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:0,max:2,scaling:"linear"},"",1),14:_.create({parent:this,fieldKey:14,fieldName:"repeat",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:1,max:16},"",1),15:b.create({parent:this,fieldKey:15,fieldName:"velocity",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},"bipolar","",0)}}};var Lm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"PitchDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData],mandatory:!1}}),n)}static ClassName="PitchDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.MIDIEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:_.create({parent:this,fieldKey:10,fieldName:"semiTones",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-36,max:36},"st",0),11:b.create({parent:this,fieldKey:11,fieldName:"cents",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-50,max:50,scaling:"linear"},"ct",0),12:_.create({parent:this,fieldKey:12,fieldName:"octaves",deprecated:!1,pointerRules:{accepts:[c.Modulation,c.Automation,c.MIDIControl],mandatory:!1}},{min:-7,max:7},"oct",0)}}};var Km=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ZeitgeistDeviceBox",pointerRules:{accepts:[c.Device,c.Selection,c.MetaData],mandatory:!1}}),n)}static ClassName="ZeitgeistDeviceBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"host",deprecated:!1,pointerRules:f},c.MIDIEffectHost,!0),2:_.create({parent:this,fieldKey:2,fieldName:"index",deprecated:!1,pointerRules:f},"index",""),3:D.create({parent:this,fieldKey:3,fieldName:"label",deprecated:!1,pointerRules:f}),4:k.create({parent:this,fieldKey:4,fieldName:"enabled",deprecated:!1,pointerRules:f},!0),5:k.create({parent:this,fieldKey:5,fieldName:"minimized",deprecated:!1,pointerRules:f},!1),10:F.create({parent:this,fieldKey:10,fieldName:"groove",deprecated:!1,pointerRules:f},c.Groove,!0)}}};var Wm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularBox",pointerRules:f}),n)}static ClassName="ModularBox";constructor(e){super(e)}accept(e){return P(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:F.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:f},c.ModularSetup,!0),2:W.hook({parent:this,fieldKey:2,fieldName:"device",deprecated:!1,pointerRules:{accepts:[c.ModularSetup],mandatory:!0}}),3:W.hook({parent:this,fieldKey:3,fieldName:"editing",deprecated:!1,pointerRules:{accepts:[c.Editing],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"modules",deprecated:!1,pointerRules:{accepts:[c.ModuleCollection],mandatory:!1}}),12:W.hook({parent:this,fieldKey:12,fieldName:"connections",deprecated:!1,pointerRules:{accepts:[c.ConnectionCollection],mandatory:!1}}),13:D.create({parent:this,fieldKey:13,fieldName:"label",deprecated:!1,pointerRules:f})}}};var Zm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleConnectionBox",pointerRules:f}),n)}static ClassName="ModuleConnectionBox";constructor(e){super(e)}accept(e){return P(e.visitModuleConnectionBox,this)}get collection(){return this.getField(1)}get source(){return this.getField(2)}get target(){return this.getField(3)}initializeFields(){return{1:F.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:f},c.ConnectionCollection,!0),2:F.create({parent:this,fieldKey:2,fieldName:"source",deprecated:!1,pointerRules:f},c.VoltageConnection,!0),3:F.create({parent:this,fieldKey:3,fieldName:"target",deprecated:!1,pointerRules:f},c.VoltageConnection,!0)}}};var bi=class r extends Ve{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:F.create({parent:this,fieldKey:1,fieldName:"collection",deprecated:!1,pointerRules:f},c.ModuleCollection,!0),2:D.create({parent:this,fieldKey:2,fieldName:"label",deprecated:!1,pointerRules:f}),3:_.create({parent:this,fieldKey:3,fieldName:"x",deprecated:!1,pointerRules:f},"any","x"),4:_.create({parent:this,fieldKey:4,fieldName:"y",deprecated:!1,pointerRules:f},"any","y"),5:k.create({parent:this,fieldKey:5,fieldName:"collapsed",deprecated:!1,pointerRules:f},!1),6:k.create({parent:this,fieldKey:6,fieldName:"removable",deprecated:!1,pointerRules:f},!0)}}};var qm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioInputBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ModularAudioInputBox";constructor(e){super(e)}accept(e){return P(e.visitModularAudioInputBox,this)}get attributes(){return this.getField(1)}get output(){return this.getField(10)}initializeFields(){return{1:bi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:W.hook({parent:this,fieldKey:10,fieldName:"output",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}})}}};var Gm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModularAudioOutputBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ModularAudioOutputBox";constructor(e){super(e)}accept(e){return P(e.visitModularAudioOutputBox,this)}get attributes(){return this.getField(1)}get input(){return this.getField(10)}initializeFields(){return{1:bi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:W.hook({parent:this,fieldKey:10,fieldName:"input",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}})}}};var Hm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleDelayBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ModuleDelayBox";constructor(e){super(e)}accept(e){return P(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:bi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:W.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),20:b.create({parent:this,fieldKey:20,fieldName:"time",deprecated:!1,pointerRules:{accepts:[c.ParameterController],mandatory:!1}},{min:1,max:1e3,scaling:"exponential"},"ms",500)}}};var Jm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleMultiplierBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ModuleMultiplierBox";constructor(e){super(e)}accept(e){return P(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:bi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:W.hook({parent:this,fieldKey:10,fieldName:"voltageInputX",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),11:W.hook({parent:this,fieldKey:11,fieldName:"voltageInputY",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),12:W.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),20:b.create({parent:this,fieldKey:20,fieldName:"multiplier",deprecated:!1,pointerRules:f},"unipolar","%")}}};var Qm=class r extends I{static create(e,t,n){return e.stageBox(new r({uuid:t,graph:e,name:"ModuleGainBox",pointerRules:{accepts:[c.Selection],mandatory:!1}}),n)}static ClassName="ModuleGainBox";constructor(e){super(e)}accept(e){return P(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:bi.create({parent:this,fieldKey:1,fieldName:"attributes",deprecated:!1,pointerRules:f}),10:W.hook({parent:this,fieldKey:10,fieldName:"voltageInput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),12:W.hook({parent:this,fieldKey:12,fieldName:"voltageOutput",deprecated:!1,pointerRules:{accepts:[c.VoltageConnection],mandatory:!1}}),20:b.create({parent:this,fieldKey:20,fieldName:"gain",deprecated:!1,pointerRules:{accepts:[c.ParameterController],mandatory:!1}},"decibel","dB")}}};var cg=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 xE=(r,e)=>{if(r===e)return 0;let t=r-e;return t===0?B(`Indices cannot be equal (${r}, ${e})`):t};var Ao=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},er=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ug,en,la,dg,_o,Kt=class r{static create(e,t,n){return new r(e,t,n)}constructor(e,t,n){ug.set(this,void 0),en.set(this,void 0),la.set(this,void 0),dg.set(this,void 0),_o.set(this,null),Ao(this,ug,e,"f"),Ao(this,en,w.newSet(i=>i.adapter.uuid),"f"),Ao(this,la,new jt,"f"),Ao(this,dg,e.pointerHub.catchupAndSubscribe({onAdded:i=>{Ao(this,_o,null,"f");let o=t(i.box),a=o.indexField.subscribe(()=>{Ao(this,_o,null,"f"),er(this,la,"f").proxy.onReorder(o)}),s=er(this,en,"f").add({adapter:o,subscription:a});T(s,`Could not add ${o}`),er(this,la,"f").proxy.onAdd(o)},onRemoved:i=>{Ao(this,_o,null,"f");let o=i.box.address.uuid,{adapter:a,subscription:s}=er(this,en,"f").removeByKey(o);s.terminate(),er(this,la,"f").proxy.onRemove(a)}},n),"f")}field(){return er(this,ug,"f")}subscribe(e){return er(this,la,"f").subscribe(e)}catchupAndSubscribe(e){return er(this,en,"f").forEach(({adapter:t})=>e.onAdd(t)),this.subscribe(e)}getAdapterByIndex(e){let t=nt.exactMapped(this.adapters(),e,xE,n=>n.indexField.getValue());return t===-1?m.None:m.wrap(this.adapters()[t])}getAdapterById(e){return er(this,en,"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 er(this,_o,"f")===null&&Ao(this,_o,er(this,en,"f").values().map(({adapter:e})=>e).sort((e,t)=>e.indexField.getValue()-t.indexField.getValue()),"f"),er(this,_o,"f")}move(e,t){this.moveIndex(e.indexField.getValue(),t)}moveIndex(e,t){let n=this.adapters(),i=n[e];if(t<0){let o=pe(e+t,0,n.length-1);for(let a=o;a<e;a++)n[a].indexField.setValue(a+1);i.indexField.setValue(o)}else if(t>1){let o=pe(e+(t-1),0,n.length-1);for(let a=e;a<o;a++)n[a+1].indexField.setValue(a);i.indexField.setValue(o)}else console.warn(`moveIndex had no effect: startIndex: ${e}, delta: ${t}`)}size(){return er(this,en,"f").size()}isEmpty(){return this.size()===0}terminate(){Ao(this,_o,null,"f"),er(this,en,"f").forEach(({subscription:e})=>e.terminate()),er(this,en,"f").clear(),er(this,la,"f").terminate(),er(this,dg,"f").terminate()}};ug=new WeakMap,en=new WeakMap,la=new WeakMap,dg=new WeakMap,_o=new WeakMap;var Mn;(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 n=e.pointerHub.filter(c.ValueInterpolation).at(0)?.box;Z(n)?(fw(n,Yo),n.slope.setValue(t.slope)):Yo.create(e.box.graph,w.generate(),i=>{i.slope.setValue(t.slope),i.event.refer(e)})}},r.read=e=>{let t=e.pointerHub.incoming().at(0)?.box;return Z(t)?(fw(t,Yo),{type:"curve",slope:t.slope.getValue()}):e.getValue()===0?xo.None:e.getValue()===1?xo.Linear:B("Unknown Interpolation value")}})(Mn||(Mn={}));var ca=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},We=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},rp,mc,vt,ip,ua,np,Po=class r{constructor(e,t){this.type="value-event",rp.set(this,new R),mc.set(this,void 0),vt.set(this,void 0),ip.set(this,void 0),ua.set(this,void 0),np.set(this,!1),ca(this,mc,e,"f"),ca(this,vt,t,"f"),ca(this,ip,We(this,rp,"f").own(new Qf(()=>Mn.read(We(this,vt,"f").interpolation))),"f");let n=()=>{We(this,ip,"f").invalidate(),this.collection.ifSome(i=>i.onEventPropertyChanged())};We(this,rp,"f").ownAll(We(this,vt,"f").subscribe(ke.Children,i=>{if(!this.collection.isEmpty()&&(i.type==="primitive"||i.type==="pointer")){let o=this.collection.unwrap(),a=i.address.fieldKeys,s=O.equals(We(this,vt,"f").index.address.fieldKeys,a),l=O.equals(We(this,vt,"f").position.address.fieldKeys,a);s||l?o.requestSorting():o.onEventPropertyChanged()}}),We(this,vt,"f").interpolation.subscribe(n),We(this,vt,"f").interpolation.pointerHub.subscribe({onAdded:({box:i})=>{We(this,ua,"f").terminate(),ca(this,ua,i.subscribe(ke.Children,n),"f"),n()},onRemoved:()=>{We(this,ua,"f").terminate(),ca(this,ua,q.Empty,"f"),n()}})),ca(this,ua,We(this,vt,"f").interpolation.pointerHub.filter(c.ValueInterpolation).at(0)?.box.subscribe(ke.Children,n)??q.Empty,"f")}onSelected(){ca(this,np,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){ca(this,np,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){We(this,ua,"f").terminate(),We(this,rp,"f").terminate()}get box(){return We(this,vt,"f")}get uuid(){return We(this,vt,"f").address.uuid}get address(){return We(this,vt,"f").address}get position(){return We(this,vt,"f").position.getValue()}get index(){return We(this,vt,"f").index.getValue()}set interpolation(e){Mn.write(We(this,vt,"f").interpolation,e)}get interpolation(){return We(this,ip,"f").get()}get value(){return We(this,vt,"f").value.getValue()}get isSelected(){return We(this,np,"f")}get collection(){return We(this,vt,"f").events.targetVertex.map(e=>We(this,mc,"f").boxAdapters.adapterFor(e.box,tr))}copyTo(e){let t=e?.position??this.position,n=e?.index??this.index;console.debug(`copyTo: position=${t}, index=${n}`,new Error().stack);let i=Xo.create(We(this,mc,"f").boxGraph,w.generate(),o=>{o.position.setValue(t),o.index.setValue(n),o.events.refer(e?.events??this.collection.unwrap().box.events),o.value.setValue(e?.value??this.value)});return Mn.write(i.interpolation,e?.interpolation??this.interpolation),We(this,mc,"f").boxAdapters.adapterFor(i,r)}copyFrom(e){return We(this,vt,"f").position.setValue(e?.position??this.position),We(this,vt,"f").index.setValue(e?.index??this.index),We(this,vt,"f").events.refer(e?.events??this.collection.unwrap().box.events),We(this,vt,"f").value.setValue(e?.value??this.value),Mn.write(We(this,vt,"f").interpolation,e?.interpolation??this.interpolation),this}toString(){return`{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`}};rp=new WeakMap,mc=new WeakMap,vt=new WeakMap,ip=new WeakMap,ua=new WeakMap,np=new WeakMap;Po.Comparator=(r,e)=>{let t=r.position-e.position;if(t!==0)return t;let n=r.index-e.index;if(n!==0)return n;throw new Error(`${r} and ${e} are identical in terms of comparison`)};var op=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ze=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ap,sp,da,Yr,As,gc,So,pg,tr=class r{constructor(e,t){ap.add(this),sp.set(this,new R),da.set(this,void 0),Yr.set(this,void 0),As.set(this,void 0),gc.set(this,void 0),So.set(this,void 0),op(this,da,e,"f"),op(this,Yr,t,"f"),op(this,As,new te,"f"),op(this,gc,w.newSet(i=>i.uuid),"f"),op(this,So,Dr.create(Po.Comparator),"f");let n=i=>{let o=se(i.accept({visitValueEventBox:a=>ze(this,da,"f").boxAdapters.adapterFor(a,Po)}),`Could not find adapter for ${i}`);ze(this,gc,"f").add(o)&&(ze(this,So,"f").add(o),ze(this,ap,"m",pg).call(this))};ze(this,Yr,"f").events.pointerHub.incoming().forEach(({box:i})=>n(i)),ze(this,sp,"f").own(ze(this,Yr,"f").events.pointerHub.subscribe({onAdded:({box:i})=>n(i),onRemoved:({box:{address:{uuid:i}}})=>{ze(this,So,"f").remove(ze(this,gc,"f").removeByKey(i)),ze(this,ap,"m",pg).call(this)}})),ze(this,sp,"f").own(ze(this,Yr,"f").owners.pointerHub.subscribe({onAdded:()=>ze(this,As,"f").notify(this),onRemoved:()=>ze(this,As,"f").notify(this)}))}valueAt(e,t){return ym.valueAt(ze(this,So,"f"),e,t)}copy(){let e=ze(this,da,"f").boxGraph,t=Ji.create(e,w.generate());return ze(this,So,"f").asArray().forEach(n=>n.copyTo({events:t.events})),ze(this,da,"f").boxAdapters.adapterFor(t,r)}cut(e,t=S.unipolar()){let n=this.events.lowerEqual(e),i=this.events.greaterEqual(e);if(i===null)return n===null?m.None:m.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n===null)return m.wrap(this.createEvent({position:e,value:i.value,index:i.index,interpolation:i.interpolation}));if(n.position===e)return m.wrap(n);if(n.interpolation.type==="none")return m.wrap(this.createEvent({position:e,value:n.value,index:n.index,interpolation:n.interpolation}));if(n.interpolation.type==="linear"){let{position:o}=n,{position:a}=i,s=t.x(n.value),l=t.x(i.value),u=Xf(s,l,(e-o)/(a-o));return m.wrap(this.createEvent({position:e,value:t.y(u),index:0,interpolation:n.interpolation}))}if(n.interpolation.type==="curve"){let{position:o}=n,{position:a}=i,s=t.x(n.value),l=t.x(i.value),u=a-o,d=e-o,p=xi.byHalf(u,s,xi.valueAt({slope:n.interpolation.slope,steps:u,y0:s,y1:l},u*.5),l),h=xi.valueAt(p,d),g=xi.slopeByHalf(s,xi.valueAt(p,d*.5),h);return Mn.write(n.box.interpolation,xo.Curve(g)),m.wrap(this.createEvent({position:e,value:t.y(h),index:0,interpolation:xo.Curve(xi.slopeByHalf(h,xi.valueAt(p,(d+u)*.5),l))}))}return B("Unknown interpolation type")}subscribeChange(e){return ze(this,As,"f").subscribe(e)}createEvent({position:e,index:t,value:n,interpolation:i}){let o=ze(this,gc,"f").values().find(s=>s.position===e&&s.index===t);Z(o)&&console.warn("createEvent: DUPLICATE POSITION/INDEX!",{existingUUID:w.toString(o.uuid),position:e,index:t,collectionUUID:w.toString(ze(this,Yr,"f").address.uuid),stack:new Error().stack});let a=Xo.create(ze(this,da,"f").boxGraph,w.generate(),s=>{s.position.setValue(e),s.index.setValue(t),s.value.setValue(n),s.events.refer(ze(this,Yr,"f").events)});return Mn.write(a.interpolation,i),ze(this,da,"f").boxAdapters.adapterFor(a,Po)}requestSorting(){ze(this,So,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){ze(this,ap,"m",pg).call(this)}terminate(){ze(this,sp,"f").terminate()}get box(){return ze(this,Yr,"f")}get uuid(){return ze(this,Yr,"f").address.uuid}get address(){return ze(this,Yr,"f").address}get numOwners(){return ze(this,Yr,"f").owners.pointerHub.filter(c.ValueEventCollection).length}get events(){return ze(this,So,"f")}toString(){return`{ValueEventCollectionBox ${w.toString(ze(this,Yr,"f").address.uuid)}}`}};sp=new WeakMap,da=new WeakMap,Yr=new WeakMap,As=new WeakMap,gc=new WeakMap,So=new WeakMap,ap=new WeakSet,pg=function(){ze(this,As,"f").notify(this)};var _s=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ie=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ps,pa,Ss,Mt,Es,up,lp,cp,vc,ha=class{constructor(e,t){Ps.add(this),this.type="value-clip",pa.set(this,new R),Ss.set(this,void 0),Mt.set(this,void 0),Es.set(this,void 0),up.set(this,void 0),lp.set(this,void 0),cp.set(this,q.Empty),_s(this,Ss,e,"f"),_s(this,Mt,t,"f"),_s(this,lp,!0,"f"),_s(this,Es,Ie(this,pa,"f").own(new Qr(!1)),"f"),_s(this,up,Ie(this,pa,"f").own(new te),"f"),Ie(this,pa,"f").own(Ie(this,Mt,"f").pointerHub.subscribe({onAdded:()=>Ie(this,Ps,"m",vc).call(this),onRemoved:()=>Ie(this,Ps,"m",vc).call(this)})),Ie(this,pa,"f").own(Ie(this,Mt,"f").subscribe(ke.Children,n=>Ie(this,Ps,"m",vc).call(this))),Ie(this,pa,"f").own(Ie(this,Mt,"f").events.catchupAndSubscribe(({targetVertex:n})=>{Ie(this,cp,"f").terminate(),_s(this,cp,n.match({none:()=>q.Empty,some:({box:i})=>Ie(this,Ss,"f").boxAdapters.adapterFor(i,tr).subscribeChange(()=>Ie(this,Ps,"m",vc).call(this))}),"f"),Ie(this,Ps,"m",vc).call(this)})),_s(this,lp,!1,"f")}valueAt(e,t){let n=this.optCollection;return n.isEmpty()?t:n.unwrap().valueAt(e%this.duration,t)}catchupAndSubscribeSelected(e){return Ie(this,Es,"f").catchupAndSubscribe(e)}subscribeChange(e){return Ie(this,up,"f").subscribe(e)}accept(e){return P(e.visitValueClipBoxAdapter,this)}consolidate(){this.isMirrowed&&Ie(this,Mt,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:Ie(this,Mt,"f").events.targetVertex.unwrap();Yl.create(Ie(this,Ss,"f").boxGraph,w.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(Ie(this,Mt,"f").clips.targetVertex.unwrap()),n.events.refer(t)})}onSelected(){Ie(this,Es,"f").setValue(!0)}onDeselected(){Ie(this,Es,"f").setValue(!1)}get isSelected(){return Ie(this,Es,"f").getValue()}terminate(){Ie(this,cp,"f").terminate(),Ie(this,pa,"f").terminate()}get box(){return Ie(this,Mt,"f")}get uuid(){return Ie(this,Mt,"f").address.uuid}get address(){return Ie(this,Mt,"f").address}get indexField(){return Ie(this,Mt,"f").index}get duration(){return Ie(this,Mt,"f").duration.getValue()}get mute(){return Ie(this,Mt,"f").mute.getValue()}get hue(){return Ie(this,Mt,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return Ie(this,Mt,"f").events.targetVertex.map(e=>Ie(this,Ss,"f").boxAdapters.adapterFor(e.box,tr))}get label(){return Ie(this,Mt,"f").label.getValue()}get trackBoxAdapter(){return Ie(this,lp,"f")?m.None:Ie(this,Mt,"f").clips.targetVertex.map(e=>Ie(this,Ss,"f").boxAdapters.adapterFor(e.box,_t))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{ValueClipBoxAdapter ${w.toString(Ie(this,Mt,"f").address.uuid)} d: ${G.toString(this.duration)}}`}};pa=new WeakMap,Ss=new WeakMap,Mt=new WeakMap,Es=new WeakMap,up=new WeakMap,lp=new WeakMap,cp=new WeakMap,Ps=new WeakSet,vc=function(){Ie(this,up,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var bE=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},yc=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Cw,Fs,hg,xc=class{constructor(e){this.type="transient-marker",Cw.set(this,new R),Fs.set(this,void 0),hg.set(this,void 0),bE(this,Fs,e,"f"),bE(this,hg,new te,"f")}get box(){return yc(this,Fs,"f")}get uuid(){return yc(this,Fs,"f").address.uuid}get address(){return yc(this,Fs,"f").address}get position(){return yc(this,Fs,"f").position.getValue()}subscribe(e){return yc(this,hg,"f").subscribe(e)}terminate(){yc(this,Cw,"f").terminate()}};Cw=new WeakMap,Fs=new WeakMap,hg=new WeakMap;var dp=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},rr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},fg,pp,Tn,hp,bc,mg,tn=class r{constructor(e,t){fg.set(this,new R),pp.set(this,void 0),Tn.set(this,void 0),hp.set(this,void 0),bc.set(this,void 0),mg.set(this,void 0),dp(this,pp,e,"f"),dp(this,Tn,t,"f"),dp(this,hp,w.newSet(({uuid:n})=>n),"f"),dp(this,bc,Dr.create(r.Comparator),"f"),dp(this,mg,_m.memoizeAsync(async()=>{if(this.data.nonEmpty())return this.data.unwrap();let{promise:n,resolve:i,reject:o}=Promise.withResolvers(),a=this.getOrCreateLoader(),s=a.subscribe(l=>{l.type==="loaded"?(s.terminate(),i(a.data.unwrap("State mismatch"))):l.type==="error"&&(s.terminate(),o(new Error(l.reason)))});return n}),"f"),rr(this,fg,"f").ownAll(t.transientMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=rr(this,pp,"f").boxAdapters.adapterFor(n.box,xc);rr(this,hp,"f").add(i)&&rr(this,bc,"f").add(i)},onRemoved:({box:{address:{uuid:n}}})=>{rr(this,bc,"f").remove(rr(this,hp,"f").removeByKey(n))}}))}get box(){return rr(this,Tn,"f")}get uuid(){return rr(this,Tn,"f").address.uuid}get address(){return rr(this,Tn,"f").address}get startInSeconds(){return rr(this,Tn,"f").startInSeconds.getValue()}get endInSeconds(){return rr(this,Tn,"f").endInSeconds.getValue()}get transients(){return rr(this,bc,"f")}get fileName(){return rr(this,Tn,"f").fileName.getValue()}get data(){return this.getOrCreateLoader().data}get peaks(){return this.getOrCreateLoader().peaks}get audioData(){return rr(this,mg,"f").call(this)}getOrCreateLoader(){return rr(this,pp,"f").sampleManager.getOrCreate(rr(this,Tn,"f").address.uuid)}terminate(){rr(this,fg,"f").terminate()}};fg=new WeakMap,pp=new WeakMap,Tn=new WeakMap,hp=new WeakMap,bc=new WeakMap,mg=new WeakMap;tn.Comparator=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),B("Events at the same position: "+r.position+", "+e.position)):t};var fp=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ar=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},mp,gg,vg,Eo,vp,gp,yg,fa=class{constructor(e,t){mp.add(this),this.type="warp-marker",gg.set(this,new R),vg.set(this,void 0),Eo.set(this,void 0),vp.set(this,void 0),gp.set(this,!1),fp(this,vg,e,"f"),fp(this,Eo,t,"f"),fp(this,vp,new te,"f"),Ar(this,gg,"f").own(t.subscribe(ke.Children,()=>Ar(this,mp,"m",yg).call(this)))}onSelected(){fp(this,gp,!0,"f"),this.optWarping.ifSome(e=>e.onChanged()),Ar(this,mp,"m",yg).call(this)}onDeselected(){fp(this,gp,!1,"f"),Ar(this,mp,"m",yg).call(this)}get box(){return Ar(this,Eo,"f")}get uuid(){return Ar(this,Eo,"f").address.uuid}get address(){return Ar(this,Eo,"f").address}get position(){return Ar(this,Eo,"f").position.getValue()}get seconds(){return Ar(this,Eo,"f").seconds.getValue()}get isSelected(){return Ar(this,gp,"f")}get optWarping(){return Ar(this,Eo,"f").owner.targetVertex.map(e=>Ar(this,vg,"f").boxAdapters.adapterFor(e.box,Cn.isAudioPlayMode))}get isAnchor(){return this.optWarping.mapOr(({warpMarkers:e})=>this===e.optAt(0)||this===e.optAt(e.length()-1),!1)}subscribe(e){return Ar(this,vp,"f").subscribe(e)}terminate(){Ar(this,gg,"f").terminate()}};gg=new WeakMap,vg=new WeakMap,Eo=new WeakMap,vp=new WeakMap,gp=new WeakMap,mp=new WeakSet,yg=function(){Ar(this,vp,"f").notify(),this.optWarping.ifSome(e=>e.onChanged())};var xg=(r,e)=>{let t=r.position-e.position;return t===0?(console.warn(r,e),B("Events at the same position: "+r.position+", "+e.position)):t};var yp=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ur=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},bg,wg,Bs,Is,xp,wc,Rn=class{constructor(e,t){bg.set(this,new R),wg.set(this,void 0),Bs.set(this,void 0),Is.set(this,void 0),xp.set(this,void 0),wc.set(this,void 0),yp(this,wg,e,"f"),yp(this,Bs,t,"f"),yp(this,Is,new te,"f"),yp(this,xp,w.newSet(({uuid:n})=>n),"f"),yp(this,wc,Dr.create(xg),"f"),ur(this,bg,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=ur(this,wg,"f").boxAdapters.adapterFor(n.box,fa);ur(this,xp,"f").add(i)&&(ur(this,wc,"f").add(i),ur(this,Is,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{ur(this,wc,"f").remove(ur(this,xp,"f").removeByKey(n)),ur(this,Is,"f").notify()}}))}get box(){return ur(this,Bs,"f")}get uuid(){return ur(this,Bs,"f").address.uuid}get address(){return ur(this,Bs,"f").address}get warpMarkers(){return ur(this,wc,"f")}clone(){let e=rc.create(ur(this,Bs,"f").graph,w.generate());return this.warpMarkers.asArray().forEach(t=>ta.create(e.graph,w.generate(),n=>{n.position.setValue(t.position),n.seconds.setValue(t.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return ur(this,Is,"f").subscribe(e)}onChanged(){ur(this,Is,"f").notify()}terminate(){ur(this,bg,"f").terminate()}};bg=new WeakMap,wg=new WeakMap,Bs=new WeakMap,Is=new WeakMap,xp=new WeakMap,wc=new WeakMap;var bp=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Tt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ag,_g,rn,ks,wp,Ac,On=class{constructor(e,t){Ag.set(this,new R),_g.set(this,void 0),rn.set(this,void 0),ks.set(this,void 0),wp.set(this,void 0),Ac.set(this,void 0),bp(this,_g,e,"f"),bp(this,rn,t,"f"),bp(this,ks,new te,"f"),bp(this,wp,w.newSet(({uuid:n})=>n),"f"),bp(this,Ac,Dr.create(xg),"f"),Tt(this,Ag,"f").ownAll(t.warpMarkers.pointerHub.catchupAndSubscribe({onAdded:n=>{let i=Tt(this,_g,"f").boxAdapters.adapterFor(n.box,fa);Tt(this,wp,"f").add(i)&&(Tt(this,Ac,"f").add(i),Tt(this,ks,"f").notify())},onRemoved:({box:{address:{uuid:n}}})=>{Tt(this,Ac,"f").remove(Tt(this,wp,"f").removeByKey(n)),Tt(this,ks,"f").notify()}}))}get box(){return Tt(this,rn,"f")}get uuid(){return Tt(this,rn,"f").address.uuid}get address(){return Tt(this,rn,"f").address}get warpMarkers(){return Tt(this,Ac,"f")}get playbackRate(){return Tt(this,rn,"f").playbackRate.getValue()}get cents(){return Math.log2(Tt(this,rn,"f").playbackRate.getValue())*1200}set cents(e){Tt(this,rn,"f").playbackRate.setValue(pe(2**(e/1200),.5,2))}get transientPlayMode(){return vi(Tt(this,rn,"f").transientPlayMode.getValue(),aa)}clone(){let e=ic.create(Tt(this,rn,"f").graph,w.generate(),t=>{t.transientPlayMode.setValue(this.transientPlayMode),t.playbackRate.setValue(this.playbackRate),t.warpMarkers});return this.warpMarkers.asArray().forEach(t=>ta.create(e.graph,w.generate(),n=>{n.position.setValue(t.position),n.seconds.setValue(t.seconds),n.owner.refer(e.warpMarkers)})),e}subscribe(e){return Tt(this,ks,"f").subscribe(e)}onChanged(){Tt(this,ks,"f").notify()}terminate(){Tt(this,Ag,"f").terminate()}};Ag=new WeakMap,_g=new WeakMap,rn=new WeakMap,ks=new WeakMap,wp=new WeakMap,Ac=new WeakMap;var Cn;(function(r){r.isAudioPlayMode=e=>e instanceof Rn||e instanceof On})(Cn||(Cn={}));var ei=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},le=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ns,_c,$s,yt,Ds,Ms,Ap,Pp,_p,Ts,Pc,Sc,Ec,ma=class{constructor(e,t){Ns.add(this),this.type="audio-clip",_c.set(this,new R),$s.set(this,void 0),yt.set(this,void 0),Ds.set(this,void 0),Ms.set(this,void 0),Ap.set(this,void 0),Pp.set(this,void 0),_p.set(this,void 0),Ts.set(this,m.None),Pc.set(this,m.None),Sc.set(this,q.Empty),ei(this,$s,e,"f"),ei(this,yt,t,"f"),ei(this,_p,!0,"f"),ei(this,Ds,new $r,"f"),ei(this,Ms,le(this,_c,"f").own(new Qr(!1)),"f"),ei(this,Ap,Ho.aware(e.tempoMap,t.timeBase,t.duration),"f"),ei(this,Pp,le(this,_c,"f").own(new te),"f"),le(this,_c,"f").ownAll(le(this,yt,"f").pointerHub.subscribe({onAdded:()=>le(this,Ns,"m",Ec).call(this),onRemoved:()=>le(this,Ns,"m",Ec).call(this)}),le(this,yt,"f").playMode.catchupAndSubscribe(({targetVertex:n})=>{le(this,Sc,"f").terminate(),n.match({none:()=>le(this,Ds,"f").clear(),some:({box:i})=>{let o=le(this,$s,"f").boxAdapters.adapterFor(i,Cn.isAudioPlayMode);ei(this,Sc,o.subscribe(()=>le(this,Ns,"m",Ec).call(this)),"f"),le(this,Ds,"f").wrap(o)}})}),le(this,yt,"f").file.catchupAndSubscribe(n=>{ei(this,Ts,n.targetVertex.map(i=>le(this,$s,"f").boxAdapters.adapterFor(i.box,tn)),"f"),le(this,Pc,"f").ifSome(i=>i.terminate()),ei(this,Pc,le(this,Ts,"f").map(i=>i.getOrCreateLoader().subscribe(()=>le(this,Ns,"m",Ec).call(this))),"f")}),le(this,yt,"f").subscribe(ke.Children,n=>le(this,Ns,"m",Ec).call(this))),ei(this,_p,!1,"f")}catchupAndSubscribeSelected(e){return le(this,Ms,"f").catchupAndSubscribe(e)}subscribeChange(e){return le(this,Pp,"f").subscribe(e)}accept(e){return P(e.visitAudioClipBoxAdapter,this)}consolidate(){}clone(e){let t=this.observableOptPlayMode.map(n=>n.clone());tc.create(le(this,$s,"f").boxGraph,w.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.gain.setValue(this.gain.getValue()),n.timeBase.setValue(this.timeBase),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer(le(this,yt,"f").clips.targetVertex.unwrap()),n.file.refer(le(this,yt,"f").file.targetVertex.unwrap()),n.events.refer(le(this,yt,"f").events.targetVertex.unwrap()),t.ifSome(i=>n.playMode.refer(i))})}onSelected(){le(this,Ms,"f").setValue(!0)}onDeselected(){le(this,Ms,"f").setValue(!1)}get isSelected(){return le(this,Ms,"f").getValue()}get box(){return le(this,yt,"f")}get uuid(){return le(this,yt,"f").address.uuid}get address(){return le(this,yt,"f").address}get indexField(){return le(this,yt,"f").index}get duration(){return le(this,Ap,"f").toPPQN(0)}set duration(e){le(this,Ap,"f").fromPPQN(e,0)}get mute(){return le(this,yt,"f").mute.getValue()}get hue(){return le(this,yt,"f").hue.getValue()}get gain(){return le(this,yt,"f").gain}get file(){return le(this,Ts,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return le(this,Ds,"f")}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return m.None}get timeBase(){return vi(le(this,yt,"f").timeBase.getValue(),Mr)}get waveformOffset(){return le(this,yt,"f").waveformOffset}get isPlayModeNoStretch(){return le(this,yt,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>Ke(e,Rn)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Ke(e,On)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>Cn.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(le(this,Ts,"f").isEmpty())return"No Audio File";let e=le(this,Ts,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):le(this,yt,"f").label.getValue()}get trackBoxAdapter(){return le(this,_p,"f")?m.None:le(this,yt,"f").clips.targetVertex.map(e=>le(this,$s,"f").boxAdapters.adapterFor(e.box,_t))}get isMirrowed(){return!1}get canMirror(){return!1}get canResize(){return le(this,Ds,"f").nonEmpty()}terminate(){le(this,Pc,"f").ifSome(e=>e.terminate()),ei(this,Pc,m.None,"f"),le(this,Sc,"f").terminate(),ei(this,Sc,q.Empty,"f"),le(this,_c,"f").terminate()}toString(){return`{AudioClipBoxAdapter ${w.toString(le(this,yt,"f").address.uuid)} d: ${G.toString(this.duration)}}`}};_c=new WeakMap,$s=new WeakMap,yt=new WeakMap,Ds=new WeakMap,Ms=new WeakMap,Ap=new WeakMap,Pp=new WeakMap,_p=new WeakMap,Ts=new WeakMap,Pc=new WeakMap,Sc=new WeakMap,Ns=new WeakSet,Ec=function(){le(this,Pp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Sp=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Bt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Fc,Wt,Pg,Ep,Cs=class r{constructor(e,t){this.type="note-event",Fc.set(this,void 0),Wt.set(this,void 0),Pg.set(this,void 0),Ep.set(this,!1),Sp(this,Fc,e,"f"),Sp(this,Wt,t,"f"),Sp(this,Pg,Bt(this,Wt,"f").subscribe(ke.Children,n=>{if(!this.collection.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.collection.unwrap(),o=n.address.fieldKeys,a=O.equals(Bt(this,Wt,"f").pitch.address.fieldKeys,o),s=O.equals(Bt(this,Wt,"f").position.address.fieldKeys,o);a||s?i.requestSorting():i.onEventPropertyChanged()}}),"f")}onSelected(){Sp(this,Ep,!0,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}onDeselected(){Sp(this,Ep,!1,"f"),this.collection.ifSome(e=>e.onEventPropertyChanged())}terminate(){Bt(this,Pg,"f").terminate()}get box(){return Bt(this,Wt,"f")}get uuid(){return Bt(this,Wt,"f").address.uuid}get address(){return Bt(this,Wt,"f").address}get position(){return Bt(this,Wt,"f").position.getValue()}get duration(){return Bt(this,Wt,"f").duration.getValue()}get complete(){return this.position+this.duration}get velocity(){return Bt(this,Wt,"f").velocity.getValue()}get pitch(){return Bt(this,Wt,"f").pitch.getValue()}get cent(){return Bt(this,Wt,"f").cent.getValue()}get chance(){return Bt(this,Wt,"f").chance.getValue()}get playCount(){return Bt(this,Wt,"f").playCount.getValue()}get playCurve(){return Bt(this,Wt,"f").playCurve.getValue()}get isSelected(){return Bt(this,Ep,"f")}get collection(){return Bt(this,Wt,"f").events.targetVertex.map(e=>Bt(this,Fc,"f").boxAdapters.adapterFor(e.box,wi))}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 Bt(this,Fc,"f").boxAdapters.adapterFor(Qo.create(Bt(this,Fc,"f").boxGraph,w.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 cr.curveFunc(e,this.playCurve)}canConsolidate(){return this.playCount>1}consolidate(){let e=this.playCount,t=this.collection.unwrap().box.events,n=O.create(i=>{let o=Math.floor(this.computeCurveValue(i/e)*this.duration),a=Math.floor(this.computeCurveValue((i+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 Bt(this,Wt,"f").delete(),n}};Fc=new WeakMap,Wt=new WeakMap,Pg=new WeakMap,Ep=new WeakMap;var Vn=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},be=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Fo,Fp,ga,nn,Rs,Bp,ti,Eg,Fg,Bg,va,Sg,Ip,wi=class r{constructor(e,t){Fo.add(this),Fp.set(this,new R),ga.set(this,void 0),nn.set(this,void 0),Rs.set(this,void 0),Bp.set(this,void 0),ti.set(this,void 0),Eg.set(this,60),Fg.set(this,60),Bg.set(this,0),va.set(this,!1),Vn(this,ga,e,"f"),Vn(this,nn,t,"f"),Vn(this,Rs,new te,"f"),Vn(this,Bp,w.newSet(n=>n.uuid),"f"),Vn(this,ti,Dr.create(cr.Comparator),"f"),be(this,Fp,"f").own(be(this,nn,"f").events.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=be(this,ga,"f").boxAdapters.adapterFor(n,Cs);be(this,Bp,"f").add(i)&&(be(this,ti,"f").add(i),be(this,Fo,"m",Sg).call(this))},onRemoved:({box:{address:{uuid:n}}})=>{be(this,ti,"f").remove(be(this,Bp,"f").removeByKey(n)),be(this,Fo,"m",Sg).call(this)}})),be(this,Fp,"f").own(be(this,nn,"f").owners.pointerHub.subscribe({onAdded:()=>be(this,Rs,"f").notify(this),onRemoved:()=>be(this,Rs,"f").notify(this)}))}copy(){let e=be(this,ga,"f").boxGraph,t=wo.create(e,w.generate());return be(this,ti,"f").asArray().forEach(n=>n.copyTo({events:t.events})),be(this,ga,"f").boxAdapters.adapterFor(t,r)}createEvent({position:e,duration:t,velocity:n,pitch:i,chance:o,playCount:a,cent:s}){return be(this,ga,"f").boxAdapters.adapterFor(Qo.create(be(this,ga,"f").boxGraph,w.generate(),l=>{l.position.setValue(e),l.duration.setValue(t),l.velocity.setValue(n),l.pitch.setValue(i),l.chance.setValue(o),l.playCount.setValue(a),l.cent.setValue(s),l.events.refer(be(this,nn,"f").events)}),Cs)}subscribeChange(e){return be(this,Rs,"f").subscribe(e)}selectable(){return be(this,ti,"f").asArray()}selectableAt(e){for(let t of be(this,ti,"f").asArray())if(t.position<=e.u&&e.u<t.complete&&t.pitch===e.v)return Ye.one(t);return Ye.empty()}selectablesBetween(e,t){let n=[],i=be(this,ti,"f").asArray(),o=be(this,ti,"f").ceilFirstIndex(t.u);for(let a=0;a<o;a++){let s=i[a];s.complete>e.u&&s.pitch>=e.v&&s.pitch<=t.v&&n.push(s)}return n}requestSorting(){be(this,ti,"f").onIndexingChanged(),this.onEventPropertyChanged()}onEventPropertyChanged(){be(this,Fo,"m",Sg).call(this)}terminate(){be(this,Fp,"f").terminate()}get box(){return be(this,nn,"f")}get uuid(){return be(this,nn,"f").address.uuid}get address(){return be(this,nn,"f").address}get numOwners(){return be(this,nn,"f").owners.pointerHub.filter(c.NoteEventCollection).length}get events(){return be(this,va,"f")||be(this,Fo,"m",Ip).call(this),be(this,ti,"f")}get minPitch(){return be(this,va,"f")||be(this,Fo,"m",Ip).call(this),be(this,Eg,"f")}get maxPitch(){return be(this,va,"f")||be(this,Fo,"m",Ip).call(this),be(this,Fg,"f")}get maxDuration(){return be(this,va,"f")||be(this,Fo,"m",Ip).call(this),be(this,Bg,"f")}toString(){return`{NoteEventCollectionBox ${w.toString(be(this,nn,"f").address.uuid)}}`}};Fp=new WeakMap,ga=new WeakMap,nn=new WeakMap,Rs=new WeakMap,Bp=new WeakMap,ti=new WeakMap,Eg=new WeakMap,Fg=new WeakMap,Bg=new WeakMap,va=new WeakMap,Fo=new WeakSet,Sg=function(){Vn(this,va,!1,"f"),be(this,Rs,"f").notify(this)},Ip=function(){let e=127,t=0,n=0;be(this,ti,"f").asArray().forEach(({pitch:i,duration:o})=>{e=Math.min(e,i),t=Math.max(t,i),n=Math.max(n,o)}),Vn(this,Eg,e,"f"),Vn(this,Fg,t,"f"),Vn(this,Bg,n,"f"),Vn(this,va,!0,"f")};var Os=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},$e=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Vs,Bc,zs,Ct,Us,$p,kp,Np,Ic,kc=class{constructor(e,t){Vs.add(this),this.type="note-clip",Bc.set(this,new R),zs.set(this,void 0),Ct.set(this,void 0),Us.set(this,void 0),$p.set(this,void 0),kp.set(this,void 0),Np.set(this,q.Empty),Os(this,zs,e,"f"),Os(this,Ct,t,"f"),Os(this,kp,!0,"f"),Os(this,Us,$e(this,Bc,"f").own(new Qr(!1)),"f"),Os(this,$p,$e(this,Bc,"f").own(new te),"f"),$e(this,Bc,"f").ownAll($e(this,Ct,"f").pointerHub.subscribe({onAdded:()=>$e(this,Vs,"m",Ic).call(this),onRemoved:()=>$e(this,Vs,"m",Ic).call(this)}),$e(this,Ct,"f").subscribe(ke.Children,n=>$e(this,Vs,"m",Ic).call(this)),$e(this,Ct,"f").events.catchupAndSubscribe(({targetVertex:n})=>{$e(this,Np,"f").terminate(),Os(this,Np,n.match({none:()=>q.Empty,some:({box:i})=>$e(this,zs,"f").boxAdapters.adapterFor(i,wi).subscribeChange(()=>$e(this,Vs,"m",Ic).call(this))}),"f"),$e(this,Vs,"m",Ic).call(this)})),Os(this,kp,!1,"f")}catchupAndSubscribeSelected(e){return $e(this,Us,"f").catchupAndSubscribe(e)}subscribeChange(e){return $e(this,$p,"f").subscribe(e)}accept(e){return P(e.visitNoteClipBoxAdapter,this)}consolidate(){this.isMirrowed&&$e(this,Ct,"f").events.refer(this.optCollection.unwrap().copy().box.owners)}clone(e){let t=e?this.optCollection.unwrap().copy().box.owners:$e(this,Ct,"f").events.targetVertex.unwrap();Xl.create($e(this,zs,"f").boxGraph,w.generate(),n=>{n.index.setValue(this.indexField.getValue()),n.label.setValue(this.label),n.hue.setValue(this.hue),n.duration.setValue(this.duration),n.mute.setValue(this.mute),n.clips.refer($e(this,Ct,"f").clips.targetVertex.unwrap()),n.events.refer(t)})}onSelected(){$e(this,Us,"f").setValue(!0)}onDeselected(){$e(this,Us,"f").setValue(!1)}get isSelected(){return $e(this,Us,"f").getValue()}terminate(){$e(this,Np,"f").terminate(),$e(this,Bc,"f").terminate()}get box(){return $e(this,Ct,"f")}get uuid(){return $e(this,Ct,"f").address.uuid}get address(){return $e(this,Ct,"f").address}get indexField(){return $e(this,Ct,"f").index}get duration(){return $e(this,Ct,"f").duration.getValue()}get mute(){return $e(this,Ct,"f").mute.getValue()}get hue(){return $e(this,Ct,"f").hue.getValue()}get events(){return this.optCollection.map(e=>e.events)}get hasCollection(){return!this.optCollection.isEmpty()}get optCollection(){return $e(this,Ct,"f").events.targetVertex.map(e=>$e(this,zs,"f").boxAdapters.adapterFor(e.box,wi))}get label(){return $e(this,Ct,"f").label.getValue()}get trackBoxAdapter(){return $e(this,kp,"f")?m.None:$e(this,Ct,"f").clips.targetVertex.map(e=>$e(this,zs,"f").boxAdapters.adapterFor(e.box,_t))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}toString(){return`{NoteClipBoxAdapter ${w.toString($e(this,Ct,"f").address.uuid)} d: ${G.toString(this.duration)}}`}};Bc=new WeakMap,zs=new WeakMap,Ct=new WeakMap,Us=new WeakMap,$p=new WeakMap,kp=new WeakMap,Np=new WeakMap,Vs=new WeakSet,Ic=function(){$e(this,$p,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.clips?.dispatchChange()};var Ig={for:(r,e)=>se(e.accept({visitNoteClipBox:t=>r.adapterFor(t,kc),visitValueClipBox:t=>r.adapterFor(t,ha),visitAudioClipBox:t=>r.adapterFor(t,ma)}),"")};var kg=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ya=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ng,Nc,Dp,Mp,$g=class{constructor(e,t){Ng.set(this,void 0),Nc.set(this,void 0),Dp.set(this,void 0),Mp.set(this,void 0),kg(this,Ng,e,"f"),kg(this,Nc,new R,"f"),kg(this,Dp,ya(this,Nc,"f").own(new te),"f"),kg(this,Mp,ya(this,Nc,"f").own(Kt.create(e.box.clips,n=>Ig.for(t,n),c.ClipCollection)),"f"),ya(this,Mp,"f").subscribe({onAdd:()=>this.dispatchChange(),onRemove:()=>this.dispatchChange(),onReorder:()=>this.dispatchChange()})}get trackBoxAdapter(){return ya(this,Ng,"f")}get collection(){return ya(this,Mp,"f")}dispatchChange(){ya(this,Dp,"f").notify()}subscribeChanges(e){return ya(this,Dp,"f").subscribe(e)}terminate(){ya(this,Nc,"f").terminate()}};Ng=new WeakMap,Nc=new WeakMap,Dp=new WeakMap,Mp=new WeakMap;var Pt=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},H=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ri,Tp,zn,Xe,$c,Dc,Mc,js,Cp,Rp,Ls,Tc,Cc,Rc,Oc,Vc,Ai,xa=class r{constructor(e,t){ri.add(this),this.type="audio-region",Tp.set(this,void 0),zn.set(this,void 0),Xe.set(this,void 0),$c.set(this,void 0),Dc.set(this,void 0),Mc.set(this,void 0),js.set(this,void 0),Cp.set(this,void 0),Rp.set(this,void 0),Ls.set(this,m.None),Tc.set(this,q.Empty),Cc.set(this,q.Empty),Rc.set(this,q.Empty),Oc.set(this,q.Empty),Vc.set(this,void 0),Pt(this,zn,e,"f"),Pt(this,Xe,t,"f"),Pt(this,Tp,new R,"f");let{timeBase:n,duration:i,loopOffset:o,loopDuration:a}=t;Pt(this,$c,Ho.aware(e.tempoMap,n,i),"f"),Pt(this,Dc,Ho.aware(e.tempoMap,n,o),"f"),Pt(this,Mc,Ho.aware(e.tempoMap,n,a),"f"),Pt(this,js,new $r,"f"),Pt(this,Cp,new te,"f"),Pt(this,Vc,!1,"f"),Pt(this,Rp,!0,"f"),H(this,Tp,"f").ownAll(H(this,Xe,"f").pointerHub.subscribe({onAdded:()=>H(this,ri,"m",Ai).call(this),onRemoved:()=>H(this,ri,"m",Ai).call(this)}),H(this,Xe,"f").file.catchupAndSubscribe(s=>{Pt(this,Ls,s.targetVertex.map(l=>H(this,zn,"f").boxAdapters.adapterFor(l.box,tn)),"f"),H(this,Tc,"f").terminate(),Pt(this,Tc,H(this,Ls,"f").mapOr(l=>l.getOrCreateLoader().subscribe(()=>H(this,ri,"m",Ai).call(this)),q.Empty),"f")}),H(this,Xe,"f").playMode.catchupAndSubscribe(({targetVertex:s})=>{H(this,Cc,"f").terminate(),s.match({none:()=>H(this,js,"f").clear(),some:({box:l})=>{let u=H(this,zn,"f").boxAdapters.adapterFor(l,Cn.isAudioPlayMode);Pt(this,Cc,u.subscribe(()=>H(this,ri,"m",Ai).call(this)),"f"),H(this,js,"f").wrap(u)}})}),H(this,Xe,"f").timeBase.catchupAndSubscribe(s=>{H(this,Rc,"f").terminate(),vi(s.getValue(),Mr)===Mr.Seconds&&Pt(this,Rc,e.tempoMap.subscribe(()=>H(this,ri,"m",Ai).call(this)),"f")}),H(this,Xe,"f").subscribe(ke.Children,s=>{if(!this.trackBoxAdapter.isEmpty()&&(s.type==="primitive"||s.type==="pointer")){let l=this.trackBoxAdapter.unwrap();H(this,Xe,"f").position.address.equals(s.address)?(l.regions.onIndexingChanged(),H(this,ri,"m",Ai).call(this)):H(this,ri,"m",Ai).call(this)}}),H(this,Xe,"f").events.catchupAndSubscribe(({targetVertex:s})=>{H(this,Oc,"f").terminate(),Pt(this,Oc,s.match({none:()=>q.Empty,some:({box:l})=>H(this,zn,"f").boxAdapters.adapterFor(l,tr).subscribeChange(()=>H(this,ri,"m",Ai).call(this))}),"f"),H(this,ri,"m",Ai).call(this)})),Pt(this,Rp,!1,"f")}subscribeChange(e){return H(this,Cp,"f").subscribe(e)}accept(e){return P(e.visitAudioRegionBoxAdapter,this)}onSelected(){Pt(this,Vc,!0,"f"),H(this,ri,"m",Ai).call(this)}onDeselected(){Pt(this,Vc,!1,"f"),H(this,ri,"m",Ai).call(this)}get isSelected(){return H(this,Vc,"f")}get box(){return H(this,Xe,"f")}get uuid(){return H(this,Xe,"f").address.uuid}get address(){return H(this,Xe,"f").address}get position(){return H(this,Xe,"f").position.getValue()}get duration(){return H(this,$c,"f").toPPQN(this.position)}get complete(){return this.position+this.duration}get loopOffset(){return H(this,Dc,"f").toPPQN(this.position)}get loopDuration(){return H(this,Mc,"f").toPPQN(this.position)}resolveDuration(e){return H(this,$c,"f").toPPQN(e)}resolveComplete(e){return e+this.resolveDuration(e)}resolveLoopOffset(e){return H(this,Dc,"f").toPPQN(e)}resolveLoopDuration(e){return H(this,Mc,"f").toPPQN(e)}get offset(){return this.position-this.loopOffset}get mute(){return H(this,Xe,"f").mute.getValue()}get hue(){return H(this,Xe,"f").hue.getValue()}get gain(){return H(this,Xe,"f").gain}get file(){return H(this,Ls,"f").unwrap("Cannot access file.")}get observableOptPlayMode(){return H(this,js,"f")}get timeBase(){return vi(H(this,Xe,"f").timeBase.getValue(),Mr)}get waveformOffset(){return H(this,Xe,"f").waveformOffset}get isPlayModeNoStretch(){return H(this,Xe,"f").playMode.isEmpty()}get asPlayModePitchStretch(){return this.observableOptPlayMode.map(e=>Ke(e,Rn)?e:null)}get asPlayModeTimeStretch(){return this.observableOptPlayMode.map(e=>Ke(e,On)?e:null)}get optWarpMarkers(){return this.observableOptPlayMode.map(e=>Cn.isAudioPlayMode(e)?e.warpMarkers:null)}get label(){if(H(this,Ls,"f").isEmpty())return"No Audio File";let e=H(this,Ls,"f").unwrap().getOrCreateLoader().state;return e.type==="progress"?`${Math.round(e.progress*100)}%`:e.type==="error"?String(e.reason):H(this,Xe,"f").label.getValue()}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return H(this,js,"f").nonEmpty()}get trackBoxAdapter(){return H(this,Xe,"f").regions.targetVertex.map(e=>H(this,zn,"f").boxAdapters.adapterFor(e.box,_t))}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return H(this,Xe,"f").events.targetVertex.map(e=>H(this,zn,"f").boxAdapters.adapterFor(e.box,tr))}set position(e){H(this,Xe,"f").position.setValue(e)}set duration(e){H(this,$c,"f").fromPPQN(e,this.position)}set loopOffset(e){H(this,Dc,"f").fromPPQN(e,this.position)}set loopDuration(e){H(this,Mc,"f").fromPPQN(e,this.position)}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?t.copy().box.owners:t.box.owners,i=this.observableOptPlayMode.map(a=>a.clone()),o=H(this,zn,"f").boxAdapters.adapterFor(ea.create(H(this,zn,"f").boxGraph,w.generate(),a=>{a.timeBase.setValue(H(this,Xe,"f").timeBase.getValue()),a.position.setValue(e?.position??H(this,Xe,"f").position.getValue()),a.regions.refer(e?.track??H(this,Xe,"f").regions.targetVertex.unwrap()),a.file.refer(H(this,Xe,"f").file.targetVertex.unwrap()),a.events.refer(n),a.mute.setValue(this.mute),a.hue.setValue(this.hue),a.label.setValue(this.label),a.gain.setValue(this.gain.getValue()),a.waveformOffset.setValue(this.waveformOffset.getValue()),i.ifSome(s=>a.playMode.refer(s))}),r);return o.duration=e?.duration??this.resolveDuration(o.position),o.loopOffset=e?.loopOffset??this.resolveLoopOffset(o.position),o.loopDuration=e?.loopDuration??this.resolveLoopDuration(o.position),o}consolidate(){}canFlatten(e){return!1}flatten(e){return m.None}terminate(){H(this,Tc,"f").terminate(),Pt(this,Tc,q.Empty,"f"),H(this,Rc,"f").terminate(),Pt(this,Rc,q.Empty,"f"),H(this,Cc,"f").terminate(),Pt(this,Cc,q.Empty,"f"),H(this,Oc,"f").terminate(),Pt(this,Oc,q.Empty,"f"),H(this,Tp,"f").terminate()}toString(){return`{AudioRegionBoxAdapter ${w.toString(H(this,Xe,"f").address.uuid)}}`}};Tp=new WeakMap,zn=new WeakMap,Xe=new WeakMap,$c=new WeakMap,Dc=new WeakMap,Mc=new WeakMap,js=new WeakMap,Cp=new WeakMap,Rp=new WeakMap,Ls=new WeakMap,Tc=new WeakMap,Cc=new WeakMap,Rc=new WeakMap,Oc=new WeakMap,Vc=new WeakMap,ri=new WeakSet,Ai=function(){H(this,Rp,"f")||(H(this,Cp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange())};var Bo=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},we=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Un,Dg,jn,ot,zp,Op,zc,Vp,Io,ba=class r{constructor(e,t){Un.add(this),this.type="note-region",Dg.set(this,new R),jn.set(this,void 0),ot.set(this,void 0),zp.set(this,void 0),Op.set(this,void 0),zc.set(this,void 0),Vp.set(this,q.Empty),Bo(this,jn,e,"f"),Bo(this,ot,t,"f"),Bo(this,zp,new te,"f"),Bo(this,zc,!1,"f"),Bo(this,Op,!0,"f"),we(this,Dg,"f").ownAll(we(this,ot,"f").pointerHub.subscribe({onAdded:()=>we(this,Un,"m",Io).call(this),onRemoved:()=>we(this,Un,"m",Io).call(this)}),we(this,ot,"f").subscribe(ke.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();we(this,ot,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),we(this,Un,"m",Io).call(this)):we(this,Un,"m",Io).call(this)}}),we(this,ot,"f").events.catchupAndSubscribe(({targetVertex:n})=>{we(this,Vp,"f").terminate(),Bo(this,Vp,n.match({none:()=>q.Empty,some:({box:i})=>we(this,jn,"f").boxAdapters.adapterFor(i,wi).subscribeChange(()=>we(this,Un,"m",Io).call(this))}),"f"),we(this,Un,"m",Io).call(this)})),Bo(this,Op,!1,"f")}set position(e){we(this,ot,"f").position.setValue(e)}set duration(e){we(this,ot,"f").duration.setValue(e)}set loopOffset(e){we(this,ot,"f").loopOffset.setValue(e)}set loopDuration(e){we(this,ot,"f").loopDuration.setValue(e)}subscribeChange(e){return we(this,zp,"f").subscribe(e)}accept(e){return P(e.visitNoteRegionBoxAdapter,this)}onSelected(){Bo(this,zc,!0,"f"),we(this,Un,"m",Io).call(this)}onDeselected(){Bo(this,zc,!1,"f"),we(this,Un,"m",Io).call(this)}get isSelected(){return we(this,zc,"f")}*iterateActiveNotesAt(e){let t=this.optCollection;if(t.isEmpty())return;let n=t.unwrap(),i=lr.globalToLocal(this,e);for(let o of n.events.iterateFrom(i-n.maxDuration)){if(i<o.position)return;i<o.complete&&(yield o.copyAsNoteEvent())}}terminate(){we(this,Vp,"f").terminate(),we(this,Dg,"f").terminate()}get box(){return we(this,ot,"f")}get uuid(){return we(this,ot,"f").address.uuid}get address(){return we(this,ot,"f").address}get position(){return we(this,ot,"f").position.getValue()}get duration(){return we(this,ot,"f").duration.getValue()}get loopOffset(){return we(this,ot,"f").loopOffset.getValue()}get loopDuration(){return we(this,ot,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}resolveDuration(e){return this.duration}resolveComplete(e){return e+this.duration}resolveLoopOffset(e){return this.loopOffset}resolveLoopDuration(e){return this.loopDuration}get mute(){return we(this,ot,"f").mute.getValue()}get hue(){return we(this,ot,"f").hue.getValue()}get hasCollection(){return this.optCollection.nonEmpty()}get optCollection(){return we(this,ot,"f").events.targetVertex.map(e=>we(this,jn,"f").boxAdapters.adapterFor(e.box,wi))}get label(){return we(this,ot,"f").label.getValue()}get trackBoxAdapter(){return we(this,Op,"f")?m.None:we(this,ot,"f").regions.targetVertex.map(e=>we(this,jn,"f").boxAdapters.adapterFor(e.box,_t))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return we(this,jn,"f").boxAdapters.adapterFor(xs.create(we(this,jn,"f").boxGraph,w.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.track??we(this,ot,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.optCollection.ifSome(e=>{let t=we(this,jn,"f").boxGraph,n=wo.create(t,w.generate());e.events.asArray().forEach(i=>i.copyTo({events:n.events})),we(this,ot,"f").events.refer(n.owners)})}canFlatten(e){return e.length>0&&O.satisfy(e,(t,n)=>t.trackBoxAdapter.contains(n.trackBoxAdapter.unwrap()))&&e.every(t=>t.isSelected&&t instanceof r)}flatten(e){if(!this.canFlatten(e))return m.None;let t=we(this,jn,"f").boxGraph,n=e.toSorted(qo.Comparator),i=O.getFirst(n,"Internal error (no first)"),o=O.getLast(n,"Internal error (no last)"),a=i.position,s=o.position+o.duration,l=i.trackBoxAdapter.unwrap(),u=wo.create(t,w.generate()),d=Array.from(l.regions.collection.iterateRange(a,s));return d.filter(p=>p.isSelected).forEach(p=>{let h=p;for(let{resultStart:g,resultEnd:v,rawStart:y}of lr.locateLoops(h,h.position,h.complete)){let x=Math.floor(g-y),$=Math.floor(v-y);for(let M of h.optCollection.unwrap().events.iterateRange(x,$))M.copyTo({position:M.position+y-i.position,events:u.events})}}),d.forEach(({box:p})=>p.delete()),m.wrap(xs.create(t,w.generate(),p=>{p.position.setValue(a),p.duration.setValue(s-a),p.loopDuration.setValue(s-a),p.loopOffset.setValue(0),p.hue.setValue(this.hue),p.mute.setValue(this.mute),p.label.setValue(this.label),p.events.refer(u.owners),p.regions.refer(l.box.regions)}))}toString(){return`{NoteRegionBoxAdapter ${w.toString(we(this,ot,"f").address.uuid)} p: ${G.toString(this.position)}, c: ${G.toString(this.complete)}}`}};Dg=new WeakMap,jn=new WeakMap,ot=new WeakMap,zp=new WeakMap,Op=new WeakMap,zc=new WeakMap,Vp=new WeakMap,Un=new WeakSet,Io=function(){we(this,zp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var ko=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},fe=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},on,Uc,Ln,at,Lp,jc,Up,jp,Kn,No=class r{constructor(e,t){on.add(this),this.type="value-region",Uc.set(this,new R),Ln.set(this,void 0),at.set(this,void 0),Lp.set(this,void 0),jc.set(this,void 0),Up.set(this,void 0),jp.set(this,q.Empty),ko(this,Ln,e,"f"),ko(this,at,t,"f"),ko(this,Up,!0,"f"),ko(this,Lp,new te,"f"),ko(this,jc,!1,"f"),fe(this,Uc,"f").own(fe(this,at,"f").pointerHub.subscribe({onAdded:()=>fe(this,on,"m",Kn).call(this),onRemoved:()=>fe(this,on,"m",Kn).call(this)})),fe(this,Uc,"f").own(fe(this,at,"f").subscribe(ke.Children,n=>{if(!this.trackBoxAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackBoxAdapter.unwrap();fe(this,at,"f").position.address.equals(n.address)?(i.regions.onIndexingChanged(),fe(this,on,"m",Kn).call(this)):fe(this,on,"m",Kn).call(this)}})),fe(this,Uc,"f").own(fe(this,at,"f").events.catchupAndSubscribe(({targetVertex:n})=>{fe(this,jp,"f").terminate(),ko(this,jp,n.match({none:()=>q.Empty,some:({box:i})=>fe(this,Ln,"f").boxAdapters.adapterFor(i,tr).subscribeChange(()=>fe(this,on,"m",Kn).call(this))}),"f"),fe(this,on,"m",Kn).call(this)})),ko(this,Up,!1,"f")}valueAt(e,t){let n=this.optCollection;return n.isEmpty()?t:n.unwrap().valueAt(lr.globalToLocal(this,e),t)}incomingValue(e){return this.valueAt(this.position,e)}outgoingValue(e){let t=this.optCollection;if(t.isEmpty())return e;let n=t.unwrap();return(this.complete-this.offset)%this.loopDuration===0?n.valueAt(this.loopDuration,e):n.valueAt(lr.globalToLocal(this,this.complete),e)}subscribeChange(e){return fe(this,Lp,"f").subscribe(e)}accept(e){return P(e.visitValueRegionBoxAdapter,this)}onSelected(){ko(this,jc,!0,"f"),fe(this,on,"m",Kn).call(this)}onDeselected(){ko(this,jc,!1,"f"),fe(this,on,"m",Kn).call(this)}get isSelected(){return fe(this,jc,"f")}onValuesPropertyChanged(){fe(this,on,"m",Kn).call(this)}onValuesSortingChanged(){this.onValuesPropertyChanged()}terminate(){fe(this,jp,"f").terminate(),fe(this,Uc,"f").terminate()}get box(){return fe(this,at,"f")}get uuid(){return fe(this,at,"f").address.uuid}get address(){return fe(this,at,"f").address}get position(){return fe(this,at,"f").position.getValue()}get duration(){return fe(this,at,"f").duration.getValue()}get loopOffset(){return fe(this,at,"f").loopOffset.getValue()}get loopDuration(){return fe(this,at,"f").loopDuration.getValue()}get offset(){return this.position-this.loopOffset}get complete(){return this.position+this.duration}resolveDuration(e){return this.duration}resolveComplete(e){return e+this.duration}resolveLoopOffset(e){return this.loopOffset}resolveLoopDuration(e){return this.loopDuration}get mute(){return fe(this,at,"f").mute.getValue()}get hue(){return fe(this,at,"f").hue.getValue()}get hasCollection(){return!this.optCollection.isEmpty()}get events(){return this.optCollection.map(e=>e.events)}get optCollection(){return fe(this,at,"f").events.targetVertex.map(e=>fe(this,Ln,"f").boxAdapters.adapterFor(e.box,tr))}get label(){return fe(this,at,"f").label.getValue()}get trackBoxAdapter(){return fe(this,Up,"f")?m.None:fe(this,at,"f").regions.targetVertex.map(e=>fe(this,Ln,"f").boxAdapters.adapterFor(e.box,_t))}get isMirrowed(){return this.optCollection.mapOr(e=>e.numOwners>1,!1)}get canMirror(){return!0}get canResize(){return!0}set position(e){fe(this,at,"f").position.setValue(e)}set duration(e){fe(this,at,"f").duration.setValue(e)}set loopOffset(e){fe(this,at,"f").loopOffset.setValue(e)}set loopDuration(e){fe(this,at,"f").loopDuration.setValue(e)}copyTo(e){let t=this.optCollection.unwrap("Cannot make copy without event-collection"),n=e?.consolidate===!0?t.copy().box.owners:t.box.owners;return fe(this,Ln,"f").boxAdapters.adapterFor(bs.create(fe(this,Ln,"f").boxGraph,w.generate(),i=>{i.position.setValue(e?.position??this.position),i.duration.setValue(e?.duration??this.duration),i.loopOffset.setValue(e?.loopOffset??this.loopOffset),i.loopDuration.setValue(e?.loopDuration??this.loopDuration),i.hue.setValue(this.hue),i.label.setValue(this.label),i.mute.setValue(this.mute),i.events.refer(n),i.regions.refer(e?.track??fe(this,at,"f").regions.targetVertex.unwrap())}),r)}consolidate(){this.isMirrowed&&this.events.ifSome(e=>{let t=fe(this,Ln,"f").boxGraph,n=Ji.create(t,w.generate());e.asArray().forEach(i=>i.copyTo({events:n.events})),fe(this,at,"f").events.refer(n.owners)})}canFlatten(e){return!1}flatten(e){if(!this.canFlatten(e))return m.None;let t=fe(this,Ln,"f").boxGraph,n=e.toSorted(qo.Comparator),i=O.getFirst(n,"Internal error (no first)"),o=O.getLast(n,"Internal error (no last)"),a=i.position,s=o.position+o.duration,l=i.trackBoxAdapter.unwrap(),u=Ji.create(t,w.generate()),d=Array.from(l.regions.collection.iterateRange(a,s));return d.filter(p=>p.isSelected).forEach(p=>{let h=p;for(let{resultStart:g,resultEnd:v,rawStart:y}of lr.locateLoops(h,h.position,h.complete)){let x=Math.floor(g-y),$=Math.floor(v-y);for(let M of h.events.unwrap().iterateRange(x,$));}}),d.forEach(({box:p})=>p.delete()),m.wrap(bs.create(t,w.generate(),p=>{p.position.setValue(a),p.duration.setValue(s-a),p.loopDuration.setValue(s-a),p.loopOffset.setValue(0),p.hue.setValue(this.hue),p.mute.setValue(this.mute),p.label.setValue(this.label),p.events.refer(u.owners),p.regions.refer(l.box.regions)}))}toString(){return`{ValueRegionBoxAdapter ${w.toString(fe(this,at,"f").address.uuid)} p: ${G.toString(this.position)}, c: ${G.toString(this.complete)}}`}};Uc=new WeakMap,Ln=new WeakMap,at=new WeakMap,Lp=new WeakMap,jc=new WeakMap,Up=new WeakMap,jp=new WeakMap,on=new WeakSet,Kn=function(){fe(this,Lp,"f").notify(),this.trackBoxAdapter.unwrapOrNull()?.regions?.dispatchChange()};var wE=(r,e)=>r.position-e.position,AE={for:(r,e)=>se(e.accept({visitNoteRegionBox:t=>r.adapterFor(t,ba),visitAudioRegionBox:t=>r.adapterFor(t,xa),visitValueRegionBox:t=>r.adapterFor(t,No)}),"")};var Lc=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Xt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Kp,Ks,Wp,Kc,Ws,Wc,Mg=class{constructor(e,t){Kp.set(this,void 0),Ks.set(this,void 0),Wp.set(this,void 0),Kc.set(this,void 0),Ws.set(this,void 0),Wc.set(this,void 0),Lc(this,Kp,e,"f"),Lc(this,Ks,new R,"f"),Lc(this,Wp,Xt(this,Ks,"f").own(new te),"f"),Lc(this,Kc,Xt(this,Ks,"f").own(new jt),"f"),Lc(this,Ws,qo.create(wE),"f"),Lc(this,Wc,w.newSet(n=>n.uuid),"f"),Xt(this,Ks,"f").ownAll(Xt(this,Kp,"f").box.regions.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{let i=AE.for(t,n),o=Xt(this,Wc,"f").add(i);T(o,`Cannot add ${n}`),Xt(this,Ws,"f").add(i),Xt(this,Kc,"f").forEach(a=>a.onAdded(i)),this.dispatchChange()},onRemoved:({box:{address:{uuid:n}}})=>{let i=Xt(this,Wc,"f").removeByKey(n);Xt(this,Ws,"f").remove(i),Xt(this,Kc,"f").forEach(o=>o.onRemoved(i)),this.dispatchChange()}},c.RegionCollection))}get trackBoxAdapter(){return Xt(this,Kp,"f")}get collection(){return Xt(this,Ws,"f")}get adapters(){return Xt(this,Wc,"f")}onIndexingChanged(){Xt(this,Ws,"f").onIndexingChanged(),this.dispatchChange()}catchupAndSubscribe(e){return this.collection.asArray().forEach(e.onAdded),Xt(this,Kc,"f").subscribe(e)}subscribeChanges(e){return Xt(this,Wp,"f").subscribe(e)}dispatchChange(){Xt(this,Wp,"f").notify()}terminate(){Xt(this,Ks,"f").terminate()}};Kp=new WeakMap,Ks=new WeakMap,Wp=new WeakMap,Kc=new WeakMap,Ws=new WeakMap,Wc=new WeakMap;var oe;(function(r){r[r.Undefined=0]="Undefined",r[r.Notes=1]="Notes",r[r.Audio=2]="Audio",r[r.Value=3]="Value"})(oe||(oe={}));(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 Oe.Waveform;case r.Notes:return Oe.Piano;case r.Value:return Oe.Automation;case r.Undefined:return Oe.AudioBus;default:return Oe.Unknown}}})(oe||(oe={}));var Tg;(function(r){r.isDeviceBox=e=>"host"in e&&Ke(e.host,F)&&"label"in e&&Ke(e.label,D)&&"enabled"in e&&Ke(e.enabled,k)&&"minimized"in e&&Ke(e.minimized,k),r.isInstrumentDeviceBox=e=>r.isDeviceBox(e)&&e.host.pointerType===c.InstrumentHost,r.isEffectDeviceBox=e=>r.isDeviceBox(e)&&"index"in e&&Ke(e.index,_)&&(e.host.pointerType===c.MIDIEffectHost||e.host.pointerType===c.AudioEffectHost),r.lookupHostField=e=>Z(e)&&"host"in e&&Ke(e.host,F)?e.host:B(`Could not find 'host' field in '${e?.name}'`),r.lookupLabelField=e=>Z(e)&&"label"in e&&Ke(e.label,D)?e.label:B(`Could not find 'label' field in '${e?.name}'`),r.lookupEnabledField=e=>Z(e)&&"enabled"in e&&Ke(e.enabled,k)?e.enabled:B(`Could not find 'enabled' field in '${e?.name}'`),r.lookupMinimizedField=e=>Z(e)&&"minimized"in e&&Ke(e.minimized,k)?e.minimized:B(`Could not find 'minimized' field in '${e?.name}'`),r.lookupIndexField=e=>Z(e)&&"index"in e&&Ke(e.index,_)?e.index:B(`Could not find 'index' field in '${e?.name}'`)})(Tg||(Tg={}));var _E;(function(r){r.toTrackType=e=>{switch(e){case"midi":return oe.Notes;case"audio":return oe.Audio;default:return B()}}})(_E||(_E={}));var ne;(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;T(O.satisfy(e,(i,o)=>i.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(c.AudioEffectHost):t.accepts==="midi"?t.deviceHost().midiEffects.field().pointerHub.filter(c.MIDIEffectHost):B("unknown type")).map(({box:i})=>Tg.lookupIndexField(i)).filter(i=>e.some(o=>w.Comparator(o.uuid,i.address.uuid)!==0)).sort((i,o)=>i.getValue()-o.getValue()).forEach((i,o)=>i.setValue(o)),e.forEach(i=>i.box.delete())}})(ne||(ne={}));var Cg=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ir=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Zp,Rg,an,Zs,Og,Vg=class{constructor(e,t){Zp.set(this,void 0),Rg.set(this,new te),an.set(this,void 0),Zs.set(this,void 0),Og.set(this,void 0),Cg(this,Zp,e,"f"),Cg(this,an,Kt.create(e.box.tracks,n=>t.adapterFor(n,_t),c.TrackCollection),"f"),Cg(this,Zs,w.newSet(({uuid:n})=>n),"f"),Cg(this,Og,ir(this,an,"f").catchupAndSubscribe({onAdd:n=>ir(this,Zs,"f").add({uuid:n.uuid,subscription:n.regions.subscribeChanges(()=>ir(this,Rg,"f").notify())}),onRemove:({uuid:n})=>ir(this,Zs,"f").removeByKey(n).subscription.terminate(),onReorder:n=>{}}),"f")}create(e,t,n){let i=ir(this,Zp,"f").box.graph,o=ir(this,Zp,"f").box.tracks;wr.create(i,w.generate(),a=>{a.index.setValue(n??ir(this,an,"f").getMinFreeIndex()),a.type.setValue(e),a.tracks.refer(o),a.target.refer(t)})}controls(e){return m.wrap(ir(this,an,"f").adapters().find(t=>t.target.targetVertex.contains(e),!1))}delete(e){let t=ir(this,an,"f").adapters(),n=t.indexOf(e);if(n===-1)return B(`Cannot delete ${e}. Does not exist.`);for(let i=n+1;i<t.length;i++)t[i].indexField.setValue(i-1);e.box.delete()}get collection(){return ir(this,an,"f")}values(){return ir(this,an,"f").adapters()}catchupAndSubscribe(e){return ir(this,an,"f").catchupAndSubscribe(e)}subscribeAnyChange(e){return ir(this,Rg,"f").subscribe(e)}terminate(){ir(this,an,"f").terminate(),ir(this,Og,"f").terminate(),ir(this,Zs,"f").forEach(({subscription:e})=>e.terminate()),ir(this,Zs,"f").clear()}};Zp=new WeakMap,Rg=new WeakMap,an=new WeakMap,Zs=new WeakMap,Og=new WeakMap;var ue;(function(r){r.AudioBus="manuals/audio-bus",r.Arpeggio="manuals/devices/midi/arpeggio",r.Pitch="manuals/devices/midi/pitch",r.Velocity="manuals/devices/midi/velocity",r.Zeitgeist="manuals/devices/midi/zeitgeist",r.StereoTool="manuals/devices/audio/stereo-tool",r.Delay="manuals/devices/audio/delay",r.DattorroReverb="manuals/devices/audio/dattorro-reverb",r.Maximizer="manuals/devices/audio/maximizer",r.Compressor="manuals/devices/audio/compressor",r.Reverb="manuals/devices/audio/cheap-reverb",r.Crusher="manuals/devices/audio/crusher",r.Fold="manuals/devices/audio/fold",r.Tidal="manuals/devices/audio/tidal",r.Revamp="manuals/devices/audio/revamp",r.Modular="manuals/devices/audio/modular",r.Tape="manuals/devices/instruments/tape",r.Nano="manuals/devices/instruments/nano",r.Playfield="manuals/devices/instruments/playfield",r.Vaporisateur="manuals/devices/instruments/vaporisateur",r.MIDIOutput="manuals/devices/instruments/midi-output",r.Soundfont="manuals/devices/instruments/soundfont"})(ue||(ue={}));var PE=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},sn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},zg,ii,_r=class{constructor(e,t){this.type="bus",this.accepts="audio",this.manualUrl=ue.AudioBus,zg.set(this,void 0),ii.set(this,void 0),PE(this,zg,e,"f"),PE(this,ii,t,"f")}catchupAndSubscribe(e){return e(this),sn(this,ii,"f").subscribe(ke.Children,()=>e(this))}get uuid(){return sn(this,ii,"f").address.uuid}get address(){return sn(this,ii,"f").address}get box(){return sn(this,ii,"f")}get enabledField(){return sn(this,ii,"f").enabled}get minimizedField(){return sn(this,ii,"f").minimized}get iconField(){return sn(this,ii,"f").icon}get labelField(){return sn(this,ii,"f").label}get colorField(){return sn(this,ii,"f").color}get iconSymbol(){return Oe.fromName(this.iconField.getValue()??"audio-bus")}deviceHost(){return sn(this,zg,"f").boxAdapters.adapterFor(sn(this,ii,"f").output.targetVertex.unwrap("No AudioUnitBox found").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){}toString(){return`{${this.constructor.name}}`}};zg=new WeakMap,ii=new WeakMap;var qp=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},xt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},$o,Zc,qc,_i,Gp,Ug=class{constructor(e,t){$o.set(this,void 0),Zc.set(this,void 0),qc.set(this,void 0),_i.set(this,void 0),Gp.set(this,q.Empty),qp(this,$o,new R,"f"),qp(this,Zc,xt(this,$o,"f").own(new te),"f"),qp(this,qc,xt(this,$o,"f").own(new Qr(Oe.Unknown)),"f"),qp(this,_i,xt(this,$o,"f").own(new Qr(m.None)),"f"),xt(this,$o,"f").own(xt(this,_i,"f").subscribe(n=>{xt(this,Gp,"f").terminate(),qp(this,Gp,n.getValue().match({none:()=>(xt(this,Zc,"f").notify(m.None),q.Empty),some:({labelField:i,iconField:o})=>q.many(o.catchupAndSubscribe(a=>xt(this,qc,"f").setValue(Oe.fromName(a.getValue()))),i.catchupAndSubscribe(a=>xt(this,Zc,"f").notify(m.wrap(a.getValue()))))}),"f")})),xt(this,$o,"f").own(e.catchupAndSubscribe({onAdded:({box:n})=>{T(xt(this,_i,"f").getValue().isEmpty(),"Already set");let i=n instanceof Qi?t.adapterFor(n,_r):t.adapterFor(n,ne.isInstrument);xt(this,_i,"f").getValue().unwrapOrNull()!==i&&xt(this,_i,"f").setValue(m.wrap(i))},onRemoved:({box:n})=>{T(xt(this,_i,"f").getValue().unwrap("Cannot remove").box.address.equals(n.address),"Unexpected value to remove"),xt(this,_i,"f").setValue(m.None)}},c.InstrumentHost,c.AudioOutput))}getValue(){return xt(this,_i,"f").getValue()}subscribe(e){return xt(this,_i,"f").subscribe(e)}catchupAndSubscribe(e){return e(xt(this,_i,"f")),this.subscribe(e)}catchupAndSubscribeLabelChange(e){return e(this.label),xt(this,Zc,"f").subscribe(e)}catchupAndSubscribeIconChange(e){return xt(this,qc,"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(Oe.toName(e)))}get icon(){return this.getValue().match({none:()=>Oe.Unknown,some:e=>Oe.fromName(e.iconField.getValue())})}get iconValue(){return xt(this,qc,"f")}terminate(){xt(this,$o,"f").terminate(),xt(this,Gp,"f").terminate()}};$o=new WeakMap,Zc=new WeakMap,qc=new WeakMap,_i=new WeakMap,Gp=new WeakMap;var SE=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},qs=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},jg,Do,ve=class{constructor(e){jg.set(this,void 0),Do.set(this,void 0),SE(this,jg,e,"f"),SE(this,Do,Se.newSet(t=>t.address),"f")}terminate(){qs(this,Do,"f").forEach(e=>e.terminate()),qs(this,Do,"f").clear()}parameters(){return qs(this,Do,"f").values()}parameterAt(e){return qs(this,Do,"f").getOrThrow(e,()=>new Error(`No ParameterAdapter found at [${e.toString()}]`))}createParameter(e,t,n,i,o){let a=new Gs(qs(this,jg,"f"),e,t,n,i,o),s=qs(this,Do,"f").add(a);return T(s,`Could not add adapter for ${e}`),a}removeParameter(e){return qs(this,Do,"f").removeByKey(e)}};jg=new WeakMap,Do=new WeakMap;var Hs=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},dt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Js,Pi,wa,Gc,Lg,Kg,Hp,Hc=class{constructor(e,t){Js.set(this,void 0),Pi.set(this,void 0),wa.set(this,void 0),Gc.set(this,void 0),Lg.set(this,void 0),Kg.set(this,void 0),Hp.set(this,q.Empty),Hs(this,Js,e,"f"),Hs(this,Pi,t,"f"),Hs(this,wa,new R,"f"),Hs(this,Gc,dt(this,wa,"f").own(new te),"f"),dt(this,wa,"f").own(t.targetBus.catchupAndSubscribe(()=>{dt(this,Hp,"f").terminate(),Hs(this,Hp,this.optTargetBus.match({none:()=>(dt(this,Gc,"f").notify(m.None),q.Empty),some:n=>n.catchupAndSubscribe(i=>dt(this,Gc,"f").notify(m.wrap(i)))}),"f")})),Hs(this,Lg,dt(this,wa,"f").own(new Gs(dt(this,Js,"f"),dt(this,Pi,"f").sendPan,S.bipolar(),E.percent({unit:"%",fractionDigits:0}),"panning")),"f"),Hs(this,Kg,dt(this,wa,"f").own(new Gs(dt(this,Js,"f"),dt(this,Pi,"f").sendGain,S.DefaultDecibel,E.numeric({unit:"dB",fractionDigits:1}),"gain")),"f")}catchupAndSubscribeBusChanges(e){return e(this.optTargetBus),dt(this,Gc,"f").subscribe(e)}get uuid(){return dt(this,Pi,"f").address.uuid}get address(){return dt(this,Pi,"f").address}get box(){return dt(this,Pi,"f")}get indexField(){return dt(this,Pi,"f").index}get sendPan(){return dt(this,Lg,"f")}get sendGain(){return dt(this,Kg,"f")}get targetBus(){return dt(this,Js,"f").boxAdapters.adapterFor(dt(this,Pi,"f").targetBus.targetVertex.unwrap("no audioUnit").box,_r)}get optTargetBus(){return dt(this,Pi,"f").targetBus.targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>dt(this,Js,"f").boxAdapters.adapterFor(t,_r)})))}delete(){dt(this,Pi,"f").delete()}terminate(){dt(this,wa,"f").terminate(),dt(this,Hp,"f").terminate()}};Js=new WeakMap,Pi=new WeakMap,wa=new WeakMap,Gc=new WeakMap,Lg=new WeakMap,Kg=new WeakMap,Hp=new WeakMap;var Jp=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Wn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Wg,Zg,Jc,Qc,Qp,qg=class{constructor(e,t){Wg.set(this,void 0),Zg.set(this,void 0),Jc.set(this,void 0),Qc.set(this,void 0),Qp.set(this,q.Empty),Jp(this,Wg,e,"f"),Jp(this,Zg,t,"f"),Jp(this,Jc,new R,"f"),Jp(this,Qc,Wn(this,Jc,"f").own(new te),"f"),Wn(this,Jc,"f").own(e.catchupAndSubscribe(()=>{Wn(this,Qp,"f").terminate(),Jp(this,Qp,this.adapter.match({none:()=>(Wn(this,Qc,"f").notify(m.None),q.Empty),some:n=>n.catchupAndSubscribe(i=>Wn(this,Qc,"f").notify(m.wrap(i)))}),"f")}))}subscribe(e){return Wn(this,Qc,"f").subscribe(e)}catchupAndSubscribe(e){return e(this.adapter),this.subscribe(e)}get adapter(){return Wn(this,Wg,"f").targetVertex.flatMap(e=>m.wrap(e.box.accept({visitAudioBusBox:t=>Wn(this,Zg,"f").adapterFor(t,_r)})))}terminate(){Wn(this,Jc,"f").terminate(),Wn(this,Qp,"f").terminate()}};Wg=new WeakMap,Zg=new WeakMap,Jc=new WeakMap,Qc=new WeakMap,Qp=new WeakMap;var Mo=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ae=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Gg,EE,Zn,ni,St,Xs,Xc,Qs,Hg,Xp,Jg,Qg,FE,BE,Si=class{constructor(e,t){Gg.add(this),this.class="device-host",Zn.set(this,new R),ni.set(this,void 0),St.set(this,void 0),Xs.set(this,void 0),Xc.set(this,void 0),Qs.set(this,void 0),Hg.set(this,void 0),Xp.set(this,void 0),Jg.set(this,void 0),Qg.set(this,void 0),Mo(this,ni,e,"f"),Mo(this,St,t,"f"),Mo(this,Xs,ae(this,Zn,"f").own(new ve(ae(this,ni,"f"))),"f"),Mo(this,Xc,ae(this,Zn,"f").own(new Vg(this,ae(this,ni,"f").boxAdapters)),"f"),Mo(this,Qs,ae(this,Zn,"f").own(new Ug(ae(this,St,"f").input.pointerHub,ae(this,ni,"f").boxAdapters)),"f"),Mo(this,Hg,ae(this,Zn,"f").own(Kt.create(ae(this,St,"f").midiEffects,n=>ae(this,ni,"f").boxAdapters.adapterFor(n,ne.isMidiEffect),c.MIDIEffectHost)),"f"),Mo(this,Xp,ae(this,Zn,"f").own(Kt.create(ae(this,St,"f").audioEffects,n=>ae(this,ni,"f").boxAdapters.adapterFor(n,ne.isAudioEffect),c.AudioEffectHost)),"f"),Mo(this,Jg,ae(this,Zn,"f").own(Kt.create(ae(this,St,"f").auxSends,n=>ae(this,ni,"f").boxAdapters.adapterFor(n,Hc),c.AuxSend)),"f"),Mo(this,Qg,ae(this,Zn,"f").own(new qg(ae(this,St,"f").output,ae(this,ni,"f").boxAdapters)),"f"),this.namedParameter=ae(this,Gg,"m",FE).call(this,t),ae(this,Gg,"m",BE).call(this)}get box(){return ae(this,St,"f")}get uuid(){return ae(this,St,"f").address.uuid}get address(){return ae(this,St,"f").address}get indexField(){return ae(this,St,"f").index}get type(){return ae(this,St,"f").type.getValue()}get captureBox(){return ae(this,St,"f").capture.targetVertex}get tracks(){return ae(this,Xc,"f")}get input(){return ae(this,Qs,"f")}get midiEffects(){return ae(this,Hg,"f")}get audioEffects(){return ae(this,Xp,"f")}get inputAdapter(){return ae(this,Qs,"f").getValue()}get auxSends(){return ae(this,Jg,"f")}get output(){return ae(this,Qg,"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 ae(this,St,"f").output.targetVertex.mapOr(e=>e.box.address.equals(ae(this,ni,"f").rootBoxAdapter.address),!1)}get midiEffectsField(){return ae(this,St,"f").midiEffects}get inputField(){return ae(this,St,"f").input}get audioEffectsField(){return ae(this,St,"f").audioEffects}get tracksField(){return ae(this,St,"f").tracks}get minimizedField(){return ae(this,Qs,"f").getValue().unwrap().minimizedField}get isAudioUnit(){return!0}get label(){return ae(this,Qs,"f").getValue().mapOr(e=>e.labelField.getValue(),"")}deviceHost(){return this}audioUnitBoxAdapter(){return this}*labeledAudioOutputs(){let e=this.input.getValue();e.nonEmpty()&&(yield*e.unwrap().labeledAudioOutputs());for(let t of ae(this,Xp,"f").adapters())yield*t.labeledAudioOutputs();yield{address:this.address,label:"Channelstrip",children:()=>m.None}}indicesLimit(){let e=ae(this,ni,"f").rootBoxAdapter.audioUnits.adapters(),t=this.indexField.getValue(),n=this.type,i=t,o=t;for(;i>0&&e[i-1].type===n;)i--;for(;o<e.length-1&&e[o+1].type===n;)o++;return[i,o+1]}move(e){ae(this,ni,"f").rootBoxAdapter.audioUnits.move(this,e)}moveTrack(e,t){ae(this,Xc,"f").collection.move(e,t)}deleteTrack(e){ae(this,Xc,"f").delete(e)}toString(){return`{${this.constructor.name}}`}terminate(){ae(this,Zn,"f").terminate()}};EE=Si,Zn=new WeakMap,ni=new WeakMap,St=new WeakMap,Xs=new WeakMap,Xc=new WeakMap,Qs=new WeakMap,Hg=new WeakMap,Xp=new WeakMap,Jg=new WeakMap,Qg=new WeakMap,Gg=new WeakSet,FE=function(e){return{volume:ae(this,Xs,"f").createParameter(e.volume,EE.VolumeMapper,E.decible,"volume"),panning:ae(this,Xs,"f").createParameter(e.panning,S.bipolar(),E.panning,"panning",.5),mute:ae(this,Xs,"f").createParameter(e.mute,S.bool,E.bool,"mute"),solo:ae(this,Xs,"f").createParameter(e.solo,S.bool,E.bool,"solo")}},BE=function(){let e=this.address.toString(),t=ae(this,St,"f").capture.targetAddress.unwrapOrUndefined(),n=()=>`AudioUnit '${e}' must have a capture. AudioUnit is typed ${this.type} and has input ${ae(this,St,"f").input.pointerHub.incoming().at(0)?.box.name}, but capture is ${t}`;T(this.type!==Dt.Instrument||ae(this,St,"f").capture.targetAddress.nonEmpty(),n)};Si.VolumeMapper=S.decibel(-96,-9,6);var Yc=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},et=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Xg,To,Pr,Ys,Yg,ev,Yp,IE,kE,_t=class{constructor(e,t){Xg.add(this),To.set(this,void 0),Pr.set(this,void 0),Ys.set(this,void 0),Yg.set(this,void 0),ev.set(this,void 0),Yp.set(this,void 0),Yc(this,To,e,"f"),Yc(this,Pr,t,"f"),Yc(this,Ys,new R,"f"),Yc(this,Yg,et(this,Ys,"f").own(new $g(this,e.boxAdapters)),"f"),Yc(this,ev,et(this,Ys,"f").own(new Mg(this,e.boxAdapters)),"f"),Yc(this,Yp,et(this,Ys,"f").own(new Qr(-1)),"f")}catchupAndSubscribePath(e){let t=[m.None,m.None],n=()=>{t.every(i=>i.nonEmpty())?e(m.wrap(t.map(i=>i.unwrap()))):e(m.None)};return q.many(et(this,Xg,"m",IE).call(this,i=>{t[0].equals(i)||(t[0]=i,n())}),et(this,Xg,"m",kE).call(this,i=>{t[1].equals(i)||(t[1]=i,n())}))}get context(){return et(this,To,"f")}set targetDeviceName(e){et(this,Pr,"f").target.targetVertex.ifSome(t=>{let n=t.box;if(n instanceof ut)return et(this,To,"f").boxAdapters.adapterFor(n,Si).input.getValue().ifSome(({labelField:o})=>o.setValue(e));if("label"in n&&n.label instanceof D)return n.label.setValue(e)})}get targetDeviceName(){return et(this,Pr,"f").target.targetVertex.flatMap(e=>{let t=e.box;return t instanceof ut?et(this,To,"f").boxAdapters.adapterFor(t,Si).input.label:"label"in t&&t.label instanceof D?m.wrap(t.label.getValue()):m.wrap(t.name)})}terminate(){et(this,Ys,"f").terminate()}get audioUnit(){return Te(et(this,Pr,"f").tracks.targetVertex.unwrap().box,ut)}get target(){return et(this,Pr,"f").target}get clips(){return et(this,Yg,"f")}get regions(){return et(this,ev,"f")}get enabled(){return et(this,Pr,"f").enabled}get indexField(){return et(this,Pr,"f").index}get type(){return et(this,Pr,"f").type.getValue()}get box(){return et(this,Pr,"f")}get uuid(){return et(this,Pr,"f").address.uuid}get address(){return et(this,Pr,"f").address}get listIndex(){return et(this,Yp,"f").getValue()}set listIndex(e){et(this,Yp,"f").setValue(e)}accepts(e){switch(e.type){case"audio-clip":return this.type===oe.Audio;case"note-clip":return this.type===oe.Notes;case"value-clip":return this.type===oe.Value;case"audio-region":return this.type===oe.Audio;case"note-region":return this.type===oe.Notes;case"value-region":return this.type===oe.Value}}valueAt(e,t){if(!this.enabled.getValue())return t;let n=t,i=et(this,To,"f").clipSequencing.iterate(this.uuid,e,e+vm);for(let{optClip:o,sectionFrom:a}of i)n=o.match({none:()=>{let s=this.regions.collection.lowerEqual(e,l=>!l.mute);if(s===null){let l=this.regions.collection.optAt(0);return Ke(l,No)?l.incomingValue(t):t}else if(Ke(s,No))return e<s.complete?s.valueAt(e,t):s.outgoingValue(t);return t},some:s=>a===e&&Ke(s,ha)?s.valueAt(e,t):t});return n}};To=new WeakMap,Pr=new WeakMap,Ys=new WeakMap,Yg=new WeakMap,ev=new WeakMap,Yp=new WeakMap,Xg=new WeakSet,IE=function(e){let t=et(this,Pr,"f").target.targetVertex;if(t.nonEmpty()){let n=t.unwrap().box;return n instanceof ut?et(this,To,"f").boxAdapters.adapterFor(n,Si).input.catchupAndSubscribeLabelChange(o=>e(o)):"label"in n&&n.label instanceof D?n.label.catchupAndSubscribe(i=>e(m.wrap(i.getValue()))):(e(m.wrap(n.name)),q.Empty)}return e(m.None),q.Empty},kE=function(e){let t=this.type;switch(t){case oe.Audio:case oe.Notes:return e(m.wrap(oe[t])),q.Empty;case oe.Value:{let n=et(this,Pr,"f").target.targetVertex.unwrap();if(n.isField())e(et(this,To,"f").parameterFieldAdapters.opt(n.address).map(i=>i.name));else if(n.isBox())e(m.wrap(n.name));else return B("Illegal State. Vertex is not a field nor box.");return q.Empty}case oe.Undefined:return e(m.wrap("")),q.Empty;default:return e(m.None),q.Empty}};var nr=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},me=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Aa,oi,_a,el,tv,rv,tl,rl,Pa,Sa,il,eu,eh,NE=[c.Automation,c.Modulation,c.MIDIControl,c.ParameterController],Gs=class{constructor(e,t,n,i,o,a){Aa.set(this,void 0),oi.set(this,void 0),_a.set(this,void 0),el.set(this,void 0),tv.set(this,void 0),rv.set(this,void 0),tl.set(this,new R),rl.set(this,void 0),Pa.set(this,void 0),Sa.set(this,m.None),il.set(this,m.None),eu.set(this,null),eh.set(this,!1),nr(this,Aa,e,"f"),nr(this,oi,t,"f"),nr(this,_a,n,"f"),nr(this,el,i,"f"),nr(this,tv,o,"f"),nr(this,rv,a??0,"f"),me(this,tl,"f").own(me(this,Aa,"f").parameterFieldAdapters.register(this)),nr(this,rl,me(this,tl,"f").own(new te),"f"),nr(this,Pa,new jt,"f"),me(this,tl,"f").own(me(this,oi,"f").subscribe(()=>me(this,rl,"f").notify(this))),me(this,tl,"f").own(me(this,oi,"f").pointerHub.catchupAndSubscribe({onAdded:s=>{me(this,Pa,"f").proxy.onControlSourceAdd(Rw(s.pointerType)),s.box.accept({visitTrackBox:l=>{T(me(this,Sa,"f").isEmpty(),"Already assigned");let u=me(this,Aa,"f").boxAdapters.adapterFor(l,_t);nr(this,Sa,m.wrap(u),"f"),me(this,Aa,"f").isMainThread&&nr(this,il,m.wrap(me(this,Aa,"f").liveStreamReceiver.subscribeFloat(me(this,oi,"f").address,d=>{me(this,eu,"f")!==d&&(nr(this,eu,d,"f"),me(this,rl,"f").notify(this))})),"f")}})},onRemoved:s=>{me(this,Pa,"f").proxy.onControlSourceRemove(Rw(s.pointerType)),s.box.accept({visitTrackBox:l=>{T(me(this,Sa,"f").unwrapOrNull()?.address?.equals(l.address)===!0,`Unknown ${l}`),nr(this,Sa,m.None,"f"),me(this,Aa,"f").isMainThread&&(me(this,il,"f").ifSome(u=>u.terminate()),nr(this,il,m.None,"f"),nr(this,eu,null,"f"),me(this,rl,"f").notify(this))}})}},...NE)),t.getValue(),n.clamp(t.getValue())}registerMidiControl(){return me(this,Pa,"f").proxy.onControlSourceAdd("midi"),nr(this,eh,!0,"f"),{terminate:()=>{nr(this,eh,!1,"f"),me(this,Pa,"f").proxy.onControlSourceRemove("midi")}}}get field(){return me(this,oi,"f")}get valueMapping(){return me(this,_a,"f")}get stringMapping(){return me(this,el,"f")}get name(){return me(this,tv,"f")}get anchor(){return me(this,rv,"f")}get type(){return me(this,oi,"f").type}get address(){return me(this,oi,"f").address}get track(){return me(this,Sa,"f")}valueAt(e){let t=me(this,Sa,"f");if(t.nonEmpty()){let n=t.unwrap();if(n.enabled)return this.valueMapping.y(n.valueAt(e,this.getUnitValue()))}return this.getValue()}subscribe(e){return me(this,rl,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}catchupAndSubscribeControlSources(e){return me(this,eh,"f")&&e.onControlSourceAdd("midi"),me(this,oi,"f").pointerHub.filter(...NE).forEach(t=>e.onControlSourceAdd(Rw(t.pointerType))),me(this,Pa,"f").subscribe(e)}getValue(){return me(this,oi,"f").getValue()}setValue(e){me(this,oi,"f").setValue(e)}setUnitValue(e){this.setValue(me(this,_a,"f").y(e))}getUnitValue(){return me(this,_a,"f").x(this.getValue())}getControlledValue(){return me(this,_a,"f").y(this.getControlledUnitValue())}getControlledUnitValue(){return me(this,eu,"f")??this.getUnitValue()}getControlledPrintValue(){return me(this,el,"f").x(this.getControlledValue())}getPrintValue(){return me(this,el,"f").x(this.getValue())}setPrintValue(e){let t=me(this,el,"f").y(e);t.type==="unitValue"?this.setUnitValue(pe(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(me(this,_a,"f").clamp(me(this,oi,"f").initValue))}terminate(){me(this,il,"f").ifSome(e=>e.terminate()),nr(this,il,m.None,"f"),me(this,tl,"f").terminate()}};Aa=new WeakMap,oi=new WeakMap,_a=new WeakMap,el=new WeakMap,tv=new WeakMap,rv=new WeakMap,tl=new WeakMap,rl=new WeakMap,Pa=new WeakMap,Sa=new WeakMap,il=new WeakMap,eu=new WeakMap,eh=new WeakMap;var Rw=r=>{switch(r){case c.Automation:return"automated";case c.Modulation:return"modulated";case c.MIDIControl:return"midi";case c.ParameterController:return"external";default:return B(`${r.toString()} is an unknown pointer type`)}};var Ow=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ln=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Co,nl,iv,nv=class{constructor(e,t,n){Co.set(this,void 0),nl.set(this,void 0),iv.set(this,void 0),Ow(this,Co,w.newSet(i=>i.uuid),"f"),Ow(this,nl,new jt,"f"),Ow(this,iv,e.catchupAndSubscribe({onAdded:i=>{let o=t(i.box),a=ln(this,Co,"f").add(o);T(a,`Could not add ${o}`),ln(this,nl,"f").proxy.onAdd(o)},onRemoved:i=>{let o=i.box.address.uuid;ln(this,nl,"f").proxy.onRemove(ln(this,Co,"f").removeByKey(o))}},n),"f")}subscribe(e){return ln(this,nl,"f").subscribe(e)}catchupAndSubscribe(e){return ln(this,Co,"f").forEach(t=>e.onAdd(t)),this.subscribe(e)}adapters(){return ln(this,Co,"f").values()}size(){return ln(this,Co,"f").size()}isEmpty(){return this.size()===0}terminate(){ln(this,Co,"f").clear(),ln(this,nl,"f").terminate(),ln(this,iv,"f").terminate()}};Co=new WeakMap,nl=new WeakMap,iv=new WeakMap;var Vw=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},st=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},zw,Cr,th,Ei,or,$E,Rt=class{constructor(e,t){zw.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ue.Delay,th.set(this,void 0),Ei.set(this,void 0),or.set(this,void 0),Vw(this,th,e,"f"),Vw(this,Ei,t,"f"),Vw(this,or,new ve(st(this,th,"f")),"f"),this.namedParameter=st(this,zw,"m",$E).call(this,t)}get box(){return st(this,Ei,"f")}get uuid(){return st(this,Ei,"f").address.uuid}get address(){return st(this,Ei,"f").address}get indexField(){return st(this,Ei,"f").index}get labelField(){return st(this,Ei,"f").label}get enabledField(){return st(this,Ei,"f").enabled}get minimizedField(){return st(this,Ei,"f").minimized}get host(){return st(this,Ei,"f").host}deviceHost(){return st(this,th,"f").boxAdapters.adapterFor(st(this,Ei,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){st(this,or,"f").terminate()}};Cr=Rt,th=new WeakMap,Ei=new WeakMap,or=new WeakMap,zw=new WeakSet,$E=function(e){return{preSyncTimeLeft:st(this,or,"f").createParameter(e.preSyncTimeLeft,S.linearInteger(0,Cr.Fractions.length-1),Cr.FractionsStringMapping,"pre sync L"),preMillisTimeLeft:st(this,or,"f").createParameter(e.preMillisTimeLeft,S.powerByCenter(100,0,Cr.MAX_MILLIS_TIME),E.numeric({unit:"ms",fractionDigits:1}),"pre ms L"),preSyncTimeRight:st(this,or,"f").createParameter(e.preSyncTimeRight,S.linearInteger(0,Cr.Fractions.length-1),Cr.FractionsStringMapping,"pre sync R"),preMillisTimeRight:st(this,or,"f").createParameter(e.preMillisTimeRight,S.powerByCenter(100,0,Cr.MAX_MILLIS_TIME),E.numeric({unit:"ms",fractionDigits:1}),"pre ms R"),delay:st(this,or,"f").createParameter(e.delayMusical,S.linearInteger(0,Cr.Fractions.length-1),Cr.FractionsStringMapping,"delay"),millisTime:st(this,or,"f").createParameter(e.delayMillis,S.powerByCenter(100,0,Cr.MAX_MILLIS_TIME),E.numeric({unit:"ms",fractionDigits:1}),"ms"),feedback:st(this,or,"f").createParameter(e.feedback,S.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"feedback"),cross:st(this,or,"f").createParameter(e.cross,S.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"cross"),lfoSpeed:st(this,or,"f").createParameter(e.lfoSpeed,S.exponential(Cr.LFO_SPEED_MIN,Cr.LFO_SPEED_MAX),E.numeric({unit:"Hz",fractionDigits:2}),"lfo speed"),lfoDepth:st(this,or,"f").createParameter(e.lfoDepth,S.power(4,0,Cr.LFO_DEPTH_MAX),E.numeric({unit:"ms",fractionDigits:1}),"lfo depth"),filter:st(this,or,"f").createParameter(e.filter,S.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"filter",.5),dry:st(this,or,"f").createParameter(e.dry,S.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"dry"),wet:st(this,or,"f").createParameter(e.wet,S.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"wet")}};Rt.Fractions=Yt.builder().add([0,1]).add([1,128]).add([1,96]).add([1,64]).add([1,48]).add([1,32]).add([1,24]).add([3,64]).add([1,16]).add([1,12]).add([3,32]).add([1,8]).add([1,6]).add([3,16]).add([1,4]).add([5,16]).add([1,3]).add([3,8]).add([7,16]).add([1,2]).add([1,1]).asAscendingArray();Rt.FractionsStringMapping=E.indices("",Cr.Fractions.map(([r,e])=>r===0?"Off":`${r}/${e}`));Rt.MAX_MILLIS_TIME=1e3;Rt.LFO_SPEED_MIN=.1;Rt.LFO_SPEED_MAX=5;Rt.LFO_DEPTH_MAX=50;var Uw=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Zt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},jw,rh,Fi,qn,DE,tu=class{constructor(e,t){jw.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ue.Reverb,rh.set(this,void 0),Fi.set(this,void 0),qn.set(this,void 0),Uw(this,rh,e,"f"),Uw(this,Fi,t,"f"),Uw(this,qn,new ve(Zt(this,rh,"f")),"f"),this.namedParameter=Zt(this,jw,"m",DE).call(this,t)}get box(){return Zt(this,Fi,"f")}get uuid(){return Zt(this,Fi,"f").address.uuid}get address(){return Zt(this,Fi,"f").address}get indexField(){return Zt(this,Fi,"f").index}get labelField(){return Zt(this,Fi,"f").label}get enabledField(){return Zt(this,Fi,"f").enabled}get minimizedField(){return Zt(this,Fi,"f").minimized}get host(){return Zt(this,Fi,"f").host}deviceHost(){return Zt(this,rh,"f").boxAdapters.adapterFor(Zt(this,Fi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Zt(this,qn,"f").terminate()}};rh=new WeakMap,Fi=new WeakMap,qn=new WeakMap,jw=new WeakSet,DE=function(e){return{decay:Zt(this,qn,"f").createParameter(e.decay,S.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"Room-Size"),preDelay:Zt(this,qn,"f").createParameter(e.preDelay,S.exponential(.001,.5),E.numeric({unit:"s",fractionDigits:1,unitPrefix:!0}),"Pre-Delay"),damp:Zt(this,qn,"f").createParameter(e.damp,S.unipolar(),E.numeric({unit:"%",fractionDigits:0}),"damping"),filter:Zt(this,qn,"f").createParameter(e.filter,S.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"filter"),dry:Zt(this,qn,"f").createParameter(e.dry,S.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"dry"),wet:Zt(this,qn,"f").createParameter(e.wet,S.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"wet")}};var Lw=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},It=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ww,ih,ai,cn,CE,ru=class{constructor(e,t){Ww.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ue.Revamp,ih.set(this,void 0),ai.set(this,void 0),cn.set(this,void 0),Lw(this,ih,e,"f"),Lw(this,ai,t,"f"),Lw(this,cn,new ve(It(this,ih,"f")),"f"),this.namedParameter=It(this,Ww,"m",CE).call(this,t)}get box(){return It(this,ai,"f")}get uuid(){return It(this,ai,"f").address.uuid}get address(){return It(this,ai,"f").address}get indexField(){return It(this,ai,"f").index}get labelField(){return It(this,ai,"f").label}get enabledField(){return It(this,ai,"f").enabled}get minimizedField(){return It(this,ai,"f").minimized}get host(){return It(this,ai,"f").host}get spectrum(){return It(this,ai,"f").address.append(4095)}deviceHost(){return It(this,ih,"f").boxAdapters.adapterFor(It(this,ai,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){It(this,cn,"f").terminate()}};ih=new WeakMap,ai=new WeakMap,cn=new WeakMap,Ww=new WeakSet,CE=function(e){return{highPass:ME(It(this,cn,"f"),e.highPass,"High-Pass"),lowShelf:TE(It(this,cn,"f"),e.lowShelf,"Low-Shelf"),lowBell:Kw(It(this,cn,"f"),e.lowBell,"Low-Bell"),midBell:Kw(It(this,cn,"f"),e.midBell,"Mid-Bell"),highBell:Kw(It(this,cn,"f"),e.highBell,"High-Bell"),highShelf:TE(It(this,cn,"f"),e.highShelf,"High-Shelf"),lowPass:ME(It(this,cn,"f"),e.lowPass,"Low-Pass")}};var Zw=S.exponential(20,2e4),RE=S.linear(-24,24),OE=S.exponential(.01,10),ME=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,E.bool,"enabled"),frequency:r.createParameter(e.frequency,Zw,E.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),order:r.createParameter(e.order,S.linearInteger(0,3),E.indices("db",["12","24","36","48"]),`${t} Order`),q:r.createParameter(e.q,OE,E.numeric({fractionDigits:3}),`${t} Q`)}),TE=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,E.bool,"enabled"),frequency:r.createParameter(e.frequency,Zw,E.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,RE,E.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5)}),Kw=(r,e,t)=>({enabled:r.createParameter(e.enabled,S.bool,E.bool,"enabled"),frequency:r.createParameter(e.frequency,Zw,E.numeric({unit:"Hz",fractionDigits:0}),`${t} Freq`),gain:r.createParameter(e.gain,RE,E.numeric({unit:"db",fractionDigits:1,bipolar:!0}),`${t} Gain`,.5),q:r.createParameter(e.q,OE,E.numeric({fractionDigits:3}),`${t} Q`)});var VE=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Rr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ov,av,Or,Ea=class{constructor(e,t){this.type="marker-event",ov.set(this,new R),av.set(this,void 0),Or.set(this,void 0),VE(this,av,e,"f"),VE(this,Or,t,"f"),Rr(this,ov,"f").own(Rr(this,Or,"f").subscribe(ke.Children,n=>{if(!this.trackAdapter.isEmpty()&&(n.type==="primitive"||n.type==="pointer")){let i=this.trackAdapter.unwrap();Rr(this,Or,"f").position.address.equals(n.address)?i.onSortingChanged():i.dispatchChange()}}))}get box(){return Rr(this,Or,"f")}get uuid(){return Rr(this,Or,"f").address.uuid}get address(){return Rr(this,Or,"f").address}get position(){return Rr(this,Or,"f").position.getValue()}get plays(){return Rr(this,Or,"f").plays.getValue()}get hue(){return Rr(this,Or,"f").hue.getValue()}get label(){return Rr(this,Or,"f").label.getValue()}get trackAdapter(){return Rr(this,Or,"f").track.targetVertex.map(e=>Rr(this,av,"f").boxAdapters.adapterFor(e.box,Bi).markerTrack)}terminate(){Rr(this,ov,"f").terminate()}toString(){return`{MarkerBoxAdapter ${w.toString(Rr(this,Or,"f").address.uuid).substring(0,4)}, plays: ${this.plays}`}};ov=new WeakMap,av=new WeakMap,Or=new WeakMap;Ea.Comparator=(r,e)=>r.position-e.position;var nh=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ii=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},oh,iu,ah,ol,sv,lv=class{constructor(e,t){oh.set(this,void 0),iu.set(this,void 0),ah.set(this,void 0),ol.set(this,void 0),sv.set(this,void 0),nh(this,oh,e,"f"),nh(this,iu,t,"f"),this.changeNotifier=new te,nh(this,ah,w.newSet(n=>n.uuid),"f"),nh(this,ol,Dr.create(Ea.Comparator),"f"),nh(this,sv,Ii(this,iu,"f").markers.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>{if(n instanceof oc){let i=Ii(this,oh,"f").boxAdapters.adapterFor(n,Ea),o=Ii(this,ah,"f").add(i);T(o,"Could not add adapter"),Ii(this,ol,"f").add(i),this.dispatchChange()}},onRemoved:({box:{address:{uuid:n}}})=>{Ii(this,ol,"f").remove(Ii(this,ah,"f").removeByKey(n)),this.dispatchChange()}}),"f")}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return Ii(this,oh,"f")}get enabled(){return Ii(this,iu,"f").enabled.getValue()}get events(){return Ii(this,ol,"f")}get object(){return Ii(this,iu,"f")}dispatchChange(){this.changeNotifier.notify()}onSortingChanged(){Ii(this,ol,"f").onIndexingChanged(),this.dispatchChange()}terminate(){Ii(this,sv,"f").terminate()}};oh=new WeakMap,iu=new WeakMap,ah=new WeakMap,ol=new WeakMap,sv=new WeakMap;var zE=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},si=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},cv,uv,li,al=class{constructor(e,t){this.type="signature-event",cv.set(this,new R),uv.set(this,void 0),li.set(this,void 0),zE(this,uv,e,"f"),zE(this,li,t,"f"),si(this,cv,"f").own(si(this,li,"f").subscribe(ke.Children,n=>this.trackAdapter.ifSome(i=>i.dispatchChange())))}get box(){return si(this,li,"f")}get uuid(){return si(this,li,"f").address.uuid}get address(){return si(this,li,"f").address}get index(){return si(this,li,"f").index.getValue()}get indexField(){return si(this,li,"f").index}get relativePosition(){return si(this,li,"f").relativePosition.getValue()}get nominator(){return si(this,li,"f").nominator.getValue()}get denominator(){return si(this,li,"f").denominator.getValue()}get trackAdapter(){return si(this,li,"f").events.targetVertex.map(e=>si(this,uv,"f").boxAdapters.adapterFor(e.box,Bi).signatureTrack)}terminate(){si(this,cv,"f").terminate()}toString(){return`{SignatureEventBoxAdapter ${this.nominator}/${this.denominator}}`}};cv=new WeakMap,uv=new WeakMap,li=new WeakMap;al.Comparator=(r,e)=>r.index-e.index;var dv=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},pt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},sl,sh,lh,ll,Ro,Fa,UE,ch,pv=class{constructor(e,t,n){sl.add(this),sh.set(this,new R),lh.set(this,void 0),ll.set(this,void 0),Ro.set(this,void 0),Fa.set(this,void 0),dv(this,lh,e,"f"),dv(this,ll,t,"f"),dv(this,Ro,n,"f"),this.changeNotifier=new te,dv(this,Fa,pt(this,sh,"f").own(Kt.create(pt(this,Ro,"f").events,i=>e.boxAdapters.adapterFor(i,al),c.SignatureAutomation)),"f"),pt(this,sh,"f").ownAll(pt(this,ll,"f").subscribe(()=>this.dispatchChange()),pt(this,Ro,"f").enabled.subscribe(()=>this.dispatchChange()),pt(this,Fa,"f").subscribe({onAdd:i=>this.changeNotifier.notify(),onRemove:i=>this.changeNotifier.notify(),onReorder:i=>this.changeNotifier.notify()}))}subscribe(e){return this.changeNotifier.subscribe(e)}get context(){return pt(this,lh,"f")}get enabled(){return pt(this,Ro,"f").enabled.getValue()}get object(){return pt(this,Ro,"f")}get size(){return pt(this,Fa,"f").size()}get storageSignature(){let{nominator:e,denominator:t}=pt(this,ll,"f");return[e.getValue(),t.getValue()]}nonEmpty(){return pt(this,Fa,"f").size()>0}dispatchChange(){this.changeNotifier.notify()}signatureAt(e){e=Math.max(0,e);let t=this.storageSignature;for(let{accumulatedPpqn:n,nominator:i,denominator:o}of this.iterateAll()){if(n>e)break;t=[i,o]}return t}*iterateAll(){let e=0,t=0,[n,i]=this.storageSignature;if(yield{index:-1,accumulatedPpqn:e,accumulatedBars:t,nominator:n,denominator:i},!!pt(this,Ro,"f").enabled.getValue())for(let o of pt(this,Fa,"f").adapters())e+=G.fromSignature(n,i)*o.relativePosition,t+=o.relativePosition,n=o.nominator,i=o.denominator,yield{index:o.index,accumulatedPpqn:e,accumulatedBars:t,nominator:n,denominator:i}}changeSignature(e,t){let n=Array.from(this.iterateAll()).slice(1),i=n.map(l=>l.accumulatedPpqn);pt(this,ll,"f").nominator.setValue(e),pt(this,ll,"f").denominator.setValue(t);let o=0,a=0,s=G.fromSignature(e,t);for(let l=0;l<n.length;l++){let u=n[l],d=this.adapterAt(u.index);if(d.isEmpty())continue;let h=(i[l]-o)/s,g=Math.floor(h),v=h-g;a+=v;let y=g;a>=1&&(y++,a--),y=Math.max(1,y),d.unwrap().box.relativePosition.setValue(y),o+=y*s,s=G.fromSignature(u.nominator,u.denominator)}}deleteAdapter(e){let t=e.index,n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(g=>g.index===t);if(i===-1)return;let o=n.slice(i+1),a=o.map(g=>g.accumulatedPpqn),s=i>0?n[i-1]:null,[l,u]=s!==null?[s.nominator,s.denominator]:this.storageSignature,d=s!==null?s.accumulatedPpqn:0;e.box.delete();let p=d,h=G.fromSignature(l,u);for(let g=0;g<o.length;g++){let v=o[g],y=this.adapterAt(v.index);if(y.isEmpty())continue;let $=(a[g]-p)/h,M=Math.max(1,Math.round($));y.unwrap().box.relativePosition.setValue(M),p+=M*h,h=G.fromSignature(v.nominator,v.denominator)}}createEvent(e,t,n){let i=Array.from(this.iterateAll()),o=i[0],a=0;for(let y=1;y<i.length&&!(i[y].accumulatedPpqn>e);y++)o=i[y],a=y;let s=G.fromSignature(o.nominator,o.denominator),l=(e-o.accumulatedPpqn)/s,u=Math.max(1,Math.round(l)),d=o.index+1,p=i.slice(a+1),h=o.accumulatedPpqn+u*s,g=G.fromSignature(t,n),v=p.map(y=>({event:y,adapter:this.adapterAt(y.index)})).filter(({adapter:y})=>y.nonEmpty()).map(({event:y,adapter:x})=>({event:y,adapter:x.unwrap()}));for(let y=0;y<v.length;y++){let{event:x,adapter:$}=v[y];if($.box.index.setValue(x.index+1),y===0){let M=(x.accumulatedPpqn-h)/g;$.box.relativePosition.setValue(Math.max(1,Math.round(M)))}}ec.create(pt(this,lh,"f").boxGraph,w.generate(),y=>{y.index.setValue(d),y.relativePosition.setValue(u),y.nominator.setValue(t),y.denominator.setValue(n),y.events.refer(pt(this,Ro,"f").events)})}adapterAt(e){return pt(this,Fa,"f").getAdapterByIndex(e)}moveEvent(e,t){let n=Array.from(this.iterateAll()).slice(1),i=n.findIndex(h=>h.index===e.index);if(i===-1)return;let o=n[i];if(t===o.accumulatedPpqn)return;let a=n.map(h=>h.accumulatedBars),s=pt(this,sl,"m",UE).call(this,t,o.index);if(s===o.accumulatedBars)return;let l=[...a];l[i]=s;let u=l.map((h,g)=>({bar:h,i:g})).sort((h,g)=>h.bar-g.bar).map(h=>h.i),d=n.map(h=>this.adapterAt(h.index).unwrap());for(let h=0;h<u.length;h++)d[u[h]].box.index.setValue(h);let p=0;for(let h=0;h<u.length;h++){let g=u[h],v=d[g],y=l[g],x=Math.max(1,y-p);v.box.relativePosition.setValue(x),p=y}}floorToBar(e){let{event:t,barPpqn:n}=pt(this,sl,"m",ch).call(this,e),i=Math.floor((e-t.accumulatedPpqn)/n);return t.accumulatedPpqn+i*n}ceilToBar(e){let{event:t,barPpqn:n}=pt(this,sl,"m",ch).call(this,e),i=Math.ceil((e-t.accumulatedPpqn)/n);return t.accumulatedPpqn+i*n}roundToBar(e){let{event:t,barPpqn:n}=pt(this,sl,"m",ch).call(this,e),i=Math.round((e-t.accumulatedPpqn)/n);return t.accumulatedPpqn+i*n}barLengthAt(e){let[t,n]=this.signatureAt(e);return G.fromSignature(t,n)}getBarInterval(e){let{event:t,barPpqn:n}=pt(this,sl,"m",ch).call(this,e),i=Math.floor((e-t.accumulatedPpqn)/n),o=t.accumulatedPpqn+i*n;return{position:o,complete:o+n}}terminate(){pt(this,sh,"f").terminate()}};sh=new WeakMap,lh=new WeakMap,ll=new WeakMap,Ro=new WeakMap,Fa=new WeakMap,sl=new WeakSet,UE=function(e,t){let n=null;for(let a of this.iterateAll())if(a.index!==t){if(a.accumulatedPpqn>e)break;n=a}if(_n(n)){let[a,s]=this.storageSignature,l=G.fromSignature(a,s);return Math.max(1,Math.round(e/l))}let i=G.fromSignature(n.nominator,n.denominator),o=Math.round((e-n.accumulatedPpqn)/i);return Math.max(1,n.accumulatedBars+o)},ch=function(e){let t=null;for(let n of this.iterateAll()){if(n.accumulatedPpqn>e)break;t=n}if(_n(t)){let[n,i]=this.storageSignature;return{event:{index:-1,accumulatedPpqn:0,accumulatedBars:0,nominator:n,denominator:i},barPpqn:G.fromSignature(n,i)}}return{event:t,barPpqn:G.fromSignature(t.nominator,t.denominator)}};var uh=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Et=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},dh,Gn,hv,fv,Oo,ph,mv,Bi=class{constructor(e,t){dh.set(this,new R),Gn.set(this,void 0),hv.set(this,void 0),fv.set(this,void 0),Oo.set(this,void 0),ph.set(this,void 0),mv.set(this,()=>{let{tempoTrack:{enabled:s}}=Et(this,Gn,"f");return s.getValue()?Et(this,Oo,"f").isEmpty()?m.None:Et(this,Oo,"f").unwrap().events.isEmpty()?m.None:Et(this,Oo,"f"):m.None}),uh(this,Gn,t,"f"),uh(this,hv,new lv(e,t.markerTrack),"f"),uh(this,fv,new pv(e,t.signature,t.signatureTrack),"f"),uh(this,Oo,new $r,"f"),uh(this,ph,new te,"f");let n=Et(this,dh,"f").own(new R),i=()=>Et(this,ph,"f").notify(Et(this,mv,"f").call(this)),{tempoTrack:{events:o,enabled:a}}=t;Et(this,dh,"f").own(o.catchupAndSubscribe(({targetVertex:s})=>{n.terminate(),s.match({none:()=>Et(this,Oo,"f").clear(),some:({box:l})=>{let u=e.boxAdapters.adapterFor(l,tr);Et(this,Oo,"f").wrap(u),n.ownAll(u.subscribeChange(i),a.subscribe(i))}})}))}catchupAndSubscribeTempoAutomation(e){return e(Et(this,mv,"f").call(this)),Et(this,ph,"f").subscribe(e)}get box(){return Et(this,Gn,"f")}get uuid(){return Et(this,Gn,"f").address.uuid}get address(){return Et(this,Gn,"f").address}get markerTrack(){return Et(this,hv,"f")}get signatureTrack(){return Et(this,fv,"f")}get tempoTrackEvents(){return Et(this,Oo,"f")}get signature(){let{nominator:e,denominator:t}=Et(this,Gn,"f").signature;return[e.getValue(),t.getValue()]}get signatureDuration(){let{nominator:e,denominator:t}=Et(this,Gn,"f").signature;return G.fromSignature(e.getValue(),t.getValue())}catchupAndSubscribeSignature(e){return e(this.signature),Et(this,Gn,"f").signature.subscribe(()=>e(this.signature))}terminate(){Et(this,dh,"f").terminate()}};dh=new WeakMap,Gn=new WeakMap,hv=new WeakMap,fv=new WeakMap,Oo=new WeakMap,ph=new WeakMap,mv=new WeakMap;var Zk=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},hh=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Ba,Ia=class{constructor(e,t){Ba.set(this,void 0),Zk(this,Ba,t,"f")}get box(){return hh(this,Ba,"f")}get uuid(){return hh(this,Ba,"f").address.uuid}get address(){return hh(this,Ba,"f").address}get source(){return hh(this,Ba,"f").source.targetVertex.unwrap("Insufficient Vertex")}get target(){return hh(this,Ba,"f").target.targetVertex.unwrap("Insufficient Vertex")}terminate(){}};Ba=new WeakMap;var cl=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ki=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},gv,ul,dl,vv,yv,fh,Ni=class{constructor(e,t){gv.set(this,void 0),ul.set(this,void 0),dl.set(this,void 0),vv.set(this,void 0),yv.set(this,void 0),fh.set(this,!1),cl(this,gv,e,"f"),cl(this,ul,t,"f"),cl(this,dl,new R,"f"),cl(this,vv,t.attributes,"f"),cl(this,yv,ki(this,dl,"f").own(new ve(e)),"f")}get inputs(){throw new Error("Method not implemented.")}get outputs(){throw new Error("Method not implemented.")}own(e){return ki(this,dl,"f").own(e)}ownAll(...e){ki(this,dl,"f").ownAll(...e)}onSelected(){cl(this,fh,!0,"f")}onDeselected(){cl(this,fh,!1,"f")}isSelected(){return ki(this,fh,"f")}get box(){return ki(this,ul,"f")}get attributes(){return ki(this,vv,"f")}get uuid(){return ki(this,ul,"f").address.uuid}get address(){return ki(this,ul,"f").address}get parameters(){return ki(this,yv,"f")}get modular(){return ki(this,gv,"f").boxAdapters.adapterFor(ki(this,ul,"f").attributes.collection.targetVertex.unwrap().box,ka)}terminate(){ki(this,dl,"f").terminate()}};gv=new WeakMap,ul=new WeakMap,dl=new WeakMap,vv=new WeakMap,yv=new WeakMap,fh=new WeakMap;var xv=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Vo=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},bv,Na,mh,wv,dr;(function(r){r.Input="input",r.Output="output"})(dr||(dr={}));var pr=class r{static create(e,t,n,i){return new r(e,t,n,i??t.fieldName)}constructor(e,t,n,i){bv.set(this,void 0),Na.set(this,void 0),mh.set(this,void 0),wv.set(this,void 0),xv(this,bv,e,"f"),xv(this,Na,t,"f"),xv(this,mh,n,"f"),xv(this,wv,i,"f")}matches(e){return this.direction!==e.direction&&this.field.pointerRules.accepts.some(t=>e.field.pointerRules.accepts.some(n=>n===t))}get connections(){return Vo(this,Na,"f").pointerHub.isEmpty()?O.empty():Vo(this,Na,"f").pointerHub.filter(c.VoltageConnection).map(({box:e})=>Vo(this,bv,"f").adapterFor(e,Ia))}get field(){return Vo(this,Na,"f")}get address(){return Vo(this,Na,"f").address}get direction(){return Vo(this,mh,"f")}get name(){return Vo(this,wv,"f")}toString(){return`{ModuleConnectorAdapter address: ${Vo(this,Na,"f").address.toString()}, direction: ${Vo(this,mh,"f")}}`}};bv=new WeakMap,Na=new WeakMap,mh=new WeakMap,wv=new WeakMap;var qw=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},gh=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Av,vh,yh,nu=class extends Ni{constructor(e,t){super(e,t),Av.set(this,void 0),vh.set(this,void 0),yh.set(this,void 0),qw(this,Av,this.parameters.createParameter(t.time,S.exponential(1,1e4),E.numeric({unit:"ms"}),"Time"),"f"),qw(this,vh,pr.create(e.boxAdapters,t.voltageInput,dr.Input,"Input"),"f"),qw(this,yh,pr.create(e.boxAdapters,t.voltageOutput,dr.Output,"Output"),"f")}get parameterTime(){return gh(this,Av,"f")}get voltageInput(){return gh(this,vh,"f")}get voltageOutput(){return gh(this,yh,"f")}get inputs(){return[gh(this,vh,"f")]}get outputs(){return[gh(this,yh,"f")]}};Av=new WeakMap,vh=new WeakMap,yh=new WeakMap;var qk=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},jE=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},xh,ou=class extends Ni{constructor(e,t){super(e,t),xh.set(this,void 0),qk(this,xh,pr.create(e.boxAdapters,t.input,dr.Input,"Input"),"f")}get voltageInput(){return jE(this,xh,"f")}get inputs(){return[jE(this,xh,"f")]}get outputs(){return O.empty()}};xh=new WeakMap;var Gw=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},bh=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},_v,wh,Ah,au=class extends Ni{constructor(e,t){super(e,t),_v.set(this,void 0),wh.set(this,void 0),Ah.set(this,void 0),Gw(this,_v,this.parameters.createParameter(t.gain,S.DefaultDecibel,E.numeric({unit:"db"}),"Gain"),"f"),Gw(this,wh,pr.create(e.boxAdapters,t.voltageInput,dr.Input,"Input"),"f"),Gw(this,Ah,pr.create(e.boxAdapters,t.voltageOutput,dr.Output,"Output"),"f")}get parameterGain(){return bh(this,_v,"f")}get voltageInput(){return bh(this,wh,"f")}get voltageOutput(){return bh(this,Ah,"f")}get inputs(){return[bh(this,wh,"f")]}get outputs(){return[bh(this,Ah,"f")]}};_v=new WeakMap,wh=new WeakMap,Ah=new WeakMap;var Hw=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Jw=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Pv,Sv,Ev,su=class extends Ni{constructor(e,t){super(e,t),Pv.set(this,void 0),Sv.set(this,void 0),Ev.set(this,void 0),Hw(this,Pv,pr.create(e.boxAdapters,t.voltageInputX,dr.Input,"X"),"f"),Hw(this,Sv,pr.create(e.boxAdapters,t.voltageInputY,dr.Input,"Y"),"f"),Hw(this,Ev,pr.create(e.boxAdapters,t.voltageOutput,dr.Output,"Result"),"f")}get inputs(){return[Jw(this,Pv,"f"),Jw(this,Sv,"f")]}get outputs(){return[Jw(this,Ev,"f")]}};Pv=new WeakMap,Sv=new WeakMap,Ev=new WeakMap;var Gk=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},LE=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},_h,lu=class extends Ni{constructor(e,t){super(e,t),_h.set(this,void 0),Gk(this,_h,pr.create(e.boxAdapters,t.output,dr.Output,"Output"),"f")}get voltageOutput(){return LE(this,_h,"f")}get inputs(){return O.empty()}get outputs(){return[LE(this,_h,"f")]}};_h=new WeakMap;var cu;(function(r){r.isVertexOfModule=e=>e.box.accept({visitModuleGainBox:()=>!0,visitModuleDelayBox:()=>!0,visitModuleMultiplierBox:()=>!0,visitModularAudioInputBox:()=>!0,visitModularAudioOutputBox:()=>!0})??!1,r.adapterFor=(e,t)=>se(t.accept({visitModuleGainBox:n=>e.adapterFor(n,au),visitModuleDelayBox:n=>e.adapterFor(n,nu),visitModuleMultiplierBox:n=>e.adapterFor(n,su),visitModularAudioInputBox:n=>e.adapterFor(n,lu),visitModularAudioOutputBox:n=>e.adapterFor(n,ou)}),`Could not find ModuleAdapter for ${t.name}`)})(cu||(cu={}));var KE=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},pl=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Fv,Bv,hl,Qw,uu=class{constructor(e,t){Fv.add(this),Bv.set(this,void 0),hl.set(this,void 0),KE(this,Bv,e,"f"),KE(this,hl,t,"f")}get box(){return pl(this,hl,"f")}get uuid(){return pl(this,hl,"f").address.uuid}get address(){return pl(this,hl,"f").address}get moduleAdapter(){return cu.adapterFor(pl(this,Bv,"f").boxAdapters,pl(this,Fv,"a",Qw).box)}get parameterAdapter(){return this.moduleAdapter.parameters.parameterAt(pl(this,Fv,"a",Qw).address)}terminate(){}};Bv=new WeakMap,hl=new WeakMap,Fv=new WeakSet,Qw=function(){return pl(this,hl,"f").parameter.targetVertex.unwrap("Parameter not assigned")};var WE=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Vr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},du,zr,$a=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",this.manualUrl=ue.Modular,du.set(this,void 0),zr.set(this,void 0),WE(this,du,e,"f"),WE(this,zr,t,"f")}get box(){return Vr(this,zr,"f")}get uuid(){return Vr(this,zr,"f").address.uuid}get address(){return Vr(this,zr,"f").address}get indexField(){return Vr(this,zr,"f").index}get labelField(){return Vr(this,zr,"f").label}get enabledField(){return Vr(this,zr,"f").enabled}get minimizedField(){return Vr(this,zr,"f").minimized}get host(){return Vr(this,zr,"f").host}parameterAt(e){return B("Not yet implemented")}deviceHost(){return Vr(this,du,"f").boxAdapters.adapterFor(Vr(this,zr,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}modular(){return Vr(this,du,"f").boxAdapters.adapterFor(Vr(this,zr,"f").modularSetup.targetVertex.unwrap("No Modular found").box,ka)}elements(){return Vr(this,zr,"f").userInterface.elements.pointerHub.filter(c.DeviceUserInterface).map(e=>Vr(this,du,"f").boxAdapters.adapterFor(e.box,uu))}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){}};du=new WeakMap,zr=new WeakMap;var Ph=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},He=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},pu,Da,hu,ci,fl,ml,ka=class{constructor(e,t){pu.set(this,new R),Da.set(this,void 0),hu.set(this,void 0),ci.set(this,void 0),fl.set(this,void 0),ml.set(this,void 0),Ph(this,hu,e,"f"),Ph(this,ci,t,"f"),Ph(this,Da,He(this,pu,"f").own(new jt),"f"),Ph(this,fl,w.newSet(s=>s.uuid),"f"),Ph(this,ml,w.newSet(s=>s.uuid),"f");let n=s=>{let l=cu.adapterFor(He(this,hu,"f").boxAdapters,s.box);He(this,fl,"f").add(l)&&He(this,Da,"f").proxy.onModuleAdded(l)},i=s=>He(this,Da,"f").proxy.onModuleRemoved(He(this,fl,"f").removeByKey(s.address.uuid)),o=s=>{let l=He(this,hu,"f").boxAdapters.adapterFor(s.box,Ia);He(this,ml,"f").add(l)&&He(this,Da,"f").proxy.onConnectionAdded(l)},a=s=>He(this,Da,"f").proxy.onConnectionRemoved(He(this,ml,"f").removeByKey(s.address.uuid));He(this,ci,"f").modules.pointerHub.filter(c.ModuleCollection).forEach(n),He(this,ci,"f").connections.pointerHub.filter(c.ConnectionCollection).forEach(o),He(this,pu,"f").own(He(this,ci,"f").modules.pointerHub.subscribe({onAdded:n,onRemoved:i},c.ModuleCollection)),He(this,pu,"f").own(He(this,ci,"f").connections.pointerHub.subscribe({onAdded:o,onRemoved:a},c.ConnectionCollection))}catchupAndSubscribe(e){return hw(e.onModuleAdded,t=>He(this,fl,"f").forEach(n=>t(n))),hw(e.onConnectionAdded,t=>He(this,ml,"f").forEach(n=>t(n))),He(this,Da,"f").subscribe(e)}get box(){return He(this,ci,"f")}get address(){return He(this,ci,"f").address}get uuid(){return He(this,ci,"f").address.uuid}get editingField(){return He(this,ci,"f").editing}get labelField(){return He(this,ci,"f").label}get modules(){return He(this,fl,"f").values()}get connections(){return He(this,ml,"f").values()}get device(){return He(this,hu,"f").boxAdapters.adapterFor(se(He(this,ci,"f").device.pointerHub.incoming().at(0),"No device found").box,$a)}terminate(){console.debug(`terminate ${this}`),He(this,pu,"f").terminate()}};pu=new WeakMap,Da=new WeakMap,hu=new WeakMap,ci=new WeakMap,fl=new WeakMap,ml=new WeakMap;var Sh=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Sr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Xw,mu,Eh,Iv,fu,Bh,kv,Fh,Nv,ZE,Hn=class{constructor(e,t){Xw.add(this),this.type="groove-adapter",Eh.set(this,new R),Iv.set(this,void 0),fu.set(this,void 0),Bh.set(this,void 0),kv.set(this,new dm({duration:()=>Sr(this,Nv,"f"),fx:n=>vw(n,Sr(this,Fh,"f")),fy:n=>vw(n,1-Sr(this,Fh,"f"))})),Fh.set(this,0),Nv.set(this,G.SemiQuaver*2),Sh(this,Iv,e,"f"),Sh(this,fu,t,"f"),Sh(this,Bh,Sr(this,Eh,"f").own(new ve(Sr(this,Iv,"f"))),"f"),this.namedParameter=Sr(this,Xw,"m",ZE).call(this,t),Sr(this,Eh,"f").ownAll(this.namedParameter.duration.catchupAndSubscribe(n=>Sh(this,Nv,n.getValue(),"f")),this.namedParameter.amount.catchupAndSubscribe(n=>Sh(this,Fh,eE(n.getValue(),.01),"f")))}unwarp(e){return Sr(this,kv,"f").unwarp(e)}warp(e){return Sr(this,kv,"f").warp(e)}get box(){return Sr(this,fu,"f")}get uuid(){return Sr(this,fu,"f").address.uuid}get address(){return Sr(this,fu,"f").address}terminate(){Sr(this,Eh,"f").terminate()}};mu=Hn,Eh=new WeakMap,Iv=new WeakMap,fu=new WeakMap,Bh=new WeakMap,kv=new WeakMap,Fh=new WeakMap,Nv=new WeakMap,Xw=new WeakSet,ZE=function(e){return{duration:Sr(this,Bh,"f").createParameter(e.duration,S.values(mu.DurationPPQNs),E.values("",mu.DurationPPQNs,mu.DurationStrings),"duration"),amount:Sr(this,Bh,"f").createParameter(e.amount,S.unipolar(),E.percent({fractionDigits:0}),"amount")}};Hn.Durations=[[1,8],[1,4],[1,4],[1,2],[1,1],[2,1],[4,1],[8,1],[16,1]];Hn.DurationPPQNs=mu.Durations.map(([r,e])=>G.fromSignature(r,e));Hn.DurationStrings=mu.Durations.map(([r,e])=>`${r}/${e}`);var gu=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},bt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Jn,Ma,vu,$v,Dv,Ih,kh,Yw,Ta=class{constructor(e,t,n,i,o){Jn.set(this,void 0),Ma.set(this,void 0),vu.set(this,void 0),$v.set(this,void 0),Dv.set(this,void 0),Ih.set(this,new R),kh.set(this,void 0),Yw.set(this,m.None),gu(this,Jn,e,"f"),gu(this,Ma,t,"f"),gu(this,vu,n,"f"),gu(this,$v,i,"f"),gu(this,Dv,o??0,"f"),gu(this,kh,bt(this,Ih,"f").own(new te),"f"),bt(this,Ih,"f").own(bt(this,Jn,"f").subscribe(()=>bt(this,kh,"f").notify(this))),e.getValue(),t.clamp(e.getValue())}get field(){return bt(this,Jn,"f")}get valueMapping(){return bt(this,Ma,"f")}get stringMapping(){return bt(this,vu,"f")}get name(){return bt(this,$v,"f")}get anchor(){return bt(this,Dv,"f")}get type(){return bt(this,Jn,"f").type}get address(){return bt(this,Jn,"f").address}get track(){return bt(this,Yw,"f")}subscribe(e){return bt(this,kh,"f").subscribe(e)}catchupAndSubscribe(e){return e(this),this.subscribe(e)}getValue(){return bt(this,Jn,"f").getValue()}setValue(e){bt(this,Jn,"f").setValue(bt(this,Ma,"f").clamp(e))}setUnitValue(e){this.setValue(bt(this,Ma,"f").y(e))}getUnitValue(){return bt(this,Ma,"f").x(this.getValue())}getPrintValue(){return bt(this,vu,"f").x(this.getValue())}setPrintValue(e){let t=bt(this,vu,"f").y(e);t.type==="unitValue"?this.setUnitValue(pe(t.value,0,1)):t.type==="explicit"?this.setValue(this.valueMapping.clamp(t.value)):console.debug(`Unknown text input: '${t.value}'`)}reset(){this.setValue(bt(this,Ma,"f").clamp(bt(this,Jn,"f").initValue))}terminate(){bt(this,Ih,"f").terminate()}};Jn=new WeakMap,Ma=new WeakMap,vu=new WeakMap,$v=new WeakMap,Dv=new WeakMap,Ih=new WeakMap,kh=new WeakMap,Yw=new WeakMap;var yu=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},$i=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Qn,Mv,Tv,Cv,Rv,Ov,Vv=class{constructor(e){Qn.set(this,void 0),Mv.set(this,void 0),Tv.set(this,void 0),Cv.set(this,void 0),Rv.set(this,void 0),Ov.set(this,void 0),yu(this,Qn,e,"f"),yu(this,Mv,new Ta($i(this,Qn,"f").keyboard,S.values([88,76,61,49]),E.numeric({fractionDigits:1}),"Keyboard Type"),"f"),yu(this,Tv,new Ta($i(this,Qn,"f").timeRangeInQuarters,S.exponential(1,64),E.numeric({fractionDigits:1}),"Time-Range"),"f"),yu(this,Cv,new Ta($i(this,Qn,"f").noteScale,S.exponential(.5,2),E.numeric({fractionDigits:1}),"Note Scale"),"f"),yu(this,Rv,new Ta($i(this,Qn,"f").noteLabels,S.bool,E.bool,"Note Labels"),"f"),yu(this,Ov,new Ta($i(this,Qn,"f").transpose,S.linearInteger(-48,48),E.numeric({fractionDigits:0}),"Transpose"),"f")}subscribe(e){return $i(this,Qn,"f").box.subscribe(ke.Children,()=>e(this))}get object(){return $i(this,Qn,"f")}get keyboard(){return $i(this,Mv,"f")}get timeRangeInQuarters(){return $i(this,Tv,"f")}get noteScale(){return $i(this,Cv,"f")}get noteLabels(){return $i(this,Rv,"f")}get transpose(){return $i(this,Ov,"f")}};Qn=new WeakMap,Mv=new WeakMap,Tv=new WeakMap,Cv=new WeakMap,Rv=new WeakMap,Ov=new WeakMap;var Nh=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ot=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},gl,ui,vl,zv,Uv,xu=class{constructor(e,t){gl.set(this,void 0),ui.set(this,void 0),vl.set(this,void 0),zv.set(this,void 0),Uv.set(this,void 0),Nh(this,gl,e,"f"),Nh(this,ui,t,"f"),Nh(this,vl,Kt.create(Ot(this,ui,"f").audioUnits,n=>Ot(this,gl,"f").boxAdapters.adapterFor(n,Si),c.AudioUnits),"f"),Nh(this,zv,new nv(Ot(this,ui,"f").audioBusses.pointerHub,n=>Ot(this,gl,"f").boxAdapters.adapterFor(n,_r),c.AudioBusses),"f"),Nh(this,Uv,new Vv(Ot(this,ui,"f").pianoMode),"f")}get uuid(){return Ot(this,ui,"f").address.uuid}get address(){return Ot(this,ui,"f").address}get box(){return Ot(this,ui,"f")}get audioBusses(){return Ot(this,zv,"f")}get audioUnits(){return Ot(this,vl,"f")}get clips(){return Ot(this,vl,"f").adapters().flatMap(e=>e.tracks.collection.adapters()).flatMap(e=>e.clips.collection.adapters())}get groove(){return Ot(this,gl,"f").boxAdapters.adapterFor(Ot(this,ui,"f").groove.targetVertex.unwrap("no groove").box,Hn)}get timeline(){return Ot(this,gl,"f").boxAdapters.adapterFor(Ot(this,ui,"f").timeline.targetVertex.unwrap("no timeline").box,Bi)}get pianoMode(){return Ot(this,Uv,"f")}get created(){return new Date(Ot(this,ui,"f").created.getValue())}get midiOutputDevices(){return Ot(this,ui,"f").outputMidiDevices.pointerHub.incoming().map(({box:e})=>Te(e,Xi))}*labeledAudioOutputs(){for(let e of Ot(this,vl,"f").adapters())yield{label:e.label,address:e.address,children:()=>m.wrap(e.labeledAudioOutputs())}}terminate(){Ot(this,vl,"f").terminate()}};gl=new WeakMap,ui=new WeakMap,vl=new WeakMap,zv=new WeakMap,Uv=new WeakMap;var e0=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},hr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},t0,$h,un,Ca,qE,bu=class{constructor(e,t){t0.add(this),this.type="instrument",this.accepts="audio",this.manualUrl=ue.Tape,$h.set(this,void 0),un.set(this,void 0),Ca.set(this,void 0),e0(this,$h,e,"f"),e0(this,un,t,"f"),e0(this,Ca,new ve(hr(this,$h,"f")),"f"),this.namedParameter=hr(this,t0,"m",qE).call(this,t)}get box(){return hr(this,un,"f")}get uuid(){return hr(this,un,"f").address.uuid}get address(){return hr(this,un,"f").address}get labelField(){return hr(this,un,"f").label}get iconField(){return hr(this,un,"f").icon}get defaultTrackType(){return oe.Audio}get enabledField(){return hr(this,un,"f").enabled}get minimizedField(){return hr(this,un,"f").minimized}get acceptsMidiEvents(){return!1}deviceHost(){return hr(this,$h,"f").boxAdapters.adapterFor(hr(this,un,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){hr(this,Ca,"f").terminate()}};$h=new WeakMap,un=new WeakMap,Ca=new WeakMap,t0=new WeakSet,qE=function(e){return{flutter:hr(this,Ca,"f").createParameter(e.flutter,S.unipolar(),E.percent(),"flutter"),wow:hr(this,Ca,"f").createParameter(e.wow,S.unipolar(),E.percent(),"wow"),noise:hr(this,Ca,"f").createParameter(e.noise,S.unipolar(),E.percent(),"noise"),saturation:hr(this,Ca,"f").createParameter(e.saturation,S.unipolar(),E.percent(),"saturation")}};var Xn=(()=>{let t=[1,2,3,4],n=["12","24","36","48"],i=[Qe.sine,Qe.triangle,Qe.saw,Qe.square],o=["Sine","Triangle","Saw","Square"];return{MIN_CUTOFF:20,MAX_CUTOFF:2e4,CUTOFF_VALUE_MAPPING:S.exponential(20,2e4),CUTOFF_STRING_MAPPING:E.numeric({unit:"Hz"}),FILTER_ORDER_VALUES:t,FILTER_ORDER_STRINGS:n,FILTER_ORDER_VALUE_MAPPING:S.values(t),FILTER_ORDER_STRING_MAPPING:E.values("db",t,n),LFO_WAVEFORM_VALUES:i,LFO_WAVEFORM_STRINGS:o,LFO_WAVEFORM_VALUE_MAPPING:S.values(i),LFO_WAVEFORM_STRING_MAPPING:E.values("",i,o)}})();var r0=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},De=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},i0,Dh,dn,qe,GE,wu=class{constructor(e,t){i0.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ue.Vaporisateur,Dh.set(this,void 0),dn.set(this,void 0),qe.set(this,void 0),r0(this,Dh,e,"f"),r0(this,dn,t,"f"),r0(this,qe,new ve(De(this,Dh,"f")),"f"),this.namedParameter=De(this,i0,"m",GE).call(this,t)}get box(){return De(this,dn,"f")}get uuid(){return De(this,dn,"f").address.uuid}get address(){return De(this,dn,"f").address}get labelField(){return De(this,dn,"f").label}get iconField(){return De(this,dn,"f").icon}get defaultTrackType(){return oe.Notes}get enabledField(){return De(this,dn,"f").enabled}get minimizedField(){return De(this,dn,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return De(this,Dh,"f").boxAdapters.adapterFor(De(this,dn,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){De(this,qe,"f").terminate()}};Dh=new WeakMap,dn=new WeakMap,qe=new WeakMap,i0=new WeakSet,GE=function(e){let t=[Dn.Monophonic,Dn.Polyphonic];return{oscillators:e.oscillators.fields().map(n=>({waveform:De(this,qe,"f").createParameter(n.waveform,S.linearInteger(0,3),E.indices("",["Sine","Triangle","Sawtooth","Square"]),"Waveform"),volume:De(this,qe,"f").createParameter(n.volume,S.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Volume"),octave:De(this,qe,"f").createParameter(n.octave,S.linearInteger(-3,3),E.numeric({unit:"oct"}),"Octave",.5),tune:De(this,qe,"f").createParameter(n.tune,S.linear(-1200,1200),E.numeric({unit:"ct",fractionDigits:0}),"Tune",.5)})),noise:{volume:De(this,qe,"f").createParameter(e.noise.volume,S.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"Volume"),attack:De(this,qe,"f").createParameter(e.noise.attack,S.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Attack"),hold:De(this,qe,"f").createParameter(e.noise.hold,S.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Hold"),release:De(this,qe,"f").createParameter(e.noise.release,S.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Release")},filterOrder:De(this,qe,"f").createParameter(e.filterOrder,Xn.FILTER_ORDER_VALUE_MAPPING,Xn.FILTER_ORDER_STRING_MAPPING,"Flt. Order"),cutoff:De(this,qe,"f").createParameter(e.cutoff,Xn.CUTOFF_VALUE_MAPPING,Xn.CUTOFF_STRING_MAPPING,"Flt. Cutoff"),resonance:De(this,qe,"f").createParameter(e.resonance,S.exponential(.01,10),E.numeric({unit:"q",fractionDigits:3}),"Flt. Q"),attack:De(this,qe,"f").createParameter(e.attack,S.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Attack"),decay:De(this,qe,"f").createParameter(e.decay,S.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Decay"),sustain:De(this,qe,"f").createParameter(e.sustain,S.unipolar(),E.percent({fractionDigits:1}),"Sustain"),release:De(this,qe,"f").createParameter(e.release,S.exponential(.001,5),E.numeric({unit:"s",fractionDigits:3}),"Release"),filterEnvelope:De(this,qe,"f").createParameter(e.filterEnvelope,S.bipolar(),E.percent({fractionDigits:1}),"Flt. Env.",.5),filterKeyboard:De(this,qe,"f").createParameter(e.filterKeyboard,S.bipolar(),E.percent({fractionDigits:1}),"Flt. Kbd.",.5),voicingMode:De(this,qe,"f").createParameter(e.voicingMode,S.values(t),E.values("",t,["mono","poly"]),"Play Mode",.5),glideTime:De(this,qe,"f").createParameter(e.glideTime,S.unipolar(),E.percent({fractionDigits:1}),"Glide time",0),unisonCount:De(this,qe,"f").createParameter(e.unisonCount,S.values([1,3,5]),E.values("#",[1,3,5],[1,3,5].map(n=>String(n))),"Unisono",0),unisonDetune:De(this,qe,"f").createParameter(e.unisonDetune,S.exponential(1,1200),E.numeric({unit:"ct",fractionDigits:0}),"Detune",0),unisonStereo:De(this,qe,"f").createParameter(e.unisonStereo,S.unipolar(),E.percent({fractionDigits:0}),"Stereo",0),lfoWaveform:De(this,qe,"f").createParameter(e.lfo.waveform,Xn.LFO_WAVEFORM_VALUE_MAPPING,Xn.LFO_WAVEFORM_STRING_MAPPING,"LFO Shape",0),lfoRate:De(this,qe,"f").createParameter(e.lfo.rate,S.exponential(1e-4,30),E.numeric({unit:"Hz",fractionDigits:1,unitPrefix:!0}),"Rate",0),lfoTargetTune:De(this,qe,"f").createParameter(e.lfo.targetTune,S.bipolar(),E.percent({fractionDigits:1}),"Vibrato \u29BF",.5),lfoTargetVolume:De(this,qe,"f").createParameter(e.lfo.targetVolume,S.bipolar(),E.percent({fractionDigits:1}),"Tremolo \u29BF",.5),lfoTargetCutoff:De(this,qe,"f").createParameter(e.lfo.targetCutoff,S.bipolar(),E.percent({fractionDigits:1}),"Cutoff \u29BF",.5)}};var n0=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},qt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},o0,jv,Mh,Di,Yn,HE,pn=class{constructor(e,t){o0.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=ue.Arpeggio,Mh.set(this,void 0),Di.set(this,void 0),Yn.set(this,void 0),n0(this,Mh,e,"f"),n0(this,Di,t,"f"),n0(this,Yn,new ve(qt(this,Mh,"f")),"f"),this.namedParameter=qt(this,o0,"m",HE).call(this,t)}get box(){return qt(this,Di,"f")}get uuid(){return qt(this,Di,"f").address.uuid}get address(){return qt(this,Di,"f").address}get indexField(){return qt(this,Di,"f").index}get labelField(){return qt(this,Di,"f").label}get enabledField(){return qt(this,Di,"f").enabled}get minimizedField(){return qt(this,Di,"f").minimized}get host(){return qt(this,Di,"f").host}deviceHost(){return qt(this,Mh,"f").boxAdapters.adapterFor(qt(this,Di,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){qt(this,Yn,"f").terminate()}};jv=pn,Mh=new WeakMap,Di=new WeakMap,Yn=new WeakMap,o0=new WeakSet,HE=function(e){return{modeIndex:qt(this,Yn,"f").createParameter(e.modeIndex,S.linearInteger(0,2),E.indices("",["Up","Down","UpDown"]),"mode"),numOctaves:qt(this,Yn,"f").createParameter(e.numOctaves,S.linearInteger(1,5),E.numeric({unit:"",fractionDigits:0}),"Octaves"),rate:qt(this,Yn,"f").createParameter(e.rateIndex,S.linearInteger(0,jv.RateFractions.length-1),jv.RateStringMapping,"Rate"),gate:qt(this,Yn,"f").createParameter(e.gate,S.linear(0,2),E.percent({fractionDigits:0}),"Gate"),repeat:qt(this,Yn,"f").createParameter(e.repeat,S.linearInteger(1,16),E.numeric({fractionDigits:0}),"Repeat"),velocity:qt(this,Yn,"f").createParameter(e.velocity,S.bipolar(),E.percent({fractionDigits:0,bipolar:!1}),"Velocity")}};pn.RateFractions=Yt.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();pn.RateStringMapping=E.indices("",jv.RateFractions.map(([r,e])=>`${r}/${e}`));var a0=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},fr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},s0,Th,Mi,yl,JE,Au=class{constructor(e,t){s0.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=ue.Pitch,Th.set(this,void 0),Mi.set(this,void 0),yl.set(this,void 0),a0(this,Th,e,"f"),a0(this,Mi,t,"f"),a0(this,yl,new ve(fr(this,Th,"f")),"f"),this.namedParameter=fr(this,s0,"m",JE).call(this,t)}get box(){return fr(this,Mi,"f")}get uuid(){return fr(this,Mi,"f").address.uuid}get address(){return fr(this,Mi,"f").address}get indexField(){return fr(this,Mi,"f").index}get labelField(){return fr(this,Mi,"f").label}get enabledField(){return fr(this,Mi,"f").enabled}get minimizedField(){return fr(this,Mi,"f").minimized}get host(){return fr(this,Mi,"f").host}deviceHost(){return fr(this,Th,"f").boxAdapters.adapterFor(fr(this,Mi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){fr(this,yl,"f").terminate()}};Th=new WeakMap,Mi=new WeakMap,yl=new WeakMap,s0=new WeakSet,JE=function(e){return{octaves:fr(this,yl,"f").createParameter(e.octaves,S.linearInteger(-7,7),E.numeric({unit:"oct",fractionDigits:0}),"octaves"),semiTones:fr(this,yl,"f").createParameter(e.semiTones,S.linearInteger(-36,36),E.numeric({unit:"st",fractionDigits:0}),"semi-tones"),cent:fr(this,yl,"f").createParameter(e.cents,S.linear(-50,50),E.numeric({unit:"cents",fractionDigits:1}),"cents")}};var l0=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ur=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},c0,Ch,hn,_u,QE,Pu=class{constructor(e,t){c0.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ue.Nano,Ch.set(this,void 0),hn.set(this,void 0),_u.set(this,void 0),l0(this,Ch,e,"f"),l0(this,hn,t,"f"),l0(this,_u,new ve(Ur(this,Ch,"f")),"f"),this.namedParameter=Ur(this,c0,"m",QE).call(this,t)}get box(){return Ur(this,hn,"f")}get uuid(){return Ur(this,hn,"f").address.uuid}get address(){return Ur(this,hn,"f").address}get labelField(){return Ur(this,hn,"f").label}get iconField(){return Ur(this,hn,"f").icon}get defaultTrackType(){return oe.Notes}get enabledField(){return Ur(this,hn,"f").enabled}get minimizedField(){return Ur(this,hn,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Ur(this,Ch,"f").boxAdapters.adapterFor(Ur(this,hn,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Ur(this,_u,"f").terminate()}};Ch=new WeakMap,hn=new WeakMap,_u=new WeakMap,c0=new WeakSet,QE=function(e){return{volume:Ur(this,_u,"f").createParameter(e.volume,S.DefaultDecibel,E.numeric({unit:"db",fractionDigits:1}),"volume"),release:Ur(this,_u,"f").createParameter(e.release,S.exponential(.001,8),E.numeric({unit:"s",fractionDigits:3}),"release")}};var Su=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},X=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},u0,xl,Ra,Ee,Lv,Rh,di,bl,XE,Eu=class{constructor(e,t){u0.add(this),this.class="device-host",this.accepts=!1,this.type="instrument",this.manualUrl="manuals/devices/instruments/playfield",xl.set(this,new R),Ra.set(this,void 0),Ee.set(this,void 0),Lv.set(this,void 0),Rh.set(this,void 0),di.set(this,void 0),bl.set(this,m.None),Su(this,Ra,e,"f"),Su(this,Ee,t,"f"),Su(this,Lv,X(this,xl,"f").own(Kt.create(X(this,Ee,"f").midiEffects,n=>X(this,Ra,"f").boxAdapters.adapterFor(n,ne.isMidiEffect),c.MIDIEffectHost)),"f"),Su(this,Rh,X(this,xl,"f").own(Kt.create(X(this,Ee,"f").audioEffects,n=>X(this,Ra,"f").boxAdapters.adapterFor(n,ne.isAudioEffect),c.AudioEffectHost)),"f"),Su(this,di,X(this,xl,"f").own(new ve(X(this,Ra,"f"))),"f"),this.namedParameter=X(this,u0,"m",XE).call(this,t),X(this,xl,"f").own(X(this,Ee,"f").file.catchupAndSubscribe(n=>{Su(this,bl,n.targetVertex.map(({box:i})=>X(this,Ra,"f").boxAdapters.adapterFor(i,tn)),"f"),X(this,bl,"f").unwrapOrNull()?.getOrCreateLoader()}))}get box(){return X(this,Ee,"f")}get uuid(){return X(this,Ee,"f").address.uuid}get address(){return X(this,Ee,"f").address}get peakAddress(){return X(this,Ee,"f").address.append(1001)}get indexField(){return X(this,Ee,"f").index}get gate(){return X(this,Ee,"f").gate.getValue()}get exclude(){return X(this,Ee,"f").exclude.getValue()}get label(){return`${this.device().labelField.getValue()} > ${X(this,bl,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get fileLabel(){return`${X(this,bl,"f").mapOr(e=>e.box.fileName.getValue(),"No file")}`}get iconField(){return X(this,Ee,"f").icon}get defaultTrackType(){return oe.Notes}get acceptsMidiEvents(){return!0}get midiEffectsField(){return X(this,Ee,"f").midiEffects}get inputField(){return this.audioUnitBoxAdapter().box.input}get audioEffectsField(){return X(this,Ee,"f").audioEffects}get tracksField(){return this.audioUnitBoxAdapter().box.tracks}get isAudioUnit(){return!1}file(){return X(this,bl,"f")}fileUUID(){return X(this,Ee,"f").file.targetAddress.unwrap().uuid}resetParameters(){X(this,Ee,"f").mute.reset(),X(this,Ee,"f").solo.reset(),X(this,Ee,"f").exclude.reset(),X(this,Ee,"f").polyphone.reset(),X(this,Ee,"f").pitch.reset(),X(this,Ee,"f").attack.reset(),X(this,Ee,"f").release.reset(),X(this,Ee,"f").sampleStart.reset(),X(this,Ee,"f").sampleEnd.reset(),X(this,Ee,"f").gate.reset()}copyToIndex(e){na.create(X(this,Ee,"f").graph,w.generate(),t=>{t.file.refer(X(this,Ee,"f").file.targetVertex.unwrap()),t.device.refer(X(this,Ee,"f").device.targetVertex.unwrap()),t.index.setValue(e),t.mute.setValue(X(this,Ee,"f").mute.getValue()),t.solo.setValue(X(this,Ee,"f").solo.getValue()),t.sampleStart.setValue(X(this,Ee,"f").sampleStart.getValue()),t.sampleEnd.setValue(X(this,Ee,"f").sampleEnd.getValue()),t.attack.setValue(X(this,Ee,"f").attack.getValue()),t.release.setValue(X(this,Ee,"f").release.getValue()),t.pitch.setValue(X(this,Ee,"f").pitch.getValue()),t.exclude.setValue(X(this,Ee,"f").exclude.getValue()),t.gate.setValue(X(this,Ee,"f").gate.getValue())})}get midiEffects(){return X(this,Lv,"f")}get inputAdapter(){return m.wrap(this)}get audioEffects(){return X(this,Rh,"f")}get labelField(){return X(this,Ee,"f").label}get enabledField(){return X(this,Ee,"f").enabled}get minimizedField(){return X(this,Ee,"f").minimized}device(){return X(this,Ra,"f").boxAdapters.adapterFor(X(this,Ee,"f").device.targetVertex.unwrap().box,Oa)}deviceHost(){return this.device().deviceHost()}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.fileLabel,children:()=>m.None};for(let e of X(this,Rh,"f").adapters())yield*e.labeledAudioOutputs()}terminate(){X(this,xl,"f").terminate()}};xl=new WeakMap,Ra=new WeakMap,Ee=new WeakMap,Lv=new WeakMap,Rh=new WeakMap,di=new WeakMap,bl=new WeakMap,u0=new WeakSet,XE=function(e){return{gate:X(this,di,"f").createParameter(e.gate,S.linearInteger(0,2),E.indices("",["Off","On","Loop"]),"Gate"),mute:X(this,di,"f").createParameter(e.mute,S.bool,E.bool,"Mute"),solo:X(this,di,"f").createParameter(e.solo,S.bool,E.bool,"Solo"),polyphone:X(this,di,"f").createParameter(e.polyphone,S.bool,E.bool,"Polyphone"),exclude:X(this,di,"f").createParameter(e.exclude,S.bool,E.bool,"Exclude"),pitch:X(this,di,"f").createParameter(e.pitch,S.linear(-1200,1200),E.numeric({unit:"cents",bipolar:!0,fractionDigits:0}),"Pitch",0),sampleStart:X(this,di,"f").createParameter(e.sampleStart,S.unipolar(),E.percent(),"Start",0),sampleEnd:X(this,di,"f").createParameter(e.sampleEnd,S.unipolar(),E.percent(),"End",1),attack:X(this,di,"f").createParameter(e.attack,S.exponential(.001,5),E.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Attack"),release:X(this,di,"f").createParameter(e.release,S.exponential(.001,5),E.numeric({unit:"s",unitPrefix:!0,fractionDigits:1}),"Release")}};var Kv=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Er=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Fu,fn,Bu,Wv,Oa=class{constructor(e,t){this.type="instrument",this.accepts="midi",this.manualUrl=ue.Playfield,Fu.set(this,void 0),fn.set(this,void 0),Bu.set(this,void 0),Wv.set(this,void 0),Kv(this,Fu,e,"f"),Kv(this,fn,t,"f"),Kv(this,Bu,Kt.create(t.samples,n=>e.boxAdapters.adapterFor(n,Eu),c.Sample),"f"),Kv(this,Wv,new ve(Er(this,Fu,"f")),"f")}reset(){Er(this,Bu,"f").adapters().forEach(e=>e.box.delete())}get box(){return Er(this,fn,"f")}get uuid(){return Er(this,fn,"f").address.uuid}get address(){return Er(this,fn,"f").address}get labelField(){return Er(this,fn,"f").label}get iconField(){return Er(this,fn,"f").icon}get defaultTrackType(){return oe.Notes}get enabledField(){return Er(this,fn,"f").enabled}get minimizedField(){return Er(this,fn,"f").minimized}get acceptsMidiEvents(){return!0}get samples(){return Er(this,Bu,"f")}get context(){return Er(this,Fu,"f")}deviceHost(){return Er(this,Fu,"f").boxAdapters.adapterFor(Er(this,fn,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None};for(let e of Er(this,Bu,"f").adapters())yield{address:e.address,label:e.fileLabel,children:()=>m.wrap(e.labeledAudioOutputs())}}terminate(){Er(this,Wv,"f").terminate()}};Fu=new WeakMap,fn=new WeakMap,Bu=new WeakMap,Wv=new WeakMap;var d0=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Gt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},p0,Oh,Ti,eo,YE,Iu=class{constructor(e,t){p0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ue.StereoTool,Oh.set(this,void 0),Ti.set(this,void 0),eo.set(this,void 0),d0(this,Oh,e,"f"),d0(this,Ti,t,"f"),d0(this,eo,new ve(Gt(this,Oh,"f")),"f"),this.namedParameter=Gt(this,p0,"m",YE).call(this,t)}get box(){return Gt(this,Ti,"f")}get uuid(){return Gt(this,Ti,"f").address.uuid}get address(){return Gt(this,Ti,"f").address}get indexField(){return Gt(this,Ti,"f").index}get labelField(){return Gt(this,Ti,"f").label}get enabledField(){return Gt(this,Ti,"f").enabled}get minimizedField(){return Gt(this,Ti,"f").minimized}get host(){return Gt(this,Ti,"f").host}deviceHost(){return Gt(this,Oh,"f").boxAdapters.adapterFor(Gt(this,Ti,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Gt(this,eo,"f").terminate()}};Oh=new WeakMap,Ti=new WeakMap,eo=new WeakMap,p0=new WeakSet,YE=function(e){return{volume:Gt(this,eo,"f").createParameter(e.volume,S.decibel(-72,0,12),E.numeric({unit:"db",fractionDigits:1}),"Volume"),panning:Gt(this,eo,"f").createParameter(e.panning,S.bipolar(),E.panning,"Panning",.5),stereo:Gt(this,eo,"f").createParameter(e.stereo,S.bipolar(),E.numeric({unit:"%",fractionDigits:0}),"stereo",.5),invertL:Gt(this,eo,"f").createParameter(e.invertL,S.bool,E.bool,"Invert Left"),invertR:Gt(this,eo,"f").createParameter(e.invertR,S.bool,E.bool,"Invert Right"),swap:Gt(this,eo,"f").createParameter(e.swap,S.bool,E.bool,"Swap")}};var wl;(function(r){r.checkType=e=>e!==null&&typeof e=="object"&&"type"in e&&e.type==="groove-adapter"})(wl||(wl={}));var eF=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},jr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ku,Lr,Nu=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",this.manualUrl=ue.Zeitgeist,ku.set(this,void 0),Lr.set(this,void 0),eF(this,ku,e,"f"),eF(this,Lr,t,"f"),this.groove()}get box(){return jr(this,Lr,"f")}get uuid(){return jr(this,Lr,"f").address.uuid}get address(){return jr(this,Lr,"f").address}get indexField(){return jr(this,Lr,"f").index}get labelField(){return jr(this,Lr,"f").label}get enabledField(){return jr(this,Lr,"f").enabled}get minimizedField(){return jr(this,Lr,"f").minimized}get host(){return jr(this,Lr,"f").host}deviceHost(){return jr(this,ku,"f").boxAdapters.adapterFor(jr(this,Lr,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}groove(){return jr(this,ku,"f").boxAdapters.adapterFor(jr(this,Lr,"f").groove.targetVertex.unwrap("no groove").box,wl.checkType)}catchupAndSubscribeGroove(e){return jr(this,Lr,"f").groove.catchupAndSubscribe(t=>e(jr(this,ku,"f").boxAdapters.adapterFor(t.targetVertex.unwrap("No groove found").box,wl.checkType)))}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};ku=new WeakMap,Lr=new WeakMap;var tF=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},mn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Zv,pi,$u=class{constructor(e,t){this.type="audio-effect",this.accepts="audio",this.manualUrl="",Zv.set(this,void 0),pi.set(this,void 0),tF(this,Zv,e,"f"),tF(this,pi,t,"f")}get box(){return mn(this,pi,"f")}get uuid(){return mn(this,pi,"f").address.uuid}get address(){return mn(this,pi,"f").address}get indexField(){return mn(this,pi,"f").index}get labelField(){return mn(this,pi,"f").label}get enabledField(){return mn(this,pi,"f").enabled}get minimizedField(){return mn(this,pi,"f").minimized}get host(){return mn(this,pi,"f").host}get commentField(){return mn(this,pi,"f").comment}deviceHost(){return mn(this,Zv,"f").boxAdapters.adapterFor(mn(this,pi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){}};Zv=new WeakMap,pi=new WeakMap;var rF=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},gn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},qv,hi,Du=class{constructor(e,t){this.type="midi-effect",this.accepts="midi",this.manualUrl="",qv.set(this,void 0),hi.set(this,void 0),rF(this,qv,e,"f"),rF(this,hi,t,"f")}get box(){return gn(this,hi,"f")}get uuid(){return gn(this,hi,"f").address.uuid}get address(){return gn(this,hi,"f").address}get indexField(){return gn(this,hi,"f").index}get labelField(){return gn(this,hi,"f").label}get enabledField(){return gn(this,hi,"f").enabled}get minimizedField(){return gn(this,hi,"f").minimized}get host(){return gn(this,hi,"f").host}get commentField(){return gn(this,hi,"f").comment}deviceHost(){return gn(this,qv,"f").boxAdapters.adapterFor(gn(this,hi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){}};qv=new WeakMap,hi=new WeakMap;var Va=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Me=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},h0,f0,Vh,Kr,Gv,Mu,vn,Ci,Tu,iF,m0,Cu=class{constructor(e,t){h0.add(this),this.type="instrument",this.accepts="midi",this.manualUrl=ue.Soundfont,f0.set(this,new R),Vh.set(this,void 0),Kr.set(this,void 0),Gv.set(this,void 0),Mu.set(this,void 0),vn.set(this,void 0),Ci.set(this,void 0),Tu.set(this,q.Empty),m0.set(this,n=>n.match({none:()=>{Me(this,Ci,"f").clear(),Me(this,vn,"f").clear()},some:i=>i.soundfont.match({none:()=>{Me(this,Ci,"f").clear(),Me(this,vn,"f").clear(),Me(this,Tu,"f").terminate(),Va(this,Tu,i.subscribe(o=>{if(o.type==="loaded"){let a=i.soundfont.unwrap();Me(this,Ci,"f").wrap(a.presets[this.presetIndex]??a.presets[0]),Me(this,vn,"f").wrap(a)}else o.type==="error"?(Me(this,Ci,"f").clear(),Me(this,vn,"f").clear()):o.type==="idle"&&(Me(this,Ci,"f").clear(),Me(this,vn,"f").clear())}),"f")},some:o=>{Me(this,vn,"f").wrap(o),Me(this,Ci,"f").wrap(o.presets[this.presetIndex]??o.presets[0])}})})),Va(this,Vh,e,"f"),Va(this,Kr,t,"f"),Va(this,Gv,new ve(Me(this,Vh,"f")),"f"),this.namedParameter=Me(this,h0,"m",iF).call(this,t),Va(this,Mu,new $r,"f"),Va(this,vn,new $r,"f"),Va(this,Ci,new $r,"f"),Me(this,f0,"f").ownAll(Me(this,Mu,"f").subscribe(Me(this,m0,"f")),Me(this,Kr,"f").file.catchupAndSubscribe(({targetVertex:n})=>Me(this,Mu,"f").wrapOption(n.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid)))),Me(this,Kr,"f").presetIndex.catchupAndSubscribe(n=>Me(this,vn,"f").match({none:()=>Me(this,Ci,"f").clear(),some:i=>Me(this,Ci,"f").wrap(i.presets[n.getValue()]??i.presets[0])})))}get loader(){return Me(this,Mu,"f")}get soundfont(){return Me(this,vn,"f")}get preset(){return Me(this,Ci,"f")}get presetIndex(){return Me(this,Kr,"f").presetIndex.getValue()}get box(){return Me(this,Kr,"f")}get uuid(){return Me(this,Kr,"f").address.uuid}get address(){return Me(this,Kr,"f").address}get labelField(){return Me(this,Kr,"f").label}get iconField(){return Me(this,Kr,"f").icon}get defaultTrackType(){return oe.Notes}get enabledField(){return Me(this,Kr,"f").enabled}get minimizedField(){return Me(this,Kr,"f").minimized}get acceptsMidiEvents(){return!0}deviceHost(){return Me(this,Vh,"f").boxAdapters.adapterFor(Me(this,Kr,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Me(this,Tu,"f").terminate(),Va(this,Tu,q.Empty,"f"),Me(this,Gv,"f").terminate()}};f0=new WeakMap,Vh=new WeakMap,Kr=new WeakMap,Gv=new WeakMap,Mu=new WeakMap,vn=new WeakMap,Ci=new WeakMap,Tu=new WeakMap,m0=new WeakMap,h0=new WeakSet,iF=function(e){return{}};var nF=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},zh=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Hv,Al,Jv=class{constructor(e,t){Hv.set(this,void 0),Al.set(this,void 0),nF(this,Hv,e,"f"),nF(this,Al,t,"f")}get box(){return zh(this,Al,"f")}get uuid(){return zh(this,Al,"f").address.uuid}get address(){return zh(this,Al,"f").address}get soundfont(){return this.getOrCreateLoader().soundfont}getOrCreateLoader(){return zh(this,Hv,"f").soundfontManager.getOrCreate(zh(this,Al,"f").address.uuid)}terminate(){}};Hv=new WeakMap,Al=new WeakMap;var g0=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Wr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},v0,Uh,Ri,jh,oF,Ru=class{constructor(e,t){v0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ue.Maximizer,Uh.set(this,void 0),Ri.set(this,void 0),jh.set(this,void 0),g0(this,Uh,e,"f"),g0(this,Ri,t,"f"),g0(this,jh,new ve(Wr(this,Uh,"f")),"f"),this.namedParameter=Wr(this,v0,"m",oF).call(this,t)}get box(){return Wr(this,Ri,"f")}get uuid(){return Wr(this,Ri,"f").address.uuid}get address(){return Wr(this,Ri,"f").address}get indexField(){return Wr(this,Ri,"f").index}get labelField(){return Wr(this,Ri,"f").label}get enabledField(){return Wr(this,Ri,"f").enabled}get minimizedField(){return Wr(this,Ri,"f").minimized}get host(){return Wr(this,Ri,"f").host}deviceHost(){return Wr(this,Uh,"f").boxAdapters.adapterFor(Wr(this,Ri,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Wr(this,jh,"f").terminate()}};Uh=new WeakMap,Ri=new WeakMap,jh=new WeakMap,v0=new WeakSet,oF=function(e){return{threshold:Wr(this,jh,"f").createParameter(e.threshold,S.linear(-24,0),E.decible,"Threshold")}};var y0=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},lt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},x0,Lh,fi,mr,aF,Ou=class{constructor(e,t){x0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ue.Compressor,Lh.set(this,void 0),fi.set(this,void 0),mr.set(this,void 0),y0(this,Lh,e,"f"),y0(this,fi,t,"f"),y0(this,mr,new ve(lt(this,Lh,"f")),"f"),this.namedParameter=lt(this,x0,"m",aF).call(this,t)}get box(){return lt(this,fi,"f")}get uuid(){return lt(this,fi,"f").address.uuid}get address(){return lt(this,fi,"f").address}get indexField(){return lt(this,fi,"f").index}get labelField(){return lt(this,fi,"f").label}get enabledField(){return lt(this,fi,"f").enabled}get minimizedField(){return lt(this,fi,"f").minimized}get host(){return lt(this,fi,"f").host}get sideChain(){return lt(this,fi,"f").sideChain}deviceHost(){return lt(this,Lh,"f").boxAdapters.adapterFor(lt(this,fi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){lt(this,mr,"f").terminate()}};Lh=new WeakMap,fi=new WeakMap,mr=new WeakMap,x0=new WeakSet,aF=function(e){return{lookahead:lt(this,mr,"f").createParameter(e.lookahead,S.bool,E.bool,"Lookahead"),automakeup:lt(this,mr,"f").createParameter(e.automakeup,S.bool,E.bool,"Auto Makeup"),autoattack:lt(this,mr,"f").createParameter(e.autoattack,S.bool,E.bool,"Auto Attack"),autorelease:lt(this,mr,"f").createParameter(e.autorelease,S.bool,E.bool,"Auto Release"),inputgain:lt(this,mr,"f").createParameter(e.inputgain,S.linear(-30,30),E.decible,"Input Gain"),threshold:lt(this,mr,"f").createParameter(e.threshold,S.linear(-60,0),E.decible,"Threshold"),ratio:lt(this,mr,"f").createParameter(e.ratio,S.exponential(1,24),E.numeric({fractionDigits:1}),"Ratio"),knee:lt(this,mr,"f").createParameter(e.knee,S.linear(0,24),E.decible,"Knee"),attack:lt(this,mr,"f").createParameter(e.attack,S.linear(0,100),E.numeric({unit:"ms",fractionDigits:1}),"Attack Time"),release:lt(this,mr,"f").createParameter(e.release,S.linear(5,1500),E.numeric({unit:"ms",fractionDigits:1}),"Release Time"),makeup:lt(this,mr,"f").createParameter(e.makeup,S.linear(-40,40),E.decible,"Makeup Gain"),mix:lt(this,mr,"f").createParameter(e.mix,S.unipolar(),E.percent(),"Dry/Wet")}};var b0=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ar=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},w0,Kh,Oi,za,sF,Vu=class{constructor(e,t){w0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ue.Crusher,Kh.set(this,void 0),Oi.set(this,void 0),za.set(this,void 0),b0(this,Kh,e,"f"),b0(this,Oi,t,"f"),b0(this,za,new ve(ar(this,Kh,"f")),"f"),this.namedParameter=ar(this,w0,"m",sF).call(this,t)}get box(){return ar(this,Oi,"f")}get uuid(){return ar(this,Oi,"f").address.uuid}get address(){return ar(this,Oi,"f").address}get indexField(){return ar(this,Oi,"f").index}get labelField(){return ar(this,Oi,"f").label}get enabledField(){return ar(this,Oi,"f").enabled}get minimizedField(){return ar(this,Oi,"f").minimized}get host(){return ar(this,Oi,"f").host}deviceHost(){return ar(this,Kh,"f").boxAdapters.adapterFor(ar(this,Oi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){ar(this,za,"f").terminate()}};Kh=new WeakMap,Oi=new WeakMap,za=new WeakMap,w0=new WeakSet,sF=function(e){return{crush:ar(this,za,"f").createParameter(e.crush,S.unipolar(),E.percent(),"Crush"),bits:ar(this,za,"f").createParameter(e.bits,S.linearInteger(1,16),E.numeric(),"Bits"),boost:ar(this,za,"f").createParameter(e.boost,S.linear(0,24),E.decible,"Boost"),mix:ar(this,za,"f").createParameter(e.mix,S.exponential(.001,1),E.percent(),"Mix")}};var A0=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Fr=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},_0,Wh,Vi,zu,lF,Uu=class{constructor(e,t){_0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ue.Fold,Wh.set(this,void 0),Vi.set(this,void 0),zu.set(this,void 0),A0(this,Wh,e,"f"),A0(this,Vi,t,"f"),A0(this,zu,new ve(Fr(this,Wh,"f")),"f"),this.namedParameter=Fr(this,_0,"m",lF).call(this,t)}get box(){return Fr(this,Vi,"f")}get uuid(){return Fr(this,Vi,"f").address.uuid}get address(){return Fr(this,Vi,"f").address}get indexField(){return Fr(this,Vi,"f").index}get labelField(){return Fr(this,Vi,"f").label}get enabledField(){return Fr(this,Vi,"f").enabled}get minimizedField(){return Fr(this,Vi,"f").minimized}get host(){return Fr(this,Vi,"f").host}deviceHost(){return Fr(this,Wh,"f").boxAdapters.adapterFor(Fr(this,Vi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Fr(this,zu,"f").terminate()}};Wh=new WeakMap,Vi=new WeakMap,zu=new WeakMap,_0=new WeakSet,lF=function(e){return{drive:Fr(this,zu,"f").createParameter(e.drive,S.linear(0,30),E.decible,"Drive"),volume:Fr(this,zu,"f").createParameter(e.volume,S.linear(-18,0),E.decible,"Volume")}};var Qv=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Vt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Zh,qh,zi,ju,Lu,Ku=class{constructor(e,t){Zh.set(this,new R),this.type="instrument",this.accepts="midi",this.manualUrl=ue.MIDIOutput,qh.set(this,void 0),zi.set(this,void 0),ju.set(this,void 0),Lu.set(this,void 0),Qv(this,qh,e,"f"),Qv(this,zi,t,"f"),Qv(this,ju,new $r,"f"),Qv(this,Lu,Vt(this,Zh,"f").own(new ve(Vt(this,qh,"f"))),"f"),Vt(this,Zh,"f").ownAll(t.parameters.pointerHub.catchupAndSubscribe({onAdded:({box:n})=>Vt(this,Lu,"f").createParameter(Te(n,Yi).value,S.unipolar(),E.percent({fractionDigits:1}),"",0),onRemoved:({box:n})=>Vt(this,Lu,"f").removeParameter(Te(n,Yi).value.address)}),Vt(this,zi,"f").device.catchupAndSubscribe(({targetVertex:n})=>n.match({none:()=>Vt(this,ju,"f").clear(),some:({box:i})=>Vt(this,ju,"f").wrap(Te(i,Xi))})))}get box(){return Vt(this,zi,"f")}get uuid(){return Vt(this,zi,"f").address.uuid}get address(){return Vt(this,zi,"f").address}get labelField(){return Vt(this,zi,"f").label}get iconField(){return Vt(this,zi,"f").icon}get defaultTrackType(){return oe.Notes}get enabledField(){return Vt(this,zi,"f").enabled}get minimizedField(){return Vt(this,zi,"f").minimized}get acceptsMidiEvents(){return!0}get parameters(){return Vt(this,Lu,"f")}get midiDevice(){return Vt(this,ju,"f")}deviceHost(){return Vt(this,qh,"f").boxAdapters.adapterFor(Vt(this,zi,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Vt(this,Zh,"f").terminate()}};Zh=new WeakMap,qh=new WeakMap,zi=new WeakMap,ju=new WeakMap,Lu=new WeakMap;var Xv=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},kt=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},P0,Gh,Ui,to,Hh,cF,Wu=class{constructor(e,t){P0.add(this),this.type="midi-effect",this.accepts="midi",this.manualUrl=ue.Velocity,Gh.set(this,void 0),Ui.set(this,void 0),to.set(this,void 0),Hh.set(this,void 0),Xv(this,Gh,e,"f"),Xv(this,Ui,t,"f"),Xv(this,to,new ve(kt(this,Gh,"f")),"f"),Xv(this,Hh,zl.create(),"f"),this.namedParameter=kt(this,P0,"m",cF).call(this,t)}computeVelocity(e,t){let{magnetPosition:n,magnetStrength:i,randomSeed:o,randomAmount:a,offset:s,mix:l}=this.namedParameter;kt(this,Hh,"f").setSeed(o.valueAt(e)+e);let u=t+(n.valueAt(e)-t)*i.valueAt(e),d=(kt(this,Hh,"f").uniform()*2-1)*a.valueAt(e),p=s.valueAt(e),h=l.valueAt(e);return t*(1-h)+yi(u+d+p)*h}get box(){return kt(this,Ui,"f")}get uuid(){return kt(this,Ui,"f").address.uuid}get address(){return kt(this,Ui,"f").address}get indexField(){return kt(this,Ui,"f").index}get labelField(){return kt(this,Ui,"f").label}get enabledField(){return kt(this,Ui,"f").enabled}get minimizedField(){return kt(this,Ui,"f").minimized}get host(){return kt(this,Ui,"f").host}deviceHost(){return kt(this,Gh,"f").boxAdapters.adapterFor(kt(this,Ui,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}terminate(){kt(this,to,"f").terminate()}};Gh=new WeakMap,Ui=new WeakMap,to=new WeakMap,Hh=new WeakMap,P0=new WeakSet,cF=function(e){return{magnetPosition:kt(this,to,"f").createParameter(e.magnetPosition,S.unipolar(),E.percent(),"Position"),magnetStrength:kt(this,to,"f").createParameter(e.magnetStrength,S.unipolar(),E.percent(),"Strength"),randomSeed:kt(this,to,"f").createParameter(e.randomSeed,S.linearInteger(0,65535),E.numeric({unit:"",fractionDigits:0}),"Seed"),randomAmount:kt(this,to,"f").createParameter(e.randomAmount,S.unipolar(),E.percent(),"Amount"),offset:kt(this,to,"f").createParameter(e.offset,S.bipolar(),E.percent(),"Offset"),mix:kt(this,to,"f").createParameter(e.mix,S.unipolar(),E.percent(),"Mix")}};var S0=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ht=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},E0,F0,Jh,ji,ro,uF,yn=class{constructor(e,t){E0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ue.Tidal,Jh.set(this,void 0),ji.set(this,void 0),ro.set(this,void 0),S0(this,Jh,e,"f"),S0(this,ji,t,"f"),S0(this,ro,new ve(Ht(this,Jh,"f")),"f"),this.namedParameter=Ht(this,E0,"m",uF).call(this,t)}get box(){return Ht(this,ji,"f")}get uuid(){return Ht(this,ji,"f").address.uuid}get address(){return Ht(this,ji,"f").address}get indexField(){return Ht(this,ji,"f").index}get labelField(){return Ht(this,ji,"f").label}get enabledField(){return Ht(this,ji,"f").enabled}get minimizedField(){return Ht(this,ji,"f").minimized}get host(){return Ht(this,ji,"f").host}deviceHost(){return Ht(this,Jh,"f").boxAdapters.adapterFor(Ht(this,ji,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){Ht(this,ro,"f").terminate()}};F0=yn,Jh=new WeakMap,ji=new WeakMap,ro=new WeakMap,E0=new WeakSet,uF=function(e){let{RateFractions:t,RateStringMapping:n}=F0;return{slope:Ht(this,ro,"f").createParameter(e.slope,S.bipolar(),E.percent({fractionDigits:1}),"Slope",.5),symmetry:Ht(this,ro,"f").createParameter(e.symmetry,S.unipolar(),E.percent({fractionDigits:1,bipolar:!0}),"Symmetry",.5),rate:Ht(this,ro,"f").createParameter(e.rate,S.values(t.map((i,o)=>o)),n,"Rate",0),depth:Ht(this,ro,"f").createParameter(e.depth,S.unipolar(),E.percent({fractionDigits:1}),"Depth",0),offset:Ht(this,ro,"f").createParameter(e.offset,S.linear(-180,180),E.numeric({unit:"\xB0",fractionDigits:0}),"Offset",.5),channelOffset:Ht(this,ro,"f").createParameter(e.channelOffset,S.linear(-180,180),E.numeric({unit:"\xB0",fractionDigits:0}),"Ch. Offset",.5)}};yn.RateFractions=Yt.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();yn.RateStringMapping=E.indices("",F0.RateFractions.map(([r,e])=>`${r}/${e}`));var B0=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ht=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},I0,Qh,Li,gr,dF,Zu=class{constructor(e,t){I0.add(this),this.type="audio-effect",this.accepts="audio",this.manualUrl=ue.DattorroReverb,Qh.set(this,void 0),Li.set(this,void 0),gr.set(this,void 0),B0(this,Qh,e,"f"),B0(this,Li,t,"f"),B0(this,gr,new ve(ht(this,Qh,"f")),"f"),this.namedParameter=ht(this,I0,"m",dF).call(this,t)}get box(){return ht(this,Li,"f")}get uuid(){return ht(this,Li,"f").address.uuid}get address(){return ht(this,Li,"f").address}get indexField(){return ht(this,Li,"f").index}get labelField(){return ht(this,Li,"f").label}get enabledField(){return ht(this,Li,"f").enabled}get minimizedField(){return ht(this,Li,"f").minimized}get host(){return ht(this,Li,"f").host}deviceHost(){return ht(this,Qh,"f").boxAdapters.adapterFor(ht(this,Li,"f").host.targetVertex.unwrap("no device-host").box,ne.isHost)}audioUnitBoxAdapter(){return this.deviceHost().audioUnitBoxAdapter()}*labeledAudioOutputs(){yield{address:this.address,label:this.labelField.getValue(),children:()=>m.None}}terminate(){ht(this,gr,"f").terminate()}};Qh=new WeakMap,Li=new WeakMap,gr=new WeakMap,I0=new WeakSet,dF=function(e){return{preDelay:ht(this,gr,"f").createParameter(e.preDelay,S.linear(0,1e3),E.numeric({unit:e.preDelay.unit}),"Pre-Delay"),bandwidth:ht(this,gr,"f").createParameter(e.bandwidth,S.unipolar(),E.percent(),"Bandwidth"),inputDiffusion1:ht(this,gr,"f").createParameter(e.inputDiffusion1,S.unipolar(),E.percent(),"Tank 1"),inputDiffusion2:ht(this,gr,"f").createParameter(e.inputDiffusion2,S.unipolar(),E.percent(),"Tank 2"),decay:ht(this,gr,"f").createParameter(e.decay,S.unipolar(),E.percent(),"Decay"),decayDiffusion1:ht(this,gr,"f").createParameter(e.decayDiffusion1,S.unipolar(),E.percent(),"Tank 1"),decayDiffusion2:ht(this,gr,"f").createParameter(e.decayDiffusion2,S.unipolar(),E.percent(),"Tank 2"),damping:ht(this,gr,"f").createParameter(e.damping,S.unipolar(),E.percent(),"Damping"),excursionRate:ht(this,gr,"f").createParameter(e.excursionRate,S.unipolar(),E.numeric({unit:e.excursionRate.unit}),"Rate"),excursionDepth:ht(this,gr,"f").createParameter(e.excursionDepth,S.unipolar(),E.numeric({unit:e.excursionDepth.unit}),"Depth"),wet:ht(this,gr,"f").createParameter(e.wet,S.DefaultDecibel,E.decible,"Wet"),dry:ht(this,gr,"f").createParameter(e.dry,S.DefaultDecibel,E.decible,"Dry")}};var Yv=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},ee=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},k0,ie,zo,Xh,ey,pF,ty=class{constructor(e){k0.add(this),ie.set(this,void 0),zo.set(this,void 0),Xh.set(this,void 0),ey.set(this,void 0),Yv(this,ie,e,"f"),Yv(this,zo,w.newSet(t=>t.uuid),"f"),Yv(this,Xh,new Set,"f"),Yv(this,ey,ee(this,ie,"f").boxGraph.subscribeToAllUpdates({onUpdate:t=>{if(t.type==="delete"){let n=ee(this,zo,"f").getOrNull(t.uuid);Z(n)&&(ee(this,Xh,"f").add(n.box),ee(this,zo,"f").removeByValue(n).terminate())}}}),"f")}terminate(){ee(this,zo,"f").values().forEach(e=>e.terminate()),ee(this,zo,"f").clear(),ee(this,ey,"f").terminate()}adapterFor(e,t){if(ee(this,Xh,"f").has(e))return B(`Cannot resolve adapter for already deleted box: ${e}`);let n=ee(this,zo,"f").getOrNull(e.address.uuid);if(n===null){n=ee(this,k0,"m",pF).call(this,e);let i=ee(this,zo,"f").add(n);T(i,`Could not add adapter for ${e}`)}return typeof t=="function"?Object.hasOwn(t,"prototype")?n instanceof t?n:B(`${n} is not instance of ${t}`):t(n)?n:B(`${n} did not pass custom type guard`):B("Unknown checkType method")}};ie=new WeakMap,zo=new WeakMap,Xh=new WeakMap,ey=new WeakMap,k0=new WeakSet,pF=function(e){return se(e.accept({visitArpeggioDeviceBox:t=>new pn(ee(this,ie,"f"),t),visitAudioBusBox:t=>new _r(ee(this,ie,"f"),t),visitAudioClipBox:t=>new ma(ee(this,ie,"f"),t),visitAudioFileBox:t=>new tn(ee(this,ie,"f"),t),visitAudioTimeStretchBox:t=>new On(ee(this,ie,"f"),t),visitAudioPitchStretchBox:t=>new Rn(ee(this,ie,"f"),t),visitTransientMarkerBox:t=>new xc(t),visitWarpMarkerBox:t=>new fa(ee(this,ie,"f"),t),visitAudioRegionBox:t=>new xa(ee(this,ie,"f"),t),visitAudioUnitBox:t=>new Si(ee(this,ie,"f"),t),visitAuxSendBox:t=>new Hc(ee(this,ie,"f"),t),visitMaximizerDeviceBox:t=>new Ru(ee(this,ie,"f"),t),visitCompressorDeviceBox:t=>new Ou(ee(this,ie,"f"),t),visitCrusherDeviceBox:t=>new Vu(ee(this,ie,"f"),t),visitDattorroReverbDeviceBox:t=>new Zu(ee(this,ie,"f"),t),visitDelayDeviceBox:t=>new Rt(ee(this,ie,"f"),t),visitDeviceInterfaceKnobBox:t=>new uu(ee(this,ie,"f"),t),visitTidalDeviceBox:t=>new yn(ee(this,ie,"f"),t),visitFoldDeviceBox:t=>new Uu(ee(this,ie,"f"),t),visitGrooveShuffleBox:t=>new Hn(ee(this,ie,"f"),t),visitMarkerBox:t=>new Ea(ee(this,ie,"f"),t),visitSignatureEventBox:t=>new al(ee(this,ie,"f"),t),visitMIDIOutputDeviceBox:t=>new Ku(ee(this,ie,"f"),t),visitModularAudioInputBox:t=>new lu(ee(this,ie,"f"),t),visitModularAudioOutputBox:t=>new ou(ee(this,ie,"f"),t),visitModularBox:t=>new ka(ee(this,ie,"f"),t),visitModularDeviceBox:t=>new $a(ee(this,ie,"f"),t),visitModuleConnectionBox:t=>new Ia(ee(this,ie,"f"),t),visitModuleDelayBox:t=>new nu(ee(this,ie,"f"),t),visitModuleGainBox:t=>new au(ee(this,ie,"f"),t),visitModuleMultiplierBox:t=>new su(ee(this,ie,"f"),t),visitNanoDeviceBox:t=>new Pu(ee(this,ie,"f"),t),visitNoteClipBox:t=>new kc(ee(this,ie,"f"),t),visitNoteEventBox:t=>new Cs(ee(this,ie,"f"),t),visitNoteEventCollectionBox:t=>new wi(ee(this,ie,"f"),t),visitNoteRegionBox:t=>new ba(ee(this,ie,"f"),t),visitPitchDeviceBox:t=>new Au(ee(this,ie,"f"),t),visitPlayfieldDeviceBox:t=>new Oa(ee(this,ie,"f"),t),visitPlayfieldSampleBox:t=>new Eu(ee(this,ie,"f"),t),visitRevampDeviceBox:t=>new ru(ee(this,ie,"f"),t),visitReverbDeviceBox:t=>new tu(ee(this,ie,"f"),t),visitRootBox:t=>new xu(ee(this,ie,"f"),t),visitSoundfontDeviceBox:t=>new Cu(ee(this,ie,"f"),t),visitSoundfontFileBox:t=>new Jv(ee(this,ie,"f"),t),visitStereoToolDeviceBox:t=>new Iu(ee(this,ie,"f"),t),visitTapeDeviceBox:t=>new bu(ee(this,ie,"f"),t),visitTimelineBox:t=>new Bi(ee(this,ie,"f"),t),visitTrackBox:t=>new _t(ee(this,ie,"f"),t),visitUnknownAudioEffectDeviceBox:t=>new $u(ee(this,ie,"f"),t),visitUnknownMidiEffectDeviceBox:t=>new Du(ee(this,ie,"f"),t),visitValueClipBox:t=>new ha(ee(this,ie,"f"),t),visitValueEventBox:t=>new Po(ee(this,ie,"f"),t),visitValueEventCollectionBox:t=>new tr(ee(this,ie,"f"),t),visitValueRegionBox:t=>new No(ee(this,ie,"f"),t),visitVaporisateurDeviceBox:t=>new wu(ee(this,ie,"f"),t),visitVelocityDeviceBox:t=>new Wu(ee(this,ie,"f"),t),visitZeitgeistDeviceBox:t=>new Nu(ee(this,ie,"f"),t)}),`Could not find factory for ${e}`)};var qu;(function(r){r.PEAKS=Se.compose(w.Lowest).append(0),r.SPECTRUM=Se.compose(w.Lowest).append(1),r.WAVEFORM=Se.compose(w.Lowest).append(2)})(qu||(qu={}));var hF;(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,n=i=>{let o=t.get(i)??0,a=i;for(;t.has(a);)o++,a=`${i} ${o}`;return t.set(i,o),t.set(a,1),a};Object.keys(e).forEach(i=>{let o=e[i];o.fileName=n(r.sanitizeFileName(o.fileName))})}})(hF||(hF={}));var fF=br.createBuilder({position:br.float,bpm:br.float,playbackTimestamp:br.float,countInBeatsRemaining:br.float,isPlaying:br.bool,isCountingIn:br.bool,isRecording:br.bool});var mF;(function(r){r.store=(e,t,n)=>{if(n==="")return B("MetaData.store: origin must be unique to your app.");let i=e.pointerHub.filter(c.MetaData).map(({box:a})=>a).find(a=>a instanceof bo&&a.origin.getValue()===n),o=a=>{a.target.refer(e),a.origin.setValue(n),a.value.setValue(JSON.stringify(t))};ns(i)?o(i):bo.create(e.graph,w.generate(),o)},r.read=(e,t)=>{if(t==="")return B("MetaData.read: origin must be unique to your app.");let n=e.pointerHub.filter(c.MetaData).map(({box:i})=>i).find(i=>i instanceof bo&&i.origin.getValue()===t);if(ns(n)){let{status:i,value:o,error:a}=ho(()=>JSON.parse(n.value.getValue()));if(i==="success")return o;console.warn(a)}return null},r.clear=(e,t)=>{if(t==="")return B("MetaData.clear: origin must be unique to your app.");e.pointerHub.filter(c.MetaData).map(({box:n})=>n).filter(n=>n instanceof bo&&n.origin.getValue()===t).forEach(n=>n.delete())}})(mF||(mF={}));var N0=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},Ua=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ry,iy,ny,_l,Ki=class{constructor(e,t){ry.set(this,new R),iy.set(this,void 0),ny.set(this,void 0),_l.set(this,void 0),N0(this,iy,e,"f"),N0(this,ny,t,"f"),N0(this,_l,new ct(128),"f"),Ua(this,ry,"f").own(Ua(this,iy,"f").broadcastIntegers(Ua(this,ny,"f"),new Int32Array(Ua(this,_l,"f").buffer),n=>{}))}noteOn(e){e>=0&&e<128&&Ua(this,_l,"f").setBit(e,!0)}noteOff(e){e>=0&&e<128&&Ua(this,_l,"f").setBit(e,!1)}reset(){}clear(){Ua(this,_l,"f").clear()}terminate(){Ua(this,ry,"f").terminate()}toString(){return`{${this.constructor.name}}`}};ry=new WeakMap,iy=new WeakMap,ny=new WeakMap,_l=new WeakMap;var ft;(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 n=r.readParam1(t)&127,i=r.readParam2(t)&127,o=n|i<<7;return 8192>=o?o/8192-1:(o-8191)/8192},r.asValue=t=>{let n=r.readParam2(t);return n>64?.5+(n-63)/128:n<64?n/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,n,i)=>new Uint8Array([e.NoteOn|t,n,i]),r.noteOff=(t,n)=>new Uint8Array([e.NoteOff|t,n,0]),r.control=(t,n,i)=>new Uint8Array([e.Controller|t,n&127,i&127]),r.position=(t,n)=>new Uint8Array([e.Position,t&127,n&127]),r.positionInPPQN=t=>{let n=Math.floor(t/96),i=n&127,o=n>>7&127;return new Uint8Array([e.Position,i,o])},r.accept=(t,n)=>{_n(t)||(r.isNoteOn(t)?P(n.noteOn,r.readPitch(t),r.readVelocity(t)):r.isNoteOff(t)?P(n.noteOff,r.readPitch(t)):r.isPitchWheel(t)?P(n.pitchBend,r.asPitchBend(t)):r.isController(t)?P(n.controller,r.readParam1(t),r.readParam2(t)/127):r.isClock(t)?P(n.clock):r.isStart(t)?P(n.start):r.isContinue(t)?P(n.continue):r.isStop(t)?P(n.stop):r.isPosition(t)&&P(n.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"})(ft||(ft={}));var Uo;(function(r){r.on=(e,t,n)=>({type:"note-on",uuid:e,pitch:t,velocity:n}),r.off=(e,t)=>({type:"note-off",uuid:e,pitch:t}),r.audition=(e,t,n,i)=>({type:"note-audition",uuid:e,pitch:t,duration:n,velocity:i}),r.isOn=e=>e.type==="note-on",r.isOff=e=>e.type==="note-off",r.isAudition=e=>e.type==="note-audition",r.fromEvent=(e,t)=>{let n=e.data;if(ft.isNoteOn(n)){let i=ft.readPitch(n),o=ft.readVelocity(n);return{type:"note-on",uuid:t,pitch:i,velocity:o}}else if(ft.isNoteOff(n)){let i=ft.readPitch(n);return{type:"note-off",uuid:t,pitch:i}}return B("Unknown MIDI event")}})(Uo||(Uo={}));var gF;(function(r){r.start=(e,t,n,i=1)=>{let o=!0;return e(Uo.on(t,n,i)),{terminate:()=>{o&&(e(Uo.off(t,n)),o=!1)}}}})(gF||(gF={}));var Hk,Jk,Qk,Xk,Yk;Hk=new WeakMap,Jk=new WeakMap,Qk=new WeakMap,Xk=new WeakMap,Yk=new WeakMap;var eN=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},oy=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Pl,ay=class{constructor(){Pl.set(this,void 0),eN(this,Pl,Se.newSet(e=>e.field.address),"f")}register(e){return oy(this,Pl,"f").add(e),{terminate:()=>oy(this,Pl,"f").removeByValue(e)}}get(e){return oy(this,Pl,"f").get(e)}opt(e){return oy(this,Pl,"f").opt(e)}};Pl=new WeakMap;var ja={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})??B("Could not cast to AnyRegionBox"),isLoopableRegionBox:r=>r.accept({visitNoteRegionBox:e=>!0,visitAudioRegionBox:e=>!0,visitValueRegionBox:e=>!0})??!1};var Yh={min:30,max:1e3};var sy;(function(r){r.isTimeSignatureValid=(e,t)=>!Number.isInteger(e)||e<1||e>31?Sn.err("Numerator needs to be a interger between 1 and 31"):!Number.isInteger(t)||t<1||t>32||t&t-1?Sn.err("Denominator must be a power of two between 1 and 32"):Sn.ok([e,t]),r.clampBpm=e=>Number.isFinite(e)?pe(e,Yh.min,Yh.max):120,r.hasOverlappingRegions=e=>e.boxes().some(t=>t.accept({visitTrackBox:n=>{for(let[i,o]of O.iterateAdjacent(n.regions.pointerHub.incoming().map(({box:a})=>ja.asRegionBox(a)).sort(({position:a},{position:s})=>a.getValue()-s.getValue()))){if(i instanceof ea&&i.timeBase.getValue()===Mr.Seconds)return!1;if(i.position.getValue()+i.duration.getValue()>o.position.getValue())return!0}return!1}})??!1)})(sy||(sy={}));var vF;(function(r){r.parseTimeSignature=e=>{let[t,n]=e.split("/"),i=parseInt(t,10),o=parseInt(n,10);return sy.isTimeSignatureValid(i,o)}})(vF||(vF={}));var ly;(function(r){r.reader=({sab:e,numChunks:t,numberOfChannels:n,bufferSize:i},o)=>{let a=!0,s=new Int32Array(e,0,2),l=new Float32Array(e,8),u=new Float32Array(n*i),d=typeof document>"u",p=()=>{if(!a)return;let h=Atomics.load(s,1),g=Atomics.load(s,0);if(h===g){if(d)Atomics.wait(s,0,g);else{setTimeout(p,1);return}g=Atomics.load(s,0)}for(;h!==g;){let v=h*n*i;u.set(l.subarray(v,v+n*i));let y=[];for(let x=0;x<n;x++){let $=x*i,M=$+i;y.push(u.slice($,M))}if(h=(h+1)%t,Atomics.store(s,1,h),!a)return;o(y)}p()};return p(),{stop:()=>a=!1}},r.writer=({sab:e,numChunks:t,numberOfChannels:n,bufferSize:i})=>{let o=new Int32Array(e,0,2),a=new Float32Array(e,8);return Object.freeze({write:s=>{if(s.length!==n)return;for(let d of s)if(d.length!==i)return B("Each channel buffer must contain 'bufferSize' samples");let l=Atomics.load(o,0),u=l*n*i;s.forEach((d,p)=>a.set(d,u+p*i)),Atomics.store(o,0,(l+1)%t),Atomics.notify(o,0)}})}})(ly||(ly={}));var $0={isRegion:r=>ja.isRegionBox(r.box),isLoopableRegion:r=>ja.isLoopableRegionBox(r.box)};var tN=function(r,e,t,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t},xn=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},ef,bn,cy,uy=class{constructor(e){ef.add(this),bn.set(this,void 0),tN(this,bn,e,"f")}getTempoAt(e){let t=xn(this,bn,"f").box.bpm.getValue();return xn(this,bn,"f").tempoTrackEvents.mapOr(n=>n.valueAt(e,t),t)}ppqnToSeconds(e){return this.intervalToSeconds(0,e)}secondsToPPQN(e){return xn(this,ef,"m",cy).call(this,e)}intervalToSeconds(e,t){if(e>=t)return 0;let n=xn(this,bn,"f").box.bpm.getValue(),i=xn(this,bn,"f").tempoTrackEvents;if(i.isEmpty())return G.pulsesToSeconds(t-e,n);let o=i.unwrap();if(o.events.isEmpty())return G.pulsesToSeconds(t-e,n);let a=0,s=e;for(;s<t;){let l=o.valueAt(s,n),u=Od(s,ss),d=u<=s?u+ss:u,p=Math.min(d,t);a+=G.pulsesToSeconds(p-s,l),s=p}return a}intervalToPPQN(e,t){if(e>=t)return 0;let n=xn(this,ef,"m",cy).call(this,e);return xn(this,ef,"m",cy).call(this,t)-n}subscribe(e){let t=new R;return t.ownAll(xn(this,bn,"f").box.bpm.subscribe(()=>e(this)),xn(this,bn,"f").catchupAndSubscribeTempoAutomation(()=>e(this))),t}};bn=new WeakMap,ef=new WeakSet,cy=function(e){if(e<=0)return 0;let t=xn(this,bn,"f").box.bpm.getValue(),n=xn(this,bn,"f").tempoTrackEvents;if(n.isEmpty())return G.secondsToPulses(e,t);let i=n.unwrap();if(i.events.isEmpty())return G.secondsToPulses(e,t);let o=0,a=0;for(;o<e;){let s=i.valueAt(a,t),l=Od(a,ss),u=l<=a?l+ss:l,d=u-a,p=G.pulsesToSeconds(d,s);if(o+p>=e){let h=e-o;a+=G.secondsToPulses(h,s);break}o+=p,a=u}return a};var io;(function(r){r[r.Off=0]="Off",r[r.On=1]="On",r[r.Loop=2]="Loop"})(io||(io={}));var rN,iN,nN,oN;rN=new WeakMap,iN=new WeakMap,nN=new WeakMap,oN=new WeakMap;var aN,sN,lN,cN;aN=new WeakMap,sN=new WeakMap,lN=new WeakMap,cN=new WeakMap;var Ue={};po(Ue,{$brand:()=>dy,$input:()=>X_,$output:()=>Q_,NEVER:()=>D0,TimePrecision:()=>rP,ZodAny:()=>W1,ZodArray:()=>H1,ZodBase64:()=>Ox,ZodBase64URL:()=>Vx,ZodBigInt:()=>_d,ZodBigIntFormat:()=>jx,ZodBoolean:()=>Ad,ZodCIDRv4:()=>Cx,ZodCIDRv6:()=>Rx,ZodCUID:()=>Ix,ZodCUID2:()=>kx,ZodCatch:()=>vS,ZodCodec:()=>Jx,ZodCustom:()=>Df,ZodCustomStringFormat:()=>bd,ZodDate:()=>Bf,ZodDefault:()=>dS,ZodDiscriminatedUnion:()=>Q1,ZodE164:()=>zx,ZodEmail:()=>Ex,ZodEmoji:()=>Fx,ZodEnum:()=>yd,ZodError:()=>RD,ZodExactOptional:()=>lS,ZodFile:()=>aS,ZodFirstPartyTypeKind:()=>IS,ZodFunction:()=>ES,ZodGUID:()=>_f,ZodIPv4:()=>Mx,ZodIPv6:()=>Tx,ZodISODate:()=>bx,ZodISODateTime:()=>xx,ZodISODuration:()=>Ax,ZodISOTime:()=>wx,ZodIntersection:()=>X1,ZodIssueCode:()=>VD,ZodJWT:()=>Ux,ZodKSUID:()=>Dx,ZodLazy:()=>_S,ZodLiteral:()=>oS,ZodMAC:()=>O1,ZodMap:()=>iS,ZodNaN:()=>xS,ZodNanoID:()=>Bx,ZodNever:()=>q1,ZodNonOptional:()=>Gx,ZodNull:()=>L1,ZodNullable:()=>uS,ZodNumber:()=>wd,ZodNumberFormat:()=>$l,ZodObject:()=>kf,ZodOptional:()=>qx,ZodPipe:()=>Hx,ZodPrefault:()=>hS,ZodPromise:()=>SS,ZodReadonly:()=>bS,ZodRealError:()=>Gr,ZodRecord:()=>$f,ZodSet:()=>nS,ZodString:()=>xd,ZodStringFormat:()=>rt,ZodSuccess:()=>gS,ZodSymbol:()=>U1,ZodTemplateLiteral:()=>AS,ZodTransform:()=>sS,ZodTuple:()=>eS,ZodType:()=>Be,ZodULID:()=>Nx,ZodURL:()=>Ff,ZodUUID:()=>so,ZodUndefined:()=>j1,ZodUnion:()=>Nf,ZodUnknown:()=>Z1,ZodVoid:()=>G1,ZodXID:()=>$x,ZodXor:()=>J1,_ZodString:()=>Sx,_default:()=>pS,_function:()=>JI,any:()=>BI,array:()=>If,base64:()=>dI,base64url:()=>pI,bigint:()=>_I,boolean:()=>z1,catch:()=>yS,check:()=>QI,cidrv4:()=>cI,cidrv6:()=>uI,clone:()=>Br,codec:()=>qI,coerce:()=>kS,config:()=>Ft,core:()=>Ko,cuid:()=>tI,cuid2:()=>rI,custom:()=>XI,date:()=>kI,decode:()=>N1,decodeAsync:()=>D1,describe:()=>YI,discriminatedUnion:()=>CI,e164:()=>hI,email:()=>WB,emoji:()=>YB,encode:()=>k1,encodeAsync:()=>$1,endsWith:()=>ld,enum:()=>Wx,exactOptional:()=>cS,file:()=>LI,flattenError:()=>uf,float32:()=>xI,float64:()=>bI,formatError:()=>df,fromJSONSchema:()=>ak,function:()=>JI,getErrorMap:()=>UD,globalRegistry:()=>sr,gt:()=>oo,gte:()=>Ir,guid:()=>ZB,hash:()=>yI,hex:()=>vI,hostname:()=>gI,httpUrl:()=>XB,includes:()=>ad,instanceof:()=>tk,int:()=>Px,int32:()=>wI,int64:()=>PI,intersection:()=>Y1,ipv4:()=>aI,ipv6:()=>lI,iso:()=>vd,json:()=>ik,jwt:()=>fI,keyof:()=>NI,ksuid:()=>oI,lazy:()=>PS,length:()=>kl,literal:()=>jI,locales:()=>xf,looseObject:()=>MI,looseRecord:()=>OI,lowercase:()=>nd,lt:()=>no,lte:()=>gi,mac:()=>sI,map:()=>VI,maxLength:()=>Il,maxSize:()=>Ha,meta:()=>ek,mime:()=>cd,minLength:()=>Lo,minSize:()=>ao,multipleOf:()=>Ga,nan:()=>ZI,nanoid:()=>eI,nativeEnum:()=>UI,negative:()=>cx,never:()=>Lx,nonnegative:()=>dx,nonoptional:()=>mS,nonpositive:()=>ux,normalize:()=>ud,null:()=>K1,nullable:()=>Sf,nullish:()=>KI,number:()=>V1,object:()=>$I,optional:()=>Pf,overwrite:()=>An,parse:()=>E1,parseAsync:()=>F1,partialRecord:()=>RI,pipe:()=>Ef,positive:()=>lx,prefault:()=>fS,preprocess:()=>nk,prettifyError:()=>W0,promise:()=>HI,property:()=>px,readonly:()=>wS,record:()=>rS,refine:()=>FS,regex:()=>id,regexes:()=>Zi,registry:()=>Uy,safeDecode:()=>T1,safeDecodeAsync:()=>R1,safeEncode:()=>M1,safeEncodeAsync:()=>C1,safeParse:()=>B1,safeParseAsync:()=>I1,set:()=>zI,setErrorMap:()=>zD,size:()=>Bl,slugify:()=>fd,startsWith:()=>sd,strictObject:()=>DI,string:()=>_x,stringFormat:()=>mI,stringbool:()=>rk,success:()=>WI,superRefine:()=>BS,symbol:()=>EI,templateLiteral:()=>GI,toJSONSchema:()=>gx,toLowerCase:()=>pd,toUpperCase:()=>hd,transform:()=>Zx,treeifyError:()=>K0,trim:()=>dd,tuple:()=>tS,uint32:()=>AI,uint64:()=>SI,ulid:()=>iI,undefined:()=>FI,union:()=>Kx,unknown:()=>Nl,uppercase:()=>od,url:()=>QB,util:()=>L,uuid:()=>qB,uuidv4:()=>GB,uuidv6:()=>HB,uuidv7:()=>JB,void:()=>II,xid:()=>nI,xor:()=>TI});var Ko={};po(Ko,{$ZodAny:()=>x_,$ZodArray:()=>P_,$ZodAsyncError:()=>wn,$ZodBase64:()=>c_,$ZodBase64URL:()=>u_,$ZodBigInt:()=>My,$ZodBigIntFormat:()=>m_,$ZodBoolean:()=>mf,$ZodCIDRv4:()=>a_,$ZodCIDRv6:()=>s_,$ZodCUID:()=>GA,$ZodCUID2:()=>HA,$ZodCatch:()=>j_,$ZodCheck:()=>it,$ZodCheckBigIntFormat:()=>PA,$ZodCheckEndsWith:()=>CA,$ZodCheckGreaterThan:()=>Fy,$ZodCheckIncludes:()=>MA,$ZodCheckLengthEquals:()=>kA,$ZodCheckLessThan:()=>Ey,$ZodCheckLowerCase:()=>$A,$ZodCheckMaxLength:()=>BA,$ZodCheckMaxSize:()=>SA,$ZodCheckMimeType:()=>OA,$ZodCheckMinLength:()=>IA,$ZodCheckMinSize:()=>EA,$ZodCheckMultipleOf:()=>AA,$ZodCheckNumberFormat:()=>_A,$ZodCheckOverwrite:()=>VA,$ZodCheckProperty:()=>RA,$ZodCheckRegex:()=>NA,$ZodCheckSizeEquals:()=>FA,$ZodCheckStartsWith:()=>TA,$ZodCheckStringFormat:()=>td,$ZodCheckUpperCase:()=>DA,$ZodCodec:()=>vf,$ZodCustom:()=>J_,$ZodCustomStringFormat:()=>h_,$ZodDate:()=>__,$ZodDefault:()=>O_,$ZodDiscriminatedUnion:()=>F_,$ZodE164:()=>d_,$ZodEmail:()=>KA,$ZodEmoji:()=>ZA,$ZodEncodeError:()=>La,$ZodEnum:()=>$_,$ZodError:()=>cf,$ZodExactOptional:()=>C_,$ZodFile:()=>M_,$ZodFunction:()=>q_,$ZodGUID:()=>jA,$ZodIPv4:()=>i_,$ZodIPv6:()=>n_,$ZodISODate:()=>e_,$ZodISODateTime:()=>YA,$ZodISODuration:()=>r_,$ZodISOTime:()=>t_,$ZodIntersection:()=>B_,$ZodJWT:()=>p_,$ZodKSUID:()=>XA,$ZodLazy:()=>H_,$ZodLiteral:()=>D_,$ZodMAC:()=>o_,$ZodMap:()=>k_,$ZodNaN:()=>L_,$ZodNanoID:()=>qA,$ZodNever:()=>w_,$ZodNonOptional:()=>z_,$ZodNull:()=>y_,$ZodNullable:()=>R_,$ZodNumber:()=>Dy,$ZodNumberFormat:()=>f_,$ZodObject:()=>KF,$ZodObjectJIT:()=>S_,$ZodOptional:()=>Cy,$ZodPipe:()=>K_,$ZodPrefault:()=>V_,$ZodPromise:()=>G_,$ZodReadonly:()=>W_,$ZodRealError:()=>qr,$ZodRecord:()=>I_,$ZodRegistry:()=>zy,$ZodSet:()=>N_,$ZodString:()=>Fl,$ZodStringFormat:()=>tt,$ZodSuccess:()=>U_,$ZodSymbol:()=>g_,$ZodTemplateLiteral:()=>Z_,$ZodTransform:()=>T_,$ZodTuple:()=>Ty,$ZodType:()=>Ae,$ZodULID:()=>JA,$ZodURL:()=>WA,$ZodUUID:()=>LA,$ZodUndefined:()=>v_,$ZodUnion:()=>gf,$ZodUnknown:()=>b_,$ZodVoid:()=>A_,$ZodXID:()=>QA,$ZodXor:()=>E_,$brand:()=>dy,$constructor:()=>A,$input:()=>X_,$output:()=>Q_,Doc:()=>ff,JSONSchema:()=>LB,JSONSchemaGenerator:()=>vx,NEVER:()=>D0,TimePrecision:()=>rP,_any:()=>_P,_array:()=>kP,_base64:()=>nx,_base64url:()=>ox,_bigint:()=>gP,_boolean:()=>fP,_catch:()=>ID,_check:()=>jB,_cidrv4:()=>rx,_cidrv6:()=>ix,_coercedBigint:()=>vP,_coercedBoolean:()=>mP,_coercedDate:()=>BP,_coercedNumber:()=>lP,_coercedString:()=>eP,_cuid:()=>Hy,_cuid2:()=>Jy,_custom:()=>$P,_date:()=>FP,_decode:()=>vy,_decodeAsync:()=>xy,_default:()=>ED,_discriminatedUnion:()=>fD,_e164:()=>ax,_email:()=>jy,_emoji:()=>qy,_encode:()=>gy,_encodeAsync:()=>yy,_endsWith:()=>ld,_enum:()=>bD,_file:()=>NP,_float32:()=>uP,_float64:()=>dP,_gt:()=>oo,_gte:()=>Ir,_guid:()=>bf,_includes:()=>ad,_int:()=>cP,_int32:()=>pP,_int64:()=>yP,_intersection:()=>mD,_ipv4:()=>ex,_ipv6:()=>tx,_isoDate:()=>nP,_isoDateTime:()=>iP,_isoDuration:()=>aP,_isoTime:()=>oP,_jwt:()=>sx,_ksuid:()=>Yy,_lazy:()=>DD,_length:()=>kl,_literal:()=>AD,_lowercase:()=>nd,_lt:()=>no,_lte:()=>gi,_mac:()=>tP,_map:()=>yD,_max:()=>gi,_maxLength:()=>Il,_maxSize:()=>Ha,_mime:()=>cd,_min:()=>Ir,_minLength:()=>Lo,_minSize:()=>ao,_multipleOf:()=>Ga,_nan:()=>IP,_nanoid:()=>Gy,_nativeEnum:()=>wD,_negative:()=>cx,_never:()=>SP,_nonnegative:()=>dx,_nonoptional:()=>FD,_nonpositive:()=>ux,_normalize:()=>ud,_null:()=>AP,_nullable:()=>SD,_number:()=>sP,_optional:()=>PD,_overwrite:()=>An,_parse:()=>Qu,_parseAsync:()=>Xu,_pipe:()=>kD,_positive:()=>lx,_promise:()=>MD,_property:()=>px,_readonly:()=>ND,_record:()=>vD,_refine:()=>DP,_regex:()=>id,_safeDecode:()=>wy,_safeDecodeAsync:()=>_y,_safeEncode:()=>by,_safeEncodeAsync:()=>Ay,_safeParse:()=>Yu,_safeParseAsync:()=>ed,_set:()=>xD,_size:()=>Bl,_slugify:()=>fd,_startsWith:()=>sd,_string:()=>Y_,_stringFormat:()=>md,_stringbool:()=>RP,_success:()=>BD,_superRefine:()=>MP,_symbol:()=>bP,_templateLiteral:()=>$D,_toLowerCase:()=>pd,_toUpperCase:()=>hd,_transform:()=>_D,_trim:()=>dd,_tuple:()=>gD,_uint32:()=>hP,_uint64:()=>xP,_ulid:()=>Qy,_undefined:()=>wP,_union:()=>pD,_unknown:()=>PP,_uppercase:()=>od,_url:()=>wf,_uuid:()=>Ly,_uuidv4:()=>Ky,_uuidv6:()=>Wy,_uuidv7:()=>Zy,_void:()=>EP,_xid:()=>Xy,_xor:()=>hD,clone:()=>Br,config:()=>Ft,createStandardJSONSchemaMethod:()=>gd,createToJSONSchemaMethod:()=>OP,decode:()=>RN,decodeAsync:()=>VN,describe:()=>TP,encode:()=>CN,encodeAsync:()=>ON,extractDefs:()=>Qa,finalize:()=>Xa,flattenError:()=>uf,formatError:()=>df,globalConfig:()=>tf,globalRegistry:()=>sr,initializeContext:()=>Ja,isValidBase64:()=>l_,isValidBase64URL:()=>zF,isValidJWT:()=>UF,locales:()=>xf,meta:()=>CP,parse:()=>fy,parseAsync:()=>my,prettifyError:()=>W0,process:()=>Je,regexes:()=>Zi,registry:()=>Uy,safeDecode:()=>UN,safeDecodeAsync:()=>LN,safeEncode:()=>zN,safeEncodeAsync:()=>jN,safeParse:()=>Z0,safeParseAsync:()=>q0,toDotPath:()=>AF,toJSONSchema:()=>gx,treeifyError:()=>K0,util:()=>L,version:()=>zA});var D0=Object.freeze({status:"aborted"});function A(r,e,t){function n(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 u=a.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){let h=d[p];h in s||(s[h]=u[h].bind(s))}}let i=t?.Parent??Object;class o extends i{}Object.defineProperty(o,"name",{value:r});function a(s){var l;let u=t?.Parent?new o:this;n(u,s),(l=u._zod).deferred??(l.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(a,"init",{value:n}),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 dy=Symbol("zod_brand"),wn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},La=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},tf={};function Ft(r){return r&&Object.assign(tf,r),tf}var L={};po(L,{BIGINT_FORMAT_RANGES:()=>L0,Class:()=>T0,NUMBER_FORMAT_RANGES:()=>j0,aborted:()=>qa,allowsEval:()=>O0,assert:()=>fN,assertEqual:()=>uN,assertIs:()=>pN,assertNever:()=>hN,assertNotEqual:()=>dN,assignProp:()=>Wa,base64ToUint8Array:()=>xF,base64urlToUint8Array:()=>NN,cached:()=>Hu,captureStackTrace:()=>hy,cleanEnum:()=>kN,cleanRegex:()=>of,clone:()=>Br,cloneDef:()=>gN,createTransparentProxy:()=>AN,defineLazy:()=>Ne,esc:()=>py,escapeRegex:()=>Wi,extend:()=>SN,finalizeIssue:()=>Zr,floatSafeRemainder:()=>C0,getElementAtPath:()=>vN,getEnumValues:()=>nf,getLengthableOrigin:()=>lf,getParsedType:()=>wN,getSizableOrigin:()=>sf,hexToUint8Array:()=>DN,isObject:()=>Sl,isPlainObject:()=>Za,issue:()=>Ju,joinValues:()=>N,jsonStringifyReplacer:()=>Gu,merge:()=>FN,mergeDefs:()=>jo,normalizeParams:()=>K,nullish:()=>Ka,numKeys:()=>bN,objectClone:()=>mN,omit:()=>PN,optionalKeys:()=>U0,parsedType:()=>j,partial:()=>BN,pick:()=>_N,prefixIssues:()=>mi,primitiveTypes:()=>z0,promiseAllObject:()=>yN,propertyKeyTypes:()=>af,randomString:()=>xN,required:()=>IN,safeExtend:()=>EN,shallowClone:()=>V0,slugify:()=>R0,stringifyPrimitive:()=>z,uint8ArrayToBase64:()=>bF,uint8ArrayToBase64url:()=>$N,uint8ArrayToHex:()=>MN,unwrapMessage:()=>rf});function uN(r){return r}function dN(r){return r}function pN(r){}function hN(r){throw new Error("Unexpected value in exhaustive check")}function fN(r){}function nf(r){let e=Object.values(r).filter(n=>typeof n=="number");return Object.entries(r).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}function N(r,e="|"){return r.map(t=>z(t)).join(e)}function Gu(r,e){return typeof e=="bigint"?e.toString():e}function Hu(r){return{get value(){{let t=r();return Object.defineProperty(this,"value",{value:t}),t}throw new Error("cached value already set")}}}function Ka(r){return r==null}function of(r){let e=r.startsWith("^")?1:0,t=r.endsWith("$")?r.length-1:r.length;return r.slice(e,t)}function C0(r,e){let t=(r.toString().split(".")[1]||"").length,n=e.toString(),i=(n.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(n)){let l=n.match(/\d?e-(\d?)/);l?.[1]&&(i=Number.parseInt(l[1]))}let o=t>i?t:i,a=Number.parseInt(r.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return a%s/10**o}var yF=Symbol("evaluating");function Ne(r,e,t){let n;Object.defineProperty(r,e,{get(){if(n!==yF)return n===void 0&&(n=yF,n=t()),n},set(i){Object.defineProperty(r,e,{value:i})},configurable:!0})}function mN(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function Wa(r,e,t){Object.defineProperty(r,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function jo(...r){let e={};for(let t of r){let n=Object.getOwnPropertyDescriptors(t);Object.assign(e,n)}return Object.defineProperties({},e)}function gN(r){return jo(r._zod.def)}function vN(r,e){return e?e.reduce((t,n)=>t?.[n],r):r}function yN(r){let e=Object.keys(r),t=e.map(n=>r[n]);return Promise.all(t).then(n=>{let i={};for(let o=0;o<e.length;o++)i[e[o]]=n[o];return i})}function xN(r=10){let e="abcdefghijklmnopqrstuvwxyz",t="";for(let n=0;n<r;n++)t+=e[Math.floor(Math.random()*e.length)];return t}function py(r){return JSON.stringify(r)}function R0(r){return r.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var hy="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function Sl(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var O0=Hu(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let r=Function;return new r(""),!0}catch{return!1}});function Za(r){if(Sl(r)===!1)return!1;let e=r.constructor;if(e===void 0||typeof e!="function")return!0;let t=e.prototype;return!(Sl(t)===!1||Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)}function V0(r){return Za(r)?{...r}:Array.isArray(r)?[...r]:r}function bN(r){let e=0;for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&e++;return e}var wN=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}`)}},af=new Set(["string","number","symbol"]),z0=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Wi(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Br(r,e,t){let n=new r._zod.constr(e??r._zod.def);return(!e||t?.parent)&&(n._zod.parent=r),n}function K(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 AN(r){let e;return new Proxy({},{get(t,n,i){return e??(e=r()),Reflect.get(e,n,i)},set(t,n,i,o){return e??(e=r()),Reflect.set(e,n,i,o)},has(t,n){return e??(e=r()),Reflect.has(e,n)},deleteProperty(t,n){return e??(e=r()),Reflect.deleteProperty(e,n)},ownKeys(t){return e??(e=r()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(t,n){return e??(e=r()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(t,n,i){return e??(e=r()),Reflect.defineProperty(e,n,i)}})}function z(r){return typeof r=="bigint"?r.toString()+"n":typeof r=="string"?`"${r}"`:`${r}`}function U0(r){return Object.keys(r).filter(e=>r[e]._zod.optin==="optional"&&r[e]._zod.optout==="optional")}var j0={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]},L0={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function _N(r,e){let t=r._zod.def,n=t.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o=jo(r._zod.def,{get shape(){let a={};for(let s in e){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&(a[s]=t.shape[s])}return Wa(this,"shape",a),a},checks:[]});return Br(r,o)}function PN(r,e){let t=r._zod.def,n=t.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=jo(r._zod.def,{get shape(){let a={...r._zod.def.shape};for(let s in e){if(!(s in t.shape))throw new Error(`Unrecognized key: "${s}"`);e[s]&&delete a[s]}return Wa(this,"shape",a),a},checks:[]});return Br(r,o)}function SN(r,e){if(!Za(e))throw new Error("Invalid input to extend: expected a plain object");let t=r._zod.def.checks;if(t&&t.length>0){let o=r._zod.def.shape;for(let a in e)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=jo(r._zod.def,{get shape(){let o={...r._zod.def.shape,...e};return Wa(this,"shape",o),o}});return Br(r,i)}function EN(r,e){if(!Za(e))throw new Error("Invalid input to safeExtend: expected a plain object");let t=jo(r._zod.def,{get shape(){let n={...r._zod.def.shape,...e};return Wa(this,"shape",n),n}});return Br(r,t)}function FN(r,e){let t=jo(r._zod.def,{get shape(){let n={...r._zod.def.shape,...e._zod.def.shape};return Wa(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:[]});return Br(r,t)}function BN(r,e,t){let i=e._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=jo(e._zod.def,{get shape(){let s=e._zod.def.shape,l={...s};if(t)for(let u in t){if(!(u in s))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(l[u]=r?new r({type:"optional",innerType:s[u]}):s[u])}else for(let u in s)l[u]=r?new r({type:"optional",innerType:s[u]}):s[u];return Wa(this,"shape",l),l},checks:[]});return Br(e,a)}function IN(r,e,t){let n=jo(e._zod.def,{get shape(){let i=e._zod.def.shape,o={...i};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:i[a]}))}else for(let a in i)o[a]=new r({type:"nonoptional",innerType:i[a]});return Wa(this,"shape",o),o}});return Br(e,n)}function qa(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 mi(r,e){return e.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(r),t})}function rf(r){return typeof r=="string"?r:r?.message}function Zr(r,e,t){let n={...r,path:r.path??[]};if(!r.message){let i=rf(r.inst?._zod.def?.error?.(r))??rf(e?.error?.(r))??rf(t.customError?.(r))??rf(t.localeError?.(r))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function sf(r){return r instanceof Set?"set":r instanceof Map?"map":r instanceof File?"file":"unknown"}function lf(r){return Array.isArray(r)?"array":typeof r=="string"?"string":"unknown"}function j(r){let e=typeof r;switch(e){case"number":return Number.isNaN(r)?"nan":"number";case"object":{if(r===null)return"null";if(Array.isArray(r))return"array";let t=r;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return e}function Ju(...r){let[e,t,n]=r;return typeof e=="string"?{message:e,code:"custom",input:t,inst:n}:{...e}}function kN(r){return Object.entries(r).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function xF(r){let e=atob(r),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function bF(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e)}function NN(r){let e=r.replace(/-/g,"+").replace(/_/g,"/"),t="=".repeat((4-e.length%4)%4);return xF(e+t)}function $N(r){return bF(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function DN(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 n=0;n<e.length;n+=2)t[n/2]=Number.parseInt(e.slice(n,n+2),16);return t}function MN(r){return Array.from(r).map(e=>e.toString(16).padStart(2,"0")).join("")}var T0=class{constructor(...e){}};var wF=(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,Gu,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},cf=A("$ZodError",wF),qr=A("$ZodError",wF,{Parent:Error});function uf(r,e=t=>t.message){let t={},n=[];for(let i of r.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}function df(r,e=t=>t.message){let t={_errors:[]},n=i=>{for(let o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>n({issues:a}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({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 n(r),t}function K0(r,e=t=>t.message){let t={errors:[]},n=(i,o=[])=>{var a,s;for(let l of i.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>n({issues:u},l.path));else if(l.code==="invalid_key")n({issues:l.issues},l.path);else if(l.code==="invalid_element")n({issues:l.issues},l.path);else{let u=[...o,...l.path];if(u.length===0){t.errors.push(e(l));continue}let d=t,p=0;for(;p<u.length;){let h=u[p],g=p===u.length-1;typeof h=="string"?(d.properties??(d.properties={}),(a=d.properties)[h]??(a[h]={errors:[]}),d=d.properties[h]):(d.items??(d.items=[]),(s=d.items)[h]??(s[h]={errors:[]}),d=d.items[h]),g&&d.errors.push(e(l)),p++}}};return n(r),t}function AF(r){let e=[],t=r.map(n=>typeof n=="object"?n.key:n);for(let n of t)typeof n=="number"?e.push(`[${n}]`):typeof n=="symbol"?e.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?e.push(`[${JSON.stringify(n)}]`):(e.length&&e.push("."),e.push(n));return e.join("")}function W0(r){let e=[],t=[...r.issues].sort((n,i)=>(n.path??[]).length-(i.path??[]).length);for(let n of t)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${AF(n.path)}`);return e.join(`
4
+ `)}var Qu=r=>(e,t,n,i)=>{let o=n?Object.assign(n,{async:!1}):{async:!1},a=e._zod.run({value:t,issues:[]},o);if(a instanceof Promise)throw new wn;if(a.issues.length){let s=new(i?.Err??r)(a.issues.map(l=>Zr(l,o,Ft())));throw hy(s,i?.callee),s}return a.value},fy=Qu(qr),Xu=r=>async(e,t,n,i)=>{let o=n?Object.assign(n,{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(i?.Err??r)(a.issues.map(l=>Zr(l,o,Ft())));throw hy(s,i?.callee),s}return a.value},my=Xu(qr),Yu=r=>(e,t,n)=>{let i=n?{...n,async:!1}:{async:!1},o=e._zod.run({value:t,issues:[]},i);if(o instanceof Promise)throw new wn;return o.issues.length?{success:!1,error:new(r??cf)(o.issues.map(a=>Zr(a,i,Ft())))}:{success:!0,data:o.value}},Z0=Yu(qr),ed=r=>async(e,t,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},o=e._zod.run({value:t,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new r(o.issues.map(a=>Zr(a,i,Ft())))}:{success:!0,data:o.value}},q0=ed(qr),gy=r=>(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Qu(r)(e,t,i)},CN=gy(qr),vy=r=>(e,t,n)=>Qu(r)(e,t,n),RN=vy(qr),yy=r=>async(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Xu(r)(e,t,i)},ON=yy(qr),xy=r=>async(e,t,n)=>Xu(r)(e,t,n),VN=xy(qr),by=r=>(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Yu(r)(e,t,i)},zN=by(qr),wy=r=>(e,t,n)=>Yu(r)(e,t,n),UN=wy(qr),Ay=r=>async(e,t,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ed(r)(e,t,i)},jN=Ay(qr),_y=r=>async(e,t,n)=>ed(r)(e,t,n),LN=_y(qr);var Zi={};po(Zi,{base64:()=>cA,base64url:()=>Py,bigint:()=>mA,boolean:()=>vA,browserEmail:()=>QN,cidrv4:()=>sA,cidrv6:()=>lA,cuid:()=>G0,cuid2:()=>H0,date:()=>dA,datetime:()=>hA,domain:()=>e$,duration:()=>eA,e164:()=>uA,email:()=>rA,emoji:()=>iA,extendedDuration:()=>KN,guid:()=>tA,hex:()=>t$,hostname:()=>YN,html5Email:()=>GN,idnEmail:()=>JN,integer:()=>gA,ipv4:()=>nA,ipv6:()=>oA,ksuid:()=>X0,lowercase:()=>bA,mac:()=>aA,md5_base64:()=>i$,md5_base64url:()=>n$,md5_hex:()=>r$,nanoid:()=>Y0,null:()=>yA,number:()=>Sy,rfc5322Email:()=>HN,sha1_base64:()=>a$,sha1_base64url:()=>s$,sha1_hex:()=>o$,sha256_base64:()=>c$,sha256_base64url:()=>u$,sha256_hex:()=>l$,sha384_base64:()=>p$,sha384_base64url:()=>h$,sha384_hex:()=>d$,sha512_base64:()=>m$,sha512_base64url:()=>g$,sha512_hex:()=>f$,string:()=>fA,time:()=>pA,ulid:()=>J0,undefined:()=>xA,unicodeEmail:()=>_F,uppercase:()=>wA,uuid:()=>El,uuid4:()=>WN,uuid6:()=>ZN,uuid7:()=>qN,xid:()=>Q0});var G0=/^[cC][^\s-]{8,}$/,H0=/^[0-9a-z]+$/,J0=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Q0=/^[0-9a-vA-V]{20}$/,X0=/^[A-Za-z0-9]{27}$/,Y0=/^[a-zA-Z0-9_-]{21}$/,eA=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,KN=/^[-+]?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)?)??$/,tA=/^([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})$/,El=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)$/,WN=El(4),ZN=El(6),qN=El(7),rA=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,GN=/^[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])?)*$/,HN=/^(([^<>()\[\]\\.,;:\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,}))$/,_F=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,JN=_F,QN=/^[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])?)*$/,XN="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function iA(){return new RegExp(XN,"u")}var nA=/^(?:(?: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])$/,oA=/^(([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}|:))$/,aA=r=>{let e=Wi(r??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},sA=/^((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])$/,lA=/^(([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])$/,cA=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Py=/^[A-Za-z0-9_-]*$/,YN=/^(?=.{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])?)*\.?$/,e$=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,uA=/^\+[1-9]\d{6,14}$/,PF="(?:(?:\\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])))",dA=new RegExp(`^${PF}$`);function SF(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 pA(r){return new RegExp(`^${SF(r)}$`)}function hA(r){let e=SF({precision:r.precision}),t=["Z"];r.local&&t.push(""),r.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${t.join("|")})`;return new RegExp(`^${PF}T(?:${n})$`)}var fA=r=>{let e=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},mA=/^-?\d+n?$/,gA=/^-?\d+$/,Sy=/^-?\d+(?:\.\d+)?$/,vA=/^(?:true|false)$/i,yA=/^null$/i;var xA=/^undefined$/i;var bA=/^[^A-Z]*$/,wA=/^[^a-z]*$/,t$=/^[0-9a-fA-F]*$/;function pf(r,e){return new RegExp(`^[A-Za-z0-9+/]{${r}}${e}$`)}function hf(r){return new RegExp(`^[A-Za-z0-9_-]{${r}}$`)}var r$=/^[0-9a-fA-F]{32}$/,i$=pf(22,"=="),n$=hf(22),o$=/^[0-9a-fA-F]{40}$/,a$=pf(27,"="),s$=hf(27),l$=/^[0-9a-fA-F]{64}$/,c$=pf(43,"="),u$=hf(43),d$=/^[0-9a-fA-F]{96}$/,p$=pf(64,""),h$=hf(64),f$=/^[0-9a-fA-F]{128}$/,m$=pf(86,"=="),g$=hf(86);var it=A("$ZodCheck",(r,e)=>{var t;r._zod??(r._zod={}),r._zod.def=e,(t=r._zod).onattach??(t.onattach=[])}),FF={number:"number",bigint:"bigint",object:"date"},Ey=A("$ZodCheckLessThan",(r,e)=>{it.init(r,e);let t=FF[typeof e.value];r._zod.onattach.push(n=>{let i=n._zod.bag,o=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),r._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:t,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),Fy=A("$ZodCheckGreaterThan",(r,e)=>{it.init(r,e);let t=FF[typeof e.value];r._zod.onattach.push(n=>{let i=n._zod.bag,o=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),r._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:t,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:r,continue:!e.abort})}}),AA=A("$ZodCheckMultipleOf",(r,e)=>{it.init(r,e),r._zod.onattach.push(t=>{var n;(n=t._zod.bag).multipleOf??(n.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):C0(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})}}),_A=A("$ZodCheckNumberFormat",(r,e)=>{it.init(r,e),e.format=e.format||"float64";let t=e.format?.includes("int"),n=t?"int":"number",[i,o]=j0[e.format];r._zod.onattach.push(a=>{let s=a._zod.bag;s.format=e.format,s.minimum=i,s.maximum=o,t&&(s.pattern=gA)}),r._zod.check=a=>{let s=a.value;if(t){if(!Number.isInteger(s)){a.issues.push({expected:n,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:n,inclusive:!0,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:n,inclusive:!0,continue:!e.abort});return}}s<i&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:r,continue:!e.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:r,continue:!e.abort})}}),PA=A("$ZodCheckBigIntFormat",(r,e)=>{it.init(r,e);let[t,n]=L0[e.format];r._zod.onattach.push(i=>{let o=i._zod.bag;o.format=e.format,o.minimum=t,o.maximum=n}),r._zod.check=i=>{let o=i.value;o<t&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:t,inclusive:!0,inst:r,continue:!e.abort}),o>n&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:n,inclusive:!0,inst:r,continue:!e.abort})}}),SA=A("$ZodCheckMaxSize",(r,e)=>{var t;it.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Ka(i)&&i.size!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),r._zod.check=n=>{let i=n.value;i.size<=e.maximum||n.issues.push({origin:sf(i),code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),EA=A("$ZodCheckMinSize",(r,e)=>{var t;it.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Ka(i)&&i.size!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),r._zod.check=n=>{let i=n.value;i.size>=e.minimum||n.issues.push({origin:sf(i),code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),FA=A("$ZodCheckSizeEquals",(r,e)=>{var t;it.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Ka(i)&&i.size!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.size,i.maximum=e.size,i.size=e.size}),r._zod.check=n=>{let i=n.value,o=i.size;if(o===e.size)return;let a=o>e.size;n.issues.push({origin:sf(i),...a?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:r,continue:!e.abort})}}),BA=A("$ZodCheckMaxLength",(r,e)=>{var t;it.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Ka(i)&&i.length!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(n._zod.bag.maximum=e.maximum)}),r._zod.check=n=>{let i=n.value;if(i.length<=e.maximum)return;let a=lf(i);n.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),IA=A("$ZodCheckMinLength",(r,e)=>{var t;it.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Ka(i)&&i.length!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),r._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let a=lf(i);n.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:r,continue:!e.abort})}}),kA=A("$ZodCheckLengthEquals",(r,e)=>{var t;it.init(r,e),(t=r._zod.def).when??(t.when=n=>{let i=n.value;return!Ka(i)&&i.length!==void 0}),r._zod.onattach.push(n=>{let i=n._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),r._zod.check=n=>{let i=n.value,o=i.length;if(o===e.length)return;let a=lf(i),s=o>e.length;n.issues.push({origin:a,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:r,continue:!e.abort})}}),td=A("$ZodCheckStringFormat",(r,e)=>{var t,n;it.init(r,e),r._zod.onattach.push(i=>{let o=i._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=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:r,continue:!e.abort})}):(n=r._zod).check??(n.check=()=>{})}),NA=A("$ZodCheckRegex",(r,e)=>{td.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})}}),$A=A("$ZodCheckLowerCase",(r,e)=>{e.pattern??(e.pattern=bA),td.init(r,e)}),DA=A("$ZodCheckUpperCase",(r,e)=>{e.pattern??(e.pattern=wA),td.init(r,e)}),MA=A("$ZodCheckIncludes",(r,e)=>{it.init(r,e);let t=Wi(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${t}`:t);e.pattern=n,r._zod.onattach.push(i=>{let o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),r._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:r,continue:!e.abort})}}),TA=A("$ZodCheckStartsWith",(r,e)=>{it.init(r,e);let t=new RegExp(`^${Wi(e.prefix)}.*`);e.pattern??(e.pattern=t),r._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),r._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:r,continue:!e.abort})}}),CA=A("$ZodCheckEndsWith",(r,e)=>{it.init(r,e);let t=new RegExp(`.*${Wi(e.suffix)}$`);e.pattern??(e.pattern=t),r._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(t)}),r._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:r,continue:!e.abort})}});function EF(r,e,t){r.issues.length&&e.issues.push(...mi(t,r.issues))}var RA=A("$ZodCheckProperty",(r,e)=>{it.init(r,e),r._zod.check=t=>{let n=e.schema._zod.run({value:t.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(i=>EF(i,t,e.property));EF(n,t,e.property)}}),OA=A("$ZodCheckMimeType",(r,e)=>{it.init(r,e);let t=new Set(e.mime);r._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),r._zod.check=n=>{t.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:r,continue:!e.abort})}}),VA=A("$ZodCheckOverwrite",(r,e)=>{it.init(r,e),r._zod.check=t=>{t.value=e.tx(t.value)}});var ff=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 n=e.split(`
5
+ `).filter(a=>a),i=Math.min(...n.map(a=>a.length-a.trimStart().length)),o=n.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let e=Function,t=this?.args,i=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...t,i.join(`
6
+ `))}};var zA={major:4,minor:3,patch:5};var Ae=A("$ZodType",(r,e)=>{var t;r??(r={}),r._zod.def=e,r._zod.bag=r._zod.bag||{},r._zod.version=zA;let n=[...r._zod.def.checks??[]];r._zod.traits.has("$ZodCheck")&&n.unshift(r);for(let i of n)for(let o of i._zod.onattach)o(r);if(n.length===0)(t=r._zod).deferred??(t.deferred=[]),r._zod.deferred?.push(()=>{r._zod.run=r._zod.parse});else{let i=(a,s,l)=>{let u=qa(a),d;for(let p of s){if(p._zod.def.when){if(!p._zod.def.when(a))continue}else if(u)continue;let h=a.issues.length,g=p._zod.check(a);if(g instanceof Promise&&l?.async===!1)throw new wn;if(d||g instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await g,a.issues.length!==h&&(u||(u=qa(a,h)))});else{if(a.issues.length===h)continue;u||(u=qa(a,h))}}return d?d.then(()=>a):a},o=(a,s,l)=>{if(qa(a))return a.aborted=!0,a;let u=i(s,n,l);if(u instanceof Promise){if(l.async===!1)throw new wn;return u.then(d=>r._zod.parse(d,l))}return r._zod.parse(u,l)};r._zod.run=(a,s)=>{if(s.skipChecks)return r._zod.parse(a,s);if(s.direction==="backward"){let u=r._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return u instanceof Promise?u.then(d=>o(d,a,s)):o(u,a,s)}let l=r._zod.parse(a,s);if(l instanceof Promise){if(s.async===!1)throw new wn;return l.then(u=>i(u,n,s))}return i(l,n,s)}}Ne(r,"~standard",()=>({validate:i=>{try{let o=Z0(r,i);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return q0(r,i).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Fl=A("$ZodString",(r,e)=>{Ae.init(r,e),r._zod.pattern=[...r?._zod.bag?.patterns??[]].pop()??fA(r._zod.bag),r._zod.parse=(t,n)=>{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}}),tt=A("$ZodStringFormat",(r,e)=>{td.init(r,e),Fl.init(r,e)}),jA=A("$ZodGUID",(r,e)=>{e.pattern??(e.pattern=tA),tt.init(r,e)}),LA=A("$ZodUUID",(r,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=El(n))}else e.pattern??(e.pattern=El());tt.init(r,e)}),KA=A("$ZodEmail",(r,e)=>{e.pattern??(e.pattern=rA),tt.init(r,e)}),WA=A("$ZodURL",(r,e)=>{tt.init(r,e),r._zod.check=t=>{try{let n=t.value.trim(),i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.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(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.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=i.href:t.value=n;return}catch{t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:r,continue:!e.abort})}}}),ZA=A("$ZodEmoji",(r,e)=>{e.pattern??(e.pattern=iA()),tt.init(r,e)}),qA=A("$ZodNanoID",(r,e)=>{e.pattern??(e.pattern=Y0),tt.init(r,e)}),GA=A("$ZodCUID",(r,e)=>{e.pattern??(e.pattern=G0),tt.init(r,e)}),HA=A("$ZodCUID2",(r,e)=>{e.pattern??(e.pattern=H0),tt.init(r,e)}),JA=A("$ZodULID",(r,e)=>{e.pattern??(e.pattern=J0),tt.init(r,e)}),QA=A("$ZodXID",(r,e)=>{e.pattern??(e.pattern=Q0),tt.init(r,e)}),XA=A("$ZodKSUID",(r,e)=>{e.pattern??(e.pattern=X0),tt.init(r,e)}),YA=A("$ZodISODateTime",(r,e)=>{e.pattern??(e.pattern=hA(e)),tt.init(r,e)}),e_=A("$ZodISODate",(r,e)=>{e.pattern??(e.pattern=dA),tt.init(r,e)}),t_=A("$ZodISOTime",(r,e)=>{e.pattern??(e.pattern=pA(e)),tt.init(r,e)}),r_=A("$ZodISODuration",(r,e)=>{e.pattern??(e.pattern=eA),tt.init(r,e)}),i_=A("$ZodIPv4",(r,e)=>{e.pattern??(e.pattern=nA),tt.init(r,e),r._zod.bag.format="ipv4"}),n_=A("$ZodIPv6",(r,e)=>{e.pattern??(e.pattern=oA),tt.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})}}}),o_=A("$ZodMAC",(r,e)=>{e.pattern??(e.pattern=aA(e.delimiter)),tt.init(r,e),r._zod.bag.format="mac"}),a_=A("$ZodCIDRv4",(r,e)=>{e.pattern??(e.pattern=sA),tt.init(r,e)}),s_=A("$ZodCIDRv6",(r,e)=>{e.pattern??(e.pattern=lA),tt.init(r,e),r._zod.check=t=>{let n=t.value.split("/");try{if(n.length!==2)throw new Error;let[i,o]=n;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://[${i}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:r,continue:!e.abort})}}});function l_(r){if(r==="")return!0;if(r.length%4!==0)return!1;try{return atob(r),!0}catch{return!1}}var c_=A("$ZodBase64",(r,e)=>{e.pattern??(e.pattern=cA),tt.init(r,e),r._zod.bag.contentEncoding="base64",r._zod.check=t=>{l_(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:r,continue:!e.abort})}});function zF(r){if(!Py.test(r))return!1;let e=r.replace(/[-_]/g,n=>n==="-"?"+":"/"),t=e.padEnd(Math.ceil(e.length/4)*4,"=");return l_(t)}var u_=A("$ZodBase64URL",(r,e)=>{e.pattern??(e.pattern=Py),tt.init(r,e),r._zod.bag.contentEncoding="base64url",r._zod.check=t=>{zF(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:r,continue:!e.abort})}}),d_=A("$ZodE164",(r,e)=>{e.pattern??(e.pattern=uA),tt.init(r,e)});function UF(r,e=null){try{let t=r.split(".");if(t.length!==3)return!1;let[n]=t;if(!n)return!1;let i=JSON.parse(atob(n));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}var p_=A("$ZodJWT",(r,e)=>{tt.init(r,e),r._zod.check=t=>{UF(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:r,continue:!e.abort})}}),h_=A("$ZodCustomStringFormat",(r,e)=>{tt.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})}}),Dy=A("$ZodNumber",(r,e)=>{Ae.init(r,e),r._zod.pattern=r._zod.bag.pattern??Sy,r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=Number(t.value)}catch{}let i=t.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return t;let o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:i,inst:r,...o?{received:o}:{}}),t}}),f_=A("$ZodNumberFormat",(r,e)=>{_A.init(r,e),Dy.init(r,e)}),mf=A("$ZodBoolean",(r,e)=>{Ae.init(r,e),r._zod.pattern=vA,r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=!!t.value}catch{}let i=t.value;return typeof i=="boolean"||t.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:r}),t}}),My=A("$ZodBigInt",(r,e)=>{Ae.init(r,e),r._zod.pattern=mA,r._zod.parse=(t,n)=>{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}}),m_=A("$ZodBigIntFormat",(r,e)=>{PA.init(r,e),My.init(r,e)}),g_=A("$ZodSymbol",(r,e)=>{Ae.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;return typeof i=="symbol"||t.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:r}),t}}),v_=A("$ZodUndefined",(r,e)=>{Ae.init(r,e),r._zod.pattern=xA,r._zod.values=new Set([void 0]),r._zod.optin="optional",r._zod.optout="optional",r._zod.parse=(t,n)=>{let i=t.value;return typeof i>"u"||t.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:r}),t}}),y_=A("$ZodNull",(r,e)=>{Ae.init(r,e),r._zod.pattern=yA,r._zod.values=new Set([null]),r._zod.parse=(t,n)=>{let i=t.value;return i===null||t.issues.push({expected:"null",code:"invalid_type",input:i,inst:r}),t}}),x_=A("$ZodAny",(r,e)=>{Ae.init(r,e),r._zod.parse=t=>t}),b_=A("$ZodUnknown",(r,e)=>{Ae.init(r,e),r._zod.parse=t=>t}),w_=A("$ZodNever",(r,e)=>{Ae.init(r,e),r._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:r}),t)}),A_=A("$ZodVoid",(r,e)=>{Ae.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;return typeof i>"u"||t.issues.push({expected:"void",code:"invalid_type",input:i,inst:r}),t}}),__=A("$ZodDate",(r,e)=>{Ae.init(r,e),r._zod.parse=(t,n)=>{if(e.coerce)try{t.value=new Date(t.value)}catch{}let i=t.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||t.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:r}),t}});function IF(r,e,t){r.issues.length&&e.issues.push(...mi(t,r.issues)),e.value[t]=r.value}var P_=A("$ZodArray",(r,e)=>{Ae.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;if(!Array.isArray(i))return t.issues.push({expected:"array",code:"invalid_type",input:i,inst:r}),t;t.value=Array(i.length);let o=[];for(let a=0;a<i.length;a++){let s=i[a],l=e.element._zod.run({value:s,issues:[]},n);l instanceof Promise?o.push(l.then(u=>IF(u,t,a))):IF(l,t,a)}return o.length?Promise.all(o).then(()=>t):t}});function $y(r,e,t,n,i){if(r.issues.length){if(i&&!(t in n))return;e.issues.push(...mi(t,r.issues))}r.value===void 0?t in n&&(e.value[t]=void 0):e.value[t]=r.value}function jF(r){let e=Object.keys(r.shape);for(let n of e)if(!r.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let t=U0(r.shape);return{...r,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(t)}}function LF(r,e,t,n,i,o){let a=[],s=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optout==="optional";for(let p in e){if(s.has(p))continue;if(u==="never"){a.push(p);continue}let h=l.run({value:e[p],issues:[]},n);h instanceof Promise?r.push(h.then(g=>$y(g,t,p,e,d))):$y(h,t,p,e,d)}return a.length&&t.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:o}),r.length?Promise.all(r).then(()=>t):t}var KF=A("$ZodObject",(r,e)=>{if(Ae.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 n=Hu(()=>jF(e));Ne(r._zod,"propValues",()=>{let s=e.shape,l={};for(let u in s){let d=s[u]._zod;if(d.values){l[u]??(l[u]=new Set);for(let p of d.values)l[u].add(p)}}return l});let i=Sl,o=e.catchall,a;r._zod.parse=(s,l)=>{a??(a=n.value);let u=s.value;if(!i(u))return s.issues.push({expected:"object",code:"invalid_type",input:u,inst:r}),s;s.value={};let d=[],p=a.shape;for(let h of a.keys){let g=p[h],v=g._zod.optout==="optional",y=g._zod.run({value:u[h],issues:[]},l);y instanceof Promise?d.push(y.then(x=>$y(x,s,h,u,v))):$y(y,s,h,u,v)}return o?LF(d,u,s,l,n.value,r):d.length?Promise.all(d).then(()=>s):s}}),S_=A("$ZodObjectJIT",(r,e)=>{KF.init(r,e);let t=r._zod.parse,n=Hu(()=>jF(e)),i=h=>{let g=new ff(["shape","payload","ctx"]),v=n.value,y=U=>{let C=py(U);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};g.write("const input = payload.value;");let x=Object.create(null),$=0;for(let U of v.keys)x[U]=`key_${$++}`;g.write("const newResult = {};");for(let U of v.keys){let C=x[U],V=py(U),Y=h[U]?._zod?.optout==="optional";g.write(`const ${C} = ${y(U)};`),Y?g.write(`
7
+ if (${C}.issues.length) {
8
+ if (${V} in input) {
9
+ payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
10
+ ...iss,
11
+ path: iss.path ? [${V}, ...iss.path] : [${V}]
12
+ })));
13
+ }
14
+ }
15
+
16
+ if (${C}.value === undefined) {
17
+ if (${V} in input) {
18
+ newResult[${V}] = undefined;
19
+ }
20
+ } else {
21
+ newResult[${V}] = ${C}.value;
22
+ }
23
+
24
+ `):g.write(`
25
+ if (${C}.issues.length) {
26
+ payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
9
27
  ...iss,
10
- path: iss.path ? [${j}, ...iss.path] : [${j}]
28
+ path: iss.path ? [${V}, ...iss.path] : [${V}]
11
29
  })));
12
30
  }
13
31
 
14
-
15
- if (${O}.value === undefined) {
16
- if (${j} in input) {
17
- newResult[${j}] = undefined;
32
+ if (${C}.value === undefined) {
33
+ if (${V} in input) {
34
+ newResult[${V}] = undefined;
18
35
  }
19
36
  } else {
20
- newResult[${j}] = ${O}.value;
37
+ newResult[${V}] = ${C}.value;
21
38
  }
22
39
 
23
- `)}g.write("payload.value = newResult;"),g.write("return payload;");let D=g.compile();return(V,O)=>D(h,V,O)},n,s=gl,a=!Lh.jitless,u=a&&b0.value,d=e.catchall,p;r._zod.parse=(h,g)=>{p??(p=o.value);let v=h.value;return s(v)?a&&u&&g?.async===!1&&g.jitless!==!0?(n||(n=i(e.shape)),h=n(h,g),d?IB([],v,h,g,p,r):h):t(h,g):(h.issues.push({expected:"object",code:"invalid_type",input:v,inst:r}),h)}});function vB(r,e,t,o){for(let n of r)if(n.issues.length===0)return e.value=n.value,e;let i=r.filter(n=>!Us(n));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:r.map(n=>n.issues.map(s=>Vr(s,o,_t())))}),e)}var of=w("$ZodUnion",(r,e)=>{ve.init(r,e),ke(r._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ke(r._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ke(r._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),ke(r._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${i.map(n=>Zh(n.source)).join("|")})$`)}});let t=e.options.length===1,o=e.options[0]._zod.run;r._zod.parse=(i,n)=>{if(t)return o(i,n);let s=!1,a=[];for(let l of e.options){let u=l._zod.run({value:i.value,issues:[]},n);if(u instanceof Promise)a.push(u),s=!0;else{if(u.issues.length===0)return u;a.push(u)}}return s?Promise.all(a).then(l=>vB(l,i,r,n)):vB(a,i,r,n)}});function yB(r,e,t,o){let i=r.filter(n=>n.issues.length===0);return i.length===1?(e.value=i[0].value,e):(i.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:r.map(n=>n.issues.map(s=>Vr(s,o,_t())))}):e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:[],inclusive:!1}),e)}var u_=w("$ZodXor",(r,e)=>{of.init(r,e),e.inclusive=!1;let t=e.options.length===1,o=e.options[0]._zod.run;r._zod.parse=(i,n)=>{if(t)return o(i,n);let s=!1,a=[];for(let l of e.options){let u=l._zod.run({value:i.value,issues:[]},n);u instanceof Promise?(a.push(u),s=!0):a.push(u)}return s?Promise.all(a).then(l=>yB(l,i,r,n)):yB(a,i,r,n)}}),c_=w("$ZodDiscriminatedUnion",(r,e)=>{e.inclusive=!1,of.init(r,e);let t=r._zod.parse;ke(r._zod,"propValues",()=>{let i={};for(let n of e.options){let s=n._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let[a,l]of Object.entries(s)){i[a]||(i[a]=new Set);for(let u of l)i[a].add(u)}}return i});let o=zc(()=>{let i=e.options,n=new Map;for(let s of i){let a=s._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let l of a){if(n.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);n.set(l,s)}}return n});r._zod.parse=(i,n)=>{let s=i.value;if(!gl(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:r}),i;let a=o.value.get(s?.[e.discriminator]);return a?a._zod.run(i,n):e.unionFallback?t(i,n):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:r}),i)}}),d_=w("$ZodIntersection",(r,e)=>{ve.init(r,e),r._zod.parse=(t,o)=>{let i=t.value,n=e.left._zod.run({value:i,issues:[]},o),s=e.right._zod.run({value:i,issues:[]},o);return n instanceof Promise||s instanceof Promise?Promise.all([n,s]).then(([l,u])=>xB(t,l,u)):xB(t,n,s)}});function PA(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(zs(r)&&zs(e)){let t=Object.keys(e),o=Object.keys(r).filter(n=>t.indexOf(n)!==-1),i={...r,...e};for(let n of o){let s=PA(r[n],e[n]);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};i[n]=s.data}return{valid:!0,data:i}}if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return{valid:!1,mergeErrorPath:[]};let t=[];for(let o=0;o<r.length;o++){let i=r[o],n=e[o],s=PA(i,n);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};t.push(s.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function xB(r,e,t){if(e.issues.length&&r.issues.push(...e.issues),t.issues.length&&r.issues.push(...t.issues),Us(r))return r;let o=PA(e.value,t.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return r.value=o.data,r}var wy=w("$ZodTuple",(r,e)=>{ve.init(r,e);let t=e.items;r._zod.parse=(o,i)=>{let n=o.value;if(!Array.isArray(n))return o.issues.push({input:n,inst:r,expected:"tuple",code:"invalid_type"}),o;o.value=[];let s=[],a=[...t].reverse().findIndex(d=>d._zod.optin!=="optional"),l=a===-1?0:t.length-a;if(!e.rest){let d=n.length>t.length,p=n.length<l-1;if(d||p)return o.issues.push({...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},input:n,inst:r,origin:"array"}),o}let u=-1;for(let d of t){if(u++,u>=n.length&&u>=l)continue;let p=d._zod.run({value:n[u],issues:[]},i);p instanceof Promise?s.push(p.then(h=>fy(h,o,u))):fy(p,o,u)}if(e.rest){let d=n.slice(t.length);for(let p of d){u++;let h=e.rest._zod.run({value:p,issues:[]},i);h instanceof Promise?s.push(h.then(g=>fy(g,o,u))):fy(h,o,u)}}return s.length?Promise.all(s).then(()=>o):o}});function fy(r,e,t){r.issues.length&&e.issues.push(...ai(t,r.issues)),e.value[t]=r.value}var p_=w("$ZodRecord",(r,e)=>{ve.init(r,e),r._zod.parse=(t,o)=>{let i=t.value;if(!zs(i))return t.issues.push({expected:"record",code:"invalid_type",input:i,inst:r}),t;let n=[],s=e.keyType._zod.values;if(s){t.value={};let a=new Set;for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let d=e.valueType._zod.run({value:i[u],issues:[]},o);d instanceof Promise?n.push(d.then(p=>{p.issues.length&&t.issues.push(...ai(u,p.issues)),t.value[u]=p.value})):(d.issues.length&&t.issues.push(...ai(u,d.issues)),t.value[u]=d.value)}let l;for(let u in i)a.has(u)||(l=l??[],l.push(u));l&&l.length>0&&t.issues.push({code:"unrecognized_keys",input:i,inst:r,keys:l})}else{t.value={};for(let a of Reflect.ownKeys(i)){if(a==="__proto__")continue;let l=e.keyType._zod.run({value:a,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){e.mode==="loose"?t.value[a]=i[a]:t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(d=>Vr(d,o,_t())),input:a,path:[a],inst:r});continue}let u=e.valueType._zod.run({value:i[a],issues:[]},o);u instanceof Promise?n.push(u.then(d=>{d.issues.length&&t.issues.push(...ai(a,d.issues)),t.value[l.value]=d.value})):(u.issues.length&&t.issues.push(...ai(a,u.issues)),t.value[l.value]=u.value)}}return n.length?Promise.all(n).then(()=>t):t}}),h_=w("$ZodMap",(r,e)=>{ve.init(r,e),r._zod.parse=(t,o)=>{let i=t.value;if(!(i instanceof Map))return t.issues.push({expected:"map",code:"invalid_type",input:i,inst:r}),t;let n=[];t.value=new Map;for(let[s,a]of i){let l=e.keyType._zod.run({value:s,issues:[]},o),u=e.valueType._zod.run({value:a,issues:[]},o);l instanceof Promise||u instanceof Promise?n.push(Promise.all([l,u]).then(([d,p])=>{bB(d,p,t,s,i,r,o)})):bB(l,u,t,s,i,r,o)}return n.length?Promise.all(n).then(()=>t):t}});function bB(r,e,t,o,i,n,s){r.issues.length&&(Gh.has(typeof o)?t.issues.push(...ai(o,r.issues)):t.issues.push({code:"invalid_key",origin:"map",input:i,inst:n,issues:r.issues.map(a=>Vr(a,s,_t()))})),e.issues.length&&(Gh.has(typeof o)?t.issues.push(...ai(o,e.issues)):t.issues.push({origin:"map",code:"invalid_element",input:i,inst:n,key:o,issues:e.issues.map(a=>Vr(a,s,_t()))})),t.value.set(r.value,e.value)}var f_=w("$ZodSet",(r,e)=>{ve.init(r,e),r._zod.parse=(t,o)=>{let i=t.value;if(!(i instanceof Set))return t.issues.push({input:i,inst:r,expected:"set",code:"invalid_type"}),t;let n=[];t.value=new Set;for(let s of i){let a=e.valueType._zod.run({value:s,issues:[]},o);a instanceof Promise?n.push(a.then(l=>wB(l,t))):wB(a,t)}return n.length?Promise.all(n).then(()=>t):t}});function wB(r,e){r.issues.length&&e.issues.push(...r.issues),e.value.add(r.value)}var m_=w("$ZodEnum",(r,e)=>{ve.init(r,e);let t=Wh(e.entries),o=new Set(t);r._zod.values=o,r._zod.pattern=new RegExp(`^(${t.filter(i=>Gh.has(typeof i)).map(i=>typeof i=="string"?Oi(i):i.toString()).join("|")})$`),r._zod.parse=(i,n)=>{let s=i.value;return o.has(s)||i.issues.push({code:"invalid_value",values:t,input:s,inst:r}),i}}),g_=w("$ZodLiteral",(r,e)=>{if(ve.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(o=>typeof o=="string"?Oi(o):o?Oi(o.toString()):String(o)).join("|")})$`),r._zod.parse=(o,i)=>{let n=o.value;return t.has(n)||o.issues.push({code:"invalid_value",values:e.values,input:n,inst:r}),o}}),v_=w("$ZodFile",(r,e)=>{ve.init(r,e),r._zod.parse=(t,o)=>{let i=t.value;return i instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:i,inst:r}),t}}),y_=w("$ZodTransform",(r,e)=>{ve.init(r,e),r._zod.parse=(t,o)=>{if(o.direction==="backward")throw new Ts(r.constructor.name);let i=e.transform(t.value,t);if(o.async)return(i instanceof Promise?i:Promise.resolve(i)).then(s=>(t.value=s,t));if(i instanceof Promise)throw new ho;return t.value=i,t}});function AB(r,e){return r.issues.length&&e===void 0?{issues:[],value:void 0}:r}var x_=w("$ZodOptional",(r,e)=>{ve.init(r,e),r._zod.optin="optional",r._zod.optout="optional",ke(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ke(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${Zh(t.source)})?$`):void 0}),r._zod.parse=(t,o)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(t,o);return i instanceof Promise?i.then(n=>AB(n,t.value)):AB(i,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,o)}}),b_=w("$ZodNullable",(r,e)=>{ve.init(r,e),ke(r._zod,"optin",()=>e.innerType._zod.optin),ke(r._zod,"optout",()=>e.innerType._zod.optout),ke(r._zod,"pattern",()=>{let t=e.innerType._zod.pattern;return t?new RegExp(`^(${Zh(t.source)}|null)$`):void 0}),ke(r._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),r._zod.parse=(t,o)=>t.value===null?t:e.innerType._zod.run(t,o)}),w_=w("$ZodDefault",(r,e)=>{ve.init(r,e),r._zod.optin="optional",ke(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,o)=>{if(o.direction==="backward")return e.innerType._zod.run(t,o);if(t.value===void 0)return t.value=e.defaultValue,t;let i=e.innerType._zod.run(t,o);return i instanceof Promise?i.then(n=>_B(n,e)):_B(i,e)}});function _B(r,e){return r.value===void 0&&(r.value=e.defaultValue),r}var A_=w("$ZodPrefault",(r,e)=>{ve.init(r,e),r._zod.optin="optional",ke(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,o)=>(o.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,o))}),__=w("$ZodNonOptional",(r,e)=>{ve.init(r,e),ke(r._zod,"values",()=>{let t=e.innerType._zod.values;return t?new Set([...t].filter(o=>o!==void 0)):void 0}),r._zod.parse=(t,o)=>{let i=e.innerType._zod.run(t,o);return i instanceof Promise?i.then(n=>PB(n,r)):PB(i,r)}});function PB(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 P_=w("$ZodSuccess",(r,e)=>{ve.init(r,e),r._zod.parse=(t,o)=>{if(o.direction==="backward")throw new Ts("ZodSuccess");let i=e.innerType._zod.run(t,o);return i instanceof Promise?i.then(n=>(t.value=n.issues.length===0,t)):(t.value=i.issues.length===0,t)}}),S_=w("$ZodCatch",(r,e)=>{ve.init(r,e),ke(r._zod,"optin",()=>e.innerType._zod.optin),ke(r._zod,"optout",()=>e.innerType._zod.optout),ke(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,o)=>{if(o.direction==="backward")return e.innerType._zod.run(t,o);let i=e.innerType._zod.run(t,o);return i instanceof Promise?i.then(n=>(t.value=n.value,n.issues.length&&(t.value=e.catchValue({...t,error:{issues:n.issues.map(s=>Vr(s,o,_t()))},input:t.value}),t.issues=[]),t)):(t.value=i.value,i.issues.length&&(t.value=e.catchValue({...t,error:{issues:i.issues.map(n=>Vr(n,o,_t()))},input:t.value}),t.issues=[]),t)}}),E_=w("$ZodNaN",(r,e)=>{ve.init(r,e),r._zod.parse=(t,o)=>((typeof t.value!="number"||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:r,expected:"nan",code:"invalid_type"}),t)}),B_=w("$ZodPipe",(r,e)=>{ve.init(r,e),ke(r._zod,"values",()=>e.in._zod.values),ke(r._zod,"optin",()=>e.in._zod.optin),ke(r._zod,"optout",()=>e.out._zod.optout),ke(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(t,o)=>{if(o.direction==="backward"){let n=e.out._zod.run(t,o);return n instanceof Promise?n.then(s=>my(s,e.in,o)):my(n,e.in,o)}let i=e.in._zod.run(t,o);return i instanceof Promise?i.then(n=>my(n,e.out,o)):my(i,e.out,o)}});function my(r,e,t){return r.issues.length?(r.aborted=!0,r):e._zod.run({value:r.value,issues:r.issues},t)}var nf=w("$ZodCodec",(r,e)=>{ve.init(r,e),ke(r._zod,"values",()=>e.in._zod.values),ke(r._zod,"optin",()=>e.in._zod.optin),ke(r._zod,"optout",()=>e.out._zod.optout),ke(r._zod,"propValues",()=>e.in._zod.propValues),r._zod.parse=(t,o)=>{if((o.direction||"forward")==="forward"){let n=e.in._zod.run(t,o);return n instanceof Promise?n.then(s=>gy(s,e,o)):gy(n,e,o)}else{let n=e.out._zod.run(t,o);return n instanceof Promise?n.then(s=>gy(s,e,o)):gy(n,e,o)}}});function gy(r,e,t){if(r.issues.length)return r.aborted=!0,r;if((t.direction||"forward")==="forward"){let i=e.transform(r.value,r);return i instanceof Promise?i.then(n=>vy(r,n,e.out,t)):vy(r,i,e.out,t)}else{let i=e.reverseTransform(r.value,r);return i instanceof Promise?i.then(n=>vy(r,n,e.in,t)):vy(r,i,e.in,t)}}function vy(r,e,t,o){return r.issues.length?(r.aborted=!0,r):t._zod.run({value:e,issues:r.issues},o)}var F_=w("$ZodReadonly",(r,e)=>{ve.init(r,e),ke(r._zod,"propValues",()=>e.innerType._zod.propValues),ke(r._zod,"values",()=>e.innerType._zod.values),ke(r._zod,"optin",()=>e.innerType?._zod?.optin),ke(r._zod,"optout",()=>e.innerType?._zod?.optout),r._zod.parse=(t,o)=>{if(o.direction==="backward")return e.innerType._zod.run(t,o);let i=e.innerType._zod.run(t,o);return i instanceof Promise?i.then(SB):SB(i)}});function SB(r){return r.value=Object.freeze(r.value),r}var N_=w("$ZodTemplateLiteral",(r,e)=>{ve.init(r,e);let t=[];for(let o of e.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let i=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let n=i.startsWith("^")?1:0,s=i.endsWith("$")?i.length-1:i.length;t.push(i.slice(n,s))}else if(o===null||A0.has(typeof o))t.push(Oi(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);r._zod.pattern=new RegExp(`^${t.join("")}$`),r._zod.parse=(o,i)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:r,expected:"template_literal",code:"invalid_type"}),o):(r._zod.pattern.lastIndex=0,r._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:r,code:"invalid_format",format:e.format??"template_literal",pattern:r._zod.pattern.source}),o)}),I_=w("$ZodFunction",(r,e)=>(ve.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(...o){let i=r._def.input?ty(r._def.input,o):o,n=Reflect.apply(t,this,i);return r._def.output?ty(r._def.output,n):n}},r.implementAsync=t=>{if(typeof t!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let i=r._def.input?await ry(r._def.input,o):o,n=await Reflect.apply(t,this,i);return r._def.output?await ry(r._def.output,n):n}},r._zod.parse=(t,o)=>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 o=r.constructor;return Array.isArray(t[0])?new o({type:"function",input:new wy({type:"tuple",items:t[0],rest:t[1]}),output:r._def.output}):new o({type:"function",input:t[0],output:r._def.output})},r.output=t=>{let o=r.constructor;return new o({type:"function",input:r._def.input,output:t})},r)),k_=w("$ZodPromise",(r,e)=>{ve.init(r,e),r._zod.parse=(t,o)=>Promise.resolve(t.value).then(i=>e.innerType._zod.run({value:i,issues:[]},o))}),$_=w("$ZodLazy",(r,e)=>{ve.init(r,e),ke(r._zod,"innerType",()=>e.getter()),ke(r._zod,"pattern",()=>r._zod.innerType?._zod?.pattern),ke(r._zod,"propValues",()=>r._zod.innerType?._zod?.propValues),ke(r._zod,"optin",()=>r._zod.innerType?._zod?.optin??void 0),ke(r._zod,"optout",()=>r._zod.innerType?._zod?.optout??void 0),r._zod.parse=(t,o)=>r._zod.innerType._zod.run(t,o)}),D_=w("$ZodCustom",(r,e)=>{Ye.init(r,e),ve.init(r,e),r._zod.parse=(t,o)=>t,r._zod.check=t=>{let o=t.value,i=e.fn(o);if(i instanceof Promise)return i.then(n=>EB(n,t,o,r));EB(i,t,o,r)}});function EB(r,e,t,o){if(!r){let i={code:"custom",input:t,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(i.params=o._zod.def.params),e.issues.push(Uc(i))}}var lf={};tn(lf,{ar:()=>$B,az:()=>DB,be:()=>CB,bg:()=>TB,ca:()=>RB,cs:()=>OB,da:()=>VB,de:()=>zB,en:()=>Ay,eo:()=>UB,es:()=>jB,fa:()=>LB,fi:()=>KB,fr:()=>WB,frCA:()=>ZB,he:()=>GB,hu:()=>qB,id:()=>HB,is:()=>JB,it:()=>QB,ja:()=>XB,ka:()=>YB,kh:()=>eF,km:()=>_y,ko:()=>tF,lt:()=>iF,mk:()=>oF,ms:()=>nF,nl:()=>sF,no:()=>aF,ota:()=>lF,pl:()=>cF,ps:()=>uF,pt:()=>dF,ru:()=>hF,sl:()=>fF,sv:()=>mF,ta:()=>gF,th:()=>vF,tr:()=>yF,ua:()=>xF,uk:()=>Py,ur:()=>bF,vi:()=>wF,yo:()=>PF,zhCN:()=>AF,zhTW:()=>_F});var Wk=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.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 ${i.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${z(i.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${n} ${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${n} ${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${n} ${i.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${n} ${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${i.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`${o[n.format]??i.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${i.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${i.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${i.keys.length>1?"\u0629":""}: ${k(i.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function $B(){return{localeError:Wk()}}var Zk=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i.expected}, daxil olan ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${z(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${n}${i.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${n}${i.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${n.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:n.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${n.suffix}" il\u0259 bitm\u0259lidir`:n.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${n.includes}" daxil olmal\u0131d\u0131r`:n.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${n.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${o[n.format]??i.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${i.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${i.keys.length>1?"lar":""}: ${k(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${i.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function DB(){return{localeError:Zk()}}function MB(r,e,t,o){let i=Math.abs(r),n=i%10,s=i%100;return s>=11&&s<=19?o:n===1?e:n>=2&&n<=4?t:o}var Gk=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(i))return"\u043C\u0430\u0441\u0456\u045E";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.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 ${i.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${z(i.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),l=MB(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${n}${i.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 ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);if(s){let a=Number(i.minimum),l=MB(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${n}${i.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 ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${o[n.format]??i.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${i.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${k(i.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${i.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function CB(){return{localeError:Gk()}}var qk=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},Hk=()=>{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(o){return r[o]??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 o=>{switch(o.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 ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${qk(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${z(o.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(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",n=e(o.origin);return n?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${o.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${o.maximum.toString()} ${n.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 ${o.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",n=e(o.origin);return n?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${o.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${o.minimum.toString()} ${n.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${o.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;if(i.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 "${i.prefix}"`;if(i.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 "${i.suffix}"`;if(i.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 "${i.includes}"`;if(i.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 ${i.pattern}`;let n="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(n="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(n="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(n="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(n="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(n="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${n} ${t[i.format]??o.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 ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${o.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u043E\u0432\u0435":""}: ${k(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${o.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 ${o.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function TB(){return{localeError:Hk()}}var Jk=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${i.expected}, s'ha rebut ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Valor inv\xE0lid: s'esperava ${z(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${k(i.values," o ")}`;case"too_big":{let n=i.inclusive?"com a m\xE0xim":"menys de",s=e(i.origin);return s?`Massa gran: s'esperava que ${i.origin??"el valor"} contingu\xE9s ${n} ${i.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${n} ${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?"com a m\xEDnim":"m\xE9s de",s=e(i.origin);return s?`Massa petit: s'esperava que ${i.origin} contingu\xE9s ${n} ${i.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${n} ${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${n.prefix}"`:n.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${n.suffix}"`:n.format==="includes"?`Format inv\xE0lid: ha d'incloure "${n.includes}"`:n.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${n.pattern}`:`Format inv\xE0lid per a ${o[n.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${k(i.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${i.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${i.origin}`;default:return"Entrada inv\xE0lida"}}};function RB(){return{localeError:Jk()}}var Qk=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"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(i))return"pole";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i.expected}, obdr\u017Eeno ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${z(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${n}${i.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${n}${i.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${n.prefix}"`:n.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${n.suffix}"`:n.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${n.includes}"`:n.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${n.pattern}`:`Neplatn\xFD form\xE1t ${o[n.format]??i.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${i.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${k(i.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${i.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${i.origin}`;default:return"Neplatn\xFD vstup"}}};function OB(){return{localeError:Qk()}}var Xk=()=>{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(s){return r[s]??null}function o(s){return e[s]??s}let i=s=>{let a=typeof s;switch(a){case"number":return Number.isNaN(s)?"NaN":"tal";case"object":return Array.isArray(s)?"liste":s===null?"null":Object.getPrototypeOf(s)!==Object.prototype&&s.constructor?s.constructor.name:"objekt"}return a},n={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 s=>{switch(s.code){case"invalid_type":return`Ugyldigt input: forventede ${o(s.expected)}, fik ${o(i(s.input))}`;case"invalid_value":return s.values.length===1?`Ugyldig v\xE6rdi: forventede ${z(s.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${k(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",l=t(s.origin),u=o(s.origin);return l?`For stor: forventede ${u??"value"} ${l.verb} ${a} ${s.maximum.toString()} ${l.unit??"elementer"}`:`For stor: forventede ${u??"value"} havde ${a} ${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",l=t(s.origin),u=o(s.origin);return l?`For lille: forventede ${u} ${l.verb} ${a} ${s.minimum.toString()} ${l.unit}`:`For lille: forventede ${u} havde ${a} ${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Ugyldig streng: skal starte med "${a.prefix}"`:a.format==="ends_with"?`Ugyldig streng: skal ende med "${a.suffix}"`:a.format==="includes"?`Ugyldig streng: skal indeholde "${a.includes}"`:a.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${a.pattern}`:`Ugyldig ${n[a.format]??s.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${s.divisor}`;case"unrecognized_keys":return`${s.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${k(s.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${s.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${s.origin}`;default:return"Ugyldigt input"}}};function VB(){return{localeError:Xk()}}var Yk=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"Zahl";case"object":{if(Array.isArray(i))return"Array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${i.expected}, erhalten ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Ung\xFCltige Eingabe: erwartet ${z(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${n}${i.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${n}${i.maximum.toString()} ist`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Zu klein: erwartet, dass ${i.origin} ${n}${i.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${n}${i.minimum.toString()} ist`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Ung\xFCltiger String: muss mit "${n.prefix}" beginnen`:n.format==="ends_with"?`Ung\xFCltiger String: muss mit "${n.suffix}" enden`:n.format==="includes"?`Ung\xFCltiger String: muss "${n.includes}" enthalten`:n.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${n.pattern} entsprechen`:`Ung\xFCltig: ${o[n.format]??i.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${k(i.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${i.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${i.origin}`;default:return"Ung\xFCltige Eingabe"}}};function zB(){return{localeError:Yk()}}var e$=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},t$=()=>{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(o){return r[o]??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 o=>{switch(o.code){case"invalid_type":return`Invalid input: expected ${o.expected}, received ${e$(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${z(o.values[0])}`:`Invalid option: expected one of ${k(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",n=e(o.origin);return n?`Too big: expected ${o.origin??"value"} to have ${i}${o.maximum.toString()} ${n.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",n=e(o.origin);return n?`Too small: expected ${o.origin} to have ${i}${o.minimum.toString()} ${n.unit}`:`Too small: expected ${o.origin} to be ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${t[i.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${k(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function Ay(){return{localeError:t$()}}var r$=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},i$=()=>{let r={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(o){return r[o]??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 o=>{switch(o.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${o.expected}, ricevi\u011Dis ${r$(o.input)}`;case"invalid_value":return o.values.length===1?`Nevalida enigo: atendi\u011Dis ${z(o.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${k(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",n=e(o.origin);return n?`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${i}${o.maximum.toString()} ${n.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",n=e(o.origin);return n?`Tro malgranda: atendi\u011Dis ke ${o.origin} havu ${i}${o.minimum.toString()} ${n.unit}`:`Tro malgranda: atendi\u011Dis ke ${o.origin} estu ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${t[i.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} \u015Dlosilo${o.keys.length>1?"j":""}: ${k(o.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}};function UB(){return{localeError:i$()}}var o$=()=>{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(s){return r[s]??null}function o(s){return e[s]??s}let i=s=>{let a=typeof s;switch(a){case"number":return Number.isNaN(s)?"NaN":"number";case"object":return Array.isArray(s)?"array":s===null?"null":Object.getPrototypeOf(s)!==Object.prototype?s.constructor.name:"object"}return a},n={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 s=>{switch(s.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o(s.expected)}, recibido ${o(i(s.input))}`;case"invalid_value":return s.values.length===1?`Entrada inv\xE1lida: se esperaba ${z(s.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${k(s.values,"|")}`;case"too_big":{let a=s.inclusive?"<=":"<",l=t(s.origin),u=o(s.origin);return l?`Demasiado grande: se esperaba que ${u??"valor"} tuviera ${a}${s.maximum.toString()} ${l.unit??"elementos"}`:`Demasiado grande: se esperaba que ${u??"valor"} fuera ${a}${s.maximum.toString()}`}case"too_small":{let a=s.inclusive?">=":">",l=t(s.origin),u=o(s.origin);return l?`Demasiado peque\xF1o: se esperaba que ${u} tuviera ${a}${s.minimum.toString()} ${l.unit}`:`Demasiado peque\xF1o: se esperaba que ${u} fuera ${a}${s.minimum.toString()}`}case"invalid_format":{let a=s;return a.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${a.prefix}"`:a.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${a.suffix}"`:a.format==="includes"?`Cadena inv\xE1lida: debe incluir "${a.includes}"`:a.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${a.pattern}`:`Inv\xE1lido ${n[a.format]??s.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${s.divisor}`;case"unrecognized_keys":return`Llave${s.keys.length>1?"s":""} desconocida${s.keys.length>1?"s":""}: ${k(s.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o(s.origin)}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o(s.origin)}`;default:return"Entrada inv\xE1lida"}}};function jB(){return{localeError:o$()}}var n$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(i))return"\u0622\u0631\u0627\u06CC\u0647";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.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 ${i.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${t(i.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return i.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${z(i.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${k(i.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${n}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${n}${i.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${n}${i.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${n}${i.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${n.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:n.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${n.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:n.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${n.includes}" \u0628\u0627\u0634\u062F`:n.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${n.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${o[n.format]??i.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${i.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${i.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${k(i.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${i.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${i.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function LB(){return{localeError:n$()}}var s$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${i.expected}, oli ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${z(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${n}${i.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${n}${i.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${n.prefix}"`:n.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${n.suffix}"`:n.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${n.includes}"`:n.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${n.pattern}`:`Virheellinen ${o[n.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${k(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function KB(){return{localeError:s$()}}var a$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"nombre";case"object":{if(Array.isArray(i))return"tableau";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Entr\xE9e invalide : ${i.expected} attendu, ${t(i.input)} re\xE7u`;case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : ${z(i.values[0])} attendu`:`Option invalide : une valeur parmi ${k(i.values,"|")} attendue`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Trop grand : ${i.origin??"valeur"} doit ${s.verb} ${n}${i.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i.origin??"valeur"} doit \xEAtre ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Trop petit : ${i.origin} doit ${s.verb} ${n}${i.minimum.toString()} ${s.unit}`:`Trop petit : ${i.origin} doit \xEAtre ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${n.prefix}"`:n.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${n.suffix}"`:n.format==="includes"?`Cha\xEEne invalide : doit inclure "${n.includes}"`:n.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${n.pattern}`:`${o[n.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${k(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function WB(){return{localeError:a$()}}var l$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${i.expected}, re\xE7u ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : attendu ${z(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"\u2264":"<",s=e(i.origin);return s?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${n}${i.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?"\u2265":">",s=e(i.origin);return s?`Trop petit : attendu que ${i.origin} ait ${n}${i.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${i.origin} soit ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${n.prefix}"`:n.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${n.suffix}"`:n.format==="includes"?`Cha\xEEne invalide : doit inclure "${n.includes}"`:n.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${n.pattern}`:`${o[n.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${k(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function ZB(){return{localeError:l$()}}var u$=()=>{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=u=>u?r[u]:void 0,o=u=>{let d=t(u);return d?d.label:u??r.unknown.label},i=u=>`\u05D4${o(u)}`,n=u=>(t(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=u=>u?e[u]??null:null,a=u=>{let d=typeof u;switch(d){case"number":return Number.isNaN(u)?"NaN":"number";case"object":return Array.isArray(u)?"array":u===null?"null":Object.getPrototypeOf(u)!==Object.prototype&&u.constructor?u.constructor.name:"object";default:return d}},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 u=>{switch(u.code){case"invalid_type":{let d=u.expected,p=o(d),h=a(u.input),g=r[h]?.label??h;return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${g}`}case"invalid_value":{if(u.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${z(u.values[0])}`;let d=u.values.map(g=>z(g));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d[0]} \u05D0\u05D5 ${d[1]}`;let p=d[d.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 ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let d=s(u.origin),p=i(u.origin??"value");if(u.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let v=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${v}`}if(u.origin==="array"||u.origin==="set"){let v=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=u.inclusive?`${u.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${v} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let h=u.inclusive?"<=":"<",g=n(u.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${p} ${g} ${h}${u.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${g} ${h}${u.maximum.toString()}`}case"too_small":{let d=s(u.origin),p=i(u.origin??"value");if(u.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let v=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${v}`}if(u.origin==="array"||u.origin==="set"){let v=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let x=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${v} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let y=u.inclusive?`${u.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${v} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let h=u.inclusive?">=":">",g=n(u.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${p} ${g} ${h}${u.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${g} ${h}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.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 ${d.pattern}`;let p=l[d.format],h=p?.label??d.format,v=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${h} \u05DC\u05D0 ${v}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${k(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function GB(){return{localeError:u$()}}var c$=()=>{let r={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(i))return"t\xF6mb";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i.expected}, a kapott \xE9rt\xE9k ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${z(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`T\xFAl nagy: ${i.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${n}${i.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${i.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} m\xE9rete t\xFAl kicsi ${n}${i.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} t\xFAl kicsi ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\xC9rv\xE9nytelen string: "${n.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:n.format==="ends_with"?`\xC9rv\xE9nytelen string: "${n.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:n.format==="includes"?`\xC9rv\xE9nytelen string: "${n.includes}" \xE9rt\xE9ket kell tartalmaznia`:n.format==="regex"?`\xC9rv\xE9nytelen string: ${n.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${o[n.format]??i.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${i.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${k(i.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${i.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${i.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function qB(){return{localeError:c$()}}var d$=()=>{let r={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Input tidak valid: diharapkan ${i.expected}, diterima ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${z(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${n}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Terlalu kecil: diharapkan ${i.origin} memiliki ${n}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`String tidak valid: harus dimulai dengan "${n.prefix}"`:n.format==="ends_with"?`String tidak valid: harus berakhir dengan "${n.suffix}"`:n.format==="includes"?`String tidak valid: harus menyertakan "${n.includes}"`:n.format==="regex"?`String tidak valid: harus sesuai pola ${n.pattern}`:`${o[n.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${k(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}};function HB(){return{localeError:d$()}}var p$=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},h$=()=>{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(o){return r[o]??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 o=>{switch(o.code){case"invalid_type":return`Rangt gildi: \xDE\xFA sl\xF3st inn ${p$(o.input)} \xFEar sem \xE1 a\xF0 vera ${o.expected}`;case"invalid_value":return o.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${z(o.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${k(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",n=e(o.origin);return n?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin??"gildi"} hafi ${i}${o.maximum.toString()} ${n.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin??"gildi"} s\xE9 ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",n=e(o.origin);return n?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin} hafi ${i}${o.minimum.toString()} ${n.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin} s\xE9 ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${t[i.format]??o.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${o.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${o.keys.length>1?"ir lyklar":"ur lykill"}: ${k(o.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${o.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${o.origin}`;default:return"Rangt gildi"}}};function JB(){return{localeError:h$()}}var f$=()=>{let r={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"numero";case"object":{if(Array.isArray(i))return"vettore";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Input non valido: atteso ${i.expected}, ricevuto ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Input non valido: atteso ${z(i.values[0])}`:`Opzione non valida: atteso uno tra ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Troppo grande: ${i.origin??"valore"} deve avere ${n}${i.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Troppo piccolo: ${i.origin} deve avere ${n}${i.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${i.origin} deve essere ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Stringa non valida: deve iniziare con "${n.prefix}"`:n.format==="ends_with"?`Stringa non valida: deve terminare con "${n.suffix}"`:n.format==="includes"?`Stringa non valida: deve includere "${n.includes}"`:n.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${n.pattern}`:`Invalid ${o[n.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${k(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}};function QB(){return{localeError:f$()}}var m$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(i))return"\u914D\u5217";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${i.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${t(i.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return i.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${z(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${k(i.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let n=i.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=e(i.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${s.unit??"\u8981\u7D20"}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let n=i.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=e(i.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${s.unit}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${n}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${n.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:n.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${n.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:n.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${n.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:n.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${n.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${o[n.format]??i.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${i.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${i.keys.length>1?"\u7FA4":""}: ${k(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function XB(){return{localeError:m$()}}var g$=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},v$=()=>{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(o){return r[o]??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 o=>{switch(o.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 ${o.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${g$(o.input)}`;case"invalid_value":return o.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(o.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(o.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=o.inclusive?"<=":"<",n=e(o.origin);return n?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${n.verb} ${i}${o.maximum.toString()} ${n.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",n=e(o.origin);return n?`\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 ${o.origin} ${n.verb} ${i}${o.minimum.toString()} ${n.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 ${o.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.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 "${i.prefix}"-\u10D8\u10D7`:i.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 "${i.suffix}"-\u10D8\u10D7`:i.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 "${i.includes}"-\u10E1`:i.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 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${t[i.format]??o.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 ${o.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${o.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${k(o.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${o.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 ${o.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function YB(){return{localeError:v$()}}var y$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(i))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(i===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.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 ${i.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${z(i.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${n} ${i.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${n} ${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${n} ${i.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${n} ${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${o[n.format]??i.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${i.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${k(i.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function _y(){return{localeError:y$()}}function eF(){return _y()}var x$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${t(i.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return i.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${z(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${k(i.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let n=i.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=n==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(i.origin),l=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()}${l} ${n}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()} ${n}${s}`}case"too_small":{let n=i.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=n==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(i.origin),l=a?.unit??"\uC694\uC18C";return a?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()}${l} ${n}${s}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()} ${n}${s}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${n.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:n.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${n.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:n.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${n.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:n.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${n.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${o[n.format]??i.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${i.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${k(i.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${i.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${i.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function tF(){return{localeError:x$()}}var b$=r=>af(typeof r,r),af=(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},sf=r=>r.charAt(0).toUpperCase()+r.slice(1);function rF(r){let e=Math.abs(r),t=e%10,o=e%100;return o>=11&&o<=19||t===0?"many":t===1?"one":"few"}var w$=()=>{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(o,i,n,s){let a=r[o]??null;return a===null?a:{unit:a.unit[i],verb:a.verb[s][n?"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 o=>{switch(o.code){case"invalid_type":return`Gautas tipas ${b$(o.input)}, o tik\u0117tasi - ${af(o.expected)}`;case"invalid_value":return o.values.length===1?`Privalo b\u016Bti ${z(o.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${k(o.values,"|")} pasirinkim\u0173`;case"too_big":{let i=af(o.origin),n=e(o.origin,rF(Number(o.maximum)),o.inclusive??!1,"smaller");if(n?.verb)return`${sf(i??o.origin??"reik\u0161m\u0117")} ${n.verb} ${o.maximum.toString()} ${n.unit??"element\u0173"}`;let s=o.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${sf(i??o.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${o.maximum.toString()} ${n?.unit}`}case"too_small":{let i=af(o.origin),n=e(o.origin,rF(Number(o.minimum)),o.inclusive??!1,"bigger");if(n?.verb)return`${sf(i??o.origin??"reik\u0161m\u0117")} ${n.verb} ${o.minimum.toString()} ${n.unit??"element\u0173"}`;let s=o.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${sf(i??o.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${o.minimum.toString()} ${n?.unit}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${t[i.format]??o.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${o.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${o.keys.length>1?"i":"as"} rakt${o.keys.length>1?"ai":"as"}: ${k(o.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=af(o.origin);return`${sf(i??o.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function iF(){return{localeError:w$()}}var A$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(i))return"\u043D\u0438\u0437\u0430";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${z(i.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${n}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0438\u043C\u0430 ${n}${i.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`Invalid ${o[n.format]??i.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${k(i.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${i.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${i.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function oF(){return{localeError:A$()}}var _$=()=>{let r={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"nombor";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Input tidak sah: dijangka ${i.expected}, diterima ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${z(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Terlalu besar: dijangka ${i.origin??"nilai"} ${s.verb} ${n}${i.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Terlalu kecil: dijangka ${i.origin} ${s.verb} ${n}${i.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`String tidak sah: mesti bermula dengan "${n.prefix}"`:n.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${n.suffix}"`:n.format==="includes"?`String tidak sah: mesti mengandungi "${n.includes}"`:n.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${n.pattern}`:`${o[n.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${k(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}};function nF(){return{localeError:_$()}}var P$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"getal";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Ongeldige invoer: verwacht ${i.expected}, ontving ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${z(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Te groot: verwacht dat ${i.origin??"waarde"} ${s.verb} ${n}${i.maximum.toString()} ${s.unit??"elementen"}`:`Te groot: verwacht dat ${i.origin??"waarde"} ${n}${i.maximum.toString()} is`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Te klein: verwacht dat ${i.origin} ${s.verb} ${n}${i.minimum.toString()} ${s.unit}`:`Te klein: verwacht dat ${i.origin} ${n}${i.minimum.toString()} is`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Ongeldige tekst: moet met "${n.prefix}" beginnen`:n.format==="ends_with"?`Ongeldige tekst: moet op "${n.suffix}" eindigen`:n.format==="includes"?`Ongeldige tekst: moet "${n.includes}" bevatten`:n.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${n.pattern}`:`Ongeldig: ${o[n.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${k(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}};function sF(){return{localeError:P$()}}var S$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"tall";case"object":{if(Array.isArray(i))return"liste";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Ugyldig input: forventet ${i.expected}, fikk ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${z(i.values[0])}`:`Ugyldig valg: forventet en av ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${n}${i.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`For lite(n): forventet ${i.origin} til \xE5 ha ${n}${i.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${i.origin} til \xE5 ha ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${n.prefix}"`:n.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${n.suffix}"`:n.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${n.includes}"`:n.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${n.pattern}`:`Ugyldig ${o[n.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${k(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}};function aF(){return{localeError:S$()}}var E$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"numara";case"object":{if(Array.isArray(i))return"saf";if(i===null)return"gayb";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`F\xE2sit giren: umulan ${i.expected}, al\u0131nan ${t(i.input)}`;case"invalid_value":return i.values.length===1?`F\xE2sit giren: umulan ${z(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${n}${i.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${n}${i.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${n}${i.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${n}${i.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let n=i;return n.format==="starts_with"?`F\xE2sit metin: "${n.prefix}" ile ba\u015Flamal\u0131.`:n.format==="ends_with"?`F\xE2sit metin: "${n.suffix}" ile bitmeli.`:n.format==="includes"?`F\xE2sit metin: "${n.includes}" ihtiv\xE2 etmeli.`:n.format==="regex"?`F\xE2sit metin: ${n.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${o[n.format]??i.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${i.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${i.keys.length>1?"s":""}: ${k(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${i.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function lF(){return{localeError:E$()}}var B$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(i))return"\u0627\u0631\u06D0";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${t(i.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return i.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${z(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${k(i.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${n}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${n}${i.maximum.toString()} \u0648\u064A`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${n}${i.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${n}${i.minimum.toString()} \u0648\u064A`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${n.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:n.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${n.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:n.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${n.includes}" \u0648\u0644\u0631\u064A`:n.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${n.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${o[n.format]??i.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${i.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${i.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${k(i.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${i.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${i.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function uF(){return{localeError:B$()}}var F$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"liczba";case"object":{if(Array.isArray(i))return"tablica";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i.expected}, otrzymano ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${z(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${n}${i.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${n}${i.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${n.prefix}"`:n.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${n.suffix}"`:n.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${n.includes}"`:n.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${n.pattern}`:`Nieprawid\u0142ow(y/a/e) ${o[n.format]??i.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${k(i.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${i.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${i.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function cF(){return{localeError:F$()}}var N$=()=>{let r={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(i))return"array";if(i===null)return"nulo";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${i.expected}, recebido ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: esperado ${z(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${n}${i.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Muito pequeno: esperado que ${i.origin} tivesse ${n}${i.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${n.prefix}"`:n.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${n.suffix}"`:n.format==="includes"?`Texto inv\xE1lido: deve incluir "${n.includes}"`:n.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${n.pattern}`:`${o[n.format]??i.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${k(i.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${i.origin}`;default:return"Campo inv\xE1lido"}}};function dF(){return{localeError:N$()}}function pF(r,e,t,o){let i=Math.abs(r),n=i%10,s=i%100;return s>=11&&s<=19?o:n===1?e:n>=2&&n<=4?t:o}var I$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(i))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.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 ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${z(i.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);if(s){let a=Number(i.maximum),l=pF(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${n}${i.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 ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);if(s){let a=Number(i.minimum),l=pF(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${i.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${n}${i.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 ${i.origin} \u0431\u0443\u0434\u0435\u0442 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${o[n.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${i.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0438":""}: ${k(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function hF(){return{localeError:I$()}}var k$=()=>{let r={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(i))return"tabela";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${i.expected}, prejeto ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${z(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} imelo ${n}${i.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${i.origin} imelo ${n}${i.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${n.prefix}"`:n.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${n.suffix}"`:n.format==="includes"?`Neveljaven niz: mora vsebovati "${n.includes}"`:n.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${n.pattern}`:`Neveljaven ${o[n.format]??i.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${k(i.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}};function fF(){return{localeError:k$()}}var $$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"antal";case"object":{if(Array.isArray(i))return"lista";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${i.expected}, fick ${t(i.input)}`;case"invalid_value":return i.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${z(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${n}${i.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${i.origin??"v\xE4rdet"} att ha ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${n}${i.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${n.prefix}"`:n.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${n.suffix}"`:n.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${n.includes}"`:n.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${n.pattern}"`:`Ogiltig(t) ${o[n.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${k(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${i.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function mF(){return{localeError:$$()}}var D$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(i))return"\u0B85\u0BA3\u0BBF";if(i===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.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 ${i.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${z(i.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${k(i.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${n}${i.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${n}${i.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${n}${i.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i.origin} ${n}${i.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${n.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:n.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${n.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:n.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${n.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:n.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${n.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 ${o[n.format]??i.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${i.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${i.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${k(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function gF(){return{localeError:D$()}}var M$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(i))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(i===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.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 ${i.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${z(i.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=e(i.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${i.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=e(i.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${i.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${n} ${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:n.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 ${n.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${o[n.format]??i.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${i.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${k(i.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function vF(){return{localeError:M$()}}var C$=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},T$=()=>{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(o){return r[o]??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 o=>{switch(o.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${o.expected}, al\u0131nan ${C$(o.input)}`;case"invalid_value":return o.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${z(o.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${k(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",n=e(o.origin);return n?`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${i}${o.maximum.toString()} ${n.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",n=e(o.origin);return n?`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${i}${o.minimum.toString()} ${n.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${t[i.format]??o.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${o.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${o.keys.length>1?"lar":""}: ${k(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${o.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function yF(){return{localeError:T$()}}var R$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(i))return"\u043C\u0430\u0441\u0438\u0432";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.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 ${i.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${z(i.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${n}${i.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} ${s.verb} ${n}${i.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${i.origin} \u0431\u0443\u0434\u0435 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.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 "${n.prefix}"`:n.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 "${n.suffix}"`:n.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 "${n.includes}"`:n.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 ${n.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${o[n.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0456":""}: ${k(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${i.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Py(){return{localeError:R$()}}function xF(){return Py()}var O$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(i))return"\u0622\u0631\u06D2";if(i===null)return"\u0646\u0644";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${t(i.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return i.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${z(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${k(i.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${n}${i.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${n}${i.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u06D2 ${n}${i.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u0627 ${n}${i.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${n.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:n.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${n.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:n.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${n.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:n.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${n.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${o[n.format]??i.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${i.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${i.keys.length>1?"\u0632":""}: ${k(i.keys,"\u060C ")}`;case"invalid_key":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function bF(){return{localeError:O$()}}var V$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(i))return"m\u1EA3ng";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${z(i.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${n}${i.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${s.verb} ${n}${i.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${n.prefix}"`:n.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${n.suffix}"`:n.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${n.includes}"`:n.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${n.pattern}`:`${o[n.format]??i.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${i.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${k(i.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function wF(){return{localeError:V$()}}var z$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(i))return"\u6570\u7EC4";if(i===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${z(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${n}${i.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${n}${i.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${n.prefix}" \u5F00\u5934`:n.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${n.suffix}" \u7ED3\u5C3E`:n.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${n.includes}"`:n.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${n.pattern}`:`\u65E0\u6548${o[n.format]??i.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${i.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${k(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${i.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function AF(){return{localeError:z$()}}var U$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"number";case"object":{if(Array.isArray(i))return"array";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i.expected}\uFF0C\u4F46\u6536\u5230 ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${z(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${n}${i.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${n}${i.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${n.prefix}" \u958B\u982D`:n.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${n.suffix}" \u7D50\u5C3E`:n.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${n.includes}"`:n.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${n.pattern}`:`\u7121\u6548\u7684 ${o[n.format]??i.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${i.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${i.keys.length>1?"\u5011":""}\uFF1A${k(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function _F(){return{localeError:U$()}}var j$=()=>{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(i){return r[i]??null}let t=i=>{let n=typeof i;switch(n){case"number":return Number.isNaN(i)?"NaN":"n\u1ECD\u0301mb\xE0";case"object":{if(Array.isArray(i))return"akop\u1ECD";if(i===null)return"null";if(Object.getPrototypeOf(i)!==Object.prototype&&i.constructor)return i.constructor.name}}return n},o={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 i=>{switch(i.code){case"invalid_type":return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i.expected}, \xE0m\u1ECD\u0300 a r\xED ${t(i.input)}`;case"invalid_value":return i.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${z(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${k(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",s=e(i.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin??"iye"} ${s.verb} ${n}${i.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${n}${i.maximum}`}case"too_small":{let n=i.inclusive?">=":">",s=e(i.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin} ${s.verb} ${n}${i.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${n}${i.minimum}`}case"invalid_format":{let n=i;return n.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 "${n.prefix}"`:n.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${n.suffix}"`:n.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${n.includes}"`:n.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${n.pattern}`:`A\u1E63\xEC\u1E63e: ${o[n.format]??i.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${i.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${k(i.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function PF(){return{localeError:j$()}}var SF,M_=Symbol("ZodOutput"),C_=Symbol("ZodInput"),Sy=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let o=t[0];if(this._map.set(e,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.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 o={...this.get(t)??{}};delete o.id;let i={...o,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ey(){return new Sy}(SF=globalThis).__zod_globalRegistry??(SF.__zod_globalRegistry=Ey());var _r=globalThis.__zod_globalRegistry;function T_(r,e){return new r({type:"string",...L(e)})}function R_(r,e){return new r({type:"string",coerce:!0,...L(e)})}function By(r,e){return new r({type:"string",format:"email",check:"string_format",abort:!1,...L(e)})}function uf(r,e){return new r({type:"string",format:"guid",check:"string_format",abort:!1,...L(e)})}function Fy(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,...L(e)})}function Ny(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...L(e)})}function Iy(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...L(e)})}function ky(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...L(e)})}function cf(r,e){return new r({type:"string",format:"url",check:"string_format",abort:!1,...L(e)})}function $y(r,e){return new r({type:"string",format:"emoji",check:"string_format",abort:!1,...L(e)})}function Dy(r,e){return new r({type:"string",format:"nanoid",check:"string_format",abort:!1,...L(e)})}function My(r,e){return new r({type:"string",format:"cuid",check:"string_format",abort:!1,...L(e)})}function Cy(r,e){return new r({type:"string",format:"cuid2",check:"string_format",abort:!1,...L(e)})}function Ty(r,e){return new r({type:"string",format:"ulid",check:"string_format",abort:!1,...L(e)})}function Ry(r,e){return new r({type:"string",format:"xid",check:"string_format",abort:!1,...L(e)})}function Oy(r,e){return new r({type:"string",format:"ksuid",check:"string_format",abort:!1,...L(e)})}function Vy(r,e){return new r({type:"string",format:"ipv4",check:"string_format",abort:!1,...L(e)})}function zy(r,e){return new r({type:"string",format:"ipv6",check:"string_format",abort:!1,...L(e)})}function O_(r,e){return new r({type:"string",format:"mac",check:"string_format",abort:!1,...L(e)})}function Uy(r,e){return new r({type:"string",format:"cidrv4",check:"string_format",abort:!1,...L(e)})}function jy(r,e){return new r({type:"string",format:"cidrv6",check:"string_format",abort:!1,...L(e)})}function Ly(r,e){return new r({type:"string",format:"base64",check:"string_format",abort:!1,...L(e)})}function Ky(r,e){return new r({type:"string",format:"base64url",check:"string_format",abort:!1,...L(e)})}function Wy(r,e){return new r({type:"string",format:"e164",check:"string_format",abort:!1,...L(e)})}function Zy(r,e){return new r({type:"string",format:"jwt",check:"string_format",abort:!1,...L(e)})}var V_={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function z_(r,e){return new r({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...L(e)})}function U_(r,e){return new r({type:"string",format:"date",check:"string_format",...L(e)})}function j_(r,e){return new r({type:"string",format:"time",check:"string_format",precision:null,...L(e)})}function L_(r,e){return new r({type:"string",format:"duration",check:"string_format",...L(e)})}function K_(r,e){return new r({type:"number",checks:[],...L(e)})}function W_(r,e){return new r({type:"number",coerce:!0,checks:[],...L(e)})}function Z_(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"safeint",...L(e)})}function G_(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float32",...L(e)})}function q_(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float64",...L(e)})}function H_(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"int32",...L(e)})}function J_(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"uint32",...L(e)})}function Q_(r,e){return new r({type:"boolean",...L(e)})}function X_(r,e){return new r({type:"boolean",coerce:!0,...L(e)})}function Y_(r,e){return new r({type:"bigint",...L(e)})}function eP(r,e){return new r({type:"bigint",coerce:!0,...L(e)})}function tP(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...L(e)})}function rP(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...L(e)})}function iP(r,e){return new r({type:"symbol",...L(e)})}function oP(r,e){return new r({type:"undefined",...L(e)})}function nP(r,e){return new r({type:"null",...L(e)})}function sP(r){return new r({type:"any"})}function aP(r){return new r({type:"unknown"})}function lP(r,e){return new r({type:"never",...L(e)})}function uP(r,e){return new r({type:"void",...L(e)})}function cP(r,e){return new r({type:"date",...L(e)})}function dP(r,e){return new r({type:"date",coerce:!0,...L(e)})}function pP(r,e){return new r({type:"nan",...L(e)})}function Jo(r,e){return new py({check:"less_than",...L(e),value:r,inclusive:!1})}function li(r,e){return new py({check:"less_than",...L(e),value:r,inclusive:!0})}function Qo(r,e){return new hy({check:"greater_than",...L(e),value:r,inclusive:!1})}function Pr(r,e){return new hy({check:"greater_than",...L(e),value:r,inclusive:!0})}function Gy(r){return Qo(0,r)}function qy(r){return Jo(0,r)}function Hy(r){return li(0,r)}function Jy(r){return Pr(0,r)}function js(r,e){return new nA({check:"multiple_of",...L(e),value:r})}function xl(r,e){return new lA({check:"max_size",...L(e),maximum:r})}function Ls(r,e){return new uA({check:"min_size",...L(e),minimum:r})}function Gc(r,e){return new cA({check:"size_equals",...L(e),size:r})}function bl(r,e){return new dA({check:"max_length",...L(e),maximum:r})}function Dn(r,e){return new pA({check:"min_length",...L(e),minimum:r})}function wl(r,e){return new hA({check:"length_equals",...L(e),length:r})}function qc(r,e){return new fA({check:"string_format",format:"regex",...L(e),pattern:r})}function Hc(r){return new mA({check:"string_format",format:"lowercase",...L(r)})}function Jc(r){return new gA({check:"string_format",format:"uppercase",...L(r)})}function Qc(r,e){return new vA({check:"string_format",format:"includes",...L(e),includes:r})}function Xc(r,e){return new yA({check:"string_format",format:"starts_with",...L(e),prefix:r})}function Yc(r,e){return new xA({check:"string_format",format:"ends_with",...L(e),suffix:r})}function Qy(r,e,t){return new bA({check:"property",property:r,schema:e,...L(t)})}function ed(r,e){return new wA({check:"mime_type",mime:r,...L(e)})}function fo(r){return new AA({check:"overwrite",tx:r})}function td(r){return fo(e=>e.normalize(r))}function rd(){return fo(r=>r.trim())}function id(){return fo(r=>r.toLowerCase())}function od(){return fo(r=>r.toUpperCase())}function nd(){return fo(r=>x0(r))}function hP(r,e,t){return new r({type:"array",element:e,...L(t)})}function K$(r,e,t){return new r({type:"union",options:e,...L(t)})}function W$(r,e,t){return new r({type:"union",options:e,inclusive:!1,...L(t)})}function Z$(r,e,t,o){return new r({type:"union",options:t,discriminator:e,...L(o)})}function G$(r,e,t){return new r({type:"intersection",left:e,right:t})}function q$(r,e,t,o){let i=t instanceof ve,n=i?o:t,s=i?t:null;return new r({type:"tuple",items:e,rest:s,...L(n)})}function H$(r,e,t,o){return new r({type:"record",keyType:e,valueType:t,...L(o)})}function J$(r,e,t,o){return new r({type:"map",keyType:e,valueType:t,...L(o)})}function Q$(r,e,t){return new r({type:"set",valueType:e,...L(t)})}function X$(r,e,t){let o=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new r({type:"enum",entries:o,...L(t)})}function Y$(r,e,t){return new r({type:"enum",entries:e,...L(t)})}function eD(r,e,t){return new r({type:"literal",values:Array.isArray(e)?e:[e],...L(t)})}function fP(r,e){return new r({type:"file",...L(e)})}function tD(r,e){return new r({type:"transform",transform:e})}function rD(r,e){return new r({type:"optional",innerType:e})}function iD(r,e){return new r({type:"nullable",innerType:e})}function oD(r,e,t){return new r({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():w0(t)}})}function nD(r,e,t){return new r({type:"nonoptional",innerType:e,...L(t)})}function sD(r,e){return new r({type:"success",innerType:e})}function aD(r,e,t){return new r({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function lD(r,e,t){return new r({type:"pipe",in:e,out:t})}function uD(r,e){return new r({type:"readonly",innerType:e})}function cD(r,e,t){return new r({type:"template_literal",parts:e,...L(t)})}function dD(r,e){return new r({type:"lazy",getter:e})}function pD(r,e){return new r({type:"promise",innerType:e})}function mP(r,e,t){let o=L(t);return o.abort??(o.abort=!0),new r({type:"custom",check:"custom",fn:e,...o})}function gP(r,e,t){return new r({type:"custom",check:"custom",fn:e,...L(t)})}function vP(r){let e=EF(t=>(t.addIssue=o=>{if(typeof o=="string")t.issues.push(Uc(o,t.value,e._zod.def));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=e),i.continue??(i.continue=!e._zod.def.abort),t.issues.push(Uc(i))}},r(t.value,t)));return e}function EF(r,e){let t=new Ye({check:"custom",...L(e)});return t._zod.check=r,t}function yP(r){let e=new Ye({check:"describe"});return e._zod.onattach=[t=>{let o=_r.get(t)??{};_r.add(t,{...o,description:r})}],e._zod.check=()=>{},e}function xP(r){let e=new Ye({check:"meta"});return e._zod.onattach=[t=>{let o=_r.get(t)??{};_r.add(t,{...o,...r})}],e._zod.check=()=>{},e}function bP(r,e){let t=L(e),o=t.truthy??["true","1","yes","on","y","enabled"],i=t.falsy??["false","0","no","off","n","disabled"];t.case!=="sensitive"&&(o=o.map(g=>typeof g=="string"?g.toLowerCase():g),i=i.map(g=>typeof g=="string"?g.toLowerCase():g));let n=new Set(o),s=new Set(i),a=r.Codec??nf,l=r.Boolean??rf,u=r.String??yl,d=new u({type:"string",error:t.error}),p=new l({type:"boolean",error:t.error}),h=new a({type:"pipe",in:d,out:p,transform:(g,v)=>{let y=g;return t.case!=="sensitive"&&(y=y.toLowerCase()),n.has(y)?!0:s.has(y)?!1:(v.issues.push({code:"invalid_value",expected:"stringbool",values:[...n,...s],input:v.value,inst:h,continue:!1}),{})},reverseTransform:(g,v)=>g===!0?o[0]||"true":i[0]||"false",error:t.error});return h}function sd(r,e,t,o={}){let i=L(o),n={...L(o),check:"string_format",type:"string",format:e,fn:typeof t=="function"?t:a=>t.test(a),...i};return t instanceof RegExp&&(n.pattern=t),new r(n)}function Ks(r){let e=r?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:r.processors??{},metadataRegistry:r?.metadata??_r,target:e,unrepresentable:r?.unrepresentable??"throw",override:r?.override??(()=>{}),io:r?.io??"output",counter:0,seen:new Map,cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0}}function Ze(r,e,t={path:[],schemaPath:[]}){var o;let i=r._zod.def,n=e.seen.get(r);if(n)return n.count++,t.schemaPath.includes(r)&&(n.cycle=t.path),n.schema;let s={schema:{},count:1,cycle:void 0,path:t.path};e.seen.set(r,s);let a=r._zod.toJSONSchema?.();if(a)s.schema=a;else{let d={...t,schemaPath:[...t.schemaPath,r],path:t.path},p=r._zod.parent;if(p)s.ref=p,Ze(p,e,d),e.seen.get(p).isParent=!0;else if(r._zod.processJSONSchema)r._zod.processJSONSchema(e,s.schema,d);else{let h=s.schema,g=e.processors[i.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);g(r,e,h,d)}}let l=e.metadataRegistry.get(r);return l&&Object.assign(s.schema,l),e.io==="input"&&Sr(r)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&s.schema._prefault&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(r).schema}function Ws(r,e){let t=r.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=n=>{let s=r.target==="draft-2020-12"?"$defs":"definitions";if(r.external){let d=r.external.registry.get(n[0])?.id,p=r.external.uri??(g=>g);if(d)return{ref:p(d)};let h=n[1].defId??n[1].schema.id??`schema${r.counter++}`;return n[1].defId=h,{defId:h,ref:`${p("__shared")}#/${s}/${h}`}}if(n[1]===t)return{ref:"#"};let l=`#/${s}/`,u=n[1].schema.id??`__schema${r.counter++}`;return{defId:u,ref:l+u}},i=n=>{if(n[1].schema.$ref)return;let s=n[1],{ref:a,defId:l}=o(n);s.def={...s.schema},l&&(s.defId=l);let u=s.schema;for(let d in u)delete u[d];u.$ref=a};if(r.cycles==="throw")for(let n of r.seen.entries()){let s=n[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
40
+ `)}g.write("payload.value = newResult;"),g.write("return payload;");let M=g.compile();return(U,C)=>M(h,U,C)},o,a=Sl,s=!tf.jitless,u=s&&O0.value,d=e.catchall,p;r._zod.parse=(h,g)=>{p??(p=n.value);let v=h.value;return a(v)?s&&u&&g?.async===!1&&g.jitless!==!0?(o||(o=i(e.shape)),h=o(h,g),d?LF([],v,h,g,p,r):h):t(h,g):(h.issues.push({expected:"object",code:"invalid_type",input:v,inst:r}),h)}});function kF(r,e,t,n){for(let o of r)if(o.issues.length===0)return e.value=o.value,e;let i=r.filter(o=>!qa(o));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:r.map(o=>o.issues.map(a=>Zr(a,n,Ft())))}),e)}var gf=A("$ZodUnion",(r,e)=>{Ae.init(r,e),Ne(r._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Ne(r._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Ne(r._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),Ne(r._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>of(o.source)).join("|")})$`)}});let t=e.options.length===1,n=e.options[0]._zod.run;r._zod.parse=(i,o)=>{if(t)return n(i,o);let a=!1,s=[];for(let l of e.options){let u=l._zod.run({value:i.value,issues:[]},o);if(u instanceof Promise)s.push(u),a=!0;else{if(u.issues.length===0)return u;s.push(u)}}return a?Promise.all(s).then(l=>kF(l,i,r,o)):kF(s,i,r,o)}});function NF(r,e,t,n){let i=r.filter(o=>o.issues.length===0);return i.length===1?(e.value=i[0].value,e):(i.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:r.map(o=>o.issues.map(a=>Zr(a,n,Ft())))}):e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:[],inclusive:!1}),e)}var E_=A("$ZodXor",(r,e)=>{gf.init(r,e),e.inclusive=!1;let t=e.options.length===1,n=e.options[0]._zod.run;r._zod.parse=(i,o)=>{if(t)return n(i,o);let a=!1,s=[];for(let l of e.options){let u=l._zod.run({value:i.value,issues:[]},o);u instanceof Promise?(s.push(u),a=!0):s.push(u)}return a?Promise.all(s).then(l=>NF(l,i,r,o)):NF(s,i,r,o)}}),F_=A("$ZodDiscriminatedUnion",(r,e)=>{e.inclusive=!1,gf.init(r,e);let t=r._zod.parse;Ne(r._zod,"propValues",()=>{let i={};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)){i[s]||(i[s]=new Set);for(let u of l)i[s].add(u)}}return i});let n=Hu(()=>{let i=e.options,o=new Map;for(let a of i){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=(i,o)=>{let a=i.value;if(!Sl(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:r}),i;let s=n.value.get(a?.[e.discriminator]);return s?s._zod.run(i,o):e.unionFallback?t(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:a,path:[e.discriminator],inst:r}),i)}}),B_=A("$ZodIntersection",(r,e)=>{Ae.init(r,e),r._zod.parse=(t,n)=>{let i=t.value,o=e.left._zod.run({value:i,issues:[]},n),a=e.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([l,u])=>$F(t,l,u)):$F(t,o,a)}});function UA(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(Za(r)&&Za(e)){let t=Object.keys(e),n=Object.keys(r).filter(o=>t.indexOf(o)!==-1),i={...r,...e};for(let o of n){let a=UA(r[o],e[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i[o]=a.data}return{valid:!0,data:i}}if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return{valid:!1,mergeErrorPath:[]};let t=[];for(let n=0;n<r.length;n++){let i=r[n],o=e[n],a=UA(i,o);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};t.push(a.data)}return{valid:!0,data:t}}return{valid:!1,mergeErrorPath:[]}}function $F(r,e,t){let n=new Map,i;for(let s of e.issues)if(s.code==="unrecognized_keys"){i??(i=s);for(let l of s.keys)n.has(l)||n.set(l,{}),n.get(l).l=!0}else r.issues.push(s);for(let s of t.issues)if(s.code==="unrecognized_keys")for(let l of s.keys)n.has(l)||n.set(l,{}),n.get(l).r=!0;else r.issues.push(s);let o=[...n].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(o.length&&i&&r.issues.push({...i,keys:o}),qa(r))return r;let a=UA(e.value,t.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return r.value=a.data,r}var Ty=A("$ZodTuple",(r,e)=>{Ae.init(r,e);let t=e.items;r._zod.parse=(n,i)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({input:o,inst:r,expected:"tuple",code:"invalid_type"}),n;n.value=[];let a=[],s=[...t].reverse().findIndex(d=>d._zod.optin!=="optional"),l=s===-1?0:t.length-s;if(!e.rest){let d=o.length>t.length,p=o.length<l-1;if(d||p)return n.issues.push({...d?{code:"too_big",maximum:t.length,inclusive:!0}:{code:"too_small",minimum:t.length},input:o,inst:r,origin:"array"}),n}let u=-1;for(let d of t){if(u++,u>=o.length&&u>=l)continue;let p=d._zod.run({value:o[u],issues:[]},i);p instanceof Promise?a.push(p.then(h=>By(h,n,u))):By(p,n,u)}if(e.rest){let d=o.slice(t.length);for(let p of d){u++;let h=e.rest._zod.run({value:p,issues:[]},i);h instanceof Promise?a.push(h.then(g=>By(g,n,u))):By(h,n,u)}}return a.length?Promise.all(a).then(()=>n):n}});function By(r,e,t){r.issues.length&&e.issues.push(...mi(t,r.issues)),e.value[t]=r.value}var I_=A("$ZodRecord",(r,e)=>{Ae.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;if(!Za(i))return t.issues.push({expected:"record",code:"invalid_type",input:i,inst:r}),t;let o=[],a=e.keyType._zod.values;if(a){t.value={};let s=new Set;for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){s.add(typeof u=="number"?u.toString():u);let d=e.valueType._zod.run({value:i[u],issues:[]},n);d instanceof Promise?o.push(d.then(p=>{p.issues.length&&t.issues.push(...mi(u,p.issues)),t.value[u]=p.value})):(d.issues.length&&t.issues.push(...mi(u,d.issues)),t.value[u]=d.value)}let l;for(let u in i)s.has(u)||(l=l??[],l.push(u));l&&l.length>0&&t.issues.push({code:"unrecognized_keys",input:i,inst:r,keys:l})}else{t.value={};for(let s of Reflect.ownKeys(i)){if(s==="__proto__")continue;let l=e.keyType._zod.run({value:s,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&Sy.test(s)&&l.issues.length&&l.issues.some(p=>p.code==="invalid_type"&&p.expected==="number")){let p=e.keyType._zod.run({value:Number(s),issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(l=p)}if(l.issues.length){e.mode==="loose"?t.value[s]=i[s]:t.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>Zr(p,n,Ft())),input:s,path:[s],inst:r});continue}let d=e.valueType._zod.run({value:i[s],issues:[]},n);d instanceof Promise?o.push(d.then(p=>{p.issues.length&&t.issues.push(...mi(s,p.issues)),t.value[l.value]=p.value})):(d.issues.length&&t.issues.push(...mi(s,d.issues)),t.value[l.value]=d.value)}}return o.length?Promise.all(o).then(()=>t):t}}),k_=A("$ZodMap",(r,e)=>{Ae.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;if(!(i instanceof Map))return t.issues.push({expected:"map",code:"invalid_type",input:i,inst:r}),t;let o=[];t.value=new Map;for(let[a,s]of i){let l=e.keyType._zod.run({value:a,issues:[]},n),u=e.valueType._zod.run({value:s,issues:[]},n);l instanceof Promise||u instanceof Promise?o.push(Promise.all([l,u]).then(([d,p])=>{DF(d,p,t,a,i,r,n)})):DF(l,u,t,a,i,r,n)}return o.length?Promise.all(o).then(()=>t):t}});function DF(r,e,t,n,i,o,a){r.issues.length&&(af.has(typeof n)?t.issues.push(...mi(n,r.issues)):t.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:r.issues.map(s=>Zr(s,a,Ft()))})),e.issues.length&&(af.has(typeof n)?t.issues.push(...mi(n,e.issues)):t.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:n,issues:e.issues.map(s=>Zr(s,a,Ft()))})),t.value.set(r.value,e.value)}var N_=A("$ZodSet",(r,e)=>{Ae.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;if(!(i instanceof Set))return t.issues.push({input:i,inst:r,expected:"set",code:"invalid_type"}),t;let o=[];t.value=new Set;for(let a of i){let s=e.valueType._zod.run({value:a,issues:[]},n);s instanceof Promise?o.push(s.then(l=>MF(l,t))):MF(s,t)}return o.length?Promise.all(o).then(()=>t):t}});function MF(r,e){r.issues.length&&e.issues.push(...r.issues),e.value.add(r.value)}var $_=A("$ZodEnum",(r,e)=>{Ae.init(r,e);let t=nf(e.entries),n=new Set(t);r._zod.values=n,r._zod.pattern=new RegExp(`^(${t.filter(i=>af.has(typeof i)).map(i=>typeof i=="string"?Wi(i):i.toString()).join("|")})$`),r._zod.parse=(i,o)=>{let a=i.value;return n.has(a)||i.issues.push({code:"invalid_value",values:t,input:a,inst:r}),i}}),D_=A("$ZodLiteral",(r,e)=>{if(Ae.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(n=>typeof n=="string"?Wi(n):n?Wi(n.toString()):String(n)).join("|")})$`),r._zod.parse=(n,i)=>{let o=n.value;return t.has(o)||n.issues.push({code:"invalid_value",values:e.values,input:o,inst:r}),n}}),M_=A("$ZodFile",(r,e)=>{Ae.init(r,e),r._zod.parse=(t,n)=>{let i=t.value;return i instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:i,inst:r}),t}}),T_=A("$ZodTransform",(r,e)=>{Ae.init(r,e),r._zod.parse=(t,n)=>{if(n.direction==="backward")throw new La(r.constructor.name);let i=e.transform(t.value,t);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(t.value=a,t));if(i instanceof Promise)throw new wn;return t.value=i,t}});function TF(r,e){return r.issues.length&&e===void 0?{issues:[],value:void 0}:r}var Cy=A("$ZodOptional",(r,e)=>{Ae.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(`^(${of(t.source)})?$`):void 0}),r._zod.parse=(t,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>TF(o,t.value)):TF(i,t.value)}return t.value===void 0?t:e.innerType._zod.run(t,n)}}),C_=A("$ZodExactOptional",(r,e)=>{Cy.init(r,e),Ne(r._zod,"values",()=>e.innerType._zod.values),Ne(r._zod,"pattern",()=>e.innerType._zod.pattern),r._zod.parse=(t,n)=>e.innerType._zod.run(t,n)}),R_=A("$ZodNullable",(r,e)=>{Ae.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(`^(${of(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,n)=>t.value===null?t:e.innerType._zod.run(t,n)}),O_=A("$ZodDefault",(r,e)=>{Ae.init(r,e),r._zod.optin="optional",Ne(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,n)=>{if(n.direction==="backward")return e.innerType._zod.run(t,n);if(t.value===void 0)return t.value=e.defaultValue,t;let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>CF(o,e)):CF(i,e)}});function CF(r,e){return r.value===void 0&&(r.value=e.defaultValue),r}var V_=A("$ZodPrefault",(r,e)=>{Ae.init(r,e),r._zod.optin="optional",Ne(r._zod,"values",()=>e.innerType._zod.values),r._zod.parse=(t,n)=>(n.direction==="backward"||t.value===void 0&&(t.value=e.defaultValue),e.innerType._zod.run(t,n))}),z_=A("$ZodNonOptional",(r,e)=>{Ae.init(r,e),Ne(r._zod,"values",()=>{let t=e.innerType._zod.values;return t?new Set([...t].filter(n=>n!==void 0)):void 0}),r._zod.parse=(t,n)=>{let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>RF(o,r)):RF(i,r)}});function RF(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 U_=A("$ZodSuccess",(r,e)=>{Ae.init(r,e),r._zod.parse=(t,n)=>{if(n.direction==="backward")throw new La("ZodSuccess");let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>(t.value=o.issues.length===0,t)):(t.value=i.issues.length===0,t)}}),j_=A("$ZodCatch",(r,e)=>{Ae.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,n)=>{if(n.direction==="backward")return e.innerType._zod.run(t,n);let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(o=>(t.value=o.value,o.issues.length&&(t.value=e.catchValue({...t,error:{issues:o.issues.map(a=>Zr(a,n,Ft()))},input:t.value}),t.issues=[]),t)):(t.value=i.value,i.issues.length&&(t.value=e.catchValue({...t,error:{issues:i.issues.map(o=>Zr(o,n,Ft()))},input:t.value}),t.issues=[]),t)}}),L_=A("$ZodNaN",(r,e)=>{Ae.init(r,e),r._zod.parse=(t,n)=>((typeof t.value!="number"||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:r,expected:"nan",code:"invalid_type"}),t)}),K_=A("$ZodPipe",(r,e)=>{Ae.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,n)=>{if(n.direction==="backward"){let o=e.out._zod.run(t,n);return o instanceof Promise?o.then(a=>Iy(a,e.in,n)):Iy(o,e.in,n)}let i=e.in._zod.run(t,n);return i instanceof Promise?i.then(o=>Iy(o,e.out,n)):Iy(i,e.out,n)}});function Iy(r,e,t){return r.issues.length?(r.aborted=!0,r):e._zod.run({value:r.value,issues:r.issues},t)}var vf=A("$ZodCodec",(r,e)=>{Ae.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,n)=>{if((n.direction||"forward")==="forward"){let o=e.in._zod.run(t,n);return o instanceof Promise?o.then(a=>ky(a,e,n)):ky(o,e,n)}else{let o=e.out._zod.run(t,n);return o instanceof Promise?o.then(a=>ky(a,e,n)):ky(o,e,n)}}});function ky(r,e,t){if(r.issues.length)return r.aborted=!0,r;if((t.direction||"forward")==="forward"){let i=e.transform(r.value,r);return i instanceof Promise?i.then(o=>Ny(r,o,e.out,t)):Ny(r,i,e.out,t)}else{let i=e.reverseTransform(r.value,r);return i instanceof Promise?i.then(o=>Ny(r,o,e.in,t)):Ny(r,i,e.in,t)}}function Ny(r,e,t,n){return r.issues.length?(r.aborted=!0,r):t._zod.run({value:e,issues:r.issues},n)}var W_=A("$ZodReadonly",(r,e)=>{Ae.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,n)=>{if(n.direction==="backward")return e.innerType._zod.run(t,n);let i=e.innerType._zod.run(t,n);return i instanceof Promise?i.then(OF):OF(i)}});function OF(r){return r.value=Object.freeze(r.value),r}var Z_=A("$ZodTemplateLiteral",(r,e)=>{Ae.init(r,e);let t=[];for(let n of e.parts)if(typeof n=="object"&&n!==null){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let i=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!i)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let o=i.startsWith("^")?1:0,a=i.endsWith("$")?i.length-1:i.length;t.push(i.slice(o,a))}else if(n===null||z0.has(typeof n))t.push(Wi(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);r._zod.pattern=new RegExp(`^${t.join("")}$`),r._zod.parse=(n,i)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:r,expected:"string",code:"invalid_type"}),n):(r._zod.pattern.lastIndex=0,r._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:r,code:"invalid_format",format:e.format??"template_literal",pattern:r._zod.pattern.source}),n)}),q_=A("$ZodFunction",(r,e)=>(Ae.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(...n){let i=r._def.input?fy(r._def.input,n):n,o=Reflect.apply(t,this,i);return r._def.output?fy(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(...n){let i=r._def.input?await my(r._def.input,n):n,o=await Reflect.apply(t,this,i);return r._def.output?await my(r._def.output,o):o}},r._zod.parse=(t,n)=>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 n=r.constructor;return Array.isArray(t[0])?new n({type:"function",input:new Ty({type:"tuple",items:t[0],rest:t[1]}),output:r._def.output}):new n({type:"function",input:t[0],output:r._def.output})},r.output=t=>{let n=r.constructor;return new n({type:"function",input:r._def.input,output:t})},r)),G_=A("$ZodPromise",(r,e)=>{Ae.init(r,e),r._zod.parse=(t,n)=>Promise.resolve(t.value).then(i=>e.innerType._zod.run({value:i,issues:[]},n))}),H_=A("$ZodLazy",(r,e)=>{Ae.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,n)=>r._zod.innerType._zod.run(t,n)}),J_=A("$ZodCustom",(r,e)=>{it.init(r,e),Ae.init(r,e),r._zod.parse=(t,n)=>t,r._zod.check=t=>{let n=t.value,i=e.fn(n);if(i instanceof Promise)return i.then(o=>VF(o,t,n,r));VF(i,t,n,r)}});function VF(r,e,t,n){if(!r){let i={code:"custom",input:t,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(Ju(i))}}var xf={};po(xf,{ar:()=>WF,az:()=>ZF,be:()=>GF,bg:()=>HF,ca:()=>JF,cs:()=>QF,da:()=>XF,de:()=>YF,en:()=>Ry,eo:()=>eB,es:()=>tB,fa:()=>rB,fi:()=>iB,fr:()=>nB,frCA:()=>oB,he:()=>aB,hu:()=>sB,hy:()=>cB,id:()=>uB,is:()=>dB,it:()=>pB,ja:()=>hB,ka:()=>fB,kh:()=>mB,km:()=>Oy,ko:()=>gB,lt:()=>yB,mk:()=>xB,ms:()=>bB,nl:()=>wB,no:()=>AB,ota:()=>_B,pl:()=>SB,ps:()=>PB,pt:()=>EB,ru:()=>BB,sl:()=>IB,sv:()=>kB,ta:()=>NB,th:()=>$B,tr:()=>DB,ua:()=>MB,uk:()=>Vy,ur:()=>TB,uz:()=>CB,vi:()=>RB,yo:()=>zB,zhCN:()=>OB,zhTW:()=>VB});var y$=()=>{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(i){return r[i]??null}let t={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${i.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${s}`}case"invalid_value":return i.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${z(i.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.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 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${i.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 ${i.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${i.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${i.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;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 "${i.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}`:`${t[o.format]??i.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${i.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${i.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${i.keys.length>1?"\u0629":""}: ${N(i.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${i.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function WF(){return{localeError:y$()}}var x$=()=>{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(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",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${i.expected}, daxil olan ${s}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o}, daxil olan ${s}`}case"invalid_value":return i.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${z(i.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${o}${i.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${i.origin??"d\u0259y\u0259r"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${o}${i.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${i.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${i.keys.length>1?"lar":""}: ${N(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${i.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function ZF(){return{localeError:x$()}}function qF(r,e,t,n){let i=Math.abs(r),o=i%10,a=i%100;return a>=11&&a<=19?n:o===1?e:o>=2&&o<=4?t:n}var b$=()=>{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(i){return r[i]??null}let t={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},n={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${i.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${z(i.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);if(a){let s=Number(i.maximum),l=qF(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 ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${i.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 ${i.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);if(a){let s=Number(i.minimum),l=qF(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 ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${i.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 ${i.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${i.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${N(i.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${i.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function GF(){return{localeError:b$()}}var w$=()=>{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"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${z(i.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`\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 ${o}${i.maximum.toString()} ${a.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 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`\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 ${o}${i.minimum.toString()} ${a.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 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;if(o.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 "${o.prefix}"`;if(o.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 "${o.suffix}"`;if(o.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 "${o.includes}"`;if(o.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 ${o.pattern}`;let a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return o.format==="emoji"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="datetime"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="date"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),o.format==="time"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),o.format==="duration"&&(a="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${a} ${t[o.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":""}: ${N(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 HF(){return{localeError:w$()}}var A$=()=>{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(i){return r[i]??null}let t={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${i.expected}, s'ha rebut ${s}`:`Tipus inv\xE0lid: s'esperava ${o}, s'ha rebut ${s}`}case"invalid_value":return i.values.length===1?`Valor inv\xE0lid: s'esperava ${z(i.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${N(i.values," o ")}`;case"too_big":{let o=i.inclusive?"com a m\xE0xim":"menys de",a=e(i.origin);return a?`Massa gran: s'esperava que ${i.origin??"el valor"} contingu\xE9s ${o} ${i.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"com a m\xEDnim":"m\xE9s de",a=e(i.origin);return a?`Massa petit: s'esperava que ${i.origin} contingu\xE9s ${o} ${i.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${i.origin} fos ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${i.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${i.origin}`;default:return"Entrada inv\xE0lida"}}};function JF(){return{localeError:A$()}}var _$=()=>{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(i){return r[i]??null}let t={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},n={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${i.expected}, obdr\u017Eeno ${s}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o}, obdr\u017Eeno ${s}`}case"invalid_value":return i.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${z(i.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${o}${i.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED m\xEDt ${o}${i.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${i.origin??"hodnota"} mus\xED b\xFDt ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${i.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${N(i.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${i.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${i.origin}`;default:return"Neplatn\xFD vstup"}}};function QF(){return{localeError:_$()}}var P$=()=>{let r={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(i){return r[i]??null}let t={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Ugyldigt input: forventede instanceof ${i.expected}, fik ${s}`:`Ugyldigt input: forventede ${o}, fik ${s}`}case"invalid_value":return i.values.length===1?`Ugyldig v\xE6rdi: forventede ${z(i.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin),s=n[i.origin]??i.origin;return a?`For stor: forventede ${s??"value"} ${a.verb} ${o} ${i.maximum.toString()} ${a.unit??"elementer"}`:`For stor: forventede ${s??"value"} havde ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin),s=n[i.origin]??i.origin;return a?`For lille: forventede ${s} ${a.verb} ${o} ${i.minimum.toString()} ${a.unit}`:`For lille: forventede ${s} havde ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${t[o.format]??i.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${N(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${i.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${i.origin}`;default:return"Ugyldigt input"}}};function XF(){return{localeError:P$()}}var S$=()=>{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(i){return r[i]??null}let t={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},n={nan:"NaN",number:"Zahl",array:"Array"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${i.expected}, erhalten ${s}`:`Ung\xFCltige Eingabe: erwartet ${o}, erhalten ${s}`}case"invalid_value":return i.values.length===1?`Ung\xFCltige Eingabe: erwartet ${z(i.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${i.origin??"Wert"} ${o}${i.maximum.toString()} ist`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${i.origin} ${o}${i.minimum.toString()} ist`}case"invalid_format":{let o=i;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: ${t[o.format]??i.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${N(i.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${i.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${i.origin}`;default:return"Ung\xFCltige Eingabe"}}};function YF(){return{localeError:S$()}}var E$=()=>{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"},map:{unit:"entries",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"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return`Invalid input: expected ${o}, received ${s}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${z(i.values[0])}`:`Invalid option: expected one of ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${a.unit}`:`Too small: expected ${i.origin} to be ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${t[o.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":""}: ${N(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 Ry(){return{localeError:E$()}}var F$=()=>{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"},n={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${i.expected}, ricevi\u011Dis ${s}`:`Nevalida enigo: atendi\u011Dis ${o}, ricevi\u011Dis ${s}`}case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${z(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${o}${i.maximum.toString()} ${a.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${o}${i.minimum.toString()} ${a.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${t[o.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":""}: ${N(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 eB(){return{localeError:F$()}}var B$=()=>{let r={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(i){return r[i]??null}let t={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${i.expected}, recibido ${s}`:`Entrada inv\xE1lida: se esperaba ${o}, recibido ${s}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: se esperaba ${z(i.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin),s=n[i.origin]??i.origin;return a?`Demasiado grande: se esperaba que ${s??"valor"} tuviera ${o}${i.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${s??"valor"} fuera ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin),s=n[i.origin]??i.origin;return a?`Demasiado peque\xF1o: se esperaba que ${s} tuviera ${o}${i.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${s} fuera ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${t[o.format]??i.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n[i.origin]??i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n[i.origin]??i.origin}`;default:return"Entrada inv\xE1lida"}}};function tB(){return{localeError:B$()}}var I$=()=>{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(i){return r[i]??null}let t={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${i.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${s} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return i.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${z(i.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${N(i.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${i.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=i;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`:`${t[o.format]??i.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${i.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${i.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${N(i.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${i.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${i.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function rB(){return{localeError:I$()}}var k$=()=>{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(i){return r[i]??null}let t={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Virheellinen tyyppi: odotettiin instanceof ${i.expected}, oli ${s}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${s}`}case"invalid_value":return i.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${z(i.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${o}${i.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${o}${i.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${N(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function iB(){return{localeError:k$()}}var N$=()=>{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(i){return r[i]??null}let t={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={nan:"NaN",number:"nombre",array:"tableau"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : instanceof ${i.expected} attendu, ${s} re\xE7u`:`Entr\xE9e invalide : ${o} attendu, ${s} re\xE7u`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : ${z(i.values[0])} attendu`:`Option invalide : une valeur parmi ${N(i.values,"|")} attendue`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Trop grand : ${i.origin??"valeur"} doit ${a.verb} ${o}${i.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i.origin??"valeur"} doit \xEAtre ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Trop petit : ${i.origin} doit ${a.verb} ${o}${i.minimum.toString()} ${a.unit}`:`Trop petit : ${i.origin} doit \xEAtre ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${t[o.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${N(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function nB(){return{localeError:N$()}}var $$=()=>{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(i){return r[i]??null}let t={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Entr\xE9e invalide : attendu instanceof ${i.expected}, re\xE7u ${s}`:`Entr\xE9e invalide : attendu ${o}, re\xE7u ${s}`}case"invalid_value":return i.values.length===1?`Entr\xE9e invalide : attendu ${z(i.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"\u2264":"<",a=e(i.origin);return a?`Trop grand : attendu que ${i.origin??"la valeur"} ait ${o}${i.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${i.origin??"la valeur"} soit ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"\u2265":">",a=e(i.origin);return a?`Trop petit : attendu que ${i.origin} ait ${o}${i.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${i.origin} soit ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${t[o.format]??i.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xE9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${N(i.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${i.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`;default:return"Entr\xE9e invalide"}}};function oB(){return{localeError:$$()}}var D$=()=>{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=u=>u?r[u]:void 0,n=u=>{let d=t(u);return d?d.label:u??r.unknown.label},i=u=>`\u05D4${n(u)}`,o=u=>(t(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",a=u=>u?e[u]??null:null,s={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},l={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let d=u.expected,p=l[d??""]??n(d),h=j(u.input),g=l[h]??r[h]?.label??h;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${g}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${g}`}case"invalid_value":{if(u.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${z(u.values[0])}`;let d=u.values.map(g=>z(g));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d[0]} \u05D0\u05D5 ${d[1]}`;let p=d[d.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 ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let d=a(u.origin),p=i(u.origin??"value");if(u.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let v=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${v}`}if(u.origin==="array"||u.origin==="set"){let v=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=u.inclusive?`${u.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${v} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let h=u.inclusive?"<=":"<",g=o(u.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${p} ${g} ${h}${u.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${g} ${h}${u.maximum.toString()}`}case"too_small":{let d=a(u.origin),p=i(u.origin??"value");if(u.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let v=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${v}`}if(u.origin==="array"||u.origin==="set"){let v=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let x=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${v} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let y=u.inclusive?`${u.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${v} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let h=u.inclusive?">=":">",g=o(u.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${p} ${g} ${h}${u.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${g} ${h}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.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 ${d.pattern}`;let p=s[d.format],h=p?.label??d.format,v=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${h} \u05DC\u05D0 ${v}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${N(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${i(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function aB(){return{localeError:D$()}}var M$=()=>{let r={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(i){return r[i]??null}let t={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},n={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${i.expected}, a kapott \xE9rt\xE9k ${s}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o}, a kapott \xE9rt\xE9k ${s}`}case"invalid_value":return i.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${z(i.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`T\xFAl nagy: ${i.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${i.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${i.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} m\xE9rete t\xFAl kicsi ${o}${i.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${i.origin} t\xFAl kicsi ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${i.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${i.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${i.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function sB(){return{localeError:M$()}}function lB(r,e,t){return Math.abs(r)===1?e:t}function rd(r){if(!r)return"";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],t=r[r.length-1];return r+(e.includes(t)?"\u0576":"\u0568")}var T$=()=>{let r={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(i){return r[i]??null}let t={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},n={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${i.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${o}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${s}`}case"invalid_value":return i.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${z(i.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);if(a){let s=Number(i.maximum),l=lB(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rd(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${i.maximum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rd(i.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);if(a){let s=Number(i.minimum),l=lB(s,a.unit.one,a.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rd(i.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${o}${i.minimum.toString()} ${l}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${rd(i.origin)} \u056C\u056B\u0576\u056B ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${o.prefix}"-\u0578\u057E`:o.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${o.suffix}"-\u0578\u057E`:o.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${o.includes}"`:o.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${o.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${t[o.format]??i.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${i.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${i.keys.length>1?"\u0576\u0565\u0580":""}. ${N(i.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${rd(i.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${rd(i.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function cB(){return{localeError:T$()}}var C$=()=>{let r={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(i){return r[i]??null}let t={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Input tidak valid: diharapkan instanceof ${i.expected}, diterima ${s}`:`Input tidak valid: diharapkan ${o}, diterima ${s}`}case"invalid_value":return i.values.length===1?`Input tidak valid: diharapkan ${z(i.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${o}${i.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Terlalu kecil: diharapkan ${i.origin} memiliki ${o}${i.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${i.origin} menjadi ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${t[o.format]??i.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`;default:return"Input tidak valid"}}};function uB(){return{localeError:C$()}}var R$=()=>{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"},n={nan:"NaN",number:"n\xFAmer",array:"fylki"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera instanceof ${i.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${s} \xFEar sem \xE1 a\xF0 vera ${o}`}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 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} hafi ${o}${i.maximum.toString()} ${a.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} s\xE9 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} hafi ${o}${i.minimum.toString()} ${a.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} s\xE9 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${o.prefix}"`:o.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${o.suffix}"`:o.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${o.includes}"`:o.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${o.pattern}`:`Rangt ${t[o.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"}: ${N(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 dB(){return{localeError:R$()}}var O$=()=>{let r={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(i){return r[i]??null}let t={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"numero",array:"vettore"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Input non valido: atteso instanceof ${i.expected}, ricevuto ${s}`:`Input non valido: atteso ${o}, ricevuto ${s}`}case"invalid_value":return i.values.length===1?`Input non valido: atteso ${z(i.values[0])}`:`Opzione non valida: atteso uno tra ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Troppo grande: ${i.origin??"valore"} deve avere ${o}${i.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${i.origin??"valore"} deve essere ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Troppo piccolo: ${i.origin} deve avere ${o}${i.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${i.origin} deve essere ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${N(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`;default:return"Input non valido"}}};function pB(){return{localeError:O$()}}var V$=()=>{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(i){return r[i]??null}let t={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},n={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${i.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${o}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${s}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return i.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${z(i.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${N(i.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=i.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=e(i.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${a.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${i.origin??"\u5024"}\u306F${i.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=i.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=e(i.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${a.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${i.origin}\u306F${i.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=i;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${t[o.format]??i.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${i.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${i.keys.length>1?"\u7FA4":""}: ${N(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${i.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function hB(){return{localeError:V$()}}var z$=()=>{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"},n={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${i.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${s}`}case"invalid_value":return i.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${z(i.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${N(i.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`\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"} ${a.verb} ${o}${i.maximum.toString()} ${a.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 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`\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} ${a.verb} ${o}${i.minimum.toString()} ${a.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 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.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 "${o.prefix}"-\u10D8\u10D7`:o.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 "${o.suffix}"-\u10D8\u10D7`:o.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 "${o.includes}"-\u10E1`:o.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 ${o.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${t[o.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"}: ${N(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 fB(){return{localeError:z$()}}var U$=()=>{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(i){return r[i]??null}let t={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},n={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${i.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${s}`}case"invalid_value":return i.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${z(i.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${i.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${o} ${i.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i.origin} ${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${i.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${N(i.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${i.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Oy(){return{localeError:U$()}}function mB(){return Oy()}var j$=()=>{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(i){return r[i]??null}let t={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${i.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${s}\uC785\uB2C8\uB2E4`}case"invalid_value":return i.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${z(i.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${N(i.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=i.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(i.origin),l=s?.unit??"\uC694\uC18C";return s?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()}${l} ${o}${a}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${i.maximum.toString()} ${o}${a}`}case"too_small":{let o=i.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(i.origin),l=s?.unit??"\uC694\uC18C";return s?`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()}${l} ${o}${a}`:`${i.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${i.minimum.toString()} ${o}${a}`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${i.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${N(i.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${i.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${i.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function gB(){return{localeError:j$()}}var yf=r=>r.charAt(0).toUpperCase()+r.slice(1);function vB(r){let e=Math.abs(r),t=e%10,n=e%100;return n>=11&&n<=19||t===0?"many":t===1?"one":"few"}var L$=()=>{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,o,a,s){let l=r[i]??null;return l===null?l:{unit:l.unit[o],verb:l.verb[s][a?"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"},n={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Gautas tipas ${s}, o tik\u0117tasi - instanceof ${i.expected}`:`Gautas tipas ${s}, o tik\u0117tasi - ${o}`}case"invalid_value":return i.values.length===1?`Privalo b\u016Bti ${z(i.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${N(i.values,"|")} pasirinkim\u0173`;case"too_big":{let o=n[i.origin]??i.origin,a=e(i.origin,vB(Number(i.maximum)),i.inclusive??!1,"smaller");if(a?.verb)return`${yf(o??i.origin??"reik\u0161m\u0117")} ${a.verb} ${i.maximum.toString()} ${a.unit??"element\u0173"}`;let s=i.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${yf(o??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${i.maximum.toString()} ${a?.unit}`}case"too_small":{let o=n[i.origin]??i.origin,a=e(i.origin,vB(Number(i.minimum)),i.inclusive??!1,"bigger");if(a?.verb)return`${yf(o??i.origin??"reik\u0161m\u0117")} ${a.verb} ${i.minimum.toString()} ${a.unit??"element\u0173"}`;let s=i.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${yf(o??i.origin??"reik\u0161m\u0117")} turi b\u016Bti ${s} ${i.minimum.toString()} ${a?.unit}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${o.prefix}"`:o.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${o.includes}"`:o.format==="regex"?`Eilut\u0117 privalo atitikti ${o.pattern}`:`Neteisingas ${t[o.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"}: ${N(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let o=n[i.origin]??i.origin;return`${yf(o??i.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function yB(){return{localeError:L$()}}var K$=()=>{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(i){return r[i]??null}let t={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},n={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${i.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${s}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${z(i.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.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 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${i.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 ${i.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${i.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${N(i.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${i.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${i.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function xB(){return{localeError:K$()}}var W$=()=>{let r={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(i){return r[i]??null}let t={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"nombor"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Input tidak sah: dijangka instanceof ${i.expected}, diterima ${s}`:`Input tidak sah: dijangka ${o}, diterima ${s}`}case"invalid_value":return i.values.length===1?`Input tidak sah: dijangka ${z(i.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Terlalu besar: dijangka ${i.origin??"nilai"} ${a.verb} ${o}${i.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Terlalu kecil: dijangka ${i.origin} ${a.verb} ${o}${i.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${i.origin} adalah ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${t[o.format]??i.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${N(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`;default:return"Input tidak sah"}}};function bB(){return{localeError:W$()}}var Z$=()=>{let r={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(i){return r[i]??null}let t={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},n={nan:"NaN",number:"getal"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Ongeldige invoer: verwacht instanceof ${i.expected}, ontving ${s}`:`Ongeldige invoer: verwacht ${o}, ontving ${s}`}case"invalid_value":return i.values.length===1?`Ongeldige invoer: verwacht ${z(i.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin),s=i.origin==="date"?"laat":i.origin==="string"?"lang":"groot";return a?`Te ${s}: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} ${a.unit??"elementen"} ${a.verb}`:`Te ${s}: verwacht dat ${i.origin??"waarde"} ${o}${i.maximum.toString()} is`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin),s=i.origin==="date"?"vroeg":i.origin==="string"?"kort":"klein";return a?`Te ${s}: verwacht dat ${i.origin} ${o}${i.minimum.toString()} ${a.unit} ${a.verb}`:`Te ${s}: verwacht dat ${i.origin} ${o}${i.minimum.toString()} is`}case"invalid_format":{let o=i;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: ${t[o.format]??i.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`;default:return"Ongeldige invoer"}}};function wB(){return{localeError:Z$()}}var q$=()=>{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(i){return r[i]??null}let t={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"tall",array:"liste"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Ugyldig input: forventet instanceof ${i.expected}, fikk ${s}`:`Ugyldig input: forventet ${o}, fikk ${s}`}case"invalid_value":return i.values.length===1?`Ugyldig verdi: forventet ${z(i.values[0])}`:`Ugyldig valg: forventet en av ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${i.origin??"value"} til \xE5 ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`For lite(n): forventet ${i.origin} til \xE5 ha ${o}${i.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${i.origin} til \xE5 ha ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${N(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${i.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`;default:return"Ugyldig input"}}};function AB(){return{localeError:q$()}}var G$=()=>{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(i){return r[i]??null}let t={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},n={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`F\xE2sit giren: umulan instanceof ${i.expected}, al\u0131nan ${s}`:`F\xE2sit giren: umulan ${o}, al\u0131nan ${s}`}case"invalid_value":return i.values.length===1?`F\xE2sit giren: umulan ${z(i.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${o}${i.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${i.origin??"value"}, ${o}${i.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${o}${i.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${i.origin}, ${o}${i.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${i.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${i.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function _B(){return{localeError:G$()}}var H$=()=>{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(i){return r[i]??null}let t={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},n={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${i.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${s} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return i.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${z(i.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${N(i.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${i.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${i.maximum.toString()} \u0648\u064A`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${i.origin} \u0628\u0627\u06CC\u062F ${o}${i.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=i;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`:`${t[o.format]??i.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${i.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${i.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${N(i.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${i.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${i.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function PB(){return{localeError:H$()}}var J$=()=>{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(i){return r[i]??null}let t={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},n={nan:"NaN",number:"liczba",array:"tablica"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${i.expected}, otrzymano ${s}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o}, otrzymano ${s}`}case"invalid_value":return i.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${z(i.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${i.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${i.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${i.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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) ${t[o.format]??i.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${i.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${i.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function SB(){return{localeError:J$()}}var Q$=()=>{let r={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(i){return r[i]??null}let t={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",number:"n\xFAmero",null:"nulo"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Tipo inv\xE1lido: esperado instanceof ${i.expected}, recebido ${s}`:`Tipo inv\xE1lido: esperado ${o}, recebido ${s}`}case"invalid_value":return i.values.length===1?`Entrada inv\xE1lida: esperado ${z(i.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Muito grande: esperado que ${i.origin??"valor"} tivesse ${o}${i.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${i.origin??"valor"} fosse ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Muito pequeno: esperado que ${i.origin} tivesse ${o}${i.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${i.origin} fosse ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${t[o.format]??i.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${N(i.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${i.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${i.origin}`;default:return"Campo inv\xE1lido"}}};function EB(){return{localeError:Q$()}}function FB(r,e,t,n){let i=Math.abs(r),o=i%10,a=i%100;return a>=11&&a<=19?n:o===1?e:o>=2&&o<=4?t:n}var X$=()=>{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(i){return r[i]??null}let t={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${i.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${z(i.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);if(a){let s=Number(i.maximum),l=FB(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 ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${i.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 ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);if(a){let s=Number(i.minimum),l=FB(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 ${i.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${i.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 ${i.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${i.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0438":""}: ${N(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${i.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function BB(){return{localeError:X$()}}var Y$=()=>{let r={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(i){return r[i]??null}let t={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},n={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${i.expected}, prejeto ${s}`:`Neveljaven vnos: pri\u010Dakovano ${o}, prejeto ${s}`}case"invalid_value":return i.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${z(i.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} imelo ${o}${i.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${i.origin??"vrednost"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${i.origin} imelo ${o}${i.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${N(i.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${i.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`;default:return"Neveljaven vnos"}}};function IB(){return{localeError:Y$()}}var eD=()=>{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(i){return r[i]??null}let t={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},n={nan:"NaN",number:"antal",array:"lista"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${i.expected}, fick ${s}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${o}, fick ${s}`}case"invalid_value":return i.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${z(i.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${i.origin??"v\xE4rdet"} att ha ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${i.origin??"v\xE4rdet"} att ha ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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) ${t[o.format]??i.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${N(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${i.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function kB(){return{localeError:eD()}}var tD=()=>{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(i){return r[i]??null}let t={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${i.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}`}case"invalid_value":return i.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${z(i.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${N(i.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.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 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${i.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 ${i.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${i.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.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 ${i.origin} ${o}${i.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 ${i.origin} ${o}${i.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${i.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${i.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${N(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${i.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function NB(){return{localeError:tD()}}var rD=()=>{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(i){return r[i]??null}let t={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},n={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${i.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${s}`}case"invalid_value":return i.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${z(i.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=e(i.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=e(i.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${i.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${i.minimum.toString()}`}case"invalid_format":{let o=i;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: ${t[o.format]??i.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${i.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${N(i.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${i.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function $B(){return{localeError:rD()}}var iD=()=>{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"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${i.expected}, al\u0131nan ${s}`:`Ge\xE7ersiz de\u011Fer: beklenen ${o}, al\u0131nan ${s}`}case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${z(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${o}${i.maximum.toString()} ${a.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${o}${i.minimum.toString()} ${a.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${t[o.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":""}: ${N(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 DB(){return{localeError:iD()}}var nD=()=>{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(i){return r[i]??null}let t={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},n={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${i.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${s}`}case"invalid_value":return i.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${z(i.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.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 ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${o}${i.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 ${i.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.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 ${i.origin} ${a.verb} ${o}${i.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 ${i.origin} \u0431\u0443\u0434\u0435 ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${i.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${i.keys.length>1?"\u0456":""}: ${N(i.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${i.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${i.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function Vy(){return{localeError:nD()}}function MB(){return Vy()}var oD=()=>{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(i){return r[i]??null}let t={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},n={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${i.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${s} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return i.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${z(i.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${N(i.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${i.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: ${i.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${i.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u06D2 ${o}${i.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${i.origin} \u06A9\u0627 ${o}${i.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${i.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${i.keys.length>1?"\u0632":""}: ${N(i.keys,"\u060C ")}`;case"invalid_key":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${i.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function TB(){return{localeError:oD()}}var aD=()=>{let r={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function e(i){return r[i]??null}let t={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},n={nan:"NaN",number:"raqam",array:"massiv"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${i.expected}, qabul qilingan ${s}`:`Noto\u2018g\u2018ri kirish: kutilgan ${o}, qabul qilingan ${s}`}case"invalid_value":return i.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${z(i.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Juda katta: kutilgan ${i.origin??"qiymat"} ${o}${i.maximum.toString()} ${a.unit} ${a.verb}`:`Juda katta: kutilgan ${i.origin??"qiymat"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Juda kichik: kutilgan ${i.origin} ${o}${i.minimum.toString()} ${a.unit} ${a.verb}`:`Juda kichik: kutilgan ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;return o.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto\u2018g\u2018ri satr: "${o.includes}" ni o\u2018z ichiga olishi kerak`:o.format==="regex"?`Noto\u2018g\u2018ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${t[o.format]??i.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${i.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${i.keys.length>1?"lar":""}: ${N(i.keys,", ")}`;case"invalid_key":return`${i.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${i.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function CB(){return{localeError:aD()}}var sD=()=>{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(i){return r[i]??null}let t={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},n={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${i.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o}, nh\u1EADn \u0111\u01B0\u1EE3c ${s}`}case"invalid_value":return i.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${z(i.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${o}${i.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${i.origin??"gi\xE1 tr\u1ECB"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${a.verb} ${o}${i.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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}`:`${t[o.format]??i.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${i.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${N(i.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${i.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function RB(){return{localeError:sD()}}var lD=()=>{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(i){return r[i]??null}let t={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},n={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${i.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o}\uFF0C\u5B9E\u9645\u63A5\u6536 ${s}`}case"invalid_value":return i.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${z(i.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${o}${i.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${i.origin??"\u503C"} ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${o}${i.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${i.origin} ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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${t[o.format]??i.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${i.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${N(i.keys,", ")}`;case"invalid_key":return`${i.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${i.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function OB(){return{localeError:lD()}}var cD=()=>{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(i){return r[i]??null}let t={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},n={nan:"NaN"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${i.expected}\uFF0C\u4F46\u6536\u5230 ${s}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o}\uFF0C\u4F46\u6536\u5230 ${s}`}case"invalid_value":return i.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${z(i.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${o}${i.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${i.origin??"\u503C"} \u61C9\u70BA ${o}${i.maximum.toString()}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${o}${i.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${i.origin} \u61C9\u70BA ${o}${i.minimum.toString()}`}case"invalid_format":{let o=i;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 ${t[o.format]??i.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${i.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${i.keys.length>1?"\u5011":""}\uFF1A${N(i.keys,"\u3001")}`;case"invalid_key":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${i.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function VB(){return{localeError:cD()}}var uD=()=>{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(i){return r[i]??null}let t={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},n={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return i=>{switch(i.code){case"invalid_type":{let o=n[i.expected]??i.expected,a=j(i.input),s=n[a]??a;return/^[A-Z]/.test(i.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${i.expected}, \xE0m\u1ECD\u0300 a r\xED ${s}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${o}, \xE0m\u1ECD\u0300 a r\xED ${s}`}case"invalid_value":return i.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${z(i.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${N(i.values,"|")}`;case"too_big":{let o=i.inclusive?"<=":"<",a=e(i.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin??"iye"} ${a.verb} ${o}${i.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${i.maximum}`}case"too_small":{let o=i.inclusive?">=":">",a=e(i.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${i.origin} ${a.verb} ${o}${i.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${i.minimum}`}case"invalid_format":{let o=i;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: ${t[o.format]??i.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${i.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${N(i.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${i.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function zB(){return{localeError:uD()}}var UB,Q_=Symbol("ZodOutput"),X_=Symbol("ZodInput"),zy=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let 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 n={...this.get(t)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Uy(){return new zy}(UB=globalThis).__zod_globalRegistry??(UB.__zod_globalRegistry=Uy());var sr=globalThis.__zod_globalRegistry;function Y_(r,e){return new r({type:"string",...K(e)})}function eP(r,e){return new r({type:"string",coerce:!0,...K(e)})}function jy(r,e){return new r({type:"string",format:"email",check:"string_format",abort:!1,...K(e)})}function bf(r,e){return new r({type:"string",format:"guid",check:"string_format",abort:!1,...K(e)})}function Ly(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,...K(e)})}function Ky(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...K(e)})}function Wy(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...K(e)})}function Zy(r,e){return new r({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...K(e)})}function wf(r,e){return new r({type:"string",format:"url",check:"string_format",abort:!1,...K(e)})}function qy(r,e){return new r({type:"string",format:"emoji",check:"string_format",abort:!1,...K(e)})}function Gy(r,e){return new r({type:"string",format:"nanoid",check:"string_format",abort:!1,...K(e)})}function Hy(r,e){return new r({type:"string",format:"cuid",check:"string_format",abort:!1,...K(e)})}function Jy(r,e){return new r({type:"string",format:"cuid2",check:"string_format",abort:!1,...K(e)})}function Qy(r,e){return new r({type:"string",format:"ulid",check:"string_format",abort:!1,...K(e)})}function Xy(r,e){return new r({type:"string",format:"xid",check:"string_format",abort:!1,...K(e)})}function Yy(r,e){return new r({type:"string",format:"ksuid",check:"string_format",abort:!1,...K(e)})}function ex(r,e){return new r({type:"string",format:"ipv4",check:"string_format",abort:!1,...K(e)})}function tx(r,e){return new r({type:"string",format:"ipv6",check:"string_format",abort:!1,...K(e)})}function tP(r,e){return new r({type:"string",format:"mac",check:"string_format",abort:!1,...K(e)})}function rx(r,e){return new r({type:"string",format:"cidrv4",check:"string_format",abort:!1,...K(e)})}function ix(r,e){return new r({type:"string",format:"cidrv6",check:"string_format",abort:!1,...K(e)})}function nx(r,e){return new r({type:"string",format:"base64",check:"string_format",abort:!1,...K(e)})}function ox(r,e){return new r({type:"string",format:"base64url",check:"string_format",abort:!1,...K(e)})}function ax(r,e){return new r({type:"string",format:"e164",check:"string_format",abort:!1,...K(e)})}function sx(r,e){return new r({type:"string",format:"jwt",check:"string_format",abort:!1,...K(e)})}var rP={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function iP(r,e){return new r({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...K(e)})}function nP(r,e){return new r({type:"string",format:"date",check:"string_format",...K(e)})}function oP(r,e){return new r({type:"string",format:"time",check:"string_format",precision:null,...K(e)})}function aP(r,e){return new r({type:"string",format:"duration",check:"string_format",...K(e)})}function sP(r,e){return new r({type:"number",checks:[],...K(e)})}function lP(r,e){return new r({type:"number",coerce:!0,checks:[],...K(e)})}function cP(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"safeint",...K(e)})}function uP(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float32",...K(e)})}function dP(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"float64",...K(e)})}function pP(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"int32",...K(e)})}function hP(r,e){return new r({type:"number",check:"number_format",abort:!1,format:"uint32",...K(e)})}function fP(r,e){return new r({type:"boolean",...K(e)})}function mP(r,e){return new r({type:"boolean",coerce:!0,...K(e)})}function gP(r,e){return new r({type:"bigint",...K(e)})}function vP(r,e){return new r({type:"bigint",coerce:!0,...K(e)})}function yP(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...K(e)})}function xP(r,e){return new r({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...K(e)})}function bP(r,e){return new r({type:"symbol",...K(e)})}function wP(r,e){return new r({type:"undefined",...K(e)})}function AP(r,e){return new r({type:"null",...K(e)})}function _P(r){return new r({type:"any"})}function PP(r){return new r({type:"unknown"})}function SP(r,e){return new r({type:"never",...K(e)})}function EP(r,e){return new r({type:"void",...K(e)})}function FP(r,e){return new r({type:"date",...K(e)})}function BP(r,e){return new r({type:"date",coerce:!0,...K(e)})}function IP(r,e){return new r({type:"nan",...K(e)})}function no(r,e){return new Ey({check:"less_than",...K(e),value:r,inclusive:!1})}function gi(r,e){return new Ey({check:"less_than",...K(e),value:r,inclusive:!0})}function oo(r,e){return new Fy({check:"greater_than",...K(e),value:r,inclusive:!1})}function Ir(r,e){return new Fy({check:"greater_than",...K(e),value:r,inclusive:!0})}function lx(r){return oo(0,r)}function cx(r){return no(0,r)}function ux(r){return gi(0,r)}function dx(r){return Ir(0,r)}function Ga(r,e){return new AA({check:"multiple_of",...K(e),value:r})}function Ha(r,e){return new SA({check:"max_size",...K(e),maximum:r})}function ao(r,e){return new EA({check:"min_size",...K(e),minimum:r})}function Bl(r,e){return new FA({check:"size_equals",...K(e),size:r})}function Il(r,e){return new BA({check:"max_length",...K(e),maximum:r})}function Lo(r,e){return new IA({check:"min_length",...K(e),minimum:r})}function kl(r,e){return new kA({check:"length_equals",...K(e),length:r})}function id(r,e){return new NA({check:"string_format",format:"regex",...K(e),pattern:r})}function nd(r){return new $A({check:"string_format",format:"lowercase",...K(r)})}function od(r){return new DA({check:"string_format",format:"uppercase",...K(r)})}function ad(r,e){return new MA({check:"string_format",format:"includes",...K(e),includes:r})}function sd(r,e){return new TA({check:"string_format",format:"starts_with",...K(e),prefix:r})}function ld(r,e){return new CA({check:"string_format",format:"ends_with",...K(e),suffix:r})}function px(r,e,t){return new RA({check:"property",property:r,schema:e,...K(t)})}function cd(r,e){return new OA({check:"mime_type",mime:r,...K(e)})}function An(r){return new VA({check:"overwrite",tx:r})}function ud(r){return An(e=>e.normalize(r))}function dd(){return An(r=>r.trim())}function pd(){return An(r=>r.toLowerCase())}function hd(){return An(r=>r.toUpperCase())}function fd(){return An(r=>R0(r))}function kP(r,e,t){return new r({type:"array",element:e,...K(t)})}function pD(r,e,t){return new r({type:"union",options:e,...K(t)})}function hD(r,e,t){return new r({type:"union",options:e,inclusive:!1,...K(t)})}function fD(r,e,t,n){return new r({type:"union",options:t,discriminator:e,...K(n)})}function mD(r,e,t){return new r({type:"intersection",left:e,right:t})}function gD(r,e,t,n){let i=t instanceof Ae,o=i?n:t,a=i?t:null;return new r({type:"tuple",items:e,rest:a,...K(o)})}function vD(r,e,t,n){return new r({type:"record",keyType:e,valueType:t,...K(n)})}function yD(r,e,t,n){return new r({type:"map",keyType:e,valueType:t,...K(n)})}function xD(r,e,t){return new r({type:"set",valueType:e,...K(t)})}function bD(r,e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new r({type:"enum",entries:n,...K(t)})}function wD(r,e,t){return new r({type:"enum",entries:e,...K(t)})}function AD(r,e,t){return new r({type:"literal",values:Array.isArray(e)?e:[e],...K(t)})}function NP(r,e){return new r({type:"file",...K(e)})}function _D(r,e){return new r({type:"transform",transform:e})}function PD(r,e){return new r({type:"optional",innerType:e})}function SD(r,e){return new r({type:"nullable",innerType:e})}function ED(r,e,t){return new r({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():V0(t)}})}function FD(r,e,t){return new r({type:"nonoptional",innerType:e,...K(t)})}function BD(r,e){return new r({type:"success",innerType:e})}function ID(r,e,t){return new r({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function kD(r,e,t){return new r({type:"pipe",in:e,out:t})}function ND(r,e){return new r({type:"readonly",innerType:e})}function $D(r,e,t){return new r({type:"template_literal",parts:e,...K(t)})}function DD(r,e){return new r({type:"lazy",getter:e})}function MD(r,e){return new r({type:"promise",innerType:e})}function $P(r,e,t){let n=K(t);return n.abort??(n.abort=!0),new r({type:"custom",check:"custom",fn:e,...n})}function DP(r,e,t){return new r({type:"custom",check:"custom",fn:e,...K(t)})}function MP(r){let e=jB(t=>(t.addIssue=n=>{if(typeof n=="string")t.issues.push(Ju(n,t.value,e._zod.def));else{let i=n;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=e),i.continue??(i.continue=!e._zod.def.abort),t.issues.push(Ju(i))}},r(t.value,t)));return e}function jB(r,e){let t=new it({check:"custom",...K(e)});return t._zod.check=r,t}function TP(r){let e=new it({check:"describe"});return e._zod.onattach=[t=>{let n=sr.get(t)??{};sr.add(t,{...n,description:r})}],e._zod.check=()=>{},e}function CP(r){let e=new it({check:"meta"});return e._zod.onattach=[t=>{let n=sr.get(t)??{};sr.add(t,{...n,...r})}],e._zod.check=()=>{},e}function RP(r,e){let t=K(e),n=t.truthy??["true","1","yes","on","y","enabled"],i=t.falsy??["false","0","no","off","n","disabled"];t.case!=="sensitive"&&(n=n.map(g=>typeof g=="string"?g.toLowerCase():g),i=i.map(g=>typeof g=="string"?g.toLowerCase():g));let o=new Set(n),a=new Set(i),s=r.Codec??vf,l=r.Boolean??mf,u=r.String??Fl,d=new u({type:"string",error:t.error}),p=new l({type:"boolean",error:t.error}),h=new s({type:"pipe",in:d,out:p,transform:(g,v)=>{let y=g;return t.case!=="sensitive"&&(y=y.toLowerCase()),o.has(y)?!0:a.has(y)?!1:(v.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:v.value,inst:h,continue:!1}),{})},reverseTransform:(g,v)=>g===!0?n[0]||"true":i[0]||"false",error:t.error});return h}function md(r,e,t,n={}){let i=K(n),o={...K(n),check:"string_format",type:"string",format:e,fn:typeof t=="function"?t:s=>t.test(s),...i};return t instanceof RegExp&&(o.pattern=t),new r(o)}function Ja(r){let e=r?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:r.processors??{},metadataRegistry:r?.metadata??sr,target:e,unrepresentable:r?.unrepresentable??"throw",override:r?.override??(()=>{}),io:r?.io??"output",counter:0,seen:new Map,cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0}}function Je(r,e,t={path:[],schemaPath:[]}){var n;let i=r._zod.def,o=e.seen.get(r);if(o)return o.count++,t.schemaPath.includes(r)&&(o.cycle=t.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:t.path};e.seen.set(r,a);let s=r._zod.toJSONSchema?.();if(s)a.schema=s;else{let d={...t,schemaPath:[...t.schemaPath,r],path:t.path};if(r._zod.processJSONSchema)r._zod.processJSONSchema(e,a.schema,d);else{let h=a.schema,g=e.processors[i.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);g(r,e,h,d)}let p=r._zod.parent;p&&(a.ref||(a.ref=p),Je(p,e,d),e.seen.get(p).isParent=!0)}let l=e.metadataRegistry.get(r);return l&&Object.assign(a.schema,l),e.io==="input"&&kr(r)&&(delete a.schema.examples,delete a.schema.default),e.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,e.seen.get(r).schema}function Qa(r,e){let t=r.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let a of r.seen.entries()){let s=r.metadataRegistry.get(a[0])?.id;if(s){let l=n.get(s);if(l&&l!==a[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(s,a[0])}}let i=a=>{let s=r.target==="draft-2020-12"?"$defs":"definitions";if(r.external){let p=r.external.registry.get(a[0])?.id,h=r.external.uri??(v=>v);if(p)return{ref:h(p)};let g=a[1].defId??a[1].schema.id??`schema${r.counter++}`;return a[1].defId=g,{defId:g,ref:`${h("__shared")}#/${s}/${g}`}}if(a[1]===t)return{ref:"#"};let u=`#/${s}/`,d=a[1].schema.id??`__schema${r.counter++}`;return{defId:d,ref:u+d}},o=a=>{if(a[1].schema.$ref)return;let s=a[1],{ref:l,defId:u}=i(a);s.def={...s.schema},u&&(s.defId=u);let d=s.schema;for(let p in d)delete d[p];d.$ref=l};if(r.cycles==="throw")for(let a of r.seen.entries()){let s=a[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
24
41
 
25
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of r.seen.entries()){let s=n[1];if(e===n[0]){i(n);continue}if(r.external){let l=r.external.registry.get(n[0])?.id;if(e!==n[0]&&l){i(n);continue}}if(r.metadataRegistry.get(n[0])?.id){i(n);continue}if(s.cycle){i(n);continue}if(s.count>1&&r.reused==="ref"){i(n);continue}}}function Zs(r,e){let t=r.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let a=r.seen.get(s),l=a.def??a.schema,u={...l};if(a.ref===null)return;let d=a.ref;if(a.ref=null,d){o(d);let p=r.seen.get(d).schema;p.$ref&&(r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(p)):(Object.assign(l,p),Object.assign(l,u))}a.isParent||r.override({zodSchema:s,jsonSchema:l,path:a.path??[]})};for(let s of[...r.seen.entries()].reverse())o(s[0]);let i={};if(r.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":r.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":r.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":r.target,r.external?.uri){let s=r.external.registry.get(e)?.id;if(!s)throw new Error("Schema is missing an `id` property");i.$id=r.external.uri(s)}Object.assign(i,t.def??t.schema);let n=r.external?.defs??{};for(let s of r.seen.entries()){let a=s[1];a.def&&a.defId&&(n[a.defId]=a.def)}r.external||Object.keys(n).length>0&&(r.target==="draft-2020-12"?i.$defs=n:i.definitions=n);try{let s=JSON.parse(JSON.stringify(i));return Object.defineProperty(s,"~standard",{value:{...e["~standard"],jsonSchema:{input:ad(e,"input"),output:ad(e,"output")}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function Sr(r,e){let t=e??{seen:new Set};if(t.seen.has(r))return!1;t.seen.add(r);let o=r._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Sr(o.element,t);if(o.type==="set")return Sr(o.valueType,t);if(o.type==="lazy")return Sr(o.getter(),t);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Sr(o.innerType,t);if(o.type==="intersection")return Sr(o.left,t)||Sr(o.right,t);if(o.type==="record"||o.type==="map")return Sr(o.keyType,t)||Sr(o.valueType,t);if(o.type==="pipe")return Sr(o.in,t)||Sr(o.out,t);if(o.type==="object"){for(let i in o.shape)if(Sr(o.shape[i],t))return!0;return!1}if(o.type==="union"){for(let i of o.options)if(Sr(i,t))return!0;return!1}if(o.type==="tuple"){for(let i of o.items)if(Sr(i,t))return!0;return!!(o.rest&&Sr(o.rest,t))}return!1}var wP=(r,e={})=>t=>{let o=Ks({...t,processors:e});return Ze(r,o),Ws(o,r),Zs(o,r)},ad=(r,e)=>t=>{let{libraryOptions:o,target:i}=t??{},n=Ks({...o??{},target:i,io:e,processors:{}});return Ze(r,n),Ws(n,r),Zs(n,r)};var hD={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},AP=(r,e,t,o)=>{let i=t;i.type="string";let{minimum:n,maximum:s,format:a,patterns:l,contentEncoding:u}=r._zod.bag;if(typeof n=="number"&&(i.minLength=n),typeof s=="number"&&(i.maxLength=s),a&&(i.format=hD[a]??a,i.format===""&&delete i.format),u&&(i.contentEncoding=u),l&&l.size>0){let d=[...l];d.length===1?i.pattern=d[0].source:d.length>1&&(i.allOf=[...d.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},_P=(r,e,t,o)=>{let i=t,{minimum:n,maximum:s,format:a,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=r._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number",typeof d=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.minimum=d,i.exclusiveMinimum=!0):i.exclusiveMinimum=d),typeof n=="number"&&(i.minimum=n,typeof d=="number"&&e.target!=="draft-04"&&(d>=n?delete i.minimum:delete i.exclusiveMinimum)),typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),typeof s=="number"&&(i.maximum=s,typeof u=="number"&&e.target!=="draft-04"&&(u<=s?delete i.maximum:delete i.exclusiveMaximum)),typeof l=="number"&&(i.multipleOf=l)},PP=(r,e,t,o)=>{t.type="boolean"},SP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},EP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},BP=(r,e,t,o)=>{e.target==="openapi-3.0"?(t.type="string",t.nullable=!0,t.enum=[null]):t.type="null"},FP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},NP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},IP=(r,e,t,o)=>{t.not={}},kP=(r,e,t,o)=>{},$P=(r,e,t,o)=>{},DP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},MP=(r,e,t,o)=>{let i=r._zod.def,n=Wh(i.entries);n.every(s=>typeof s=="number")&&(t.type="number"),n.every(s=>typeof s=="string")&&(t.type="string"),t.enum=n},CP=(r,e,t,o)=>{let i=r._zod.def,n=[];for(let s of i.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");n.push(Number(s))}else n.push(s);if(n.length!==0)if(n.length===1){let s=n[0];t.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?t.enum=[s]:t.const=s}else n.every(s=>typeof s=="number")&&(t.type="number"),n.every(s=>typeof s=="string")&&(t.type="string"),n.every(s=>typeof s=="boolean")&&(t.type="boolean"),n.every(s=>s===null)&&(t.type="null"),t.enum=n},TP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},RP=(r,e,t,o)=>{let i=t,n=r._zod.pattern;if(!n)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=n.source},OP=(r,e,t,o)=>{let i=t,n={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:l}=r._zod.bag;s!==void 0&&(n.minLength=s),a!==void 0&&(n.maxLength=a),l?l.length===1?(n.contentMediaType=l[0],Object.assign(i,n)):i.anyOf=l.map(u=>({...n,contentMediaType:u})):Object.assign(i,n)},VP=(r,e,t,o)=>{t.type="boolean"},zP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},UP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},jP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},LP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},KP=(r,e,t,o)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},WP=(r,e,t,o)=>{let i=t,n=r._zod.def,{minimum:s,maximum:a}=r._zod.bag;typeof s=="number"&&(i.minItems=s),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=Ze(n.element,e,{...o,path:[...o.path,"items"]})},ZP=(r,e,t,o)=>{let i=t,n=r._zod.def;i.type="object",i.properties={};let s=n.shape;for(let u in s)i.properties[u]=Ze(s[u],e,{...o,path:[...o.path,"properties",u]});let a=new Set(Object.keys(s)),l=new Set([...a].filter(u=>{let d=n.shape[u]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(i.required=Array.from(l)),n.catchall?._zod.def.type==="never"?i.additionalProperties=!1:n.catchall?n.catchall&&(i.additionalProperties=Ze(n.catchall,e,{...o,path:[...o.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},Yy=(r,e,t,o)=>{let i=r._zod.def,n=i.inclusive===!1,s=i.options.map((a,l)=>Ze(a,e,{...o,path:[...o.path,n?"oneOf":"anyOf",l]}));n?t.oneOf=s:t.anyOf=s},GP=(r,e,t,o)=>{let i=r._zod.def,n=Ze(i.left,e,{...o,path:[...o.path,"allOf",0]}),s=Ze(i.right,e,{...o,path:[...o.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(n)?n.allOf:[n],...a(s)?s.allOf:[s]];t.allOf=l},qP=(r,e,t,o)=>{let i=t,n=r._zod.def;i.type="array";let s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",l=n.items.map((h,g)=>Ze(h,e,{...o,path:[...o.path,s,g]})),u=n.rest?Ze(n.rest,e,{...o,path:[...o.path,a,...e.target==="openapi-3.0"?[n.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=l,u&&(i.items=u)):e.target==="openapi-3.0"?(i.items={anyOf:l},u&&i.items.anyOf.push(u),i.minItems=l.length,u||(i.maxItems=l.length)):(i.items=l,u&&(i.additionalItems=u));let{minimum:d,maximum:p}=r._zod.bag;typeof d=="number"&&(i.minItems=d),typeof p=="number"&&(i.maxItems=p)},HP=(r,e,t,o)=>{let i=t,n=r._zod.def;i.type="object",(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Ze(n.keyType,e,{...o,path:[...o.path,"propertyNames"]})),i.additionalProperties=Ze(n.valueType,e,{...o,path:[...o.path,"additionalProperties"]})},JP=(r,e,t,o)=>{let i=r._zod.def,n=Ze(i.innerType,e,o),s=e.seen.get(r);e.target==="openapi-3.0"?(s.ref=i.innerType,t.nullable=!0):t.anyOf=[n,{type:"null"}]},QP=(r,e,t,o)=>{let i=r._zod.def;Ze(i.innerType,e,o);let n=e.seen.get(r);n.ref=i.innerType},XP=(r,e,t,o)=>{let i=r._zod.def;Ze(i.innerType,e,o);let n=e.seen.get(r);n.ref=i.innerType,t.default=JSON.parse(JSON.stringify(i.defaultValue))},YP=(r,e,t,o)=>{let i=r._zod.def;Ze(i.innerType,e,o);let n=e.seen.get(r);n.ref=i.innerType,e.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},e1=(r,e,t,o)=>{let i=r._zod.def;Ze(i.innerType,e,o);let n=e.seen.get(r);n.ref=i.innerType;let s;try{s=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=s},t1=(r,e,t,o)=>{let i=r._zod.def,n=e.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Ze(n,e,o);let s=e.seen.get(r);s.ref=n},r1=(r,e,t,o)=>{let i=r._zod.def;Ze(i.innerType,e,o);let n=e.seen.get(r);n.ref=i.innerType,t.readOnly=!0},i1=(r,e,t,o)=>{let i=r._zod.def;Ze(i.innerType,e,o);let n=e.seen.get(r);n.ref=i.innerType},o1=(r,e,t,o)=>{let i=r._zod.def;Ze(i.innerType,e,o);let n=e.seen.get(r);n.ref=i.innerType},n1=(r,e,t,o)=>{let i=r._zod.innerType;Ze(i,e,o);let n=e.seen.get(r);n.ref=i},Xy={string:AP,number:_P,boolean:PP,bigint:SP,symbol:EP,null:BP,undefined:FP,void:NP,never:IP,any:kP,unknown:$P,date:DP,enum:MP,literal:CP,nan:TP,template_literal:RP,file:OP,success:VP,custom:zP,function:UP,transform:jP,map:LP,set:KP,array:WP,object:ZP,union:Yy,intersection:GP,tuple:qP,record:HP,nullable:JP,nonoptional:QP,default:XP,prefault:YP,catch:e1,pipe:t1,readonly:r1,promise:i1,optional:o1,lazy:n1};function ex(r,e){if("_idmap"in r){let o=r,i=Ks({...e,processors:Xy}),n={};for(let l of o._idmap.entries()){let[u,d]=l;Ze(d,i)}let s={},a={registry:o,uri:e?.uri,defs:n};i.external=a;for(let l of o._idmap.entries()){let[u,d]=l;Ws(i,d),s[u]=Zs(i,d)}if(Object.keys(n).length>0){let l=i.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:n}}return{schemas:s}}let t=Ks({...e,processors:Xy});return Ze(r,t),Ws(t,r),Zs(t,r)}var tx=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),this.ctx=Ks({processors:Xy,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return Ze(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),Ws(this.ctx,e);let o=Zs(this.ctx,e),{"~standard":i,...n}=o;return n}};var BF={};var df={};tn(df,{ZodAny:()=>N1,ZodArray:()=>D1,ZodBase64:()=>Ax,ZodBase64URL:()=>_x,ZodBigInt:()=>fd,ZodBigIntFormat:()=>Ex,ZodBoolean:()=>hd,ZodCIDRv4:()=>bx,ZodCIDRv6:()=>wx,ZodCUID:()=>hx,ZodCUID2:()=>fx,ZodCatch:()=>Y1,ZodCodec:()=>Mx,ZodCustom:()=>Af,ZodCustomStringFormat:()=>dd,ZodDate:()=>vf,ZodDefault:()=>G1,ZodDiscriminatedUnion:()=>C1,ZodE164:()=>Px,ZodEmail:()=>cx,ZodEmoji:()=>dx,ZodEnum:()=>ud,ZodFile:()=>K1,ZodFunction:()=>lS,ZodGUID:()=>pf,ZodIPv4:()=>yx,ZodIPv6:()=>xx,ZodIntersection:()=>T1,ZodJWT:()=>Sx,ZodKSUID:()=>vx,ZodLazy:()=>nS,ZodLiteral:()=>L1,ZodMAC:()=>A1,ZodMap:()=>U1,ZodNaN:()=>tS,ZodNanoID:()=>px,ZodNever:()=>k1,ZodNonOptional:()=>$x,ZodNull:()=>B1,ZodNullable:()=>Z1,ZodNumber:()=>pd,ZodNumberFormat:()=>_l,ZodObject:()=>xf,ZodOptional:()=>kx,ZodPipe:()=>Dx,ZodPrefault:()=>H1,ZodPromise:()=>aS,ZodReadonly:()=>rS,ZodRecord:()=>wf,ZodSet:()=>j1,ZodString:()=>cd,ZodStringFormat:()=>Je,ZodSuccess:()=>X1,ZodSymbol:()=>S1,ZodTemplateLiteral:()=>oS,ZodTransform:()=>W1,ZodTuple:()=>O1,ZodType:()=>Pe,ZodULID:()=>mx,ZodURL:()=>gf,ZodUUID:()=>Xo,ZodUndefined:()=>E1,ZodUnion:()=>bf,ZodUnknown:()=>I1,ZodVoid:()=>$1,ZodXID:()=>gx,ZodXor:()=>M1,_ZodString:()=>ux,_default:()=>q1,_function:()=>MN,any:()=>pN,array:()=>yf,base64:()=>HF,base64url:()=>JF,bigint:()=>aN,boolean:()=>P1,catch:()=>eS,check:()=>CN,cidrv4:()=>GF,cidrv6:()=>qF,codec:()=>kN,cuid:()=>VF,cuid2:()=>zF,custom:()=>TN,date:()=>fN,describe:()=>RN,discriminatedUnion:()=>bN,e164:()=>QF,email:()=>NF,emoji:()=>RF,enum:()=>Nx,file:()=>BN,float32:()=>iN,float64:()=>oN,function:()=>MN,guid:()=>IF,hash:()=>rN,hex:()=>tN,hostname:()=>eN,httpUrl:()=>TF,instanceof:()=>VN,int:()=>lx,int32:()=>nN,int64:()=>lN,intersection:()=>R1,ipv4:()=>KF,ipv6:()=>ZF,json:()=>UN,jwt:()=>XF,keyof:()=>mN,ksuid:()=>LF,lazy:()=>sS,literal:()=>EN,looseObject:()=>yN,looseRecord:()=>AN,mac:()=>WF,map:()=>_N,meta:()=>ON,nan:()=>IN,nanoid:()=>OF,nativeEnum:()=>SN,never:()=>Bx,nonoptional:()=>Q1,null:()=>F1,nullable:()=>ff,nullish:()=>FN,number:()=>_1,object:()=>gN,optional:()=>hf,partialRecord:()=>wN,pipe:()=>mf,prefault:()=>J1,preprocess:()=>jN,promise:()=>DN,readonly:()=>iS,record:()=>z1,refine:()=>uS,set:()=>PN,strictObject:()=>vN,string:()=>ax,stringFormat:()=>YF,stringbool:()=>zN,success:()=>NN,superRefine:()=>cS,symbol:()=>cN,templateLiteral:()=>$N,transform:()=>Ix,tuple:()=>V1,uint32:()=>sN,uint64:()=>uN,ulid:()=>UF,undefined:()=>dN,union:()=>Fx,unknown:()=>Al,url:()=>CF,uuid:()=>kF,uuidv4:()=>$F,uuidv6:()=>DF,uuidv7:()=>MF,void:()=>hN,xid:()=>jF,xor:()=>xN});var rx={};tn(rx,{endsWith:()=>Yc,gt:()=>Qo,gte:()=>Pr,includes:()=>Qc,length:()=>wl,lowercase:()=>Hc,lt:()=>Jo,lte:()=>li,maxLength:()=>bl,maxSize:()=>xl,mime:()=>ed,minLength:()=>Dn,minSize:()=>Ls,multipleOf:()=>js,negative:()=>qy,nonnegative:()=>Jy,nonpositive:()=>Hy,normalize:()=>td,overwrite:()=>fo,positive:()=>Gy,property:()=>Qy,regex:()=>qc,size:()=>Gc,slugify:()=>nd,startsWith:()=>Xc,toLowerCase:()=>id,toUpperCase:()=>od,trim:()=>rd,uppercase:()=>Jc});var ld={};tn(ld,{ZodISODate:()=>ox,ZodISODateTime:()=>ix,ZodISODuration:()=>sx,ZodISOTime:()=>nx,date:()=>a1,datetime:()=>s1,duration:()=>u1,time:()=>l1});var ix=w("ZodISODateTime",(r,e)=>{TA.init(r,e),Je.init(r,e)});function s1(r){return z_(ix,r)}var ox=w("ZodISODate",(r,e)=>{RA.init(r,e),Je.init(r,e)});function a1(r){return U_(ox,r)}var nx=w("ZodISOTime",(r,e)=>{OA.init(r,e),Je.init(r,e)});function l1(r){return j_(nx,r)}var sx=w("ZodISODuration",(r,e)=>{VA.init(r,e),Je.init(r,e)});function u1(r){return L_(sx,r)}var FF=(r,e)=>{Jh.init(r,e),r.name="ZodError",Object.defineProperties(r,{format:{value:t=>Xh(r,t)},flatten:{value:t=>Qh(r,t)},addIssue:{value:t=>{r.issues.push(t),r.message=JSON.stringify(r.issues,Vc,2)}},addIssues:{value:t=>{r.issues.push(...t),r.message=JSON.stringify(r.issues,Vc,2)}},isEmpty:{get(){return r.issues.length===0}}})},mD=w("ZodError",FF),Ur=w("ZodError",FF,{Parent:Error});var c1=jc(Ur),d1=Lc(Ur),p1=Kc(Ur),h1=Wc(Ur),f1=iy(Ur),m1=oy(Ur),g1=ny(Ur),v1=sy(Ur),y1=ay(Ur),x1=ly(Ur),b1=uy(Ur),w1=cy(Ur);var Pe=w("ZodType",(r,e)=>(ve.init(r,e),Object.assign(r["~standard"],{jsonSchema:{input:ad(r,"input"),output:ad(r,"output")}}),r.toJSONSchema=wP(r,{}),r.def=e,r.type=e.type,Object.defineProperty(r,"_def",{value:e}),r.check=(...t)=>r.clone(U.mergeDefs(e,{checks:[...e.checks??[],...t.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]})),r.clone=(t,o)=>Ar(r,t,o),r.brand=()=>r,r.register=(t,o)=>(t.add(r,o),r),r.parse=(t,o)=>c1(r,t,o,{callee:r.parse}),r.safeParse=(t,o)=>p1(r,t,o),r.parseAsync=async(t,o)=>d1(r,t,o,{callee:r.parseAsync}),r.safeParseAsync=async(t,o)=>h1(r,t,o),r.spa=r.safeParseAsync,r.encode=(t,o)=>f1(r,t,o),r.decode=(t,o)=>m1(r,t,o),r.encodeAsync=async(t,o)=>g1(r,t,o),r.decodeAsync=async(t,o)=>v1(r,t,o),r.safeEncode=(t,o)=>y1(r,t,o),r.safeDecode=(t,o)=>x1(r,t,o),r.safeEncodeAsync=async(t,o)=>b1(r,t,o),r.safeDecodeAsync=async(t,o)=>w1(r,t,o),r.refine=(t,o)=>r.check(uS(t,o)),r.superRefine=t=>r.check(cS(t)),r.overwrite=t=>r.check(fo(t)),r.optional=()=>hf(r),r.nullable=()=>ff(r),r.nullish=()=>hf(ff(r)),r.nonoptional=t=>Q1(r,t),r.array=()=>yf(r),r.or=t=>Fx([r,t]),r.and=t=>R1(r,t),r.transform=t=>mf(r,Ix(t)),r.default=t=>q1(r,t),r.prefault=t=>J1(r,t),r.catch=t=>eS(r,t),r.pipe=t=>mf(r,t),r.readonly=()=>iS(r),r.describe=t=>{let o=r.clone();return _r.add(o,{description:t}),o},Object.defineProperty(r,"description",{get(){return _r.get(r)?.description},configurable:!0}),r.meta=(...t)=>{if(t.length===0)return _r.get(r);let o=r.clone();return _r.add(o,t[0]),o},r.isOptional=()=>r.safeParse(void 0).success,r.isNullable=()=>r.safeParse(null).success,r)),ux=w("_ZodString",(r,e)=>{yl.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(o,i,n)=>AP(r,o,i,n);let t=r._zod.bag;r.format=t.format??null,r.minLength=t.minimum??null,r.maxLength=t.maximum??null,r.regex=(...o)=>r.check(qc(...o)),r.includes=(...o)=>r.check(Qc(...o)),r.startsWith=(...o)=>r.check(Xc(...o)),r.endsWith=(...o)=>r.check(Yc(...o)),r.min=(...o)=>r.check(Dn(...o)),r.max=(...o)=>r.check(bl(...o)),r.length=(...o)=>r.check(wl(...o)),r.nonempty=(...o)=>r.check(Dn(1,...o)),r.lowercase=o=>r.check(Hc(o)),r.uppercase=o=>r.check(Jc(o)),r.trim=()=>r.check(rd()),r.normalize=(...o)=>r.check(td(...o)),r.toLowerCase=()=>r.check(id()),r.toUpperCase=()=>r.check(od()),r.slugify=()=>r.check(nd())}),cd=w("ZodString",(r,e)=>{yl.init(r,e),ux.init(r,e),r.email=t=>r.check(By(cx,t)),r.url=t=>r.check(cf(gf,t)),r.jwt=t=>r.check(Zy(Sx,t)),r.emoji=t=>r.check($y(dx,t)),r.guid=t=>r.check(uf(pf,t)),r.uuid=t=>r.check(Fy(Xo,t)),r.uuidv4=t=>r.check(Ny(Xo,t)),r.uuidv6=t=>r.check(Iy(Xo,t)),r.uuidv7=t=>r.check(ky(Xo,t)),r.nanoid=t=>r.check(Dy(px,t)),r.guid=t=>r.check(uf(pf,t)),r.cuid=t=>r.check(My(hx,t)),r.cuid2=t=>r.check(Cy(fx,t)),r.ulid=t=>r.check(Ty(mx,t)),r.base64=t=>r.check(Ly(Ax,t)),r.base64url=t=>r.check(Ky(_x,t)),r.xid=t=>r.check(Ry(gx,t)),r.ksuid=t=>r.check(Oy(vx,t)),r.ipv4=t=>r.check(Vy(yx,t)),r.ipv6=t=>r.check(zy(xx,t)),r.cidrv4=t=>r.check(Uy(bx,t)),r.cidrv6=t=>r.check(jy(wx,t)),r.e164=t=>r.check(Wy(Px,t)),r.datetime=t=>r.check(s1(t)),r.date=t=>r.check(a1(t)),r.time=t=>r.check(l1(t)),r.duration=t=>r.check(u1(t))});function ax(r){return T_(cd,r)}var Je=w("ZodStringFormat",(r,e)=>{He.init(r,e),ux.init(r,e)}),cx=w("ZodEmail",(r,e)=>{BA.init(r,e),Je.init(r,e)});function NF(r){return By(cx,r)}var pf=w("ZodGUID",(r,e)=>{SA.init(r,e),Je.init(r,e)});function IF(r){return uf(pf,r)}var Xo=w("ZodUUID",(r,e)=>{EA.init(r,e),Je.init(r,e)});function kF(r){return Fy(Xo,r)}function $F(r){return Ny(Xo,r)}function DF(r){return Iy(Xo,r)}function MF(r){return ky(Xo,r)}var gf=w("ZodURL",(r,e)=>{FA.init(r,e),Je.init(r,e)});function CF(r){return cf(gf,r)}function TF(r){return cf(gf,{protocol:/^https?$/,hostname:Vi.domain,...U.normalizeParams(r)})}var dx=w("ZodEmoji",(r,e)=>{NA.init(r,e),Je.init(r,e)});function RF(r){return $y(dx,r)}var px=w("ZodNanoID",(r,e)=>{IA.init(r,e),Je.init(r,e)});function OF(r){return Dy(px,r)}var hx=w("ZodCUID",(r,e)=>{kA.init(r,e),Je.init(r,e)});function VF(r){return My(hx,r)}var fx=w("ZodCUID2",(r,e)=>{$A.init(r,e),Je.init(r,e)});function zF(r){return Cy(fx,r)}var mx=w("ZodULID",(r,e)=>{DA.init(r,e),Je.init(r,e)});function UF(r){return Ty(mx,r)}var gx=w("ZodXID",(r,e)=>{MA.init(r,e),Je.init(r,e)});function jF(r){return Ry(gx,r)}var vx=w("ZodKSUID",(r,e)=>{CA.init(r,e),Je.init(r,e)});function LF(r){return Oy(vx,r)}var yx=w("ZodIPv4",(r,e)=>{zA.init(r,e),Je.init(r,e)});function KF(r){return Vy(yx,r)}var A1=w("ZodMAC",(r,e)=>{jA.init(r,e),Je.init(r,e)});function WF(r){return O_(A1,r)}var xx=w("ZodIPv6",(r,e)=>{UA.init(r,e),Je.init(r,e)});function ZF(r){return zy(xx,r)}var bx=w("ZodCIDRv4",(r,e)=>{LA.init(r,e),Je.init(r,e)});function GF(r){return Uy(bx,r)}var wx=w("ZodCIDRv6",(r,e)=>{KA.init(r,e),Je.init(r,e)});function qF(r){return jy(wx,r)}var Ax=w("ZodBase64",(r,e)=>{ZA.init(r,e),Je.init(r,e)});function HF(r){return Ly(Ax,r)}var _x=w("ZodBase64URL",(r,e)=>{GA.init(r,e),Je.init(r,e)});function JF(r){return Ky(_x,r)}var Px=w("ZodE164",(r,e)=>{qA.init(r,e),Je.init(r,e)});function QF(r){return Wy(Px,r)}var Sx=w("ZodJWT",(r,e)=>{HA.init(r,e),Je.init(r,e)});function XF(r){return Zy(Sx,r)}var dd=w("ZodCustomStringFormat",(r,e)=>{JA.init(r,e),Je.init(r,e)});function YF(r,e,t={}){return sd(dd,r,e,t)}function eN(r){return sd(dd,"hostname",Vi.hostname,r)}function tN(r){return sd(dd,"hex",Vi.hex,r)}function rN(r,e){let t=e?.enc??"hex",o=`${r}_${t}`,i=Vi[o];if(!i)throw new Error(`Unrecognized hash format: ${o}`);return sd(dd,o,i,e)}var pd=w("ZodNumber",(r,e)=>{xy.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(o,i,n)=>_P(r,o,i,n),r.gt=(o,i)=>r.check(Qo(o,i)),r.gte=(o,i)=>r.check(Pr(o,i)),r.min=(o,i)=>r.check(Pr(o,i)),r.lt=(o,i)=>r.check(Jo(o,i)),r.lte=(o,i)=>r.check(li(o,i)),r.max=(o,i)=>r.check(li(o,i)),r.int=o=>r.check(lx(o)),r.safe=o=>r.check(lx(o)),r.positive=o=>r.check(Qo(0,o)),r.nonnegative=o=>r.check(Pr(0,o)),r.negative=o=>r.check(Jo(0,o)),r.nonpositive=o=>r.check(li(0,o)),r.multipleOf=(o,i)=>r.check(js(o,i)),r.step=(o,i)=>r.check(js(o,i)),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 _1(r){return K_(pd,r)}var _l=w("ZodNumberFormat",(r,e)=>{QA.init(r,e),pd.init(r,e)});function lx(r){return Z_(_l,r)}function iN(r){return G_(_l,r)}function oN(r){return q_(_l,r)}function nN(r){return H_(_l,r)}function sN(r){return J_(_l,r)}var hd=w("ZodBoolean",(r,e)=>{rf.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>PP(r,t,o,i)});function P1(r){return Q_(hd,r)}var fd=w("ZodBigInt",(r,e)=>{by.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(o,i,n)=>SP(r,o,i,n),r.gte=(o,i)=>r.check(Pr(o,i)),r.min=(o,i)=>r.check(Pr(o,i)),r.gt=(o,i)=>r.check(Qo(o,i)),r.gte=(o,i)=>r.check(Pr(o,i)),r.min=(o,i)=>r.check(Pr(o,i)),r.lt=(o,i)=>r.check(Jo(o,i)),r.lte=(o,i)=>r.check(li(o,i)),r.max=(o,i)=>r.check(li(o,i)),r.positive=o=>r.check(Qo(BigInt(0),o)),r.negative=o=>r.check(Jo(BigInt(0),o)),r.nonpositive=o=>r.check(li(BigInt(0),o)),r.nonnegative=o=>r.check(Pr(BigInt(0),o)),r.multipleOf=(o,i)=>r.check(js(o,i));let t=r._zod.bag;r.minValue=t.minimum??null,r.maxValue=t.maximum??null,r.format=t.format??null});function aN(r){return Y_(fd,r)}var Ex=w("ZodBigIntFormat",(r,e)=>{XA.init(r,e),fd.init(r,e)});function lN(r){return tP(Ex,r)}function uN(r){return rP(Ex,r)}var S1=w("ZodSymbol",(r,e)=>{YA.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>EP(r,t,o,i)});function cN(r){return iP(S1,r)}var E1=w("ZodUndefined",(r,e)=>{e_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>FP(r,t,o,i)});function dN(r){return oP(E1,r)}var B1=w("ZodNull",(r,e)=>{t_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>BP(r,t,o,i)});function F1(r){return nP(B1,r)}var N1=w("ZodAny",(r,e)=>{r_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>kP(r,t,o,i)});function pN(){return sP(N1)}var I1=w("ZodUnknown",(r,e)=>{i_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>$P(r,t,o,i)});function Al(){return aP(I1)}var k1=w("ZodNever",(r,e)=>{o_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>IP(r,t,o,i)});function Bx(r){return lP(k1,r)}var $1=w("ZodVoid",(r,e)=>{n_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>NP(r,t,o,i)});function hN(r){return uP($1,r)}var vf=w("ZodDate",(r,e)=>{s_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(o,i,n)=>DP(r,o,i,n),r.min=(o,i)=>r.check(Pr(o,i)),r.max=(o,i)=>r.check(li(o,i));let t=r._zod.bag;r.minDate=t.minimum?new Date(t.minimum):null,r.maxDate=t.maximum?new Date(t.maximum):null});function fN(r){return cP(vf,r)}var D1=w("ZodArray",(r,e)=>{a_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>WP(r,t,o,i),r.element=e.element,r.min=(t,o)=>r.check(Dn(t,o)),r.nonempty=t=>r.check(Dn(1,t)),r.max=(t,o)=>r.check(bl(t,o)),r.length=(t,o)=>r.check(wl(t,o)),r.unwrap=()=>r.element});function yf(r,e){return hP(D1,r,e)}function mN(r){let e=r._zod.def.shape;return Nx(Object.keys(e))}var xf=w("ZodObject",(r,e)=>{l_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>ZP(r,t,o,i),U.defineLazy(r,"shape",()=>e.shape),r.keyof=()=>Nx(Object.keys(r._zod.def.shape)),r.catchall=t=>r.clone({...r._zod.def,catchall:t}),r.passthrough=()=>r.clone({...r._zod.def,catchall:Al()}),r.loose=()=>r.clone({...r._zod.def,catchall:Al()}),r.strict=()=>r.clone({...r._zod.def,catchall:Bx()}),r.strip=()=>r.clone({...r._zod.def,catchall:void 0}),r.extend=t=>U.extend(r,t),r.safeExtend=t=>U.safeExtend(r,t),r.merge=t=>U.merge(r,t),r.pick=t=>U.pick(r,t),r.omit=t=>U.omit(r,t),r.partial=(...t)=>U.partial(kx,r,t[0]),r.required=(...t)=>U.required($x,r,t[0])});function gN(r,e){let t={type:"object",shape:r??{},...U.normalizeParams(e)};return new xf(t)}function vN(r,e){return new xf({type:"object",shape:r,catchall:Bx(),...U.normalizeParams(e)})}function yN(r,e){return new xf({type:"object",shape:r,catchall:Al(),...U.normalizeParams(e)})}var bf=w("ZodUnion",(r,e)=>{of.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>Yy(r,t,o,i),r.options=e.options});function Fx(r,e){return new bf({type:"union",options:r,...U.normalizeParams(e)})}var M1=w("ZodXor",(r,e)=>{bf.init(r,e),u_.init(r,e),r._zod.processJSONSchema=(t,o,i)=>Yy(r,t,o,i),r.options=e.options});function xN(r,e){return new M1({type:"union",options:r,inclusive:!1,...U.normalizeParams(e)})}var C1=w("ZodDiscriminatedUnion",(r,e)=>{bf.init(r,e),c_.init(r,e)});function bN(r,e,t){return new C1({type:"union",options:e,discriminator:r,...U.normalizeParams(t)})}var T1=w("ZodIntersection",(r,e)=>{d_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>GP(r,t,o,i)});function R1(r,e){return new T1({type:"intersection",left:r,right:e})}var O1=w("ZodTuple",(r,e)=>{wy.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>qP(r,t,o,i),r.rest=t=>r.clone({...r._zod.def,rest:t})});function V1(r,e,t){let o=e instanceof ve,i=o?t:e,n=o?e:null;return new O1({type:"tuple",items:r,rest:n,...U.normalizeParams(i)})}var wf=w("ZodRecord",(r,e)=>{p_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>HP(r,t,o,i),r.keyType=e.keyType,r.valueType=e.valueType});function z1(r,e,t){return new wf({type:"record",keyType:r,valueType:e,...U.normalizeParams(t)})}function wN(r,e,t){let o=Ar(r);return o._zod.values=void 0,new wf({type:"record",keyType:o,valueType:e,...U.normalizeParams(t)})}function AN(r,e,t){return new wf({type:"record",keyType:r,valueType:e,mode:"loose",...U.normalizeParams(t)})}var U1=w("ZodMap",(r,e)=>{h_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>LP(r,t,o,i),r.keyType=e.keyType,r.valueType=e.valueType});function _N(r,e,t){return new U1({type:"map",keyType:r,valueType:e,...U.normalizeParams(t)})}var j1=w("ZodSet",(r,e)=>{f_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>KP(r,t,o,i),r.min=(...t)=>r.check(Ls(...t)),r.nonempty=t=>r.check(Ls(1,t)),r.max=(...t)=>r.check(xl(...t)),r.size=(...t)=>r.check(Gc(...t))});function PN(r,e){return new j1({type:"set",valueType:r,...U.normalizeParams(e)})}var ud=w("ZodEnum",(r,e)=>{m_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(o,i,n)=>MP(r,o,i,n),r.enum=e.entries,r.options=Object.values(e.entries);let t=new Set(Object.keys(e.entries));r.extract=(o,i)=>{let n={};for(let s of o)if(t.has(s))n[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ud({...e,checks:[],...U.normalizeParams(i),entries:n})},r.exclude=(o,i)=>{let n={...e.entries};for(let s of o)if(t.has(s))delete n[s];else throw new Error(`Key ${s} not found in enum`);return new ud({...e,checks:[],...U.normalizeParams(i),entries:n})}});function Nx(r,e){let t=Array.isArray(r)?Object.fromEntries(r.map(o=>[o,o])):r;return new ud({type:"enum",entries:t,...U.normalizeParams(e)})}function SN(r,e){return new ud({type:"enum",entries:r,...U.normalizeParams(e)})}var L1=w("ZodLiteral",(r,e)=>{g_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>CP(r,t,o,i),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 EN(r,e){return new L1({type:"literal",values:Array.isArray(r)?r:[r],...U.normalizeParams(e)})}var K1=w("ZodFile",(r,e)=>{v_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>OP(r,t,o,i),r.min=(t,o)=>r.check(Ls(t,o)),r.max=(t,o)=>r.check(xl(t,o)),r.mime=(t,o)=>r.check(ed(Array.isArray(t)?t:[t],o))});function BN(r){return fP(K1,r)}var W1=w("ZodTransform",(r,e)=>{y_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>jP(r,t,o,i),r._zod.parse=(t,o)=>{if(o.direction==="backward")throw new Ts(r.constructor.name);t.addIssue=n=>{if(typeof n=="string")t.issues.push(U.issue(n,t.value,e));else{let s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=t.value),s.inst??(s.inst=r),t.issues.push(U.issue(s))}};let i=e.transform(t.value,t);return i instanceof Promise?i.then(n=>(t.value=n,t)):(t.value=i,t)}});function Ix(r){return new W1({type:"transform",transform:r})}var kx=w("ZodOptional",(r,e)=>{x_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>o1(r,t,o,i),r.unwrap=()=>r._zod.def.innerType});function hf(r){return new kx({type:"optional",innerType:r})}var Z1=w("ZodNullable",(r,e)=>{b_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>JP(r,t,o,i),r.unwrap=()=>r._zod.def.innerType});function ff(r){return new Z1({type:"nullable",innerType:r})}function FN(r){return hf(ff(r))}var G1=w("ZodDefault",(r,e)=>{w_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>XP(r,t,o,i),r.unwrap=()=>r._zod.def.innerType,r.removeDefault=r.unwrap});function q1(r,e){return new G1({type:"default",innerType:r,get defaultValue(){return typeof e=="function"?e():U.shallowClone(e)}})}var H1=w("ZodPrefault",(r,e)=>{A_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>YP(r,t,o,i),r.unwrap=()=>r._zod.def.innerType});function J1(r,e){return new H1({type:"prefault",innerType:r,get defaultValue(){return typeof e=="function"?e():U.shallowClone(e)}})}var $x=w("ZodNonOptional",(r,e)=>{__.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>QP(r,t,o,i),r.unwrap=()=>r._zod.def.innerType});function Q1(r,e){return new $x({type:"nonoptional",innerType:r,...U.normalizeParams(e)})}var X1=w("ZodSuccess",(r,e)=>{P_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>VP(r,t,o,i),r.unwrap=()=>r._zod.def.innerType});function NN(r){return new X1({type:"success",innerType:r})}var Y1=w("ZodCatch",(r,e)=>{S_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>e1(r,t,o,i),r.unwrap=()=>r._zod.def.innerType,r.removeCatch=r.unwrap});function eS(r,e){return new Y1({type:"catch",innerType:r,catchValue:typeof e=="function"?e:()=>e})}var tS=w("ZodNaN",(r,e)=>{E_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>TP(r,t,o,i)});function IN(r){return pP(tS,r)}var Dx=w("ZodPipe",(r,e)=>{B_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>t1(r,t,o,i),r.in=e.in,r.out=e.out});function mf(r,e){return new Dx({type:"pipe",in:r,out:e})}var Mx=w("ZodCodec",(r,e)=>{Dx.init(r,e),nf.init(r,e)});function kN(r,e,t){return new Mx({type:"pipe",in:r,out:e,transform:t.decode,reverseTransform:t.encode})}var rS=w("ZodReadonly",(r,e)=>{F_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>r1(r,t,o,i),r.unwrap=()=>r._zod.def.innerType});function iS(r){return new rS({type:"readonly",innerType:r})}var oS=w("ZodTemplateLiteral",(r,e)=>{N_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>RP(r,t,o,i)});function $N(r,e){return new oS({type:"template_literal",parts:r,...U.normalizeParams(e)})}var nS=w("ZodLazy",(r,e)=>{$_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>n1(r,t,o,i),r.unwrap=()=>r._zod.def.getter()});function sS(r){return new nS({type:"lazy",getter:r})}var aS=w("ZodPromise",(r,e)=>{k_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>i1(r,t,o,i),r.unwrap=()=>r._zod.def.innerType});function DN(r){return new aS({type:"promise",innerType:r})}var lS=w("ZodFunction",(r,e)=>{I_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>UP(r,t,o,i)});function MN(r){return new lS({type:"function",input:Array.isArray(r?.input)?V1(r?.input):r?.input??yf(Al()),output:r?.output??Al()})}var Af=w("ZodCustom",(r,e)=>{D_.init(r,e),Pe.init(r,e),r._zod.processJSONSchema=(t,o,i)=>zP(r,t,o,i)});function CN(r){let e=new Ye({check:"custom"});return e._zod.check=r,e}function TN(r,e){return mP(Af,r??(()=>!0),e)}function uS(r,e={}){return gP(Af,r,e)}function cS(r){return vP(r)}var RN=yP,ON=xP;function VN(r,e={error:`Input not instance of ${r.name}`}){let t=new Af({type:"custom",check:"custom",fn:o=>o instanceof r,abort:!0,...U.normalizeParams(e)});return t._zod.bag.Class=r,t}var zN=(...r)=>bP({Codec:Mx,Boolean:hd,String:cd},...r);function UN(r){let e=sS(()=>Fx([ax(r),_1(),P1(),F1(),yf(e),z1(ax(),e)]));return e}function jN(r,e){return mf(Ix(r),e)}var vD={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 yD(r){_t({customError:r})}function xD(){return _t().customError}var dS;dS||(dS={});var J={...df,...rx,iso:ld};function bD(r,e){let t=r.$schema;return t==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":t==="http://json-schema.org/draft-07/schema#"?"draft-7":t==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function wD(r,e){if(!r.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let t=r.slice(1).split("/").filter(Boolean);if(t.length===0)return e.rootSchema;let o=e.version==="draft-2020-12"?"$defs":"definitions";if(t[0]===o){let i=t[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${r}`);return e.defs[i]}throw new Error(`Reference not found: ${r}`)}function LN(r,e){if(r.not!==void 0){if(typeof r.not=="object"&&Object.keys(r.not).length===0)return J.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(r.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(r.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(r.if!==void 0||r.then!==void 0||r.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(r.dependentSchemas!==void 0||r.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(r.$ref){let i=r.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return J.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let n=wD(i,e),s=ur(n,e);return e.refs.set(i,s),e.processing.delete(i),s}if(r.enum!==void 0){let i=r.enum;if(e.version==="openapi-3.0"&&r.nullable===!0&&i.length===1&&i[0]===null)return J.null();if(i.length===0)return J.never();if(i.length===1)return J.literal(i[0]);if(i.every(s=>typeof s=="string"))return J.enum(i);let n=i.map(s=>J.literal(s));return n.length<2?n[0]:J.union([n[0],n[1],...n.slice(2)])}if(r.const!==void 0)return J.literal(r.const);let t=r.type;if(Array.isArray(t)){let i=t.map(n=>{let s={...r,type:n};return LN(s,e)});return i.length===0?J.never():i.length===1?i[0]:J.union(i)}if(!t)return J.any();let o;switch(t){case"string":{let i=J.string();if(r.format){let n=r.format;n==="email"?i=i.check(J.email()):n==="uri"||n==="uri-reference"?i=i.check(J.url()):n==="uuid"||n==="guid"?i=i.check(J.uuid()):n==="date-time"?i=i.check(J.iso.datetime()):n==="date"?i=i.check(J.iso.date()):n==="time"?i=i.check(J.iso.time()):n==="duration"?i=i.check(J.iso.duration()):n==="ipv4"?i=i.check(J.ipv4()):n==="ipv6"?i=i.check(J.ipv6()):n==="mac"?i=i.check(J.mac()):n==="cidr"?i=i.check(J.cidrv4()):n==="cidr-v6"?i=i.check(J.cidrv6()):n==="base64"?i=i.check(J.base64()):n==="base64url"?i=i.check(J.base64url()):n==="e164"?i=i.check(J.e164()):n==="jwt"?i=i.check(J.jwt()):n==="emoji"?i=i.check(J.emoji()):n==="nanoid"?i=i.check(J.nanoid()):n==="cuid"?i=i.check(J.cuid()):n==="cuid2"?i=i.check(J.cuid2()):n==="ulid"?i=i.check(J.ulid()):n==="xid"?i=i.check(J.xid()):n==="ksuid"&&(i=i.check(J.ksuid()))}typeof r.minLength=="number"&&(i=i.min(r.minLength)),typeof r.maxLength=="number"&&(i=i.max(r.maxLength)),r.pattern&&(i=i.regex(new RegExp(r.pattern))),o=i;break}case"number":case"integer":{let i=t==="integer"?J.number().int():J.number();typeof r.minimum=="number"&&(i=i.min(r.minimum)),typeof r.maximum=="number"&&(i=i.max(r.maximum)),typeof r.exclusiveMinimum=="number"?i=i.gt(r.exclusiveMinimum):r.exclusiveMinimum===!0&&typeof r.minimum=="number"&&(i=i.gt(r.minimum)),typeof r.exclusiveMaximum=="number"?i=i.lt(r.exclusiveMaximum):r.exclusiveMaximum===!0&&typeof r.maximum=="number"&&(i=i.lt(r.maximum)),typeof r.multipleOf=="number"&&(i=i.multipleOf(r.multipleOf)),o=i;break}case"boolean":{o=J.boolean();break}case"null":{o=J.null();break}case"object":{let i={},n=r.properties||{},s=new Set(r.required||[]);for(let[l,u]of Object.entries(n)){let d=ur(u,e);i[l]=s.has(l)?d:d.optional()}if(r.propertyNames){let l=ur(r.propertyNames,e),u=r.additionalProperties&&typeof r.additionalProperties=="object"?ur(r.additionalProperties,e):J.any();if(Object.keys(i).length===0){o=J.record(l,u);break}let d=J.object(i).passthrough(),p=J.looseRecord(l,u);o=J.intersection(d,p);break}if(r.patternProperties){let l=r.patternProperties,u=Object.keys(l),d=[];for(let h of u){let g=ur(l[h],e),v=J.string().regex(new RegExp(h));d.push(J.looseRecord(v,g))}let p=[];if(Object.keys(i).length>0&&p.push(J.object(i).passthrough()),p.push(...d),p.length===0)o=J.object({}).passthrough();else if(p.length===1)o=p[0];else{let h=J.intersection(p[0],p[1]);for(let g=2;g<p.length;g++)h=J.intersection(h,p[g]);o=h}break}let a=J.object(i);r.additionalProperties===!1?o=a.strict():typeof r.additionalProperties=="object"?o=a.catchall(ur(r.additionalProperties,e)):o=a.passthrough();break}case"array":{let i=r.prefixItems,n=r.items;if(i&&Array.isArray(i)){let s=i.map(l=>ur(l,e)),a=n&&typeof n=="object"&&!Array.isArray(n)?ur(n,e):void 0;a?o=J.tuple(s).rest(a):o=J.tuple(s),typeof r.minItems=="number"&&(o=o.check(J.minLength(r.minItems))),typeof r.maxItems=="number"&&(o=o.check(J.maxLength(r.maxItems)))}else if(Array.isArray(n)){let s=n.map(l=>ur(l,e)),a=r.additionalItems&&typeof r.additionalItems=="object"?ur(r.additionalItems,e):void 0;a?o=J.tuple(s).rest(a):o=J.tuple(s),typeof r.minItems=="number"&&(o=o.check(J.minLength(r.minItems))),typeof r.maxItems=="number"&&(o=o.check(J.maxLength(r.maxItems)))}else if(n!==void 0){let s=ur(n,e),a=J.array(s);typeof r.minItems=="number"&&(a=a.min(r.minItems)),typeof r.maxItems=="number"&&(a=a.max(r.maxItems)),o=a}else o=J.array(J.any());break}default:throw new Error(`Unsupported type: ${t}`)}return r.description&&(o=o.describe(r.description)),r.default!==void 0&&(o=o.default(r.default)),o}function ur(r,e){if(typeof r=="boolean")return r?J.any():J.never();let t=LN(r,e),o=r.type||r.enum!==void 0||r.const!==void 0;if(r.anyOf&&Array.isArray(r.anyOf)){let i=r.anyOf.map(s=>ur(s,e)),n=J.union(i);t=o?J.intersection(t,n):n}if(r.oneOf&&Array.isArray(r.oneOf)){let i=r.oneOf.map(s=>ur(s,e)),n=J.xor(i);t=o?J.intersection(t,n):n}if(r.allOf&&Array.isArray(r.allOf))if(r.allOf.length===0)t=o?t:J.any();else{let i=o?t:ur(r.allOf[0],e),n=o?0:1;for(let s=n;s<r.allOf.length;s++)i=J.intersection(i,ur(r.allOf[s],e));t=i}return r.nullable===!0&&e.version==="openapi-3.0"&&(t=J.nullable(t)),r.readOnly===!0&&(t=J.readonly(t)),t}function KN(r,e){if(typeof r=="boolean")return r?J.any():J.never();let t=bD(r,e?.defaultTarget),o=r.$defs||r.definitions||{};return ur(r,{version:t,defs:o,refs:new Map,processing:new Set,rootSchema:r})}var pS={};tn(pS,{bigint:()=>SD,boolean:()=>PD,date:()=>ED,number:()=>_D,string:()=>AD});function AD(r){return R_(cd,r)}function _D(r){return W_(pd,r)}function PD(r){return X_(hd,r)}function SD(r){return eP(fd,r)}function ED(r){return dP(vf,r)}_t(Ay());var WN=Ct.object({name:Ct.string(),bpm:Ct.number(),duration:Ct.number(),sample_rate:Ct.number(),origin:Ct.enum(["openDAW","recording","import"])});var aY=WN.extend({uuid:b.zType(Ct)});var BD,FD,ND,ID,kD,$D;BD=new WeakMap,FD=new WeakMap,ND=new WeakMap,ID=new WeakMap,kD=new WeakMap,$D=new WeakMap;var md=function(r,e,t,o){if(t==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!o:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?o:t==="a"?o.call(r):o?o.value:e.get(r)},DD,MD,hS,fS,mS,CD,TD;MD=new WeakMap,hS=new WeakMap,fS=new WeakMap,mS=new WeakMap,CD=new WeakMap,DD=new WeakSet,TD=function(e){return e.pointerHub.catchupAndSubscribe({onAdded:t=>{let o=Ie(t.box,Po);M(o.isAttached(),"SelectionBox is not attached");let i=o.selectable.targetVertex.unwrap(()=>`SelectionBox has no target (${o.selectable.targetAddress.unwrapOrUndefined()?.toString()??"No address"})`),n={box:o,selectable:i};md(this,mS,"f").proxy.onSelected(i),M(md(this,hS,"f").add(n),"Could not add to entityMap"),M(md(this,fS,"f").add(n),"Could not add to selectableMap")},onRemoved:t=>{let o=Ie(t.box,Po),i=md(this,hS,"f").removeByKey(o.address.uuid);M(i.box===o,"Broken selection");let n=i.selectable;md(this,mS,"f").proxy.onDeselected(n),md(this,fS,"f").removeByKey(n.address)}},c.Selection)};var ZN=Ct.object({name:Ct.string(),size:Ct.number().int(),url:Ct.string(),license:Ct.string(),origin:Ct.enum(["openDAW","import"])});var AY=ZN.extend({uuid:b.zType(Ct)});var GN;(function(r){r.cut=(e,t,o)=>{if(!(e.position>=t||t>=e.complete))if(f0.isLoopableRegion(e)){let{position:i,complete:n,loopOffset:s,loopDuration:a}=e;e.duration=t-i,e.copyTo({position:t,duration:n-t,loopOffset:Fd(s+(t-i),a),consolidate:o})}else return F("Not yet implemented")},r.clip=(e,t,o)=>{if(f0.isLoopableRegion(e)){let{position:i,complete:n,loopOffset:s,loopDuration:a}=e;if(n-o<=0)return F(`duration will zero or negative(${n-o})`);e.duration=t-i,e.copyTo({position:o,duration:n-o,loopOffset:Fd(s+(o-i),a)})}else return F("Not yet implemented")}})(GN||(GN={}));var gd;(e=>e.create=(t,o,i,n)=>0|(t?1:0)|(o?2:0)|(i?4:0)|(n?8:0))(gd||={});var Ee=class r{static PEAK_DECAY=Math.exp(-1/(sampleRate*.25));static RMS_WINDOW=Math.floor(sampleRate*.1);#e;#t;#r;#i;#o;#n=0;#s=0;#l=0;#u=0;constructor(e,t){this.#e=e,this.#t=t,this.#r=new Float32Array(4),this.#i=T.create(()=>new Vl(r.RMS_WINDOW),2),this.#o=this.#e.broadcastFloats(this.#t,this.#r,o=>{this.#r[0]=this.#n,this.#r[1]=this.#s,this.#r[2]=this.#l,this.#r[3]=this.#u})}clear(){this.#i[0].clear(),this.#i[1].clear(),this.#n=0,this.#s=0}process(e,t,o=0,i=ue){let n=i-o,s=r.PEAK_DECAY**n,a=0,l=0;for(let u=o;u<i;u++){let d=Math.abs(e[u]),p=Math.abs(t[u]);d>a&&(a=d),p>l&&(l=p)}this.#n=Math.max(a,this.#n*s),this.#s=Math.max(l,this.#s*s),this.#l=this.#i[0].processBlock(e,o,i),this.#u=this.#i[1].processBlock(t,o,i)}processStereo([e,t],o=0,i=ue){this.process(e,t,o,i)}terminate(){this.#o.terminate()}};var Cx=class{#e=new R;#t;#r;#i;#o=m.None;#n;constructor(e,t){this.#t=e,this.#r=t,this.#i=new te,this.#n=this.#r.getValue(),this.#e.own(this.#r.subscribe(o=>{this.#n=o.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.#n}getUnitValue(){return this.#r.valueMapping.x(this.#n)}onStartAutomation(){M(this.#o.isEmpty(),"Already broadcasting"),this.#o=m.wrap(this.#t.broadcaster.broadcastFloat(this.#r.address,()=>this.getUnitValue()))}updateAutomation(e){let t=this.#r.valueAt(e);return this.#n!==t?(this.#n=t,!0):!1}onStopAutomation(){M(this.#o.nonEmpty(),"Never started broadcasting"),this.#o.unwrap().terminate(),this.#o=m.None,this.#n=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 vd=class{#e;constructor(){this.#e=new Lf}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 cr=class{#e=new R;#t;#r;#i;#o;#n=m.None;constructor(e){this.#t=e,this.#r=new vd,this.#i=[],this.#o=[]}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 Cx(this.#t,e);return t.ownAll(e.field.pointerHub.catchupAndSubscribe({onAdded:o=>{this.#n.isEmpty()&&(this.#n=m.wrap(this.#t.updateClock.addEventOutput(this.#r))),this.#o.push(t),t.onStartAutomation()},onRemoved:o=>{T.remove(this.#o,t),this.#o.length===0&&(this.#n.ifSome(i=>i.terminate()),this.#n=m.None),t.onStopAutomation()}},c.Automation),t.subscribe(()=>this.parameterChanged(t))),this.#i.push(t),t}updateParameters(e,t){this.#o.forEach(o=>{o.updateAutomation(e)&&this.parameterChanged(o,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.#n.ifSome(e=>e.terminate()),this.#n=m.None,this.#i.length=0,this.#e.terminate()}toString(){return`{${this.constructor.name}}`}};var _f;(e=>e.isOfType=t=>t.type==="update-event")(_f||={});var Tx=class extends cr{#e=[];constructor(e){super(e),this.own(this.context.registerProcessor(this))}reset(){this.eventInput.clear()}addEventOutput(e){return this.#e.push(e),{terminate:()=>T.remove(this.#e,e)}}process({blocks:e}){e.forEach(({p0:t,p1:o,flags:i},n)=>{if(nt.every(i,1))for(let s of zn.iterate(t,o,im)){let a={type:"update-event",position:s};this.#e.forEach(l=>l.add(n,a))}})}toString(){return`{${this.constructor.name}}`}};var De=class extends cr{constructor(e){super(e)}process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:o,p0:i,s0:n,s1:s,bpm:a}=t,l=null,u=n;for(let d of this.eventInput.get(o)){let p=d.position-i,h=Math.abs(p)<1e-7?n:n+Math.floor(q.pulsesToSamples(p,a,sampleRate));M(n<=h&&h<=s,()=>`${h} out of bounds. event: ${d.position} (${d.type}), p0: ${i}`),l?.forEach(g=>this.handleEvent(g)),l=null,u<h&&(this.processAudio(t,u,h),u=h),_f.isOfType(d)?this.updateParameters(d.position,n/sampleRate+q.pulsesToSeconds(d.position-i,a)):(l??=[]).push(d)}l?.forEach(d=>this.handleEvent(d)),l=null,u<s&&this.processAudio(t,u,s)}),this.eventInput.clear(),this.finishProcess()}introduceBlock(e){}handleEvent(e){return F(`${this} received an event but has no accepting method.`)}finishProcess(){}};var Rx=class r{static#e=S.exponential(20/sampleRate,2e4/sampleRate);#t;#r;#i;#o;#n;feedback=.7;cross=0;wet=.75;dry=.75;#s=0;#l=0;#u=0;#a=0;#c=0;#d=!1;#p=!1;constructor(e,t){let o=Tn(e);this.#t=o,this.#r=[new Float32Array(o),new Float32Array(o)],this.#i=[new Ft,new Ft],this.#o=new xo,this.#n=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){M(0<=e&&e<this.#t,"Out of bounds"),this.#a!==e&&(this.#a=e,this.#d?this.#v():this.#m())}get offset(){return this.#a}set filter(e){e===0?this.#o.identity():e>0?this.#o.setHighpassParams(r.#e.y(e)):e<0&&this.#o.setLowpassParams(r.#e.y(1+e))}process(e,t,o,i){this.#p?this.#f(e,t,o,i):this.#h(e,t,o,i),this.#d=!0}#h(e,t,o,i){let n=this.#t-1,s=this.#r,a=this.feedback,l=this.wet,u=this.dry,d=this.#l,p=d-Math.floor(this.#u);p<0&&(p+=this.#t);let h=e[0],g=e[1],v=t[0],y=t[1],x=this.#i[0],$=this.#i[1],D=s[0],V=s[1];for(let O=o;O<i;++O){let j=h[O],Y=g[O],K=x.processFrame(this.#o,D[p]*.96),ie=$.processFrame(this.#o,V[p]*.96),re=this.cross*(ie-K),Ce=K+re,je=ie-re;D[d]=(j+Ce)*a+1e-18-1e-18,V[d]=(Y+je)*a+1e-18-1e-18,v[O]=Ce*l+j*u,y[O]=je*l+Y*u,p=++p&n,d=++d&n}this.#l=d}#f(e,t,o,i){let n=this.#t-1,s=this.#r,a=this.feedback,l=this.wet,u=this.dry,d=this.#l;for(let p=o;p<i;++p){0<this.#c?(this.#u+=this.#s,this.#c--):(this.#u=this.#a,this.#p=!1);let h=d-this.#u;h<0&&(h+=this.#t);let g=h|0,v=h-g,y=e[0][p],x=e[1][p],$=s[0][g],D=s[1][g],V=this.#i[0].processFrame(this.#o,($+v*(s[0][g+1&n]-$))*.96),O=this.#i[1].processFrame(this.#o,(D+v*(s[1][g+1&n]-D))*.96);s[0][d]=y+V*a+1e-18-1e-18,s[1][d]=x+V*a+1e-18-1e-18,t[0][p]=V*l+y*u,t[1][p]=O*l+x*u,d=++d&n}this.#l=d}#m(){this.#u=this.#a,this.#c=0,this.#p=!1}#v(){this.#a!==this.#u&&(this.#c=this.#n,this.#s=(this.#a-this.#u)/this.#c,this.#p=!0)}};var Ox=class r extends De{static ID=0;#e=r.ID++;#t;parameterDelay;parameterFeedback;parameterCross;parameterFilter;parameterDry;parameterWet;#r;#i;#o;#n=m.None;#s=!0;constructor(e,t){super(e),this.#t=t,this.#r=new ye,this.#i=this.own(new Ee(e.broadcaster,t.address));let{delay:o,feedback:i,cross:n,filter:s,dry:a,wet:l}=t.namedParameter;this.parameterDelay=this.own(this.bindParameter(o)),this.parameterFeedback=this.own(this.bindParameter(i)),this.parameterCross=this.own(this.bindParameter(n)),this.parameterFilter=this.own(this.bindParameter(s)),this.parameterDry=this.own(this.bindParameter(a)),this.parameterWet=this.own(this.bindParameter(l));let u=q.pulsesToSamples(hr.toPPQN(bi.OffsetFractions[0]),30,sampleRate),d=Math.floor(.5*sampleRate);this.#o=new Rx(u,d),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.clear(),this.#o.reset(),this.#i.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#n=m.wrap(e),{terminate:()=>this.#n=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio({bpm:e,flags:t},o,i){if(this.#n.isEmpty())return;if(this.#s||nt.some(t,8)){let s=this.parameterDelay.getValue(),a=hr.toPPQN(bi.OffsetFractions[s]);this.#o.offset=q.pulsesToSamples(a,e,sampleRate),this.#s=!1}let n=this.#n.unwrap();this.#o.process(n.channels(),this.#r.channels(),o,i),this.#i.process(this.#r.getChannel(0),this.#r.getChannel(1),o,i)}parameterChanged(e){e===this.parameterDelay?this.#s=!0:e===this.parameterFeedback?this.#o.feedback=this.parameterFeedback.getValue():e===this.parameterCross?this.#o.cross=this.parameterCross.getValue():e===this.parameterFilter?this.#o.filter=this.parameterFilter.getValue():e===this.parameterDry?this.#o.dry=Ve(this.parameterDry.getValue()):e===this.parameterWet&&(this.#o.wet=Ve(this.parameterWet.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})}`}};var Pf=class r extends cr{static ID=0;#e=r.ID++;#t;#r;#i;#o=m.None;constructor(e,t){super(e),this.#t=t,this.#r=new ye,this.#i=this.own(new Ee(e.broadcaster,t.address)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing))}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.#o=m.wrap(e),{terminate:()=>this.#o=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}process(e){if(this.#o.isEmpty())return;let t=this.#o.unwrap(),[o,i]=t.channels(),[n,s]=this.#r.channels();for(let a=0;a<ue;a++)n[a]=o[a],s[a]=i[a];this.#i.process(n,s)}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#e})`}};var yd=class r extends cr{static ID=0;#e=r.ID++;#t;#r;#i;#o;constructor(e,t){super(e),this.#t=t,this.#r=new ye,this.#i=this.own(new Ee(e.broadcaster,t.address)),this.#o=[],this.own(e.registerProcessor(this))}get noteEventTarget(){return m.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.#o.push(e),{terminate:()=>{T.remove(this.#o,e),this.#r.clear()}}}get adapter(){return this.#t}get audioOutput(){return this.#r}process(e){this.#r.clear();let[t,o]=this.#r.channels();for(let i of this.#o){let[n,s]=i.channels();for(let a=0;a<ue;a++)t[a]+=n[a],o[a]+=s[a]}this.#r.assertSanity(),this.#i.process(this.#r.getChannel(0),this.#r.getChannel(1))}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#e})}`}};var pe;(a=>{a.Comparator=(l,u)=>{let d=l.position-u.position;return d!==0?d:l.type==="note-complete-event"?-1:u.type==="note-complete-event"?1:0},a.start=(l,u,d,p,h=0)=>({type:"note-event",position:l,duration:u,pitch:d,velocity:p,cent:h,id:++s}),a.startWith=(l,u,d)=>({type:"note-event",position:u??l.position,duration:d??l.duration,pitch:l.pitch,cent:l.cent,velocity:l.velocity,id:++s}),a.stop=({id:l,pitch:u},d)=>({type:"note-complete-event",position:d,pitch:u,id:l}),a.isStart=l=>l.type==="note-event"&&"id"in l&&typeof l.id=="number",a.isStop=l=>l.type==="note-complete-event";let s=0})(pe||={});var Yo=class{#e=new R;#t;#r;#i;#o=m.None;constructor(e,t,o){this.#t=e,this.#r=this.#e.own(new Ri(t,o)),this.#i=new Array(16)}setNoteEventSource(e){return M(this.#o.isEmpty(),"NoteEventSource already set"),this.#o=m.wrap(e),this.#t.reset(),Z.create(()=>{this.#o=m.None,this.#t.reset()})}introduceBlock({index:e,p0:t,p1:o,flags:i}){if(!this.#o.isEmpty()){for(let n of this.#o.unwrap().processNotes(t,o,i))this.#i.push(n);this.#i.sort(pe.Comparator).forEach(n=>{n.pitch>=0&&n.pitch<=127&&(this.#t.eventInput.add(e,n),this.#n(n))}),this.#i.length=0}}clear(){}terminate(){this.#e.terminate()}#n(e){pe.isStart(e)?this.#r.noteOn(e.pitch):pe.isStop(e)&&this.#r.noteOff(e.pitch)}};var gS;(e=>e.NotSet={start:()=>F("VoicingStrategy.start"),stop:()=>F("VoicingStrategy.stop"),forceStop:()=>on,process:()=>F("VoicingStrategy.process"),reset:on,processing:()=>T.empty()})(gS||={});var Vx=class{#e;#t=[];constructor(e=gS.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,o,i){this.#e.process(e,t,o,i);for(let n=this.#t.length-1;n>=0;n--)this.#t[n].process(e,t,o,i)&&this.#t.splice(n,1)}reset(){this.#t.forEach(e=>e.reset()),this.#t.length=0,this.#e.reset()}};var zx=class{#e;#t=[];#r=[];constructor(e){this.#e=e}start(e){let t=NaN;for(let n=0;n<this.#r.length;n++){let s=this.#r[n];if(!s.gate){t=s.currentFrequency,this.#r.splice(n,1);break}}let o=this.#e.computeFrequency(e),i=this.#e.create();isNaN(t)?i.start(e,o,1,0):(i.start(e,t,1,0),i.startGlide(o,this.#e.glideTime)),this.#r.push(i),this.#t.push(i)}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,o,i){e.clear(o,i);for(let n=this.#t.length-1;n>=0;n--){let s=this.#t[n];s.process(e,t,o,i)&&(T.removeIf(this.#r,a=>a===s),this.#t.splice(n,1))}return this.#t.length===0}processing(){return this.#t}};var Ux=class{#e;#t=[];#r=[];#i=null;#o=null;constructor(e){this.#e=e}start(e){if(this.#r.push(e),G(this.#i)&&this.#i.gate){this.#i.startGlide(this.#e.computeFrequency(e),this.#e.glideTime);return}let t=NaN;G(this.#o)&&(t=this.#o.currentFrequency,this.#o.forceStop());let o=this.#e.create(),i=this.#e.computeFrequency(e);isNaN(t)?o.start(e,i,1,0):(o.start(e,t,1,0),o.startGlide(i,this.#e.glideTime)),this.#i=o,this.#o=o,this.#t.push(o)}stop(e){let t=this.#r.findIndex(o=>o.id===e);if(t!==-1&&(this.#r.splice(t,1),!!G(this.#i))){if(t===this.#r.length){let o=this.#r.at(-1);if(G(o)){this.#i.startGlide(this.#e.computeFrequency(o),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.#o=null}process(e,t,o,i){e.clear(o,i);for(let n=this.#t.length-1;n>=0;n--){let s=this.#t[n];s.process(e,t,o,i)&&(this.#t.splice(n,1),s===this.#i&&(this.#i=null),s===this.#o&&(this.#o=null))}return this.#t.length===0}processing(){return this.#t}};var Sf=class{#e;#t=[];#r=new Ol;#i;gate=!0;id=-1;constructor(e,t){this.#e=e,this.#i=t}get currentFrequency(){return this.#r.currentFrequency()}start(e,t,o,i){if(this.id=e.id,this.#r.init(t),this.#i===1){let n=this.#e();n.start(e,t,o,i),this.#t.push(n)}else for(let n=0;n<this.#i;++n){let s=n/(this.#i-1)*2-1,a=this.#e(),l=(1-Math.abs(i))*s+i;a.start(e,t,o/Math.sqrt(this.#i),l),this.#t.push(a)}}startGlide(e,t){this.#r.glideTo(e,t),this.#t.forEach(o=>o.startGlide(e,t))}process(e,t,o,i){this.#r.advance(t.bpm,o,i);for(let n=this.#t.length-1;n>=0;n--)this.#t[n].process(e,t,o,i)&&this.#t.splice(n,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[qN,HN,vS,JN,QN,jx,XN,YN,Lx]=VS(Float32Array,ue),Ef=class{device;oscA;oscB;lfo;filter;env;glide;gainASmooth;gainBSmooth;gainVcaSmooth;#e=Qs("NoteEvent not set");#t=1;#r=1;id=-1;phase=0;filter_keyboard_delta=0;constructor(e){this.device=e,this.oscA=new Cd(sampleRate),this.oscB=new Cd(sampleRate),this.lfo=new Xf(sampleRate),this.filter=new Wf(Ko.MIN_CUTOFF,Ko.MAX_CUTOFF,sampleRate),this.filter.order=1,this.env=new Tl(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 Ol,this.gainASmooth=new Ui(.003,sampleRate),this.gainBSmooth=new Ui(.003,sampleRate),this.gainVcaSmooth=new Ui(.003,sampleRate)}start(e,t,o,i){this.#e=e,this.#t=o,this.#r=i,this.filter_keyboard_delta=Yf.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},o,i){let{gainOscA:n,gainOscB:s,oscA_waveform:a,oscB_waveform:l,flt_cutoff:u,flt_resonance:d,flt_env_amount:p,flt_order:h,frequencyAMultiplier:g,frequencyBMultiplier:v,parameterLfoShape:y,parameterLfoRate:x,parameterLfoTargetTune:$,parameterLfoTargetCutoff:D,parameterLfoTargetVolume:V,parameterUnisonDetune:O,parameterUnisonStereo:j}=this.device,Y=Rl(this.#e.velocity)*this.#t,K=2**(this.#r*(O.getValue()/1200)),ie=this.#r*j.getValue(),[re,Ce]=ln.panningToGains(ie,bo.Linear),[je,Qe]=e.channels();vS.fill(K,o,i),this.glide.process(vS,t,o,i),this.lfo.fill(XN,y.getValue(),x.getValue(),o,i),this.env.process(jx,o,i);let Ae=$.getValue(),Xe=D.getValue(),Le=V.getValue();for(let be=o;be<i;be++){let et=XN[be];YN[be]=u+this.filter_keyboard_delta+jx[be]*p+et*Xe,jx[be]*=ci(Y+et*Le);let Lr=vS[be]*2**(et*Ae);JN[be]=Lr*g,QN[be]=Lr*v}this.oscA.generateFromFrequencies(qN,JN,a,o,i),this.oscB.generateFromFrequencies(HN,QN,l,o,i);for(let be=o;be<i;be++)Lx[be]=qN[be]*this.gainASmooth.process(n)+HN[be]*this.gainBSmooth.process(s);this.filter.order=h,this.filter.process(Lx,Lx,YN,d,o,i);for(let be=o;be<i;be++){let et=this.gainVcaSmooth.process(ci(jx[be])),Lr=Lx[be]*et;if(je[be]+=Lr*re,Qe[be]+=Lr*Ce,this.env.complete&&et<Kf)return!0}return!1}};var Kx=class extends De{#e;#t;#r;#i;#o;#n;#s;#l;#u;#a;#c;#d;#p;#h;#f;#m;#v;#g;#A;#B;#S;#_;#$;#y;#w;#x;#E;#M;#N;#F;#P;#I;#k;gainOscA=1;gainOscB=1;frequencyAMultiplier=1;frequencyBMultiplier=1;env_attack=1;env_decay=1;env_sustain=1;env_release=1;oscA_waveform=Ke.sine;oscB_waveform=Ke.sine;flt_cutoff=1;flt_resonance=Math.SQRT1_2;flt_env_amount=0;flt_order=1;#D=0;constructor(e,t){super(e),this.#e=t,this.#t=new Vx,this.#r=new Yo(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new ye,this.#o=new rm(sampleRate),this.#n=this.own(new Ee(e.broadcaster,t.address));let{namedParameter:o}=this.#e,{oscillators:i}=o;this.#s=this.own(this.bindParameter(i[0].waveform)),this.#l=this.own(this.bindParameter(i[0].octave)),this.#u=this.own(this.bindParameter(i[0].tune)),this.#a=this.own(this.bindParameter(i[0].volume)),this.#c=this.own(this.bindParameter(i[1].waveform)),this.#d=this.own(this.bindParameter(i[1].octave)),this.#p=this.own(this.bindParameter(i[1].tune)),this.#h=this.own(this.bindParameter(i[1].volume)),this.#f=this.own(this.bindParameter(o.attack)),this.#m=this.own(this.bindParameter(o.decay)),this.#v=this.own(this.bindParameter(o.sustain)),this.#g=this.own(this.bindParameter(o.release)),this.#A=this.own(this.bindParameter(o.cutoff)),this.#B=this.own(this.bindParameter(o.resonance)),this.#S=this.own(this.bindParameter(o.filterEnvelope)),this.#_=this.own(this.bindParameter(o.filterOrder)),this.#$=this.own(this.bindParameter(o.filterKeyboard)),this.#y=this.own(this.bindParameter(o.glideTime)),this.#w=this.own(this.bindParameter(o.voicingMode)),this.#x=this.own(this.bindParameter(o.unisonCount)),this.#E=this.own(this.bindParameter(o.unisonDetune)),this.#M=this.own(this.bindParameter(o.unisonStereo)),this.#N=this.own(this.bindParameter(o.lfoWaveform)),this.#F=this.own(this.bindParameter(o.lfoRate)),this.#P=this.own(this.bindParameter(o.lfoTargetTune)),this.#I=this.own(this.bindParameter(o.lfoTargetCutoff)),this.#k=this.own(this.bindParameter(o.lfoTargetVolume));let n=new Float32Array(32);this.ownAll(e.broadcaster.broadcastFloats(t.address.append(0),n,s=>{if(!s)return;let a=0;this.#t.strategy.processing().forEach(l=>{let d=Ie(l,Sf).processing().at(0);d instanceof Ef&&(n[a++]=d.env.phase),n.length-1}),n[a]=-1}),e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#i,this.outgoing)),this.readAllParameters()}computeFrequency(e){return $d(e.pitch+e.cent/100,440)}get glideTime(){return this.#D}get parameterFilterKeyboard(){return this.#$}get parameterLfoShape(){return this.#N}get parameterLfoRate(){return this.#F}get parameterLfoTargetTune(){return this.#P}get parameterLfoTargetCutoff(){return this.#I}get parameterLfoTargetVolume(){return this.#k}get parameterUnisonDetune(){return this.#E}get parameterUnisonStereo(){return this.#M}create(){return new Sf(()=>new Ef(this),this.#x.getValue())}get noteEventTarget(){return m.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.#n.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){pe.isStart(e)?this.#t.start(e):pe.isStop(e)&&this.#t.stop(e.id)}processAudio(e,t,o){this.#t.process(this.#i,e,t,o),this.#o.replace(this.#i,t,o)}parameterChanged(e){if(e===this.#a)this.gainOscA=Ve(this.#a.getValue());else if(e===this.#h)this.gainOscB=Ve(this.#h.getValue());else if(e===this.#l||e===this.#u)this.frequencyAMultiplier=2**(this.#l.getValue()+this.#u.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.#v)this.env_sustain=this.#v.getValue();else if(e===this.#g)this.env_release=this.#g.getValue();else if(e===this.#s)this.oscA_waveform=ui(this.#s.getValue(),Ke);else if(e===this.#c)this.oscB_waveform=ui(this.#c.getValue(),Ke);else if(e===this.#A)this.flt_cutoff=this.#A.getUnitValue();else if(e===this.#B)this.flt_resonance=this.#B.getValue();else if(e===this.#S)this.flt_env_amount=this.#S.getValue();else if(e===this.#_)this.flt_order=this.#_.getValue();else if(e===this.#y)this.#D=this.#y.getValue()*q.Bar;else if(e===this.#w){let t=this.#w.getValue();switch(t){case _o.Monophonic:{this.#t.strategy=new Ux(this);return}case _o.Polyphonic:{this.#t.strategy=new zx(this);return}default:return F(`Unknown VoicingMode '${t}'`)}}}finishProcess(){this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{VaporisateurDevice}"}};var Pl=class{#e;#t;#r;#i;#o;#n;#s=0;#l;#u=0;constructor(e,t,o=0,i=0){this.#e=e,this.#t=t,this.#r=Math.round(.02*sampleRate),this.#n=o,this.#l=i,this.#n>=t.numberOfFrames?(this.#i=2,this.#o=0):o===0?(this.#i=1,this.#o=0):(this.#i=0,this.#o=1)}get readPosition(){return this.#n}done(){return this.#i===2}isFadingOut(){return this.#i===0&&this.#o<0}startFadeOut(e){this.#i!==2&&!(this.#i===0&&this.#o<0)&&(this.#i=0,this.#o=-1,this.#s=0,this.#u=e)}process(e,t){let[o,i]=this.#e.channels(),{frames:n,numberOfFrames:s}=this.#t,a=n[0],l=n.length===1?n[0]:n[1],u=this.#r,d=s-u,p=this.#l,h=this.#u,g=this.#i,v=this.#o,y=this.#n,x=this.#s;for(let $=0;$<t&&g!==2;$++){if($<p)continue;let D=e+$,V;if(g===0&&v>0)V=x/u,++x>=u&&(g=1,x=0,v=0);else if(g===0&&v<0){if($<h)V=1;else if(V=1-x/u,++x>=u){g=2;break}}else V=1;y>=0&&y<s&&(o[D]+=a[y]*V,i[D]+=l[y]*V),y++,g===1&&y>=d&&(g=0,v=-1,x=0)}this.#i=g,this.#o=v,this.#n=y,this.#s=x,this.#l=0,this.#u=0}};var qs=class{#e;#t;#r;#i;#o;#n;#s=0;#l;#u;#a=0;constructor(e,t,o,i,n=0,s=0){this.#e=e,this.#t=t,this.#r=o,this.#l=i,this.#n=n,this.#u=s,this.#n>=t.numberOfFrames?(this.#i=2,this.#o=0):n===0?(this.#i=1,this.#o=0):(this.#i=0,this.#o=1)}get readPosition(){return this.#n}done(){return this.#i===2}isFadingOut(){return this.#i===0&&this.#o<0}startFadeOut(e){this.#i!==2&&!(this.#i===0&&this.#o<0)&&(this.#i=0,this.#o=-1,this.#s=0,this.#a=e)}setPlaybackRate(e){this.#l=e}process(e,t){let[o,i]=this.#e.channels(),{frames:n,numberOfFrames:s}=this.#t,a=n[0],l=n.length===1?n[0]:n[1],u=this.#r,d=this.#l,p=s-u*d,h=this.#u,g=this.#a,v=this.#i,y=this.#o,x=this.#n,$=this.#s;for(let D=0;D<t&&v!==2;D++){if(D<h)continue;let V=e+D,O;if(v===0&&y>0)O=$/u,++$>=u&&(v=1,$=0,y=0);else if(v===0&&y<0){if(D<g)O=1;else if(O=1-$/u,++$>=u){v=2;break}}else O=1;let j=x|0;if(j>=0&&j<s-1){let Y=x-j,K=a[j],ie=l[j];o[V]+=(K+Y*(a[j+1]-K))*O,i[V]+=(ie+Y*(l[j+1]-ie))*O}x+=d,v===1&&x>=p&&(v=0,y=-1,$=0)}this.#i=v,this.#o=y,this.#n=x,this.#s=$,this.#u=0,this.#a=0}};var xd=class{#e;#t;#r;#i;#o;#n;#s=1;#l=0;#u=0;#a=0;#c=0;#d=0;constructor(e,t,o,i,n,s,a){this.#e=e,this.#t=t,this.#r=n,this.#n=i,this.#i=Math.round(.02*a),this.#o=1/this.#i,this.#a=o,this.#c=s,this.#d=0,o>0?(this.#s=0,this.#l=1,this.#u=0):(this.#s=1,this.#l=0,this.#u=0)}done(){return this.#s===2}isFadingOut(){return this.#s===0&&this.#l<0}readPosition(){return this.#a}segmentEnd(){return this.#n}setSegmentEnd(e){this.#n=e}startFadeOut(e){if(this.#s!==2&&!(this.#s===0&&this.#l<0)){if(this.#s===0&&this.#l>0){let t=this.#u*this.#o;this.#u=this.#i*(1-t)}else this.#u=0;this.#s=0,this.#l=-1,this.#d=e}}process(e,t){if(this.#s===2)return;let[o,i]=this.#e.channels(),{frames:n,numberOfFrames:s}=this.#t,a=n[0],l=n.length===1?n[0]:n[1],u=this.#n,d=this.#i,p=this.#o,h=this.#r,g=this.#d,v=this.#s,y=this.#l,x=this.#u,$=this.#a;for(let D=this.#c;D<t&&v!==2;D++){let V=e+D,O;if(v===0){if(y>0)O=x*p,x+=1,x>=d&&(v=1,x=0,y=0);else if(D<g)O=1;else if(O=1-x*p,x+=1,x>=d){v=2;break}}else O=1;let j=$|0;if(j>=0&&j<s-1){let Y=$-j,K=a[j],ie=l[j];o[V]+=(K+Y*(a[j+1]-K))*O,i[V]+=(ie+Y*(l[j+1]-ie))*O}$+=h}this.#s=v,this.#l=y,this.#u=x,this.#a=$,this.#c=0,this.#d=0}};var Zx=class{#e;#t;#r;#i;#o;#n;#s;#l;#u;#a;#c=1;#d=0;#p=0;#h=0;#f=0;#m=0;#v=0;#g=0;constructor(e,t,o,i,n,s,a,l){this.#e=e,this.#t=t,this.#r=n,this.#a=i;let u=.01*a,d=.02*a;this.#i=o+u,this.#o=i-d,this.#n=Math.round(.02*a),this.#s=1/this.#n,this.#l=Math.round(.01*a),this.#u=1/this.#l,this.#h=l??o,this.#v=s,this.#g=0,this.#f=0,this.#m=0,l!==void 0||o>0?(this.#c=0,this.#d=1,this.#p=0):(this.#c=1,this.#d=0,this.#p=0),this.#i>=this.#o&&(this.#c=2)}done(){return this.#c===2}isFadingOut(){return this.#c===0&&this.#d<0}readPosition(){return this.#h}segmentEnd(){return this.#a}setSegmentEnd(e){this.#a=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.#s;this.#p=this.#n*(1-t)}else this.#p=0;this.#c=0,this.#d=-1,this.#g=e}}process(e,t){if(this.#c===2)return;let[o,i]=this.#e.channels(),{frames:n,numberOfFrames:s}=this.#t,a=n[0],l=n.length===1?n[0]:n[1],u=this.#i,p=this.#o-this.#l,h=this.#n,g=this.#s,v=this.#l,y=this.#u,x=this.#r,$=this.#g,D=this.#c,V=this.#d,O=this.#p,j=this.#h,Y=this.#f,K=this.#m;for(let ie=this.#v;ie<t&&D!==2;ie++){let re=e+ie,Ce;if(D===0){if(V>0)Ce=O*g,O+=1,O>=h&&(D=1,O=0,V=0);else if(ie<$)Ce=1;else if(Ce=1-O*g,O+=1,O>=h){D=2;break}}else Ce=1;let je=0,Qe=0,Ae=j|0;if(Ae>=0&&Ae<s-1){let Xe=j-Ae,Le=a[Ae],be=l[Ae];je=Le+Xe*(a[Ae+1]-Le),Qe=be+Xe*(l[Ae+1]-be)}if(Y===0&&j>=p&&(Y=1,K=u),Y>0){let Xe=K|0;if(Xe>=0&&Xe<s-1){let Le=K-Xe,be=a[Xe],et=l[Xe],Lr=be+Le*(a[Xe+1]-be),El=et+Le*(l[Xe+1]-et),Cn=Y*y;je=je*(1-Cn)+Lr*Cn,Qe=Qe*(1-Cn)+El*Cn}K+=x,Y+=1,Y>=v&&(j=K,Y=0)}o[re]+=je*Ce,i[re]+=Qe*Ce,j+=x}this.#c=D,this.#d=V,this.#p=O,this.#h=j,this.#f=Y,this.#m=K,this.#v=0,this.#g=0}};var Bf=class{#e;#t;#r;#i;#o;#n;#s;#l;#u;#a=1;#c=0;#d=0;#p=0;#h=1;#f=0;#m=0;#v=0;#g=0;constructor(e,t,o,i,n,s,a,l){this.#e=e,this.#t=t,this.#r=n,this.#u=i;let u=.01*a,d=.02*a;this.#i=o+u,this.#o=i-d,this.#n=Math.round(.02*a),this.#s=1/this.#n,this.#l=Math.round(.01*a),this.#p=l?.position??o,this.#h=l?.direction??1,this.#v=s,this.#g=0,this.#f=0,this.#m=0,l!==void 0||o>0?(this.#a=0,this.#c=1,this.#d=0):(this.#a=1,this.#c=0,this.#d=0),this.#i>=this.#o&&(this.#a=2)}done(){return this.#a===2}isFadingOut(){return this.#a===0&&this.#c<0}readPosition(){return this.#p}segmentEnd(){return this.#u}setSegmentEnd(e){this.#u=e}startFadeOut(e){if(this.#a!==2&&!(this.#a===0&&this.#c<0)){if(this.#a===0&&this.#c>0){let t=this.#d*this.#s;this.#d=this.#n*(1-t)}else this.#d=0;this.#a=0,this.#c=-1,this.#g=e}}process(e,t){if(this.#a===2)return;let[o,i]=this.#e.channels(),{frames:n,numberOfFrames:s}=this.#t,a=n[0],l=n.length===1?n[0]:n[1],u=this.#i,d=this.#o,p=d-this.#l,h=u+this.#l,g=this.#n,v=this.#s,y=this.#l,x=this.#r,$=this.#g,D=this.#a,V=this.#c,O=this.#d,j=this.#p,Y=this.#h,K=this.#f,ie=this.#m;for(let re=this.#v;re<t&&D!==2;re++){let Ce=e+re,je;if(D===0){if(V>0)je=O*v,O+=1,O>=g&&(D=1,O=0,V=0);else if(re<$)je=1;else if(je=1-O*v,O+=1,O>=g){D=2;break}}else je=1;let Qe=0,Ae=0,Xe=j|0;if(Xe>=0&&Xe<s-1){let Le=j-Xe,be=a[Xe],et=l[Xe];Qe=be+Le*(a[Xe+1]-be),Ae=et+Le*(l[Xe+1]-et)}if(K===0&&(Y>0&&j>=p?(K=1,ie=d):Y<0&&j<=h&&(K=1,ie=u)),K>0){let Le=ie|0;if(Le>=0&&Le<s-1){let be=ie-Le,et=a[Le],Lr=l[Le],El=et+be*(a[Le+1]-et),Cn=Lr+be*(l[Le+1]-Lr),$f=K/y,Df=Math.cos($f*Math.PI*.5),en=Math.sin($f*Math.PI*.5);Qe=Qe*Df+El*en,Ae=Ae*Df+Cn*en}ie-=Y*x,K+=1,K>=y&&(j=ie,Y=-Y,K=0)}o[Ce]+=Qe*je,i[Ce]+=Ae*je,j+=Y*x}this.#a=D,this.#c=V,this.#d=O,this.#p=j,this.#h=Y,this.#f=K,this.#m=ie,this.#v=0,this.#g=0}};var Gx=class{#e=[];#t=-1;#r=0;constructor(){}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,o,i,n,s,a){let{p0:l,p1:u,bpm:d,flags:p}=s,h=i.warpMarkers,g=i.transientPlayMode,v=i.playbackRate,{sampleRate:y,numberOfFrames:x}=t,$=x/y;nt.some(p,2)&&this.reset();let D=u-l,V=s.s0,j=s.s1-V,Y=(a.resultStart-l)/D,K=(a.resultEnd-l)/D,ie=V+j*Y|0,Ce=(V+j*K|0)-ie,je=h.first(),Qe=h.last();if(!vt(je)||!vt(Qe))return;let Ae=a.resultStart-a.rawStart;if(Ae<je.position||Ae>=Qe.position)return;let Xe=Ae+D,Le=this.#n(Xe,h);if(!vt(Le))return;let be=Le+n;if(be<0||be>=$)return;let et=this.#n(Ae,h)??0,Lr=Le-et,El=D/(960*d/60),Cn=El>0?Lr/El:1,$f=.02*Cn*v*(t.sampleRate/y),Df=be+$f,en=o.floorLastIndex(Df);if(en<this.#t&&this.reset(),en>this.#t&&en>=0){let Wt=o.optAt(en);vt(Wt)&&(this.#i(e,t,o,h,g,v,n,d,y,en,Wt.position),this.#t=en)}for(let Wt of this.#e){if(!(Wt instanceof xd)||Wt.done()||Wt.isFadingOut())continue;let Zb=Wt.readPosition(),FS=Wt.segmentEnd();if(Zb>=FS){Wt.startFadeOut(0);continue}if(g!==Kn.Once){let Mf=this.#o(o,this.#t,t);if(vt(Mf)){let{startSamples:IS,endSamples:kS,hasNext:oI,nextTransientFileSeconds:nI}=Mf,$S=kS-IS,DS=Number.POSITIVE_INFINITY;if(oI){let _d=o.optAt(this.#t);if(vt(_d)){let sI=_d.position-n,aI=this.#s(sI,h),lI=nI-n,uI=this.#s(lI,h)-aI;DS=q.pulsesToSeconds(uI,d)*y}}let MS=DS*v,CS=$S/MS;if(!(CS>=.99&&CS<=1.01)&&MS>$S){Wt.startFadeOut(0);let _d=this.#l(e,t,IS,kS,v,0,y,g,!0,Zb);vt(_d)&&this.#e.push(_d);continue}}}let NS=(FS-Zb)/v;if(NS<Ce){let Mf=Math.max(0,Math.floor(NS));Wt.startFadeOut(Mf)}}for(let Wt of this.#e)Wt.process(ie,Ce);for(let Wt=this.#e.length-1;Wt>=0;Wt--)this.#e[Wt].done()&&this.#e.splice(Wt,1)}#i(e,t,o,i,n,s,a,l,u,d,p){let h=this.#o(o,d,t);if(!vt(h))return;let{startSamples:g,endSamples:v,hasNext:y,nextTransientFileSeconds:x}=h,$=v-g,D=Number.POSITIVE_INFINITY;if(y){let Ae=p-a,Xe=this.#s(Ae,i),Le=x-a,et=this.#s(Le,i)-Xe;D=q.pulsesToSeconds(et,l)*u}let V=.02*u,O=.02*t.sampleRate*s,j=null;for(let Ae of this.#e){if(Ae.done()||!(Ae instanceof xd))continue;let Le=Ae.readPosition()+O-g;if(!(Math.abs(Le)>=V)){this.#r+=Le,Math.abs(this.#r)<V?(j=Ae,Ae.setSegmentEnd(v)):this.#r=0;break}}if(vt(j)){for(let Ae of this.#e)Ae!==j&&!Ae.done()&&Ae.startFadeOut(0);return}for(let Ae of this.#e)Ae.done()||Ae.startFadeOut(0);let Y=D*s,K=$/Y,re=!(K>=.99&&K<=1.01)&&Y>$,Ce=.02*t.sampleRate*s,je=d===0?g:Math.max(0,g-Ce),Qe=this.#l(e,t,je,v,s,0,u,n,re);vt(Qe)&&this.#e.push(Qe),this.#r=0}#o(e,t,o){let i=e.optAt(t);if(!vt(i))return null;let n=e.optAt(t+1);return{startSamples:i.position*o.sampleRate,endSamples:vt(n)?n.position*o.sampleRate:o.numberOfFrames,hasNext:vt(n),nextTransientFileSeconds:vt(n)?n.position:Number.POSITIVE_INFINITY}}#n(e,t){for(let o=0;o<t.length()-1;o++){let i=t.optAt(o),n=t.optAt(o+1);if(!(!vt(i)||!vt(n))&&e>=i.position&&e<n.position){let s=(e-i.position)/(n.position-i.position);return i.seconds+s*(n.seconds-i.seconds)}}return null}#s(e,t){for(let i=0;i<t.length()-1;i++){let n=t.optAt(i),s=t.optAt(i+1);if(!(!vt(n)||!vt(s))&&e>=n.seconds&&e<s.seconds){let a=(e-n.seconds)/(s.seconds-n.seconds);return n.position+a*(s.position-n.position)}}let o=t.last();return vt(o)&&e>=o.seconds?o.position:0}#l(e,t,o,i,n,s,a,l,u,d){return o>=i?null:l===Kn.Once||!u?new xd(e,t,o,i,n,s,a):l===Kn.Repeat?new Zx(e,t,o,i,n,s,a,d):G(d)?new Bf(e,t,o,i,n,s,a,{position:d,direction:1}):new Bf(e,t,o,i,n,s,a)}};var qx=class extends cr{#e;#t;#r;#i;constructor(e,t){super(e),this.#e=t,this.#t=new ye(2),this.#r=this.own(new Ee(e.broadcaster,t.address)),this.#i=b.newSet(({adapter:{uuid:o}})=>o),this.ownAll(this.#e.deviceHost().audioUnitBoxAdapter().tracks.catchupAndSubscribe({onAdd:o=>this.#i.add({adapter:o,voices:[],sequencer:new Gx}),onRemove:o=>this.#i.removeByKey(o.uuid),onReorder:o=>{}}),e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#t,this.outgoing))}get noteEventTarget(){return m.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,ue),this.#i.forEach(i=>e.forEach(n=>this.#o(i,n))),this.#t.assertSanity();let[t,o]=this.#t.channels();this.#r.process(t,o)}parameterChanged(e){}#o(e,t){let{adapter:o}=e;if(o.type!==ne.Audio||!o.enabled.getValue()){e.voices.forEach(l=>l.startFadeOut(0)),e.sequencer.reset();return}let{p0:i,p1:n,flags:s}=t;if(!nt.every(s,5))return;let a=this.context.clipSequencing.iterate(o.uuid,i,n);for(let{optClip:l,sectionFrom:u,sectionTo:d}of a)l.match({none:()=>{for(let p of o.regions.collection.iterateRange(i,n)){if(p.mute||!Te(p,ds))continue;let h=p.file,g=h.getOrCreateLoader().data;if(g.isEmpty())return;let v=p.waveformOffset.getValue(),y=p.asPlayModeTimeStretch;if(y.nonEmpty()){let x=h.transients;if(x.length()<2)return;for(let $ of Yt.locateLoops(p,i,n)){let D=y.unwrap();this.#u(e,t,$,g.unwrap(),D,x,v)}}else for(let x of Yt.locateLoops(p,i,n))this.#n(e,t,x,p,g.unwrap())}},some:p=>{if(!Te(p,as))return;let h=p.file,g=h.getOrCreateLoader().data;if(g.isEmpty())return;let v=p.asPlayModeTimeStretch;if(v.nonEmpty()){let y=v.unwrap(),x=h.transients;if(x.length()<2)return;for(let $ of Yt.locateLoops({position:0,loopDuration:p.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},u,d))this.#u(e,t,$,g.unwrap(),y,x,p.waveformOffset.getValue())}else for(let y of Yt.locateLoops({position:0,loopDuration:p.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},u,d))this.#n(e,t,y,p,g.unwrap())}})}#n(e,t,o,i,n){let{p0:s,p1:a,s0:l,s1:u,flags:d}=t,p=u-l,h=a-s,g=(o.resultStart-s)/h,v=(o.resultEnd-s)/h,y=l+p*g,x=l+p*v,$=x-y|0,D=i.waveformOffset.getValue();M(l<=y&&x<=u,()=>`Out of bounds ${y}, ${x}`),nt.some(d,2)&&(e.voices.forEach(O=>O.startFadeOut(0)),e.sequencer.reset());let V=i.asPlayModePitchStretch;if(i.isPlayModeNoStretch){let O=o.resultStartValue*n.numberOfFrames+D*n.sampleRate|0;this.#s(e,n,O,0)}else if(V.isEmpty()){let O=n.numberOfFrames,Y=(o.resultEndValue-o.resultStartValue)*O,K=(o.resultEnd-o.resultStart)/h*p,ie=Y/K,re=o.resultStartValue*n.numberOfFrames+D*n.sampleRate;this.#l(e,n,ie,re,0)}else{let j=V.unwrap().warpMarkers,Y=j.first(),K=j.last();if(Y===null||K===null){e.voices.forEach(Qe=>Qe.startFadeOut(0));return}let ie=o.resultStart-o.rawStart;if(ie<Y.position||ie>=K.position){e.voices.forEach(Qe=>Qe.startFadeOut(0));return}let re=this.#c(ie,o.resultStartValue,j),Ce=this.#a(ie,j,n.sampleRate,h,p),je=(re+D)*n.sampleRate;this.#l(e,n,Ce,je,0)}for(let O of e.voices)O.process(y|0,$);e.voices=e.voices.filter(O=>!O.done())}#s(e,t,o,i){let n=Math.round(.02*t.sampleRate),s=!1;for(let a of e.voices)a instanceof Pl&&!a.isFadingOut()?Math.abs(a.readPosition-o)>n?a.startFadeOut(i):s=!0:a.startFadeOut(i);s||e.voices.push(new Pl(this.#t,t,o,i))}#l(e,t,o,i,n){let s=Math.round(.02*t.sampleRate);if(e.voices.length===0)e.voices.push(new qs(this.#t,t,s,o,i,n));else{let a=!1;for(let l of e.voices)if(l instanceof qs){if(l.isFadingOut())continue;Math.abs(l.readPosition-i)>s?l.startFadeOut(n):(l.setPlaybackRate(o),a=!0)}else l.startFadeOut(n);a||e.voices.push(new qs(this.#t,t,s,o,i,n))}}#u(e,t,o,i,n,s,a){for(let l of e.voices)(l instanceof qs||l instanceof Pl)&&l.startFadeOut(0);e.sequencer.process(this.#t,i,s,n,a,t,o),e.voices=e.voices.filter(l=>(l instanceof qs||l instanceof Pl)&&!l.done())}#a(e,t,o,i,n){let s=t.floorLastIndex(e),a=t.optAt(s),l=t.optAt(s+1);if(a===null||l===null)return 1;let u=l.position-a.position,h=(l.seconds-a.seconds)*o/u,g=n/i;return h/g}#c(e,t,o){let i=o.floorLastIndex(e),n=o.optAt(i),s=o.optAt(i+1);if(n===null||s===null)return t;let a=(e-n.position)/(s.position-n.position);return n.seconds+a*(s.seconds-n.seconds)}};var jr=class extends cr{process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:o,p0:i,p1:n,s0:s,bpm:a}=t,l=null,u=i;for(let d of this.eventInput.get(o))l?.forEach(p=>this.handleEvent(t,p)),l=null,u<d.position&&(this.processEvents(t,u,d.position),u=d.position),_f.isOfType(d)?this.updateParameters(d.position,s/sampleRate+q.pulsesToSeconds(d.position-i,a)):(l??=[]).push(d);l?.forEach(d=>this.handleEvent(t,d)),l=null,u<n&&this.processEvents(t,u,n)}),this.eventInput.clear()}introduceBlock(e){}};var bd;(t=>(t.create=()=>({mult:1,add:0}),t.apply=(o,i)=>i*o.mult+o.add))(bd||={});var Hx=Object.freeze([{name:"up",run:(r,e,t,o,i,n)=>{let s=r.length,a=s*e,l=t%s,u=Math.floor(t%a/s),d=r[l];return pe.start(o,i,d.pitch+u*12,bd.apply(n,d.velocity))}},{name:"down",run:(r,e,t,o,i,n)=>{let s=r.length,a=s*e,l=s-1-t%s,u=e-1-Math.floor(t%a/s),d=r[l];return pe.start(o,i,d.pitch+u*12,bd.apply(n,d.velocity))}},{name:"up-down",run:(r,e,t,o,i,n)=>{let s=r.length,a=s*e,l=Math.max(1,a*2-2),u=t%l,d=u<a?u:l-u,p=d%s,h=Math.floor(d/s),g=r[p];return pe.start(o,i,g.pitch+h*12,bd.apply(n,g.velocity))}}]);var Jx=class extends jr{#e;#t;#r;#i;#o;#n;#s;#l;#u;#a=bd.create();#c=m.None;#d=Hx[0];#p=NaN;#h=1;#f=1;#m=1;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new ta,this.#i=this.own(this.bindParameter(t.namedParameter.modeIndex)),this.#o=this.own(this.bindParameter(t.namedParameter.rate)),this.#n=this.own(this.bindParameter(t.namedParameter.gate)),this.#s=this.own(this.bindParameter(t.namedParameter.repeat)),this.#l=this.own(this.bindParameter(t.namedParameter.numOctaves)),this.#u=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 m.wrap(this)}setNoteEventSource(e){return M(this.#c.isEmpty(),"NoteEventSource already set"),this.#c=m.wrap(e),Z.create(()=>this.#c=m.None)}*processNotes(e,t,o){if(this.#r.nonEmpty())if(nt.every(o,2))for(let n of this.#r.releaseAll())yield pe.stop(n,e);else for(let n of this.#r.releaseLinearCompleted(t))yield pe.stop(n,n.position+n.duration);if(this.#c.nonEmpty()){let i=this.#c.unwrap();for(let s of i.processNotes(e,t,o));let n=!nt.every(o,1);for(let{position:s,index:a}of zn.iterateWithIndex(e,t,this.#p)){let l=Array.from(i.iterateActiveNotesAt(s,n));if(l.length===0)continue;let u=Math.floor(a/this.#f),d=Math.max(1,Math.floor(this.#p*this.#h)),p=this.#d.run(l,this.#m,u,s,d,this.#a);this.#r.addAndRetain({...p}),yield p}for(let s of this.#r.releaseLinearCompleted(t))yield pe.stop(s,s.position+s.duration)}}*iterateActiveNotesAt(e,t){this.#c.isEmpty()||t||(yield*this.#r.overlapping(e,er.Comparator))}reset(){this.#t.length=0,this.#r.clear(),this.eventInput.clear()}processEvents(e,t,o){}parameterChanged(e){if(e===this.#i)this.#d=Hx.at(this.#i.getValue())??Hx[0];else if(e===this.#o)this.#p=hr.toPPQN(io.RateFractions[this.#o.getValue()]);else if(e===this.#n)this.#h=this.#n.getValue();else if(e===this.#s)this.#f=this.#s.getValue();else if(e===this.#l)this.#m=this.#l.getValue();else if(e===this.#u){let t=this.#u.getValue();t<=0?(this.#a.add=1+t,this.#a.mult=0):(this.#a.add=1-t,this.#a.mult=t)}}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Qx=class extends jr{#e;#t;#r;#i;#o;#n=m.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Ri(e.broadcaster,t.address)),this.#r=this.own(this.bindParameter(t.namedParameter.octaves)),this.#i=this.own(this.bindParameter(t.namedParameter.semiTones)),this.#o=this.own(this.bindParameter(t.namedParameter.cent)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return M(this.#n.isEmpty(),"NoteEventSource already set"),this.#n=m.wrap(e),Z.create(()=>this.#n=m.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,o){if(!this.#n.isEmpty())for(let i of this.#n.unwrap().processNotes(e,t,o))if(pe.isStart(i)){this.#t.noteOn(i.pitch);let{cent:n,octaves:s,semiTones:a}=this.#e.namedParameter;yield Kr.overwrite(i,{pitch:i.pitch+s.valueAt(i.position)*12+a.valueAt(i.position),cent:i.cent+n.valueAt(i.position)})}else this.#t.noteOff(i.pitch),yield i}*iterateActiveNotesAt(e,t){if(!this.#n.isEmpty()){for(let o of this.#n.unwrap().iterateActiveNotesAt(e,t))if(o.type==="note-event"){let{cent:i,octaves:n,semiTones:s}=this.#e.namedParameter;yield Kr.overwrite(o,{pitch:o.pitch+n.valueAt(o.position)*12+s.valueAt(o.position),cent:o.cent+i.valueAt(o.position)})}}}reset(){this.eventInput.clear()}processEvents(e,t,o){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Xx=class r extends De{static ID=0;#e=r.ID++;#t;#r;#i;#o;#n;#s;#l;#u;#a;#c;#d;#p;#h;#f;#m;#v;#g;#A;#B;#S;#_;#$;#y;#w;#x;#E;#M;#N;#F;#P;#I;#k;#D;#R;#O;#C;#T=m.None;#V=!1;constructor(e,t){super(e),this.#t=t,this.#r=new ye,this.#i=this.own(new Ee(e.broadcaster,t.address)),this.#o=new Bl,this.#n=new Float32Array(this.#o.numBins()),this.#s=T.create(()=>new xo,7),this.#l=[new On(4),new On(4)],this.#u=[new On(4),new On(4)],this.#a=[this.#u,[new Ft,new Ft],[new Ft,new Ft],[new Ft,new Ft],[new Ft,new Ft],[new Ft,new Ft],this.#l],this.#c=T.create(()=>!0,7);let o=this.#t.namedParameter;this.#d=this.own(this.bindParameter(o.highPass.enabled)),this.#h=this.own(this.bindParameter(o.highPass.q)),this.#p=this.own(this.bindParameter(o.highPass.frequency)),this.#f=this.own(this.bindParameter(o.highPass.order)),this.#m=this.own(this.bindParameter(o.lowShelf.enabled)),this.#v=this.own(this.bindParameter(o.lowShelf.frequency)),this.#g=this.own(this.bindParameter(o.lowShelf.gain)),this.#A=this.own(this.bindParameter(o.lowBell.enabled)),this.#B=this.own(this.bindParameter(o.lowBell.frequency)),this.#S=this.own(this.bindParameter(o.lowBell.gain)),this.#_=this.own(this.bindParameter(o.lowBell.q)),this.#$=this.own(this.bindParameter(o.midBell.enabled)),this.#y=this.own(this.bindParameter(o.midBell.frequency)),this.#w=this.own(this.bindParameter(o.midBell.gain)),this.#x=this.own(this.bindParameter(o.midBell.q)),this.#E=this.own(this.bindParameter(o.highBell.enabled)),this.#M=this.own(this.bindParameter(o.highBell.frequency)),this.#N=this.own(this.bindParameter(o.highBell.gain)),this.#F=this.own(this.bindParameter(o.highBell.q)),this.#P=this.own(this.bindParameter(o.highShelf.enabled)),this.#I=this.own(this.bindParameter(o.highShelf.frequency)),this.#k=this.own(this.bindParameter(o.highShelf.gain)),this.#D=this.own(this.bindParameter(o.lowPass.enabled)),this.#R=this.own(this.bindParameter(o.lowPass.frequency)),this.#O=this.own(this.bindParameter(o.lowPass.q)),this.#C=this.own(this.bindParameter(o.lowPass.order)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing),e.broadcaster.broadcastFloats(t.spectrum,this.#n,i=>{this.#V=i,i&&(this.#n.set(this.#o.bins()),this.#o.decay=!0)})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#r.clear(),this.#a.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.#T=m.wrap(e),{terminate:()=>this.#T=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,o){if(this.#T.isEmpty())return;let[i,n]=this.#r.channels(),s=this.#T.unwrap();if(this.#c.some(a=>a)){let[a,l]=s.channels();this.#s.forEach((u,d)=>{if(this.#c[d]){let[p,h]=this.#a[d];p.process(u,a,i,t,o),h.process(u,l,n,t,o),a=i,l=n}})}else{let[a,l]=s.channels();for(let u=t;u<o;u++)i[u]=a[u],n[u]=l[u]}this.#i.process(i,n,t,o),this.#V&&this.#o.process(i,n,t,o)}parameterChanged(e){if(e===this.#C){let o=this.#C.getValue()+1;this.#l[0].order=o,this.#l[1].order=o}else if(e===this.#f){let o=this.#f.getValue()+1;this.#u[0].order=o,this.#u[1].order=o}else if(e===this.#p||e===this.#h){let t=this.#p.getValue(),o=this.#h.getValue();this.#s[0].setHighpassParams(t/sampleRate,o)}else if(e===this.#v||e===this.#g){let t=this.#v.getValue(),o=this.#g.getValue();this.#s[1].setLowShelfParams(t/sampleRate,o)}else if(e===this.#B||e===this.#S||e===this.#_){let t=this.#B.getValue(),o=this.#S.getValue(),i=this.#_.getValue();this.#s[2].setPeakingParams(t/sampleRate,i,o)}else if(e===this.#y||e===this.#w||e===this.#x){let t=this.#y.getValue(),o=this.#w.getValue(),i=this.#x.getValue();this.#s[3].setPeakingParams(t/sampleRate,i,o)}else if(e===this.#M||e===this.#N||e===this.#F){let t=this.#M.getValue(),o=this.#N.getValue(),i=this.#F.getValue();this.#s[4].setPeakingParams(t/sampleRate,i,o)}else if(e===this.#I||e===this.#k){let t=this.#I.getValue(),o=this.#k.getValue();this.#s[5].setHighShelfParams(t/sampleRate,o)}else if(e===this.#R||e===this.#O){let t=this.#R.getValue(),o=this.#O.getValue();this.#s[6].setLowpassParams(t/sampleRate,o)}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.#$?this.#c[3]=this.#$.getValue():e===this.#E?this.#c[4]=this.#E.getValue():e===this.#P?this.#c[5]=this.#P.getValue():e===this.#D&&(this.#c[6]=this.#D.getValue())}toString(){return`{${this.constructor.name} (${this.#e})`}};var Yx=class{roomSize;damp;predelayInSamples;wetGain;dryGain;#e=new Float32Array(2048);#t=new Float32Array(2048);#r=new Float32Array(2048);#i=new Float32Array(2048);#o=new Float32Array(2048);#n=new Float32Array(2048);#s=new Float32Array(2048);#l=new Float32Array(2048);#u=new Float32Array(1024);#a=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);#v=new Float32Array(2048);#g=new Float32Array(2048);#A=new Float32Array(2048);#B=new Float32Array(2048);#S=new Float32Array(1024);#_=new Float32Array(512);#$=new Float32Array(512);#y=new Float32Array(256);#w;#x;#E=0;#M=0;#N=0;#F=0;#P=0;#I=0;#k=0;#D=0;#R=0;#O=0;#C=0;#T=0;#V=0;#z=0;#U=0;#j=0;#L=0;#K=0;#W=0;#Z=0;#G=0;#H=0;#J=0;#Q=0;#X=0;#Y=0;#ee=0;#te=0;#re=0;#ie=0;#oe=0;#ne=0;#se=0;#ae=0;#le=0;#ue=0;#ce=0;#de=0;#pe=0;#he=0;#b=0;#q=0;constructor(e=.5){this.#w=Tn(Math.ceil(e*sampleRate)),this.#x=new Float32Array(this.#w<<1),this.damp=0,this.roomSize=.5,this.wetGain=.3333,this.dryGain=1-this.wetGain,this.#b=0,this.#q=0,this.predelayInSamples=.008*sampleRate,this.clearHistory()}clear(){this.#b=0,this.#q=0,this.clearHistory(),this.clearBuffers()}process(e,t,o,i){let[n,s]=t.channels(),[a,l]=e.channels(),u=.4*this.damp,d=1-u,p=.7+.28*this.roomSize;for(let h=o;h<i;++h){let g=n[h],v=s[h],y=this.#q-this.predelayInSamples;y<0&&(y+=this.#w);let x;x=y<<1;let $=.01,D=this.#x[x]*$,V=this.#x[x+1]*$;x=this.#q<<1,this.#x[x]=g,this.#x[x+1]=v,this.#q=this.#q+1&this.#w-1;let O=this.#b&2047;this.#E=d*this.#M+u*this.#E,this.#e[O]=D+p*this.#E,this.#M=this.#e[this.#b-1617&2047],this.#N=d*this.#F+u*this.#N,this.#t[O]=D+p*this.#N,this.#F=this.#t[this.#b-1557&2047],this.#P=d*this.#I+u*this.#P,this.#r[O]=D+p*this.#P,this.#I=this.#r[this.#b-1491&2047],this.#k=d*this.#D+u*this.#k,this.#i[O]=D+p*this.#k,this.#D=this.#i[this.#b-1422&2047],this.#R=d*this.#O+u*this.#R,this.#o[O]=D+p*this.#R,this.#O=this.#o[this.#b-1356&2047],this.#C=d*this.#T+u*this.#C,this.#n[O]=D+p*this.#C,this.#T=this.#n[this.#b-1277&2047],this.#V=d*this.#z+u*this.#V,this.#s[O]=D+p*this.#V,this.#z=this.#s[this.#b-1188&2047],this.#U=d*this.#j+u*this.#U,this.#l[O]=D+p*this.#U,this.#j=this.#l[this.#b-1116&2047];let j=this.#j+this.#z+this.#T+this.#O+this.#D+this.#I+this.#F+this.#M,Y=this.#L-j,K=this.#K-Y,ie=this.#W-K;this.#u[this.#b&1023]=j+.5*this.#L,this.#L=this.#u[this.#b-556&1023],this.#a[this.#b&511]=Y+.5*this.#K,this.#K=this.#a[this.#b-441&511],this.#c[this.#b&511]=K+.5*this.#W,this.#W=this.#c[this.#b-341&511],this.#d[this.#b&255]=ie+.5*this.#Z,this.#Z=this.#d[this.#b-225&255],a[h]=this.dryGain*g+this.wetGain*(this.#Z-ie),this.#G=d*this.#H+u*this.#G,this.#p[O]=V+p*this.#G,this.#H=this.#p[this.#b-1640&2047],this.#J=d*this.#Q+u*this.#J,this.#h[O]=V+p*this.#J,this.#Q=this.#h[this.#b-1580&2047],this.#X=d*this.#Y+u*this.#X,this.#f[O]=V+p*this.#X,this.#Y=this.#f[this.#b-1514&2047],this.#ee=d*this.#te+u*this.#ee,this.#m[O]=V+p*this.#ee,this.#te=this.#m[this.#b-1445&2047],this.#re=d*this.#ie+u*this.#re,this.#v[O]=V+p*this.#re,this.#ie=this.#v[this.#b-1379&2047],this.#oe=d*this.#ne+u*this.#oe,this.#g[O]=V+p*this.#oe,this.#ne=this.#g[this.#b-1300&2047],this.#se=d*this.#ae+u*this.#se,this.#A[O]=V+p*this.#se,this.#ae=this.#A[this.#b-1211&2047],this.#le=d*this.#ue+u*this.#le,this.#B[O]=V+p*this.#le,this.#ue=this.#B[this.#b-1139&2047];let re=this.#ue+this.#ae+this.#ne+this.#ie+this.#te+this.#Y+this.#Q+this.#H,Ce=this.#ce-re,je=this.#de-Ce,Qe=this.#pe-je;this.#S[this.#b&1023]=re+.5*this.#ce,this.#ce=this.#S[this.#b-579&1023],this.#_[this.#b&511]=Ce+.5*this.#de,this.#de=this.#_[this.#b-464&511],this.#$[this.#b&511]=je+.5*this.#pe,this.#pe=this.#$[this.#b-364&511],this.#y[this.#b&255]=Qe+.5*this.#he,this.#he=this.#y[this.#b-248&255],l[h]=this.dryGain*v+this.wetGain*(this.#he-Qe),this.#b++}}clearBuffers(){this.#e.fill(0),this.#t.fill(0),this.#r.fill(0),this.#i.fill(0),this.#o.fill(0),this.#n.fill(0),this.#s.fill(0),this.#l.fill(0),this.#u.fill(0),this.#a.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.#v.fill(0),this.#g.fill(0),this.#A.fill(0),this.#B.fill(0),this.#S.fill(0),this.#_.fill(0),this.#$.fill(0),this.#y.fill(0),this.#x.fill(0)}clearHistory(){this.#E=0,this.#M=0,this.#N=0,this.#F=0,this.#P=0,this.#I=0,this.#k=0,this.#D=0,this.#R=0,this.#O=0,this.#C=0,this.#T=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.#G=0,this.#H=0,this.#J=0,this.#Q=0,this.#X=0,this.#Y=0,this.#ee=0,this.#te=0,this.#re=0,this.#ie=0,this.#oe=0,this.#ne=0,this.#se=0,this.#ae=0,this.#le=0,this.#ue=0,this.#ce=0,this.#de=0,this.#pe=0,this.#he=0}};var eb=class r extends De{static ID=0;#e=r.ID++;#t;#r;#i;#o;#n;#s;#l;#u;#a;#c=m.None;constructor(e,t){super(e),this.#t=t,this.#r=new ye,this.#i=this.own(new Ee(e.broadcaster,t.address)),this.#o=new Yx;let{decay:o,preDelay:i,damp:n,wet:s,dry:a}=this.#t.namedParameter;this.#n=this.own(this.bindParameter(o)),this.#s=this.own(this.bindParameter(i)),this.#l=this.own(this.bindParameter(n)),this.#u=this.own(this.bindParameter(s)),this.#a=this.own(this.bindParameter(a)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.clear(),this.#o.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#c=m.wrap(e),{terminate:()=>this.#c=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,o){if(this.#c.isEmpty())return;this.#o.process(this.#r,this.#c.unwrap(),t,o);let[i,n]=this.#r.channels();this.#i.process(i,n,t,o)}parameterChanged(e){this.#n===e?this.#o.roomSize=this.#n.getValue():this.#s===e?this.#o.predelayInSamples=Math.ceil(this.#s.getValue()*sampleRate):this.#l===e?this.#o.damp=this.#l.getValue():this.#u===e?this.#o.wetGain=Ve(this.#u.getValue()):this.#a===e&&(this.#o.dryGain=Ve(this.#a.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})`}};var tb=class extends De{#e;#t;#r;#i;#o;#n;#s;gain=1;release=1;loader=m.None;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new ye,this.#i=new Yo(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#o=this.own(new Ee(e.broadcaster,t.address)),this.#n=this.own(this.bindParameter(this.#e.namedParameter.volume)),this.#s=this.own(this.bindParameter(this.#e.namedParameter.release)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing),t.box.file.catchupAndSubscribe(o=>this.loader=o.targetVertex.map(({box:i})=>e.sampleManager.getOrCreate(i.address.uuid)))),this.readAllParameters()}get noteEventTarget(){return m.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.#o.clear()}get uuid(){return this.#e.uuid}get audioOutput(){return this.#r}get adapter(){return this.#e}handleEvent(e){pe.isStart(e)?this.#t.push(new wS(this,e)):pe.isStop(e)&&this.#t.find(t=>t.event().id===e.id)?.stop()}processAudio(e,t,o){this.#r.clear(t,o);for(let i=this.#t.length-1;i>=0;i--)this.#t[i].processAdd(this.#r,t,o)&&this.#t.splice(i,1)}parameterChanged(e){e===this.#n?this.gain=Ve(this.#n.getValue()):e===this.#s&&(this.release=this.#s.getValue()*sampleRate)}finishProcess(){this.#r.assertSanity(),this.#o.process(this.#r.getChannel(0),this.#r.getChannel(1))}toString(){return"{NanoDevice}"}},wS=class{#e;#t;#r=1;#i=0;#o=.003*sampleRate|0;#n=0;#s=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.#s=this.#n}processAdd(e,t,o){let i=this.#e.loader;if(i.isEmpty())return!0;let n=i.unwrap();return n.data.isEmpty()?!0:this.processSimple(e.channels(),n.data.unwrap(),t,o)}processSimple(e,t,o,i){let[n,s]=e,a=t.frames[0],l=t.frames[1]??a,u=t.numberOfFrames,d=t.sampleRate/sampleRate,p=this.#e.gain*this.#t.velocity,h=this.#e.release,g=1/h;for(let v=o;v<i;v++){let y=this.#i|0;if(y>=u-1)return!0;let x=this.#i-y,$=this.#n<this.#o?this.#n/this.#o:1,D=(Math.min(1-(this.#n-this.#s)*g,1)*$)**2,V=a[y]*(1-x)+a[y+1]*x,O=l[y]*(1-x)+l[y+1]*x;if(n[v]+=V*p*D,s[v]+=O*p*D,this.#i+=this.#r*d,++this.#n-this.#s>h)return!0}return!1}};var rb=class extends jr{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=new Yo(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,o){}handleEvent({index:e},t){pe.isStart(t)?this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:o})=>o.add(e,t)):pe.isStop(t)&&this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:o})=>o.add(e,t))}toString(){return"{PlayfieldSequencer}"}};var ib=class extends De{#e;#t;#r;#i;#o;constructor(e,t){super(e),this.#e=t,this.#t=new ye,this.#r=this.own(new Ee(e.broadcaster,t.adapter.address)),this.#i=[],this.#o=new vd,this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.adapter.address,this.#t,this.outgoing)),this.readAllParameters()}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}setAudioSource(e){return this.#i.push(e),{terminate:()=>{T.remove(this.#i,e),this.#t.clear()}}}get audioOutput(){return this.#t}get eventInput(){return this.#o}processAudio(e,t,o){}reset(){this.#r.clear()}finishProcess(){this.#t.clear();let[e,t]=this.#t.channels();for(let o of this.#i){let[i,n]=o.channels();for(let s=0;s<ue;s++)e[s]+=i[s],t[s]+=n[s]}this.#t.assertSanity(),this.#r.process(this.#t.getChannel(0),this.#t.getChannel(1))}toString(){return"{PlayfieldMixProcessor}"}};var ob=class r{static create(e,t,o,i){return new r(e,t,o,i)}#e=new R;#t;#r;#i=[];#o=!0;constructor(e,t,o,i){this.#t=b.newSet(({device:n})=>n.uuid),this.#r=this.#e.own(new R),this.#e.ownAll(t.catchupAndSubscribe({onAdd:n=>{this.invalidateWiring();let s=Nf.create(e,n.box),a=this.#t.add({device:s,subscription:s.adapter().enabledField.subscribe(()=>this.invalidateWiring())});M(a,"Could not add.")},onRemove:n=>{this.invalidateWiring();let{device:s,subscription:a}=this.#t.removeByKey(n.uuid);a.terminate(),s.terminate()},onReorder:n=>this.invalidateWiring()}),e.subscribeProcessPhase(n=>{if(n===0&&this.#o){let s=o;T.replace(this.#i,t.adapters().map(({uuid:a})=>this.#t.get(a).device));for(let a of this.#i)a.adapter().enabledField.getValue()&&(this.#r.own(a.setAudioSource(s.audioOutput)),this.#r.own(e.registerEdge(s.outgoing,a.incoming)),s=a);this.#r.own(i.setAudioSource(s.audioOutput)),this.#r.own(e.registerEdge(s.outgoing,i.incoming)),this.#o=!1}}))}invalidateWiring(){this.#r.terminate(),this.#o=!0}terminate(){this.#e.terminate(),this.#t.forEach(({device:e})=>e.terminate()),this.#t.clear(),this.#i=[]}toString(){return`{${this.constructor.name}}`}};var If=Math.floor(.005*sampleRate),nb=class{#e;#t;#r;#i;#o;#n;#s=0;#l=Number.POSITIVE_INFINITY;#u;#a;#c;#d;#p;#h;#f=!0;#m=!1;constructor(e,t,o,i){this.#e=e,this.#t=t,this.#i=o,this.#r=i,this.#o=e.gate,this.#n=Rl(this.#r.velocity);let{attack:n,release:s,sampleStart:a,sampleEnd:l}=this.#t;this.#u=n.getValue()*sampleRate,this.#a=s.getValue()*sampleRate,this.#c=(o.numberOfFrames-1)*a.getValue(),this.#d=(o.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.#a=If,this.#v(),this.#f=!1):this.#o!==Ho.Off&&this.#v())}processAdd(e,t,o){let[i,n]=e,{frames:s,numberOfFrames:a}=this.#i,l=s[0],u=s[1]??l,{pitch:d}=this.#t,p=this.#d-this.#c,h=Math.sign(p),g=this.#i.sampleRate/sampleRate*h*2**(d.getValue()/1200),v=0;for(let y=t;y<o;y++){let x=this.#p|0,$=this.#p-x,D=l[x]*(1-$)+(l[x+1]??0)*$,V=u[x]*(1-$)+(u[x+1]??0)*$;if(v=Math.min(this.#s/this.#u,1-(this.#s-(this.#l+this.#u))/this.#a,1),this.#p+=g,h>0){if(this.#o===Ho.Off){if(this.#p>=a)return!0;!this.#m&&this.#p>=this.#d&&this.#v()}else if(this.#o===Ho.On){if(this.#p>=this.#d-If){if(this.#p>=this.#d)return!0;v*=(this.#d-this.#p)/If}}else if(this.#o===Ho.Loop)for(;this.#p>=this.#d;)this.#p-=p}else if(h<0){if(this.#o===Ho.Off){if(this.#p<=0)return!0;!this.#m&&this.#p<=this.#d&&this.#v()}else if(this.#o===Ho.On){if(this.#p<=this.#d+If){if(this.#p<=this.#d)return!0;v*=(this.#d-this.#p)/If}}else if(this.#o===Ho.Loop)for(;this.#p<=this.#d;)this.#p-=p}if(++this.#s-this.#l>this.#u+this.#a)return!0;v*=this.#n*v,i[y]+=D*v,n[y]+=V*v}return this.#h=v,!1}toString(){return"{PlayfieldSampleVoice}"}#v(){this.#m||(this.#m=!0,this.#l=this.#s<this.#u?this.#s-this.#u:this.#s)}};var sb=class extends De{#e;#t;#r;#i;#o;#n;constructor(e,t,o,i){super(e),this.#e=t,this.#t=o,this.#r=[],this.#i=new ye,this.#o=this.own(new Ee(e.broadcaster,o.peakAddress));let{sampleStart:n,sampleEnd:s,attack:a,release:l,pitch:u}=o.namedParameter;this.#n=Object.freeze({sampleStart:this.own(this.bindParameter(n)),sampleEnd:this.own(this.bindParameter(s)),attack:this.own(this.bindParameter(a)),release:this.own(this.bindParameter(l)),pitch:this.own(this.bindParameter(u))});let d=new Float32Array(16);this.ownAll(ob.create(e,o.audioEffects,this,i),e.broadcaster.broadcastFloats(o.address,d,p=>{if(!p)return;let h=this.#r.length<d.length?this.#r:this.#r.slice(0,d.length);h.forEach(({position:g},v)=>d[v]=g),d[h.length]=-1}),e.audioOutputBufferRegistry.register(o.address,this.#i,this.outgoing),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(pe.isStart(e)){let t=this.#t.file().flatMap(d=>d.getOrCreateLoader().data);if(t.isEmpty())return;let{mute:o,solo:i,polyphone:n,exclude:s}=this.#t.namedParameter,a=o.getValue(),l=i.getValue();if(a||this.#e.hasSolo()&&!l)return;n.getValue()||this.#r.forEach(d=>d.release(!0)),s.getValue()&&this.#e.stopExcludeOthers(this.#t),this.#r.push(new nb(this.#t,this.#n,t.unwrap(),e))}else pe.isStop(e)&&this.#r.find(t=>t.event.id===e.id)?.release()}processAudio(e,t,o){this.#i.clear(t,o);for(let i=this.#r.length-1;i>=0;i--)this.#r[i].processAdd(this.#i.channels(),t,o)&&this.#r.splice(i,1)}forceStop(){this.#r.forEach(e=>e.release(!0))}parameterChanged(e){}reset(){this.#r.length=0,this.#i.clear(),this.#o.clear()}finishProcess(){this.#i.assertSanity(),this.#o.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return`{PlayfieldSampleProcessor note: ${this.#t.indexField.getValue()}}`}};var ab=class{#e=new R;#t;#r;#i;#o;constructor(e,t){this.#t=t,this.#r=this.#e.own(new rb(e,this)),this.#i=this.#e.own(new ib(e,this)),this.#o=b.newSet(o=>o.uuid),this.#e.ownAll(t.samples.catchupAndSubscribe({onAdd:o=>{let i=new sb(e,this,o,this.#i);this.#o.add({uuid:o.uuid,processor:i,terminable:e.registerEdge(this.#r,i)}),e.sampleManager.getOrCreate(o.fileUUID())},onRemove:o=>{let{terminable:i,processor:n}=this.#o.removeByKey(o.uuid);i.terminate(),n.terminate()},onReorder:o=>{}}),{terminate:()=>{this.#o.forEach(({terminable:o,processor:i})=>{o.terminate(),i.terminate()}),this.#o.clear()}})}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get noteEventTarget(){return m.wrap(this)}get incoming(){return this.#r}get outgoing(){return this.#i}optSampleProcessor(e){return this.#t.samples.getAdapterByIndex(e).flatMap(t=>this.#o.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.#o.opt(t.uuid).ifSome(({processor:o})=>o.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 lb=class extends De{#e;#t;#r;#i=tr.stereoMatrix(sampleRate);#o={gain:0,panning:0,stereo:0,invertL:!1,invertR:!1,swap:!1};#n;#s;#l;#u;#a;#c;#d=m.None;#p=bo.Linear;#h=!0;#f=!1;constructor(e,t){super(e),this.#e=t,this.#t=new ye,this.#r=this.own(new Ee(e.broadcaster,t.address)),this.#n=this.own(this.bindParameter(t.namedParameter.volume)),this.#s=this.own(this.bindParameter(t.namedParameter.panning)),this.#l=this.own(this.bindParameter(t.namedParameter.stereo)),this.#u=this.own(this.bindParameter(t.namedParameter.invertL)),this.#a=this.own(this.bindParameter(t.namedParameter.invertR)),this.#c=this.own(this.bindParameter(t.namedParameter.swap)),this.ownAll(t.box.panningMixing.catchupAndSubscribe(o=>{this.#p=o.getValue(),this.#h=!0}),e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#t,this.outgoing)),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=m.wrap(e),{terminate:()=>this.#d=m.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}processAudio(e,t,o){if(this.#d.isEmpty())return;this.#h&&(this.#i.update(this.#o,this.#p,this.#f),this.#h=!1);let i=this.#d.unwrap().channels(),n=this.#t.channels();this.#i.processFrames(i,n,t,o),this.#r.processStereo(n,t,o),this.#f=!0}parameterChanged(e){switch(e){case this.#n:this.#o.gain=Ve(this.#n.getValue()),this.#h=!0;return;case this.#s:this.#o.panning=this.#s.getValue(),this.#h=!0;return;case this.#l:this.#o.stereo=this.#l.getValue(),this.#h=!0;return;case this.#u:this.#o.invertL=this.#u.getValue(),this.#h=!0;return;case this.#a:this.#o.invertR=this.#a.getValue(),this.#h=!0;return;case this.#c:this.#o.swap=this.#c.getValue(),this.#h=!0;return}}toString(){return`{${this.constructor.name}}`}};var ub=class extends jr{#e;#t;#r=m.None;#i=m.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Ri(e.broadcaster,t.address)),this.ownAll(t.box.groove.catchupAndSubscribe(o=>{this.#r.ifSome(i=>i.terminate()),this.#r=m.wrap(o.targetVertex.isEmpty()?null:e.boxAdapters.adapterFor(o.targetVertex.unwrap().box,pl.checkType))}),Z.create(()=>{this.#r.ifSome(o=>o.terminate()),this.#r=m.None}),e.registerProcessor(this))}get uuid(){return this.#e.uuid}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}setNoteEventSource(e){return M(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=m.wrap(e),Z.create(()=>this.#i=m.None)}*processNotes(e,t,o){if(this.#i.isEmpty())return;let i=this.#i.unwrap(),n=this.#r.mapOr(Sd,Md.Identity);for(let s of i.processNotes(n.unwarp(e),n.unwarp(t),o))pe.isStart(s)?this.#t.noteOn(s.pitch):this.#t.noteOff(s.pitch),yield Kr.overwrite(s,{position:he(n.warp(s.position),e,t)})}*iterateActiveNotesAt(e,t){if(this.#i.isEmpty())return;let o=this.#i.unwrap(),i=this.#r.mapOr(Sd,Md.Identity);for(let n of o.iterateActiveNotesAt(i.unwarp(e),t))yield Kr.overwrite(n,{position:i.warp(n.position)})}reset(){this.eventInput.clear()}parameterChanged(e){}handleEvent(e,t){}processEvents(e,t,o){}};var cb=class extends jr{#e;#t;#r=m.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Ri(e.broadcaster,t.address)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return M(this.#r.isEmpty(),"NoteEventSource already set"),this.#r=m.wrap(e),Z.create(()=>this.#r=m.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,o){if(!this.#r.isEmpty())for(let i of this.#r.unwrap().processNotes(e,t,o))yield i}*iterateActiveNotesAt(e,t){if(!this.#r.isEmpty())for(let o of this.#r.unwrap().iterateActiveNotesAt(e,t))yield o}reset(){this.eventInput.clear()}processEvents(e,t,o){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var db=(r,e)=>(r[e]??r[e.toString()])?.value,wd=(r,e,t)=>db(e,t)??db(r,t),eI=new Float32Array(ue),pb=class{event;sampleData;envelope;#e;rootKey;sampleRate;loopStart;loopEnd;pan;shouldLoop;playbackPosition=0;isReleasing=!1;constructor(e,t,o,i){this.event=e;let n=t.generators,s=o?.generators,a=db(s,53)??0,l=o?.sample??i.samples[a];this.sampleData=l.data,this.rootKey=db(s,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 u=wd(n,s,54)??0;this.shouldLoop=u===1||u===3,this.pan=(wd(n,s,17)??0)/1e3;let d=wd(n,s,34),p=wd(n,s,36),h=wd(n,s,37),g=wd(n,s,38),v=Js(d)?Math.pow(2,d/1200):.005,y=Js(p)?Math.pow(2,p/1200):.005,x=1-(h??0)/1e3,$=Js(g)?Math.pow(2,g/1200):.005;this.envelope=new Tl(sampleRate),this.envelope.set(v,y,x,$),this.envelope.gateOn(),this.#e=new Ui(.003,sampleRate)}release(){this.isReleasing=!0,this.envelope.gateOff()}processAdd(e,t,o){let n=$d(this.event.pitch+this.event.cent/100,440)/$d(this.rootKey,440)*(this.sampleRate/sampleRate),s=Rl(this.event.velocity),a=Math.cos((this.pan+1)*Math.PI/4),l=Math.sin((this.pan+1)*Math.PI/4);this.envelope.process(eI,t,o);let u=e.getChannel(0),d=e.getChannel(1);for(let p=t;p<o;p++){let h=Math.floor(this.playbackPosition),v=this.#t(h)/32768*s*this.#e.process(eI[p]);if(u[p]+=v*a,d[p]+=v*l,this.playbackPosition+=n,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<Kf}#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 hb=class extends De{#e;#t;#r;#i;#o;#n=m.None;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new Yo(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new ye,this.#o=this.own(new Ee(e.broadcaster,t.address)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#i,this.outgoing),t.box.file.catchupAndSubscribe(o=>this.#n=o.targetVertex.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid))))}introduceBlock(e){this.#r.introduceBlock(e)}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get noteEventTarget(){return m.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.#o.clear(),this.#t.length=0,this.#i.clear(),this.eventInput.clear()}handleEvent(e){let t=this.#n.flatMap(i=>i.soundfont);if(t.isEmpty())return;let o=t.unwrap();if(pe.isStart(e)){let i=o.presets[this.#e.presetIndex]??o.presets[0];if(Tf(i)){console.warn("No preset available");return}let n=0;for(let s of i.zones){let a=Math.round(e.velocity*127);if(this.#s(e.pitch,a,s)){let l=s.instrument.zones;for(let u=0;u<l.length;u++){let d=l[u];this.#s(e.pitch,a,d)&&(this.#t.push(new pb(e,s,d,o)),n++)}}}}else pe.isStop(e)&&this.#t.forEach(i=>{i.event.id===e.id&&i.release()})}processAudio(e,t,o){this.#i.clear(t,o);for(let i=this.#t.length-1;i>=0;i--)this.#t[i].processAdd(this.#i,t,o)&&this.#t.splice(i,1)}finishProcess(){this.#i.assertSanity(),this.#o.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{SoundfontDevice}"}#s(e,t,o){return this.#l(o.generators[44]?.range,t)&&this.#l(o.generators[43]?.range,e)}#l(e,t){return Fl(e)||t>=e.lo&&t<=e.hi}};var tI=r=>r>0?20*Math.log10(r):-100,rI=r=>Math.pow(10,r*.05);var fb=class{#e=.08;#t=1;#r;#i;#o=0;#n=.14;#s=0;#l=.14;#u=0;#a=0;#c=0;constructor(e){this.#r=Math.exp(-1/(e*.2)),this.#i=1-this.#r}process(e,t,o){this.#u===0&&(this.#u=e[0]),this.#a===0&&(this.#a=e[0]),this.#s=0,this.#l=0;for(let n=t;n<o;++n){let s=e[n]*e[n];this.#u=Math.max(s,this.#r*this.#u+this.#i*s),this.#a=this.#r*this.#a+this.#i*s;let a=this.#u/this.#a;this.#c=a>0?a:0,this.#c>0&&(this.#o=2*(this.#e/this.#c),this.#n=2*(this.#t/this.#c)-this.#o,this.#s+=this.#o,this.#l+=this.#n)}let i=o-t;this.#s/=i,this.#l/=i}getAvgAttack(){return this.#s}getAvgRelease(){return this.#l}};var mb=class{#e=[];#t;#r;#i;#o=0;constructor(e,t,o,i){this.#i=i,this.#r=Math.floor(e*t),this.#t=o+this.#r;for(let n=0;n<i;n++)this.#e[n]=new Float32Array(this.#t);this.#o=0}process(e,t,o){if(this.#r===0)return;let i=(this.#o-this.#r+this.#t)%this.#t;for(let n=0;n<this.#i;n++){let s=e.getChannel(n),a=this.#o,l=i;for(let u=t;u<o;u++){let d=this.#e[n][l];this.#e[n][a]=s[u],s[u]=d,a=(a+1)%this.#t,l=(l+1)%this.#t}}this.#o=(this.#o+(o-t))%this.#t}};var gb=class{#e=-20;#t=2;#r=6;#i=3;#o=-.5;setThreshold(e){this.#e=e}setRatio(e){this.#t!==e&&(this.#t=e,this.#t>23.9&&(this.#t=-1/0),this.#o=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.#o*((t+this.#i)*(t+this.#i))/this.#r:this.#o*t}applyCompressionToBuffer(e,t,o){for(let i=t;i<o;++i){let n=Math.max(Math.abs(e[i]),1e-6),s=tI(n);e[i]=this.applyCompression(s)}}};var Sl=class{#e;#t=1;#r=0;#i=0;#o=!0;constructor(e){this.#e=e,this.#t=1,this.#r=1-this.#t}process(e){this.#o&&(this.#i=e,this.#o=!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 vb=class{#e;#t;#r;#i;#o=.01;#n=0;#s=.14;#l=0;#u=0;#a=0;#c=!1;#d=!1;constructor(e){this.#e=e,this.#t=new fb(e),this.#r=new Sl(e),this.#i=new Sl(e),this.#n=Math.exp(-1/(e*this.#o)),this.#l=Math.exp(-1/(e*this.#s)),this.#u=0,this.#a=0}setAttack(e){e!==this.#o&&(this.#o=e,this.#n=Math.exp(-1/(this.#e*this.#o)))}setRelease(e){e!==this.#s&&(this.#s=e,this.#l=Math.exp(-1/(this.#e*this.#s)))}setAutoAttack(e){this.#c=e}setAutoRelease(e){this.#d=e}#p(e){return e<this.#u?this.#u=this.#n*this.#u+(1-this.#n)*e:this.#u=this.#l*this.#u+(1-this.#l)*e,this.#u}applyBallistics(e,t,o){for(let i=t;i<o;++i)e[i]=this.#p(e[i])}processCrestFactor(e,t,o){(this.#c||this.#d)&&(this.#t.process(e,t,o),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 yb=class{#e;#t;#r;#i=0;#o=0;constructor(e,t,o){this.#t=Math.floor(e*t),this.#r=o+this.#t,this.#e=new Float32Array(this.#r),this.#i=0}process(e,t,o){this.#n(e,t,o),this.#l(),this.#s(e,t,o)}#n(e,t,o){for(let i=t;i<o;i++)this.#e[this.#i]=e[i],this.#i=(this.#i+1)%this.#r;this.#o=o-t}#s(e,t,o){let i=this.#i-this.#o-this.#t;i<0&&(i+=this.#r);for(let n=t;n<o;n++)e[n]=this.#e[i],i=(i+1)%this.#r}#l(){let e=this.#i-1;e<0&&(e+=this.#r);let t=0,o=0;for(let n=0;n<this.#o;n++){let s=this.#e[e];s>t?(this.#e[e]=t,t+=o):(o=-s/this.#t,t=s+o),e=e-1,e<0&&(e+=this.#r)}let i=!1;for(let n=0;n<this.#t&&!i;n++){if(this.#e[e]>t)this.#e[e]=t,t+=o;else{i=!0;break}e=e-1,e<0&&(e+=this.#r)}}};var xb=class r extends De{static PEAK_DECAY_PER_SAMPLE=Math.exp(-1/(sampleRate*.5));static REDUCTION_DECAY_PER_SAMPLE=ue/sampleRate*.05;static ID=0;#e=r.ID++;#t;parameterLookahead;parameterAutomakeup;parameterAutoattack;parameterAutorelease;parameterInputgain;parameterThreshold;parameterRatio;parameterKnee;parameterAttack;parameterRelease;parameterMakeup;parameterMix;#r;#i;#o;#n;#s;#l;#u;#a;#c;#d=.005;#p;#h;#f=new R;#m=m.None;#v=m.None;#g=!1;#A=!1;#B=!1;#S=!1;#_=!1;#$=-10;#y=2;#w=6;#x=2;#E=140;#M=0;#N=1;#F=0;#P=0;#I=0;#k=0;#D=!1;constructor(e,t){super(e),this.#t=t,this.#r=new ye,this.#i=this.own(new Ee(e.broadcaster,t.address)),this.#p=new Float32Array([Number.NEGATIVE_INFINITY,0,Number.NEGATIVE_INFINITY]),this.#h=tr.linear(sampleRate);let{lookahead:o,automakeup:i,autoattack:n,autorelease:s,inputgain:a,threshold:l,ratio:u,knee:d,attack:p,release:h,makeup:g,mix:v}=t.namedParameter;this.parameterLookahead=this.own(this.bindParameter(o)),this.parameterAutomakeup=this.own(this.bindParameter(i)),this.parameterAutoattack=this.own(this.bindParameter(n)),this.parameterAutorelease=this.own(this.bindParameter(s)),this.parameterInputgain=this.own(this.bindParameter(a)),this.parameterThreshold=this.own(this.bindParameter(l)),this.parameterRatio=this.own(this.bindParameter(u)),this.parameterKnee=this.own(this.bindParameter(d)),this.parameterAttack=this.own(this.bindParameter(p)),this.parameterRelease=this.own(this.bindParameter(h)),this.parameterMakeup=this.own(this.bindParameter(g)),this.parameterMix=this.own(this.bindParameter(v)),this.#o=new vb(sampleRate),this.#n=new gb,this.#s=new mb(sampleRate,.005,ue,2),this.#l=new yb(sampleRate,this.#d,ue),this.#u=new Sl(sampleRate),this.#u.setAlpha(.03),this.#a=new Float32Array(ue),this.#c=[new Float32Array(ue),new Float32Array(ue)],this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing),e.broadcaster.broadcastFloats(t.address.append(0),this.#p,y=>{this.#p[0]=aw(this.#P),this.#p[1]=this.#k,this.#p[2]=aw(this.#I)}),t.sideChain.catchupAndSubscribe(()=>{this.#f.terminate(),this.#v=m.None,this.#g=!0}),e.subscribeProcessPhase(y=>{y===0&&this.#g&&(this.#g=!1,t.sideChain.targetVertex.map(({box:x})=>x.address).ifSome(x=>{e.audioOutputBufferRegistry.resolve(x).ifSome($=>{this.#v=m.wrap($.buffer),this.#f.own(e.registerEdge($.processor,this.incoming))})}))}),this.#f),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#D=!1,this.#r.clear(),this.#i.clear(),this.eventInput.clear(),this.#a.fill(0),this.#c[0].fill(0),this.#c[1].fill(0),this.#F=0,this.#P=0,this.#I=0,this.#k=0}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#m=m.wrap(e),{terminate:()=>this.#m=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio(e,t,o){if(this.#m.isEmpty())return;let i=this.#m.unwrap(),n=i.getChannel(0),s=i.getChannel(1),a=this.#r.getChannel(0),l=this.#r.getChannel(1);for(let u=t;u<o;u++){let d=this.#h.moveAndGet();a[u]=n[u]*d,l[u]=s[u]*d}if(this.#a.fill(0,t,o),this.#v.nonEmpty()){let u=this.#v.unwrap(),d=u.getChannel(0),p=u.getChannel(1);for(let h=t;h<o;h++)this.#a[h]=Math.max(Math.abs(d[h]),Math.abs(p[h]))}else for(let u=t;u<o;u++)this.#a[u]=Math.max(Math.abs(a[u]),Math.abs(l[u]));for(let u=t;u<o;u++){let d=this.#a[u];this.#P<=d?this.#P=d:this.#P*=r.PEAK_DECAY_PER_SAMPLE}this.#o.processCrestFactor(this.#a,t,o),this.#n.applyCompressionToBuffer(this.#a,t,o),this.#o.applyBallistics(this.#a,t,o);for(let u=t;u<o;u++){let d=this.#a[u];this.#k>=d?this.#k=d:this.#k+=r.REDUCTION_DECAY_PER_SAMPLE}this.#F=this.#R(this.#a,t,o),this.#A&&(this.#s.process(this.#r,t,o),this.#l.process(this.#a,t,o));for(let u=t;u<o;u++)this.#a[u]=rI(this.#a[u]+this.#M+this.#F);for(let u=t;u<o;u++)this.#c[0][u]=a[u],this.#c[1][u]=l[u];for(let u=t;u<o;u++)a[u]*=this.#a[u],l[u]*=this.#a[u];for(let u=t;u<o;u++){let d=a[u]*this.#N+this.#c[0][u]*(1-this.#N),p=l[u]*this.#N+this.#c[1][u]*(1-this.#N),h=Math.max(Math.abs(d),Math.abs(p));this.#I<=h?this.#I=h:this.#I*=r.PEAK_DECAY_PER_SAMPLE,a[u]=d,l[u]=p}this.#i.process(a,l,t,o),this.#D=!0}#R(e,t,o){let i=0;for(let n=t;n<o;n++)i+=e[n];return this.#u.process(-i/(o-t)),this.#B?this.#u.getState():0}parameterChanged(e){e===this.parameterLookahead?this.#A=this.parameterLookahead.getValue():e===this.parameterAutomakeup?this.#B=this.parameterAutomakeup.getValue():e===this.parameterAutoattack?(this.#S=this.parameterAutoattack.getValue(),this.#o.setAutoAttack(this.#S),this.#S||this.#o.setAttack(this.#x*.001)):e===this.parameterAutorelease?(this.#_=this.parameterAutorelease.getValue(),this.#o.setAutoRelease(this.#_),this.#_||this.#o.setRelease(this.#E*.001)):e===this.parameterInputgain?this.#h.set(Ve(this.parameterInputgain.getValue()),this.#D):e===this.parameterThreshold?(this.#$=this.parameterThreshold.getValue(),this.#n.setThreshold(this.#$)):e===this.parameterRatio?(this.#y=this.parameterRatio.getValue(),this.#n.setRatio(this.#y)):e===this.parameterKnee?(this.#w=this.parameterKnee.getValue(),this.#n.setKnee(this.#w)):e===this.parameterAttack?(this.#x=this.parameterAttack.getValue(),this.#S||this.#o.setAttack(this.#x*.001)):e===this.parameterRelease?(this.#E=this.parameterRelease.getValue(),this.#_||this.#o.setRelease(this.#E*.001)):e===this.parameterMakeup?this.#M=this.parameterMakeup.getValue():e===this.parameterMix&&(this.#N=this.parameterMix.getValue())}toString(){return`{${this.constructor.name} (${this.#e})}`}};var bb=class r extends De{static ID=0;#e=r.ID++;#t;#r;#i;#o;parameterCrusherRate;parameterBitDepth;parameterBoost;parameterMix;#n=m.None;constructor(e,t){super(e),this.#t=t,this.#r=new ye,this.#i=new Zf(sampleRate),this.#o=this.own(new Ee(e.broadcaster,t.address));let{crush:o,bits:i,boost:n,mix:s}=t.namedParameter;this.parameterCrusherRate=this.own(this.bindParameter(o)),this.parameterBitDepth=this.own(this.bindParameter(i)),this.parameterBoost=this.own(this.bindParameter(n)),this.parameterMix=this.own(this.bindParameter(s)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#i.reset(),this.#o.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#n=m.wrap(e),{terminate:()=>this.#n=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,o){if(this.#n.isEmpty())return;let i=this.#n.unwrap();this.#i.process(i.channels(),this.#r.channels(),t,o),this.#o.process(this.#r.getChannel(0),this.#r.getChannel(1),t,o)}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 OD=[2,4,8],iI=8,wb=class r extends De{static ID=0;#e=r.ID++;#t;#r;#i;#o;parameterDrive;parameterVolume;#n=m.None;#s=!1;#l;#u;#a;#c;constructor(e,t){super(e),this.#t=t,this.#r=new ye,this.#i=[new Float32Array(ue*iI),new Float32Array(ue*iI)],this.#o=this.own(new Ee(e.broadcaster,t.address));let{drive:o,volume:i}=t.namedParameter;this.parameterDrive=this.own(this.bindParameter(o)),this.parameterVolume=this.own(this.bindParameter(i)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing),t.box.overSampling.catchupAndSubscribe(n=>{let s=OD[n.getValue()];this.#l=new tm(s),this.#a=tr.linear(sampleRate*s),this.#a.set(Ve(this.parameterDrive.getValue()),this.#s),this.#c=tr.linear(sampleRate*s),this.#c.set(Ve(this.parameterVolume.getValue()),this.#s),this.#u=s})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){console.debug("reset"),this.#s=!1,this.#o.clear(),this.#r.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#n=m.wrap(e),{terminate:()=>this.#n=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,o){if(this.#n.isEmpty())return;this.#l.upsample(this.#n.unwrap().channels(),this.#i,t,o);let i=(o-t)*this.#u,[n,s]=this.#i;for(let a=0;a<i;a++){let l=this.#c.moveAndGet(),u=this.#a.moveAndGet();n[a]=lw(n[a]*u)*l,s[a]=lw(s[a]*u)*l}this.#l.downsample(this.#i,this.#r.channels(),t,o),this.#o.process(this.#r.getChannel(0),this.#r.getChannel(1),t,o),this.#s=!0}parameterChanged(e){e===this.parameterDrive?this.#a.set(Ve(this.parameterDrive.getValue()),this.#s):e===this.parameterVolume&&this.#c.set(Ve(this.parameterVolume.getValue()),this.#s)}toString(){return`{${this.constructor.name} (${this.#e})`}};var Ab=class extends De{#e;#t;#r=[];#i;#o;#n=m.None;constructor(e,t){super(e),this.#e=t,this.#t=new ye,this.#i=[];let{midiDevice:o,box:i,parameters:n}=t;this.#o=i.channel.getValue(),this.ownAll(i.parameters.pointerHub.catchupAndSubscribe({onAdded:({box:s})=>this.#i.push(this.bindParameter(n.parameterAt(Ie(s,Zi).value.address))),onRemoved:({box:s})=>T.removeIf(this.#i,a=>a.address===Ie(s,Zi).value.address)}),i.channel.subscribe(s=>{o.ifSome(a=>this.#r.forEach(l=>e.sendMIDIData(a.id.getValue(),ut.noteOff(this.#o,l),a.delayInMs.getValue()))),this.#r.length=0,this.#o=s.getValue()}),e.registerProcessor(this)),this.readAllParameters()}get noteEventTarget(){return m.wrap(this)}introduceBlock({p0:e,p1:t,s0:o,flags:i,bpm:n}){if(this.#n.isEmpty())return;let{box:{channel:s,device:a}}=this.#e,l=a.targetVertex.match({none:()=>m.None,some:({box:d})=>m.wrap(Ie(d,Wi))}),u=l.mapOr(d=>d.delayInMs.getValue(),0);for(let d of this.#n.unwrap().processNotes(e,t,i))if(d.pitch>=0&&d.pitch<=127){let p=o/sampleRate,h=q.pulsesToSeconds(d.position-e,n),g=(p+h)*1e3+u,v=s.getValue();if(pe.isStart(d)){let y=Math.round(d.velocity*127);this.#r.push(d.pitch),l.ifSome(x=>this.context.sendMIDIData(x.id.getValue(),ut.noteOn(v,d.pitch,y),g))}else if(pe.isStop(d)){let y=this.#r.indexOf(d.pitch);y>-1&&this.#r.splice(y,1),l.ifSome(x=>this.context.sendMIDIData(x.id.getValue(),ut.noteOff(v,d.pitch),g))}}}setNoteEventSource(e){return this.#n=m.wrap(e),Z.create(()=>this.#n=m.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,o){}parameterChanged(e,t=0){let{box:{channel:o,device:i}}=this.#e;if(i.isEmpty())return;let{id:n,delayInMs:s}=Ie(i.targetVertex.unwrap().box,Wi),a=t*1e3*s.getValue(),l=Ie(e.adapter.field.box,Zi).controller.getValue(),u=Math.round(e.getValue()*127),d=ut.control(o.getValue(),l,u);this.context.sendMIDIData(n.getValue(),d,a)}finishProcess(){}toString(){return"{MIDIOutputDeviceProcessor}"}};var _b=class extends jr{#e;#t;#r;#i=m.None;#o;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Ri(e.broadcaster,t.address)),this.#r=new Int32Array(1024),this.#o=0;let{magnetPosition:o,magnetStrength:i,randomSeed:n,randomAmount:s,offset:a,mix:l}=t.namedParameter;this.ownAll(this.bindParameter(o),this.bindParameter(i),this.bindParameter(n),this.bindParameter(s),this.bindParameter(a),this.bindParameter(l),e.broadcaster.broadcastIntegers(t.address.append(0),this.#r,u=>{this.#r[this.#o]=0,this.#o=0}),e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return M(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=m.wrap(e),Z.create(()=>this.#i=m.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,o){if(!this.#i.isEmpty())for(let i of this.#i.unwrap().processNotes(e,t,o))if(pe.isStart(i)){this.#t.noteOn(i.pitch);let n=this.#e.computeVelocity(i.position,i.velocity);this.#r[this.#o++]=Math.round(i.velocity*127)|Math.round(n*127)<<8|65536,yield Kr.overwrite(i,{velocity:n})}else this.#t.noteOff(i.pitch),yield i}*iterateActiveNotesAt(e,t){if(!this.#i.isEmpty())for(let o of this.#i.unwrap().iterateActiveNotesAt(e,t))o.type==="note-event"&&(yield Kr.overwrite(o,{velocity:this.#e.computeVelocity(o.position,o.velocity)}))}reset(){this.eventInput.clear()}processEvents(e,t,o){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Pb=class r extends De{static ID=0;#e=r.ID++;#t;#r;#i;#o;#n;#s;#l;#u;#a;#c;#d;#p;#h=m.None;#f=!0;#m=0;constructor(e,t){super(e),this.#t=t,this.#r=new ye,this.#i=this.own(new Ee(e.broadcaster,t.address)),this.#o=new Gf,this.#n=new Ui(.003,sampleRate),this.#s=new Ui(.003,sampleRate);let{rate:o,depth:i,slope:n,symmetry:s,offset:a,channelOffset:l}=t.namedParameter;this.#l=this.bindParameter(o),this.#u=this.bindParameter(i),this.#a=this.bindParameter(n),this.#c=this.bindParameter(s),this.#d=this.bindParameter(a),this.#p=this.bindParameter(l),this.ownAll(e.broadcaster.broadcastFloat(t.address.append(0),()=>this.#m),e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing)),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=m.wrap(e),{terminate:()=>this.#h=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio({p0:e,bpm:t,flags:o},i,n){if(this.#h.isEmpty())return;let s=this.#h.unwrap(),[a,l]=s.channels(),[u,d]=this.#r.channels();this.#f&&(this.#o.set(this.#u.getValue(),this.#a.getValue(),this.#c.getValue()),this.#f=!1);let{RateFractions:p}=uo,h=q.samplesToPulses(1,t,sampleRate),v=1/hr.toPPQN(p[this.#l.getValue()]),y=this.#d.getValue()/360,x=y+this.#p.getValue()/360;for(let $=i;$<n;$++){let D=(e+$*h)*v+y,V=(e+$*h)*v+x;u[$]=a[$]*this.#n.process(this.#o.compute(D-Math.floor(D))),d[$]=l[$]*this.#s.process(this.#o.compute(V-Math.floor(V)))}this.#i.process(u,d),nt.every(o,5)&&(this.#m=(e+(n-i)*h)*v)}parameterChanged(e){(e===this.#u||e===this.#a||e===this.#c)&&(this.#f=!0)}toString(){return`{${this.constructor.name} (${this.#e})`}};var Sb=class{#e;#t=[];#r;#i;#o;#n=0;#s=0;#l=0;#u=0;#a=0;#c=0;#d=.9999;#p=.75;#h=.625;#f=.5;#m=.7;#v=.5;#g=.005;#A=.5;#B=.7;#S=.3;#_=.6;constructor(e){this.#e=e,this.#o=e+1,this.#r=new Float32Array(this.#o),[.004771345,.003595309,.012734787,.009307483,.022579886,.149625349,.060481839,.1249958,.030509727,.141695508,.089244313,.106280031].forEach(i=>this.#$(i));let o=[.008937872,.099929438,.064278754,.067067639,.066866033,.006283391,.035818689,.011861161,.121870905,.041262054,.08981553,.070931756,.011256342,.004065724];this.#i=Int16Array.from(o,i=>Math.round(i*e))}#$(e){let t=Math.round(e*this.#e),o=2**Math.ceil(Math.log2(t));this.#t.push([new Float32Array(o),t-1,0,o-1])}#y(e,t){return this.#t[e][0][this.#t[e][1]]=t}#w(e){return this.#t[e][0][this.#t[e][2]]}#x(e,t){let o=this.#t[e];return o[0][o[2]+t&o[3]]}#E(e,t){let o=this.#t[e],i=t-~~t,n=~~t+o[2]-1,s=o[3],a=o[0][n++&s],l=o[0][n++&s],u=o[0][n++&s],d=o[0][n&s],p=(3*(l-u)-a+d)*.5,h=2*u+a-(5*l+d)*.5,g=(u-a)*.5;return((p*i+h)*i+g)*i+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.#v=e*.999999}set damping(e){this.#g=e}set excursionRate(e){this.#A=e*2}set excursionDepth(e){this.#B=e*2}set wetGain(e){this.#S=e}set dryGain(e){this.#_=e}reset(){this.#r.fill(0),this.#t.forEach(e=>e[0].fill(0)),this.#n=0,this.#s=0,this.#l=0,this.#u=0,this.#a=0}process(e,t,o,i){let n=this.#c,s=this.#d,a=this.#p,l=this.#h,u=this.#f,d=this.#m,p=this.#v,h=1-this.#g,g=this.#A/this.#e,v=this.#B*this.#e/1e3,y=this.#S*.6,x=this.#_,$=e[0],D=e[1],V=t[0],O=t[1];for(let j=o;j<i;j++){let Y=$[j],K=D[j];this.#r[this.#n]=(Y+K)*.5,V[j]=Y*x,O[j]=K*x;let ie=this.#r[(this.#o+this.#n-n)%this.#o];this.#s+=s*(ie-this.#s);let re=this.#y(0,this.#s-a*this.#w(0));re=this.#y(1,a*(re-this.#w(1))+this.#w(0)),re=this.#y(2,a*re+this.#w(1)-l*this.#w(2)),re=this.#y(3,l*(re-this.#w(3))+this.#w(2));let Ce=l*re+this.#w(3),je=v*(1+Math.cos(this.#a*6.28)),Qe=v*(1+Math.sin(this.#a*6.2847)),Ae=this.#y(4,Ce+u*this.#w(11)+d*this.#E(4,je));this.#y(5,this.#E(4,je)-d*Ae),this.#l+=h*(this.#w(5)-this.#l),Ae=this.#y(6,u*this.#l-p*this.#w(6)),this.#y(7,this.#w(6)+p*Ae),Ae=this.#y(8,Ce+u*this.#w(7)+d*this.#E(8,Qe)),this.#y(9,this.#E(8,Qe)-d*Ae),this.#u+=h*(this.#w(9)-this.#u),Ae=this.#y(10,u*this.#u-p*this.#w(10)),this.#y(11,this.#w(10)+p*Ae);let Xe=this.#x(9,this.#i[0])+this.#x(9,this.#i[1])-this.#x(10,this.#i[2])+this.#x(11,this.#i[3])-this.#x(5,this.#i[4])-this.#x(6,this.#i[5])-this.#x(7,this.#i[6]),Le=this.#x(5,this.#i[7])+this.#x(5,this.#i[8])-this.#x(6,this.#i[9])+this.#x(7,this.#i[10])-this.#x(9,this.#i[11])-this.#x(10,this.#i[12])-this.#x(11,this.#i[13]);V[j]+=Xe*y,O[j]+=Le*y,this.#a+=g,this.#n=(this.#n+1)%this.#o;for(let be=0;be<this.#t.length;be++){let et=this.#t[be];et[1]=et[1]+1&et[3],et[2]=et[2]+1&et[3]}}}};var Eb=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;#o;#n=m.None;constructor(e,t){super(e),this.#t=t,this.#i=new ye,this.#o=this.own(new Ee(e.broadcaster,t.address)),this.#r=new Sb(sampleRate);let{preDelay:o,bandwidth:i,inputDiffusion1:n,inputDiffusion2:s,decay:a,decayDiffusion1:l,decayDiffusion2:u,damping:d,excursionRate:p,excursionDepth:h,wet:g,dry:v}=t.namedParameter;this.parameterPreDelay=this.own(this.bindParameter(o)),this.parameterBandwidth=this.own(this.bindParameter(i)),this.parameterInputDiffusion1=this.own(this.bindParameter(n)),this.parameterInputDiffusion2=this.own(this.bindParameter(s)),this.parameterDecay=this.own(this.bindParameter(a)),this.parameterDecayDiffusion1=this.own(this.bindParameter(l)),this.parameterDecayDiffusion2=this.own(this.bindParameter(u)),this.parameterDamping=this.own(this.bindParameter(d)),this.parameterExcursionRate=this.own(this.bindParameter(p)),this.parameterExcursionDepth=this.own(this.bindParameter(h)),this.parameterWet=this.own(this.bindParameter(g)),this.parameterDry=this.own(this.bindParameter(v)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#i,this.outgoing)),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#r.reset(),this.#i.clear(),this.#o.clear(),this.eventInput.clear()}get uuid(){return this.#t.uuid}get audioOutput(){return this.#i}setAudioSource(e){return this.#n=m.wrap(e),{terminate:()=>this.#n=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio(e,t,o){if(this.#n.isEmpty())return;let i=this.#n.unwrap();this.#r.process(i.channels(),this.#i.channels(),t,o),this.#o.process(this.#i.getChannel(0),this.#i.getChannel(1),t,o)}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 AS;(e=>e.create=(t,o)=>o.accept({visitAudioBusBox:i=>new yd(t,t.boxAdapters.adapterFor(i,vr)),visitVaporisateurDeviceBox:i=>new Kx(t,t.boxAdapters.adapterFor(i,dc)),visitNanoDeviceBox:i=>new tb(t,t.boxAdapters.adapterFor(i,fc)),visitTapeDeviceBox:i=>new qx(t,t.boxAdapters.adapterFor(i,cc)),visitPlayfieldDeviceBox:i=>new ab(t,t.boxAdapters.adapterFor(i,Ns)),visitSoundfontDeviceBox:i=>new hb(t,t.boxAdapters.adapterFor(i,Ec)),visitMIDIOutputDeviceBox:i=>new Ab(t,t.boxAdapters.adapterFor(i,Dc))}))(AS||={});var _S;(e=>e.create=(t,o)=>oe(o.accept({visitUnknownMidiEffectDeviceBox:i=>new cb(t,t.boxAdapters.adapterFor(i,_c)),visitArpeggioDeviceBox:i=>new Jx(t,t.boxAdapters.adapterFor(i,io)),visitPitchDeviceBox:i=>new Qx(t,t.boxAdapters.adapterFor(i,pc)),visitVelocityDeviceBox:i=>new _b(t,t.boxAdapters.adapterFor(i,Mc)),visitZeitgeistDeviceBox:i=>new ub(t,t.boxAdapters.adapterFor(i,wc))}),`Could not create midi-effect for'${o.name}'`))(_S||={});var Nf;(e=>e.create=(t,o)=>oe(o.accept({visitUnknownAudioEffectDeviceBox:i=>new Pf(t,t.boxAdapters.adapterFor(i,Ac)),visitStereoToolDeviceBox:i=>new lb(t,t.boxAdapters.adapterFor(i,xc)),visitCompressorDeviceBox:i=>new xb(t,t.boxAdapters.adapterFor(i,Bc)),visitDelayDeviceBox:i=>new Ox(t,t.boxAdapters.adapterFor(i,bi)),visitDattorroReverbDeviceBox:i=>new Eb(t,t.boxAdapters.adapterFor(i,Cc)),visitTidalDeviceBox:i=>new Pb(t,t.boxAdapters.adapterFor(i,uo)),visitCrusherDeviceBox:i=>new bb(t,t.boxAdapters.adapterFor(i,Fc)),visitFoldDeviceBox:i=>new wb(t,t.boxAdapters.adapterFor(i,Ic)),visitReverbDeviceBox:i=>new eb(t,t.boxAdapters.adapterFor(i,Wu)),visitRevampDeviceBox:i=>new Xx(t,t.boxAdapters.adapterFor(i,Zu)),visitModularDeviceBox:i=>new Pf(t,t.boxAdapters.adapterFor(i,_s))}),`Could not create audio-effect for'${o.name}'`))(Nf||={});var Bb=class extends De{#e;#t;#r;#i;#o;#n;#s=m.None;#l=!0;#u=!1;constructor(e,t){super(e),this.#e=t,this.#t=new ye,this.#r=tr.linear(sampleRate),this.#i=tr.linear(sampleRate),this.#o=this.own(this.bindParameter(t.sendGain)),this.#n=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.#s=m.wrap(e),{terminate:()=>this.#s=m.None}}get audioOutput(){return this.#t}processAudio(e,t,o){if(this.#s.isEmpty())return;if(this.#l){let u=Ve(this.#o.getValue()),d=this.#n.getValue();this.#r.set((1-Math.max(0,d))*u,this.#u),this.#i.set((1+Math.min(0,d))*u,this.#u),this.#l=!1}let i=this.#t.getChannel(0),n=this.#t.getChannel(1),s=this.#s.unwrap(),a=s.getChannel(0),l=s.getChannel(1);if(this.#r.isInterpolating()||this.#i.isInterpolating())for(let u=t;u<o;u++)i[u]=a[u]*this.#r.moveAndGet(),n[u]=l[u]*this.#i.moveAndGet();else{let u=this.#r.get(),d=this.#i.get();for(let p=t;p<o;p++)i[p]=a[p]*u,n[p]=l[p]*d}this.#u=!0}parameterChanged(e){this.#l=!0}};var Fb=class extends De{#e;#t;#r;#i;#o;#n;#s;#l;#u=tr.linear(sampleRate);#a=tr.linear(sampleRate);#c=tr.linear(sampleRate);#d=m.None;#p=!0;#h=!1;constructor(e,t){super(e),this.#e=t,this.#t=new ye,this.#r=[new Float32Array(ue),new Float32Array(ue)],this.#i=this.own(new Ee(e.broadcaster,this.#e.address)),this.#o=this.own(this.bindParameter(this.#e.namedParameter.volume)),this.#n=this.own(this.bindParameter(this.#e.namedParameter.panning)),this.#s=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),e.audioOutputBufferRegistry.register(t.address,this.#t,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.#s.getValue()}get isSolo(){return this.#l.getValue()}get adapter(){return this.#e}get audioOutput(){return this.#t}handleEvent(e){}processAudio(e,t,o){if(this.#d.isEmpty())return;if(this.#p){let p=this.context.mixer;p.updateSolo();let h=this.isSolo||p.isVirtualSolo(this),g=this.isMute||p.hasChannelSolo()&&!h&&!this.#e.isOutput,v=Ve(this.#o.getValue()),y=this.#n.getValue();this.#u.set((1-Math.max(0,y))*v,this.#h),this.#a.set((1+Math.min(0,y))*v,this.#h),this.#c.set(g?0:1,this.#h),this.#p=!1}let i=this.#d.unwrap(),[n,s]=i.channels(),[a,l]=this.#t.channels(),[u,d]=this.#r;if(this.#u.isInterpolating()||this.#a.isInterpolating()||this.#c.isInterpolating())for(let p=t;p<o;p++){let h=this.#c.moveAndGet(),g=n[p]*this.#u.moveAndGet(),v=s[p]*this.#a.moveAndGet();a[p]=g*h,l[p]=v*h,u[p]=g,d[p]=v}else{let p=this.#u.get(),h=this.#a.get(),g=this.#c.get();for(let v=t;v<o;v++){let y=n[v]*p,x=s[v]*h;u[v]=y,d[v]=x,a[v]=y*g,l[v]=x*g}}this.#i.process(u,d,t,o),this.#h=!0}finishProcess(){this.#t.assertSanity()}parameterChanged(e){e===this.#o?this.requestGainUpdate():e===this.#n?this.requestGainUpdate():e===this.#s?this.requestGainUpdate():e===this.#l&&this.context.mixer.onChannelStripSoloChanged(this)}requestGainUpdate(){this.#p=!0}requestSoloUpdate(){this.#p=!0}setAudioSource(e){return this.#d=m.wrap(e),{terminate:()=>this.#d=m.None}}toString(){return`{${this.constructor.name}}`}};var Nb=class{#e=new R;#t;#r;#i;#o;#n;#s;#l=[];#u=!1;constructor(e,t){this.#t=e,this.#r=t,this.#i=b.newSet(o=>o.adapter.uuid),this.#o=this.#e.own(new Fb(this.#t.context,this.#t.adapter)),this.#n=b.newSet(({device:o})=>o.uuid),this.#s=this.#e.own(new R),this.#e.ownAll(this.#t.adapter.audioEffects.catchupAndSubscribe({onAdd:o=>{this.invalidateWiring();let i=Nf.create(this.#t.context,o.box),n=this.#n.add({device:i,subscription:i.adapter().enabledField.subscribe(()=>this.invalidateWiring())});M(n,"Could not add.")},onRemove:o=>{this.invalidateWiring();let{device:i,subscription:n}=this.#n.removeByKey(o.uuid);n.terminate(),i.terminate()},onReorder:o=>this.invalidateWiring()}),this.#t.adapter.auxSends.catchupAndSubscribe({onAdd:o=>{this.invalidateWiring();let i=this.#i.add(new Bb(this.#t.context,o));M(i,"Could not add.")},onRemove:({uuid:o})=>{this.invalidateWiring(),this.#i.removeByKey(o).terminate()},onReorder:o=>{}}),this.#t.adapter.output.catchupAndSubscribe(o=>this.invalidateWiring()),this.#t.context.subscribeProcessPhase(o=>{o===0&&this.#u&&(this.#a(),this.#u=!1)}))}get channelStrip(){return this.#o}invalidateWiring(){this.#s.terminate(),this.#u=!0}terminate(){this.#e.terminate(),this.#n.forEach(({device:e})=>e.terminate()),this.#n.clear(),this.#l=[]}toString(){return`{${this.constructor.name}}`}#a(){let e=this.#t.adapter.isOutput,t=this.#t.context,o=this.#t.input(),i=this.#t.adapter.output.adapter.map(s=>t.getAudioUnit(s.deviceHost().uuid).inputAsAudioBus());if(o.isEmpty()||i.isEmpty()&&!e)return;let n=o.unwrap();if(this.#r.includeAudioEffects){T.replace(this.#l,this.#t.adapter.audioEffects.adapters().map(({uuid:s})=>this.#n.get(s).device));for(let s of this.#l)s.adapter().enabledField.getValue()&&(this.#s.own(s.setAudioSource(n.audioOutput)),this.#s.own(t.registerEdge(n.outgoing,s.incoming)),n=s)}if(this.#r.includeSends&&this.#i.forEach(s=>{let a=t.getAudioUnit(s.adapter.targetBus.deviceHost().uuid);this.#s.own(s.setAudioSource(n.audioOutput)),this.#s.own(a.inputAsAudioBus().addAudioSource(s.audioOutput)),this.#s.own(t.registerEdge(n.outgoing,s)),this.#s.own(t.registerEdge(s,a.inputAsAudioBus()))}),this.#s.own(this.#o.setAudioSource(n.audioOutput)),this.#s.own(t.registerEdge(n.outgoing,this.#o)),i.nonEmpty()&&!e){let s=i.unwrap();this.#s.own(s.addAudioSource(this.#o.audioOutput)),this.#s.own(t.registerEdge(this.#o,s))}}};var Ib=class{#e=new R;#t;#r;#i;#o;#n;#s;#l;constructor(e,t){this.#t=e,this.#r=t,this.#i=$l.create(268431651),this.#o=new Set,this.#n=[],this.#s=new ta,this.#l=new ta,this.#e.ownAll(this.#t.subscribeProcessPhase(o=>{if(o===1)for(let i of this.#o)i.gate||this.#o.delete(i)}))}get uuid(){return this.#r.uuid}terminate(){this.#e.terminate()}pushRawNoteOn(e,t){this.#o.add({pitch:e,velocity:t,gate:!0,running:m.None})}pushRawNoteOff(e){for(let t of this.#o)if(t.running.isEmpty())this.#o.delete(t);else if(t.pitch===e){t.gate=!1;return}}auditionNote(e,t,o){this.#n.push({pitch:e,duration:t,velocity:o})}*processNotes(e,t,o){let i=nt.every(o,5),n=nt.every(o,2);if(this.#l.nonEmpty()&&(!i||n?yield*this.#d(e):yield*this.#p(e,t)),this.#s.nonEmpty())if(n)for(let s of this.#s.releaseAll())yield pe.stop(s,e);else for(let s of this.#s.releaseLinearCompleted(t))yield pe.stop(s,s.position+s.duration);if(this.#o.size>0)for(let s of this.#o){if(s.running.isEmpty()){let{pitch:a,velocity:l}=s,u=Number.POSITIVE_INFINITY,d=pe.start(e,u,a,l);s.running=m.wrap(d),yield d}s.gate||(this.#o.delete(s),yield pe.stop(s.running.unwrap("raw note never started"),e))}if(this.#n.length>0){for(let s of this.#s.releaseAll())yield pe.stop(s,e);for(let{pitch:s,duration:a,velocity:l}of this.#n){let u=pe.start(e,a,s,l);this.#s.addAndRetain({...u}),yield u}this.#n.length=0}if(i){let s=this.#r.tracks.collection.adapters().filter(a=>a.type===ne.Notes&&a.enabled.getValue());for(let a of s){let l=this.#t.clipSequencing.iterate(a.uuid,e,t);for(let{optClip:u,sectionFrom:d,sectionTo:p}of l)u.isEmpty()?yield*this.#a(a,d,p):yield*this.#u(u.unwrap(),d,p)}yield*this.#p(e,t)}}*iterateActiveNotesAt(e,t){if(this.#o.size>0)for(let{pitch:o,velocity:i}of this.#o)yield{type:"note-event",position:e,duration:Number.POSITIVE_INFINITY,pitch:o,velocity:i,cent:0};yield*this.#s.overlapping(e,er.Comparator),!t&&(yield*this.#l.overlapping(e,er.Comparator))}reset(){this.#o.clear(),this.#l.clear(),this.#n.length=0,this.#s.clear()}toString(){return`{${this.constructor.name}}`}*#u(e,t,o){if(e.optCollection.isEmpty())return;let i=e.optCollection.unwrap(),n=e.duration,s=nn(t,n),a=s+n;o>a?(yield*this.#c(i,t,a,s),yield*this.#c(i,a,o,a)):yield*this.#c(i,t,o,s)}*#a(e,t,o){for(let i of e.regions.collection.iterateRange(t,o)){if(this.#t.ignoresRegion(i.address.uuid)||i.mute||!Te(i,ps))continue;let n=i.optCollection;if(n.isEmpty())continue;let s=n.unwrap();for(let{resultStart:a,resultEnd:l,rawStart:u}of Yt.locateLoops(i,t,o))yield*this.#c(s,a,l,u)}}*#c(e,t,o,i){let n=t-i,s=o-i;for(let a of e.events.iterateRange(n-e.maxDuration,s)){if(!er.isOfType(a))continue;let{position:l,duration:u,chance:d,playCount:p,playCurve:h}=a;if(!(d<100&&this.#i.nextDouble(0,100)>d)){if(p>1){let g=er.inverseCurveFunc((n-l)/u,h),v=er.inverseCurveFunc((s-l)/u,h),y=Math.floor(g*p),x=y/p;for(;x<v;){if(x>=g){let $=er.curveFunc(x,h)*u;if($>=u)break;let D=er.curveFunc(x+1/p,h)*u,V=pe.startWith(a,l+$+i,D-$);this.#l.addAndRetain({...V}),yield V}x=++y/p}}else if(n<=l&&l<s){let g=pe.startWith(a,l+i);this.#l.addAndRetain({...g}),yield g}}}}*#d(e){for(let t of this.#l.releaseAll())yield pe.stop(t,e)}*#p(e,t){for(let o of this.#l.releaseLinearCompleted(t)){let i=he(o.position+o.duration,e,t);yield pe.stop(o,i)}}};var kb=class{#e=new R;#t;#r;#i;#o;#n=!1;constructor(e){this.#t=e,this.#r=this.#e.own(new Ib(this.#t.context,this.#t.adapter)),this.#i=b.newSet(({device:t})=>t.uuid),this.#o=this.#e.own(new R),this.#e.ownAll(this.#t.adapter.midiEffects.catchupAndSubscribe({onAdd:t=>{this.invalidateWiring();let o=_S.create(this.#t.context,t.box),i=this.#i.add({device:o,subscription:o.adapter().enabledField.subscribe(()=>this.invalidateWiring())});M(i,"Could not add.")},onRemove:t=>{this.invalidateWiring();let{device:o,subscription:i}=this.#i.removeByKey(t.uuid);i.terminate(),o.terminate()},onReorder:t=>this.invalidateWiring()}),this.#t.context.subscribeProcessPhase(t=>{t===0&&this.#n&&(this.#s(),this.#n=!1)}))}get noteSequencer(){return this.#r}invalidateWiring(){this.#o.terminate(),this.#n=!0}terminate(){this.#e.terminate()}toString(){return`{${this.constructor.name}}`}#s(){let e=this.#t.input().flatMap(i=>i.noteEventTarget);if(e.isEmpty())return;let t=e.unwrap(),o=this.#r;this.#t.adapter.midiEffects.adapters().map(i=>this.#i.get(i.uuid).device).forEach(i=>{i.adapter().enabledField.getValue()&&(this.#o.ownAll(i.setNoteEventSource(o),this.#t.context.registerEdge(i,t.incoming)),o=i)}),this.#o.own(t.setNoteEventSource(o))}};var $b=class r{static ID=0;#e=r.ID++;#t=new R;#r;#i;#o;#n;#s=m.None;constructor(e,t,o){this.#r=e,this.#i=t,this.#o=this.#t.own(new kb(this)),this.#n=this.#t.own(new Nb(this,o)),this.#t.ownAll(this.#i.input.catchupAndSubscribe(i=>{this.#o.invalidateWiring(),this.#n.invalidateWiring(),this.#s.ifSome(n=>n.terminate()),this.#s=i.getValue().flatMap(n=>m.wrap(AS.create(e,n.box.box)))}))}input(){return this.#s}inputAsAudioBus(){return Ie(this.#s.unwrap("No input available"),yd)}audioOutput(){return this.#n.channelStrip.audioOutput}get midiDeviceChain(){return this.#o}get audioDeviceChain(){return this.#n}get context(){return this.#r}get adapter(){return this.#i}terminate(){this.#t.terminate(),this.#s.ifSome(e=>e.terminate()),this.#s=m.None}toString(){return`{${this.constructor.name}(${this.#e})}`}};var Db=class{#e;#t;#r;#i=!1;constructor(){this.#e=b.newSet(e=>e.adapter.uuid),this.#t=new Set,this.#r=new Set}attachChannelStrip(e){return this.#e.add(e),Z.many(e.adapter.input.subscribe(()=>this.#o()),e.adapter.output.subscribe(()=>this.#o()),{terminate:()=>{this.#t.delete(e),this.#e.removeByValue(e),this.#o()}})}onChannelStripSoloChanged(e){e.isSolo?this.#t.add(e):this.#t.delete(e),this.#o()}hasChannelSolo(){return this.#t.size>0}isVirtualSolo(e){return this.#r.has(e)}#o(){this.#i||(this.#i=!0,this.#e.forEach(e=>e.requestSoloUpdate()))}updateSolo(){if(!this.#i)return;this.#r.clear();let e=new Set,t=new Set,o=n=>{e.has(n)||(e.add(n),n.adapter.input.getValue().ifSome(s=>{s.type==="bus"&&s.box.input.pointerHub.filter(c.AudioOutput).map(a=>oe(a.box.accept({visitAudioUnitBox:({address:{uuid:l}})=>this.#e.get(l),visitAuxSendBox:({audioUnit:{targetVertex:l}})=>this.#e.get(l.unwrap().address.uuid)}),"Could not resolve channel-strip")).forEach(a=>{a.isSolo||this.#r.add(a),o(a)})}))},i=n=>{t.has(n)||(t.add(n),n.adapter.output.adapter.ifSome(s=>{let a=this.#e.get(s.audioUnitBoxAdapter().uuid);a.isSolo||(this.#r.add(a),i(a))}))};this.#e.forEach(n=>{n.isSolo&&(o(n),i(n))}),this.#i=!1}};var Hs;(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"})(Hs||(Hs={}));var kf;(function(r){r[r.WRITE=0]="WRITE",r[r.READ=1]="READ"})(kf||(kf={}));var Ad;(function(r){r[r.ID=15793935]="ID",r[r.START=15790320]="START",r[r.END=986895]="END"})(Ad||(Ad={}));var Mb=class r{static create(e,t){return new r(e.channel(t))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#o=Tt.create(0);#n=m.None;#s=m.None;#l=m.None;#u=-1;#a=-1;#c=!1;#d=!1;#p=0;constructor(e){this.#i=cn.sender(e,({dispatchAndForget:t})=>new class{sendShareLock(o){t(this.sendShareLock,o)}sendUpdateData(o){t(this.sendUpdateData,o)}sendUpdateStructure(o){t(this.sendUpdateStructure,o)}})}flush(){let e=this.#h();if(e.nonEmpty()){this.#d||(this.#i.sendShareLock(this.#t),this.#d=!0),this.#i.sendUpdateStructure(e.unwrap());let t=this.#e.length,o=this.#f(),i=t+o;if(this.#n.isEmpty()||this.#n.unwrap().byteLength<i||t!==this.#p){let s=Tn(i),a=new SharedArrayBuffer(s);this.#s=m.wrap(new Uint8Array(a,0,t)),this.#o=Tt.use(a,t),this.#n=m.wrap(a),this.#p=t,this.#i.sendUpdateData(a)}}this.#n.isEmpty()||Atomics.load(this.#r,0)===kf.WRITE&&(this.#m(this.#o),this.#o.position=0,Atomics.store(this.#r,0,kf.READ))}broadcastFloat(e,t){return this.#g(new class{type=Hs.Float;address=e;capacity=8;put(o,i){o.writeFloat(t())}})}broadcastInteger(e,t){return this.#g(new class{type=Hs.Integer;address=e;capacity=8;put(o,i){o.writeInt(t())}})}broadcastFloats(e,t,o){return this.#g(new class{type=Hs.FloatArray;address=e;capacity=4+(t.byteLength<<2);put(i,n){o?.(n),i.writeInt(t.length);for(let s of t)i.writeFloat(s)}})}broadcastIntegers(e,t,o){return this.#g(new class{type=Hs.IntegerArray;address=e;capacity=4+(t.byteLength<<2);put(i,n){o(n),i.writeInt(t.length),t.forEach(s=>i.writeInt(s))}})}broadcastByteArray(e,t,o){return this.#g(new class{type=Hs.ByteArray;address=e;capacity=4+t.byteLength;put(i,n){o(n),i.writeInt(t.byteLength),i.writeBytes(t)}})}#h(){if(this.#c){try{this.#l=m.wrap(this.#B())}catch(e){throw e}this.#c=!1}if(this.#l.nonEmpty()){let e=this.#l;return this.#l=m.None,e}return m.None}#f(){return this.#a===-1&&(this.#a=this.#v()+12),this.#a}terminate(){T.clear(this.#e),this.#l=m.None,this.#c=!1,this.#a=0}#m(e){M(!this.#c&&this.#l.isEmpty(),"Cannot flush while update is available");let t=this.#f();M(e.remaining>=t,"Insufficient data"),e.writeInt(this.#u),e.writeInt(Ad.START);let o=this.#s;for(let i=0;i<this.#e.length;i++){let n=o.nonEmpty()&&o.unwrap()[i]!==0;this.#e[i].put(e,n)}e.writeInt(Ad.END)}#v(){return this.#e.reduce((e,t)=>e+t.capacity,0)}#g(e){return this.#e.push(e),this.#A(),{terminate:()=>{T.removeOpt(this.#e,e),this.#A()}}}#A(){this.#a=-1,this.#c=!0}#B(){let e=Tt.create();e.writeInt(Ad.ID),e.writeInt(++this.#u),e.writeInt(this.#e.length);for(let{address:t,type:o}of this.#e)t.write(e),e.writeByte(o);return e.toArrayBuffer()}};var Cb=class{#e;#t;#r=new ye;#i=[];constructor(e,t){this.#e=e,this.#t=t}process({blocks:e}){e.forEach(({p0:t,p1:o,bpm:i,s0:n,s1:s,flags:a})=>{if(this.#t.metronomeEnabled&&nt.every(a,1))for(let[l,u]of Ge.pairWise(this.#e.signatureTrack.iterateAll())){let d=l.accumulatedPpqn,p=vt(u)?u.accumulatedPpqn:1/0;if(p<=t)continue;if(d>=o&&l.index!==-1)break;let h=l.index===-1?t:Math.max(t,d),g=Math.min(o,p),v=q.fromSignature(1,l.denominator),y=h-d,x=Math.ceil(y/v),$=d+x*v;for(;$<g;){let D=Math.floor(q.pulsesToSamples($-t,i,sampleRate)),V=Math.round(($-d)/v);this.#i.push(new PS(n+D,V%l.nominator===0)),$+=v}}this.#r.clear(n,s);for(let l=this.#i.length-1;l>=0;l--)this.#i[l].processAdd(this.#r,n,s)&&this.#i.splice(l,1)})}get output(){return this.#r}},PS=class{#e;#t=0;#r=0;constructor(e,t){M(e>=0&&e<ue,`${e} out of bounds`),this.#e=t?880:440,this.#r=e}processAdd(e,t,o){let[i,n]=e.channels(),s=Math.floor(.002*sampleRate),a=Math.floor(.05*sampleRate);for(let l=Math.max(this.#r,t);l<o;l++){let u=Math.min(this.#t/s,1-(this.#t-s)/a),d=Math.sin(this.#t/sampleRate*zi*this.#e)*.25*u*u;if(i[l]+=d,n[l]+=d,++this.#t>s+a)return!0}return this.#r=0,!1}};var Tb=class{#e;constructor(){this.#e=xe.newSet(({address:e})=>e)}register(e,t,o){return this.#e.add({address:e,buffer:t,processor:o}),{terminate:()=>this.#e.removeByKey(e)}}resolve(e){return this.#e.opt(e)}};var Rb=class{#e=new R;#t;#r;#i=!0;#o=!1;#n=null;#s=!1;#l=0;#u=m.None;#a;constructor(e,t){this.#t=e;let{timelineBoxAdapter:o}=e,{box:{bpm:i},markerTrack:n}=o;this.#a=i.getValue(),n.subscribe(()=>this.#s=!0),this.#e.ownAll(i.subscribe(s=>{this.#u.isEmpty()&&(this.#a=s.getValue(),this.#o=!0)}),o.catchupAndSubscribeTempoAutomation(s=>{this.#u=s,s.isEmpty()&&(this.#a=i.getValue()),this.#o=!0})),this.#i=t?.pauseOnLoopDisabled??!1,this.#r=new kl}get bpm(){return this.#a}setCallback(e,t){return this.#r.add(e,t),Z.create(()=>this.#r.remove(e,t))}reset(){this.#o=!1,this.#s=!1,this.#l=0,this.#n=null}process(e){let t=!1,{timeInfo:o,timelineBoxAdapter:{box:i,markerTrack:n}}=this.#t,s=o.transporting;if(s){let a=[],l=o.position,u=0,d=0,p=o.getLeapStateAndReset();for(;u<ue;){if(this.#s||p){this.#s=!1;let K=n.events.lowerEqual(l);(this.#n?.at(0)??null)!==K&&(this.#n=G(K)?[K,0]:null,t=!0)}if(p&&this.#u.nonEmpty()){let K=this.#u.unwrap().valueAt(l,this.#a);K!==this.#a&&(this.#a=K,this.#o=!0)}let h=ue-u,g=l+q.samplesToPulses(h,this.#a,sampleRate),v=null,y=Number.POSITIVE_INFINITY;if(n.enabled){let K=Array.from(Ge.take(n.events.iterateFrom(l),2));if(K.length>0){let[ie,re]=K;this.#n===null?ie.position>=l&&ie.position<g&&(v={type:"marker",prev:ie,next:re},y=ie.position):G(re)&&re!==this.#n[0]&&ie.position<l&&re.position<g&&(v={type:"marker",prev:ie,next:re},y=re.position)}}let{isRecording:x,isCountingIn:$}=this.#t.timeInfo,{from:D,to:V,enabled:O}=i.loopArea;if(O.getValue()&&!(x||$)||this.#i){let K=V.getValue();l<K&&g>K&&K<y&&(v={type:"loop",target:D.getValue()},y=K)}if(this.#r.keyCount()>0)for(let K of this.#r.keys())l<K&&g>K&&K<y&&(v={type:"callback",position:K,callbacks:this.#r.get(K)},y=K);if(this.#u.nonEmpty()&&!this.#u.unwrap().events.isEmpty()){let K=Bd(l,Ys);if(K>=l&&K<g&&K<y){let ie=this.#u.unwrap().valueAt(K,this.#a);ie!==this.#a&&(v={type:"tempo",position:K,bpm:ie},y=K)}}let Y=!o.isCountingIn;if(v===null){let K=u+h;a.push({index:d++,p0:l,p1:g,s0:u,s1:K,bpm:this.#a,flags:gd.create(s,p,Y,this.#o)}),p=!1,l=g,u=K}else{let K=()=>{if(y>l){let re=u+q.pulsesToSamples(y-l,this.#a,sampleRate)|0;re>u&&(a.push({index:d++,p0:l,p1:y,s0:u,s1:re,bpm:this.#a,flags:gd.create(s,p,Y,this.#o)}),p=!1),l=y,u=re}},ie=()=>{if(u<ue){let re=u+q.pulsesToSamples(g-l,this.#a,sampleRate)|0;a.push({index:d++,p0:l,p1:y,s0:u,s1:re,bpm:this.#a,flags:gd.create(!1,!1,!1,this.#o)}),u=re}};switch(v.type){case"loop":{K(),this.#i?(this.#t.timeInfo.pause(),ie()):(l=v.target,p=!0);break}case"marker":{let{prev:re,next:Ce}=v;!G(this.#n)||this.#n[0]!==re?this.#n=[re,0]:++this.#n[1]<re.plays||re.plays===0?(K(),l=re.position,p=!0):this.#n=[Ce,0],t=!0;break}case"callback":{K(),v.callbacks.forEach(re=>re());break}case"tempo":{K(),this.#a=v.bpm,this.#o=!0;break}}}}e({blocks:a}),o.advanceTo(l),p=!1,this.#l=l,this.#o=!1}else{let a=o.getLeapStateAndReset();if((a||this.#o)&&this.#u.nonEmpty()){let p=this.#u.unwrap().valueAt(this.#t.timeInfo.position,this.#a);p!==this.#a&&(this.#a=p,this.#o=!0)}if(this.#s||a){this.#s=!1;let p=n.events.lowerEqual(o.position);p!==null&&this.#n?.at(0)!==p&&(this.#n=[p,0],t=!0)}let l=this.#l,u=l+q.samplesToPulses(ue,this.#a,sampleRate),d={blocks:[{index:0,p0:l,p1:u,s0:0,s1:ue,bpm:this.#a,flags:gd.create(!1,!1,!1,this.#o)}]};e(d),this.#o=!1,this.#l=u}t&&this.#t.engineToClient.switchMarkerState(G(this.#n)?[this.#n[0].uuid,this.#n[1]]:null)}terminate(){this.#e.terminate()}};var SS=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchAudio(e).then(o=>this.#t=m.wrap(o))}peaks=m.None;#e={type:"idle"};#t=m.None;get data(){return this.#t}get state(){return this.#e}subscribe(e){return Z.Empty}invalidate(){}toString(){return"{AudioLoaderWorklet}"}},Ob=class{#e;#t;constructor(e){this.#e=e,this.#t=b.newSet(t=>t.uuid)}record(e){}getOrCreate(e){return this.#t.getOrCreate(e,t=>new SS(t,this.#e))}remove(e){}invalidate(e){}};var Vb=class{constructor(e){this.uuid=e}waiting=m.None;playing=m.None},zb=class{#e;#t;#r=[];#i=[];#o=[];constructor(e){this.#e=e,this.#e.subscribeToAllUpdatesImmediate({onUpdate:t=>{if(t.type==="delete"){let o=t.uuid;this.#t.opt(o).ifSome(i=>{i.playing.ifSome(n=>this.#s(n.uuid)),i.playing=m.None,i.waiting=m.None}),this.#t.forEach(i=>{i.playing.nonEmpty()&&b.equals(i.playing.unwrap().uuid,o)&&(i.playing=m.None,this.#s(o));let n=i.waiting.flatMap(Sd);n.nonEmpty()&&b.equals(n.unwrap().uuid,o)&&(i.waiting=m.None)})}}}),this.#t=b.newSet(t=>t.uuid)}schedulePlay(e){e.trackBoxAdapter.ifSome(({uuid:t})=>{let o=this.#t.getOrCreate(t,n=>new Vb(n));if(o.playing.nonEmpty()&&o.playing.unwrap()===e){console.debug(`${e} is already playing (ignore)`);return}let i=o.waiting.flatMap(n=>n);i.nonEmpty()&&(console.debug("obsolete",i.unwrap()),this.#o.push(i.unwrap().uuid),o.waiting=m.None),console.debug(`schedulePlay(${b.toString(o.uuid)} > ${e})`),T.removeOpt(this.#o,e.uuid),o.waiting=m.wrap(m.wrap(e))})}scheduleStop({uuid:e}){let t=this.#t.getOrCreate(e,i=>new Vb(i)),o=t.waiting.flatMap(i=>i);o.nonEmpty()&&(console.debug("obsolete",o.unwrap()),this.#o.push(o.unwrap().uuid),t.waiting=m.None),t.playing.nonEmpty()&&(console.debug(`scheduleStop(${b.toString(e)})`),t.waiting=m.wrap(m.None))}reset(){this.#t.forEach(e=>{e.waiting.ifSome(t=>t.ifSome(o=>this.#o.push(o.uuid))),e.waiting=m.None,e.playing.ifSome(t=>this.#s(t.uuid)),e.playing=m.None}),this.#t.clear()}*iterate(e,t,o){let i=this.#t.getOrNull(e);if(i===null){yield{optClip:m.None,sectionFrom:t,sectionTo:o};return}if(i.waiting.nonEmpty()){let n=i.waiting.unwrap(),s=i.playing.mapOr(l=>l.duration,q.Bar),a=nn(o,s);a>=t?(t<a&&(yield{optClip:i.playing,sectionFrom:t,sectionTo:a}),i.waiting=m.None,i.playing.ifSome(l=>this.#s(l.uuid)),n.nonEmpty()?(i.playing=n,this.#n(n.unwrap().uuid)):i.playing=m.None,yield{optClip:i.playing,sectionFrom:a,sectionTo:o}):yield{optClip:i.playing,sectionFrom:t,sectionTo:o}}else if(i.playing.nonEmpty()){let n=i.playing.unwrap();if(n.box.triggerMode.loop.getValue())yield{optClip:i.playing,sectionFrom:t,sectionTo:o};else{let s=nn(t,n.duration)+n.duration;s<=o?(yield{optClip:i.playing,sectionFrom:t,sectionTo:s},i.playing=m.None,this.#s(n.uuid),s<o&&(yield{optClip:m.None,sectionFrom:s,sectionTo:o})):yield{optClip:i.playing,sectionFrom:t,sectionTo:o}}}else yield{optClip:m.None,sectionFrom:t,sectionTo:o}}changes(){if(this.#r.length>0||this.#i.length>0||this.#o.length>0){let e=m.wrap({started:this.#r.slice(),stopped:this.#i.slice(),obsolete:this.#o.slice()});return this.#r.length=0,this.#i.length=0,this.#o.length=0,e}return m.None}terminate(){this.#t.clear(),this.#r.length=0,this.#i.length=0,this.#o.length=0}#n(e){this.#r.push(e)}#s(e){this.#i.push(e)}};var ES;(e=>e.Default={includeAudioEffects:!0,includeSends:!0})(ES||={});var BS=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchSoundfont(e).then(o=>this.#t=m.wrap(o))}peaks=m.None;#e={type:"idle"};#t=m.None;get soundfont(){return this.#t}get state(){return this.#e}subscribe(e){return Z.Empty}invalidate(){}toString(){return"{SoundfontLoaderWorklet}"}},Ub=class{#e;#t;constructor(e){this.#e=e,this.#t=b.newSet(t=>t.uuid)}getOrCreate(e){return this.#t.getOrCreate(e,t=>new BS(t,this.#e))}remove(e){}invalidate(e){}};var jb=class r extends cr{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 o=t.filter(i=>i.sendTransportMessages.getValue()&&i.id.getValue()!=="");if(o.length===0){this.#t.length=0;return}o.forEach(i=>{let n=i.id.getValue(),s=i.delayInMs.getValue();this.#t.forEach(a=>this.context.sendMIDIData(n,a,s)),this.#t.length=0}),e.forEach(({p0:i,p1:n,s0:s,bpm:a,flags:l})=>{let u=s/sampleRate;if(nt.every(l,1))for(let d of zn.iterate(i,n,r.ClockRate)){let p=q.pulsesToSeconds(d-i,a);o.forEach(h=>{let g=h.id.getValue(),v=h.delayInMs.getValue(),y=(u+p)*1e3+v;this.context.sendMIDIData(g,ut.Clock,y)})}})}toString(){return`{${this.constructor.name}}`}};var Lb=class{#e;#t;#r;#i;#o=new Map;#n=[];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,o){let i=this.#o.get(e);if(Fl(i)){if(i=this.#n.length,i>=64)return console.error(`Too many MIDI devices: ${i}, max is 64`),!1;this.#o.set(e,i),this.#n.push(e),this.#e.postMessage({registerDevice:e,id:i})}let n=Atomics.load(this.#t,0),s=n+1&this.#i;if(s===Atomics.load(this.#t,1))return!1;let a=t.length,l=t[0]??0,u=t[1]??0,d=t[2]??0,p=a<<30|i<<24|l<<16|u<<8|d,h=o|0,g=n<<1;return this.#r[g]=p,this.#r[g+1]=h,Atomics.store(this.#t,0,s),this.#e.postMessage(null),!0}};var VD=!1,Kb=class extends AudioWorkletProcessor{#e;#t;#r;#i;#o;#n;#s;#l;#u;#a;#c;#d;#p;#h;#f;#m;#v;#g;#A;#B;#S;#_;#$;#y;#w;#x;#E;#M;#N;#F;#P=m.None;#I=m.None;#k=m.None;#D=m.None;#R=!1;#O=!0;#C=!1;#T=0;#V=0;#z=!0;#U=1;constructor({processorOptions:{syncStreamBuffer:e,controlFlagsBuffer:t,project:o,exportConfiguration:i,options:n}}){super();let{boxGraph:s,mandatoryBoxes:{rootBox:a,timelineBox:l}}=Ms.decode(o);this.#e=new R,this.#t=QS.for(this.port),this.#r=s,this.#i=new cm,this.#M=new Int32Array(t),this.#o=cn.sender(this.#t.channel("engine-to-client"),p=>new class{log(h){p.dispatchAndForget(this.log,h)}error(h){p.dispatchAndForget(this.error,h)}fetchAudio(h){return p.dispatchAndReturn(this.fetchAudio,h)}fetchSoundfont(h){return p.dispatchAndReturn(this.fetchSoundfont,h)}notifyClipSequenceChanges(h){p.dispatchAndForget(this.notifyClipSequenceChanges,h)}switchMarkerState(h){p.dispatchAndForget(this.switchMarkerState,h)}ready(){p.dispatchAndForget(this.ready)}}),this.#s=new Ob(this.#o),this.#l=new Ub(this.#o),this.#u=b.newSet(p=>p.adapter.uuid),this.#p=new Zv,this.#n=this.#e.own(new Uv(this)),this.#c=this.#n.adapterFor(l,Ai),this.#d=new Jv(this.timelineBoxAdapter),this.#a=this.#n.adapterFor(a,uc),this.#h=new Hf,this.#f=new Jf(this.#h),this.#m=new te,this.#v=new Db,this.#$=new Cb(this.#c,this.#i),this.#y=new jb(this,this.#a),this.#w=new Tb,this.#x=this.#e.own(new Rb(this,n)),this.#F=b.newSet(p=>p),this.#E=Cl.writer(HE(),e,p=>{let{transporting:h,isCountingIn:g,isRecording:v,position:y}=this.#i,x=this.#c.box.signature.denominator.getValue();p.position=y,p.bpm=this.#x.bpm,p.playbackTimestamp=this.#V,p.countInBeatsRemaining=g?(this.#T-y)/q.fromSignature(1,x):0,p.isPlaying=h,p.isRecording=v,p.isCountingIn=g}),this.#g=this.#e.own(Mb.create(this.#t,"engine-live-data")),this.#B=new Tx(this),this.#S=this.#e.own(new Ee(this.#g,Tc.PEAKS)),this.#_=new Bl;let u=new Float32Array(this.#_.numBins()),d=new Float32Array(this.#_.numBins());this.#e.own(this.#g.broadcastFloats(Tc.SPECTRUM,u,p=>{p&&(u.set(this.#_.bins()),this.#_.decay=!0)})),this.#e.own(this.#g.broadcastFloats(Tc.WAVEFORM,d,p=>{p&&d.set(this.#_.waveform())})),this.#A=this.#e.own(new zb(this.#r)),this.#e.ownAll(XS(this.#r,this.#t.channel("engine-sync")),cn.executor(this.#t.channel("engine-commands"),{play:()=>this.#j(),stop:p=>this.#L(p),setPosition:p=>this.#K(p),prepareRecordingState:p=>this.#W(p),stopRecording:()=>this.#Z(),setMetronomeEnabled:p=>this.#i.metronomeEnabled=this.#C=p,setPlaybackTimestampEnabled:p=>this.#z=p,setCountInBarsTotal:p=>this.#U=p,queryLoadingComplete:()=>Promise.resolve(this.#r.boxes().every(p=>p.accept({visitAudioFileBox:h=>this.#s.getOrCreate(h.address.uuid).data.nonEmpty()&&h.pointerHub.nonEmpty()})??!0)),panic:()=>this.#R=!0,noteSignal:p=>{if($n.isOn(p)){let{uuid:h,pitch:g,velocity:v}=p;this.optAudioUnit(h).ifSome(y=>y.midiDeviceChain.noteSequencer.pushRawNoteOn(g,v))}else if($n.isOff(p)){let{uuid:h,pitch:g}=p;this.optAudioUnit(h).ifSome(v=>v.midiDeviceChain.noteSequencer.pushRawNoteOff(g))}else if($n.isAudition(p)){let{uuid:h,pitch:g,duration:v,velocity:y}=p;this.optAudioUnit(h).ifSome(x=>x.midiDeviceChain.noteSequencer.auditionNote(g,v,y))}},ignoreNoteRegion:p=>this.#F.add(p),scheduleClipPlay:p=>{p.forEach(h=>{let g=this.#r.findBox(h);if(g.isEmpty())console.warn(`Could not scheduleClipPlay. Cannot find clip: '${b.toString(h)}'`);else{let v=fg.for(this.#n,g.unwrap());this.#A.schedulePlay(v)}}),this.#i.transporting=!0,this.#y.schedule(ut.Start)},scheduleClipStop:p=>{p.forEach(h=>{let g=this.#r.findBox(h);g.isEmpty()?console.warn(`Could not scheduleClipStop. Cannot find track: '${b.toString(h)}'`):this.#A.scheduleStop(this.#n.adapterFor(g.unwrap(),xt))})},setupMIDI:(p,h)=>{this.#D=m.wrap(new Lb(p,h))},terminate:()=>{this.#k.ifSome(p=>p.terminate()),this.#k=m.None,this.#O=!1,this.#F.clear(),this.#e.terminate()}}),this.#a.audioUnits.catchupAndSubscribe({onAdd:p=>{let h=b.toString(p.uuid),g=G(i?.[h])?i[h]:ES.Default,v=new $b(this,p,g),y=this.#u.add(v);if(M(y,`Could not add ${v}`),v.adapter.isOutput){M(this.#I.isEmpty(),"Output can only assigned once."),this.#I=m.wrap(v);return}},onRemove:({uuid:p})=>this.#u.removeByKey(p).terminate(),onReorder:on})),this.#N=m.wrap(i).match({none:()=>T.empty(),some:p=>Object.keys(p).map(h=>this.#u.get(b.parse(h)))}),this.#o.ready(),console.log=(...p)=>this.#o.log(p.join(", "))}ignoresRegion(e){return this.#F.hasKey(e)}process(e,t){if(!this.#O)return!1;if(Atomics.load(this.#M,0)===1)return!0;try{return this.render(e,t)}catch(o){return console.debug(o),this.#O=!1,this.#o.error(o),this.terminate(),!1}}render(e,[t]){if(!this.#O)return!1;if(this.#R)return F("Manual Panic");let o=this.#i.metronomeEnabled;this.#m.notify(0),this.#P.isEmpty()&&(this.#f.update(),this.#P=m.wrap(this.#f.sorted().concat()),VD&&console.debug(`%cAudio-Graph%c
26
- ${this.#P.unwrap().map((n,s)=>`${s+1}: ${n}`).join(`
27
- `)}`,"color: hsl(200, 83%, 60%)","color: inherit"));let i=this.#P.unwrap();return this.#x.process(n=>{i.forEach(s=>s.process(n)),o&&this.#$.process(n)}),this.#N.length===0?(this.#I.unwrap().audioOutput().replaceInto(t),o&&this.#$.output.mixInto(t),this.#S.process(t[0],t[1]),this.#_.process(t[0],t[1],0,ue)):this.#N.forEach((n,s)=>{let[a,l]=n.audioOutput().channels();t[s*2].set(a),t[s*2+1].set(l)}),this.#m.notify(1),this.#A.changes().ifSome(n=>this.#o.notifyClipSequenceChanges(n)),this.#E.tryWrite(),this.#g.flush(),!0}getAudioUnit(e){return this.#u.get(e)}optAudioUnit(e){return this.#u.opt(e)}subscribeProcessPhase(e){return this.#m.subscribe(e)}registerProcessor(e){return this.#h.addVertex(e),this.#P=m.None,{terminate:()=>{this.#h.removeVertex(e),this.#P=m.None}}}registerEdge(e,t){return this.#h.addEdge([e,t]),this.#P=m.None,{terminate:()=>{this.#h.removeEdge([e,t]),this.#P=m.None}}}get boxGraph(){return this.#r}get boxAdapters(){return this.#n}get sampleManager(){return this.#s}get soundfontManager(){return this.#l}get rootBoxAdapter(){return this.#a}get timelineBoxAdapter(){return this.#c}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.#B}get timeInfo(){return this.#i}get mixer(){return this.#v}get engineToClient(){return this.#o}get isMainThread(){return!1}get isAudioContext(){return!0}get audioOutputBufferRegistry(){return this.#w}sendMIDIData(e,t,o){this.#D.ifSome(i=>i.send(e,t,o))}terminate(){console.trace(`terminate: ${this}`),this.#e.terminate(),this.#u.forEach(e=>e.terminate()),this.#u.clear()}#j(){this.#z&&(this.#i.position=this.#V,this.#y.schedule(ut.positionInPPQN(this.#i.position))),this.#i.transporting=!0,this.#y.schedule(ut.Start)}#L(e){(this.#i.isRecording||this.#i.isCountingIn)&&(this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.position=this.#z?this.#V:0,this.#y.schedule(ut.positionInPPQN(this.#i.position)));let t=this.#i.transporting;this.#i.transporting=!1,this.#i.metronomeEnabled=this.#C,this.#F.clear(),(e||!t)&&this.#G(),this.#y.schedule(ut.Stop)}#K(e){this.#i.isRecording||(this.#i.position=this.#V=e,this.#y.schedule(ut.positionInPPQN(this.#i.position)))}#W(e){if(!(this.#i.isRecording||this.#i.isCountingIn))if(!this.#i.transporting&&e){let t=this.#i.position,[o,i]=this.#c.signature;this.#T=nn(t,q.fromSignature(o,i)),this.#i.isCountingIn=!0,this.#i.metronomeEnabled=!0,this.#i.transporting=!0,this.#i.position=this.#T-q.fromSignature(this.#U*o,i);let n=this.#x.setCallback(this.#T,()=>{this.#i.isCountingIn=!1,this.#i.isRecording=!0,this.#i.metronomeEnabled=this.#C,n.terminate()});this.#y.schedule(ut.positionInPPQN(this.#i.position))}else this.#i.transporting=!0,this.#i.isRecording=!0,this.#y.schedule(ut.Start)}#Z(){!this.#i.isRecording&&!this.#i.isCountingIn||(this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.metronomeEnabled=this.#C,this.#i.transporting=!1,this.#F.clear(),this.#y.schedule(ut.Stop))}#G(){this.#V=0,this.#i.isRecording=!1,this.#i.isCountingIn=!1,this.#i.metronomeEnabled=this.#C,this.#i.position=0,this.#i.transporting=!1,this.#x.reset(),this.#A.reset(),this.#f.sorted().forEach(e=>e.reset()),this.#S.clear()}};var Wb=class extends AudioWorkletProcessor{#e;constructor({processorOptions:e}){super(),this.#e=qv.writer(e)}process(e){return this.#e.write(e[0]),!0}};registerProcessor("meter-processor",nm);registerProcessor("engine-processor",Kb);registerProcessor("recording-processor",Wb);
42
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of r.seen.entries()){let s=a[1];if(e===a[0]){o(a);continue}if(r.external){let u=r.external.registry.get(a[0])?.id;if(e!==a[0]&&u){o(a);continue}}if(r.metadataRegistry.get(a[0])?.id){o(a);continue}if(s.cycle){o(a);continue}if(s.count>1&&r.reused==="ref"){o(a);continue}}}function Xa(r,e){let t=r.seen.get(e);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let s=r.seen.get(a);if(s.ref===null)return;let l=s.def??s.schema,u={...l},d=s.ref;if(s.ref=null,d){n(d);let h=r.seen.get(d),g=h.schema;if(g.$ref&&(r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(g)):Object.assign(l,g),Object.assign(l,u),a._zod.parent===d)for(let y in l)y==="$ref"||y==="allOf"||y in u||delete l[y];if(g.$ref)for(let y in l)y==="$ref"||y==="allOf"||y in h.def&&JSON.stringify(l[y])===JSON.stringify(h.def[y])&&delete l[y]}let p=a._zod.parent;if(p&&p!==d){n(p);let h=r.seen.get(p);if(h?.schema.$ref&&(l.$ref=h.schema.$ref,h.def))for(let g in l)g==="$ref"||g==="allOf"||g in h.def&&JSON.stringify(l[g])===JSON.stringify(h.def[g])&&delete l[g]}r.override({zodSchema:a,jsonSchema:l,path:s.path??[]})};for(let a of[...r.seen.entries()].reverse())n(a[0]);let i={};if(r.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":r.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":r.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":r.target,r.external?.uri){let a=r.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=r.external.uri(a)}Object.assign(i,t.def??t.schema);let o=r.external?.defs??{};for(let a of r.seen.entries()){let s=a[1];s.def&&s.defId&&(o[s.defId]=s.def)}r.external||Object.keys(o).length>0&&(r.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:gd(e,"input",r.processors),output:gd(e,"output",r.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function kr(r,e){let t=e??{seen:new Set};if(t.seen.has(r))return!1;t.seen.add(r);let n=r._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return kr(n.element,t);if(n.type==="set")return kr(n.valueType,t);if(n.type==="lazy")return kr(n.getter(),t);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return kr(n.innerType,t);if(n.type==="intersection")return kr(n.left,t)||kr(n.right,t);if(n.type==="record"||n.type==="map")return kr(n.keyType,t)||kr(n.valueType,t);if(n.type==="pipe")return kr(n.in,t)||kr(n.out,t);if(n.type==="object"){for(let i in n.shape)if(kr(n.shape[i],t))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(kr(i,t))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(kr(i,t))return!0;return!!(n.rest&&kr(n.rest,t))}return!1}var OP=(r,e={})=>t=>{let n=Ja({...t,processors:e});return Je(r,n),Qa(n,r),Xa(n,r)},gd=(r,e,t={})=>n=>{let{libraryOptions:i,target:o}=n??{},a=Ja({...i??{},target:o,io:e,processors:t});return Je(r,a),Qa(a,r),Xa(a,r)};var TD={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},VP=(r,e,t,n)=>{let i=t;i.type="string";let{minimum:o,maximum:a,format:s,patterns:l,contentEncoding:u}=r._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof a=="number"&&(i.maxLength=a),s&&(i.format=TD[s]??s,i.format===""&&delete i.format,s==="time"&&delete i.format),u&&(i.contentEncoding=u),l&&l.size>0){let d=[...l];d.length===1?i.pattern=d[0].source:d.length>1&&(i.allOf=[...d.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},zP=(r,e,t,n)=>{let i=t,{minimum:o,maximum:a,format:s,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=r._zod.bag;typeof s=="string"&&s.includes("int")?i.type="integer":i.type="number",typeof d=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.minimum=d,i.exclusiveMinimum=!0):i.exclusiveMinimum=d),typeof o=="number"&&(i.minimum=o,typeof d=="number"&&e.target!=="draft-04"&&(d>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),typeof a=="number"&&(i.maximum=a,typeof u=="number"&&e.target!=="draft-04"&&(u<=a?delete i.maximum:delete i.exclusiveMaximum)),typeof l=="number"&&(i.multipleOf=l)},UP=(r,e,t,n)=>{t.type="boolean"},jP=(r,e,t,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},LP=(r,e,t,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},KP=(r,e,t,n)=>{e.target==="openapi-3.0"?(t.type="string",t.nullable=!0,t.enum=[null]):t.type="null"},WP=(r,e,t,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},ZP=(r,e,t,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},qP=(r,e,t,n)=>{t.not={}},GP=(r,e,t,n)=>{},HP=(r,e,t,n)=>{},JP=(r,e,t,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},QP=(r,e,t,n)=>{let i=r._zod.def,o=nf(i.entries);o.every(a=>typeof a=="number")&&(t.type="number"),o.every(a=>typeof a=="string")&&(t.type="string"),t.enum=o},XP=(r,e,t,n)=>{let i=r._zod.def,o=[];for(let a of i.values)if(a===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){let a=o[0];t.type=a===null?"null":typeof a,e.target==="draft-04"||e.target==="openapi-3.0"?t.enum=[a]:t.const=a}else o.every(a=>typeof a=="number")&&(t.type="number"),o.every(a=>typeof a=="string")&&(t.type="string"),o.every(a=>typeof a=="boolean")&&(t.type="boolean"),o.every(a=>a===null)&&(t.type="null"),t.enum=o},YP=(r,e,t,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},e1=(r,e,t,n)=>{let i=t,o=r._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},t1=(r,e,t,n)=>{let i=t,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:l}=r._zod.bag;a!==void 0&&(o.minLength=a),s!==void 0&&(o.maxLength=s),l?l.length===1?(o.contentMediaType=l[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=l.map(u=>({contentMediaType:u}))):Object.assign(i,o)},r1=(r,e,t,n)=>{t.type="boolean"},i1=(r,e,t,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},n1=(r,e,t,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},o1=(r,e,t,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},a1=(r,e,t,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},s1=(r,e,t,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},l1=(r,e,t,n)=>{let i=t,o=r._zod.def,{minimum:a,maximum:s}=r._zod.bag;typeof a=="number"&&(i.minItems=a),typeof s=="number"&&(i.maxItems=s),i.type="array",i.items=Je(o.element,e,{...n,path:[...n.path,"items"]})},c1=(r,e,t,n)=>{let i=t,o=r._zod.def;i.type="object",i.properties={};let a=o.shape;for(let u in a)i.properties[u]=Je(a[u],e,{...n,path:[...n.path,"properties",u]});let s=new Set(Object.keys(a)),l=new Set([...s].filter(u=>{let d=o.shape[u]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(i.required=Array.from(l)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=Je(o.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},fx=(r,e,t,n)=>{let i=r._zod.def,o=i.inclusive===!1,a=i.options.map((s,l)=>Je(s,e,{...n,path:[...n.path,o?"oneOf":"anyOf",l]}));o?t.oneOf=a:t.anyOf=a},u1=(r,e,t,n)=>{let i=r._zod.def,o=Je(i.left,e,{...n,path:[...n.path,"allOf",0]}),a=Je(i.right,e,{...n,path:[...n.path,"allOf",1]}),s=u=>"allOf"in u&&Object.keys(u).length===1,l=[...s(o)?o.allOf:[o],...s(a)?a.allOf:[a]];t.allOf=l},d1=(r,e,t,n)=>{let i=t,o=r._zod.def;i.type="array";let a=e.target==="draft-2020-12"?"prefixItems":"items",s=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",l=o.items.map((h,g)=>Je(h,e,{...n,path:[...n.path,a,g]})),u=o.rest?Je(o.rest,e,{...n,path:[...n.path,s,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=l,u&&(i.items=u)):e.target==="openapi-3.0"?(i.items={anyOf:l},u&&i.items.anyOf.push(u),i.minItems=l.length,u||(i.maxItems=l.length)):(i.items=l,u&&(i.additionalItems=u));let{minimum:d,maximum:p}=r._zod.bag;typeof d=="number"&&(i.minItems=d),typeof p=="number"&&(i.maxItems=p)},p1=(r,e,t,n)=>{let i=t,o=r._zod.def;i.type="object";let a=o.keyType,l=a._zod.bag?.patterns;if(o.mode==="loose"&&l&&l.size>0){let d=Je(o.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let p of l)i.patternProperties[p.source]=d}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=Je(o.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=Je(o.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let u=a._zod.values;if(u){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(i.required=d)}},h1=(r,e,t,n)=>{let i=r._zod.def,o=Je(i.innerType,e,n),a=e.seen.get(r);e.target==="openapi-3.0"?(a.ref=i.innerType,t.nullable=!0):t.anyOf=[o,{type:"null"}]},f1=(r,e,t,n)=>{let i=r._zod.def;Je(i.innerType,e,n);let o=e.seen.get(r);o.ref=i.innerType},m1=(r,e,t,n)=>{let i=r._zod.def;Je(i.innerType,e,n);let o=e.seen.get(r);o.ref=i.innerType,t.default=JSON.parse(JSON.stringify(i.defaultValue))},g1=(r,e,t,n)=>{let i=r._zod.def;Je(i.innerType,e,n);let o=e.seen.get(r);o.ref=i.innerType,e.io==="input"&&(t._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},v1=(r,e,t,n)=>{let i=r._zod.def;Je(i.innerType,e,n);let o=e.seen.get(r);o.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}t.default=a},y1=(r,e,t,n)=>{let i=r._zod.def,o=e.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Je(o,e,n);let a=e.seen.get(r);a.ref=o},x1=(r,e,t,n)=>{let i=r._zod.def;Je(i.innerType,e,n);let o=e.seen.get(r);o.ref=i.innerType,t.readOnly=!0},b1=(r,e,t,n)=>{let i=r._zod.def;Je(i.innerType,e,n);let o=e.seen.get(r);o.ref=i.innerType},mx=(r,e,t,n)=>{let i=r._zod.def;Je(i.innerType,e,n);let o=e.seen.get(r);o.ref=i.innerType},w1=(r,e,t,n)=>{let i=r._zod.innerType;Je(i,e,n);let o=e.seen.get(r);o.ref=i},hx={string:VP,number:zP,boolean:UP,bigint:jP,symbol:LP,null:KP,undefined:WP,void:ZP,never:qP,any:GP,unknown:HP,date:JP,enum:QP,literal:XP,nan:YP,template_literal:e1,file:t1,success:r1,custom:i1,function:n1,transform:o1,map:a1,set:s1,array:l1,object:c1,union:fx,intersection:u1,tuple:d1,record:p1,nullable:h1,nonoptional:f1,default:m1,prefault:g1,catch:v1,pipe:y1,readonly:x1,promise:b1,optional:mx,lazy:w1};function gx(r,e){if("_idmap"in r){let n=r,i=Ja({...e,processors:hx}),o={};for(let l of n._idmap.entries()){let[u,d]=l;Je(d,i)}let a={},s={registry:n,uri:e?.uri,defs:o};i.external=s;for(let l of n._idmap.entries()){let[u,d]=l;Qa(i,d),a[u]=Xa(i,d)}if(Object.keys(o).length>0){let l=i.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[l]:o}}return{schemas:a}}let t=Ja({...e,processors:hx});return Je(r,t),Qa(t,r),Xa(t,r)}var vx=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),this.ctx=Ja({processors:hx,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return Je(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),Qa(this.ctx,e);let n=Xa(this.ctx,e),{"~standard":i,...o}=n;return o}};var LB={};var Af={};po(Af,{ZodAny:()=>W1,ZodArray:()=>H1,ZodBase64:()=>Ox,ZodBase64URL:()=>Vx,ZodBigInt:()=>_d,ZodBigIntFormat:()=>jx,ZodBoolean:()=>Ad,ZodCIDRv4:()=>Cx,ZodCIDRv6:()=>Rx,ZodCUID:()=>Ix,ZodCUID2:()=>kx,ZodCatch:()=>vS,ZodCodec:()=>Jx,ZodCustom:()=>Df,ZodCustomStringFormat:()=>bd,ZodDate:()=>Bf,ZodDefault:()=>dS,ZodDiscriminatedUnion:()=>Q1,ZodE164:()=>zx,ZodEmail:()=>Ex,ZodEmoji:()=>Fx,ZodEnum:()=>yd,ZodExactOptional:()=>lS,ZodFile:()=>aS,ZodFunction:()=>ES,ZodGUID:()=>_f,ZodIPv4:()=>Mx,ZodIPv6:()=>Tx,ZodIntersection:()=>X1,ZodJWT:()=>Ux,ZodKSUID:()=>Dx,ZodLazy:()=>_S,ZodLiteral:()=>oS,ZodMAC:()=>O1,ZodMap:()=>iS,ZodNaN:()=>xS,ZodNanoID:()=>Bx,ZodNever:()=>q1,ZodNonOptional:()=>Gx,ZodNull:()=>L1,ZodNullable:()=>uS,ZodNumber:()=>wd,ZodNumberFormat:()=>$l,ZodObject:()=>kf,ZodOptional:()=>qx,ZodPipe:()=>Hx,ZodPrefault:()=>hS,ZodPromise:()=>SS,ZodReadonly:()=>bS,ZodRecord:()=>$f,ZodSet:()=>nS,ZodString:()=>xd,ZodStringFormat:()=>rt,ZodSuccess:()=>gS,ZodSymbol:()=>U1,ZodTemplateLiteral:()=>AS,ZodTransform:()=>sS,ZodTuple:()=>eS,ZodType:()=>Be,ZodULID:()=>Nx,ZodURL:()=>Ff,ZodUUID:()=>so,ZodUndefined:()=>j1,ZodUnion:()=>Nf,ZodUnknown:()=>Z1,ZodVoid:()=>G1,ZodXID:()=>$x,ZodXor:()=>J1,_ZodString:()=>Sx,_default:()=>pS,_function:()=>JI,any:()=>BI,array:()=>If,base64:()=>dI,base64url:()=>pI,bigint:()=>_I,boolean:()=>z1,catch:()=>yS,check:()=>QI,cidrv4:()=>cI,cidrv6:()=>uI,codec:()=>qI,cuid:()=>tI,cuid2:()=>rI,custom:()=>XI,date:()=>kI,describe:()=>YI,discriminatedUnion:()=>CI,e164:()=>hI,email:()=>WB,emoji:()=>YB,enum:()=>Wx,exactOptional:()=>cS,file:()=>LI,float32:()=>xI,float64:()=>bI,function:()=>JI,guid:()=>ZB,hash:()=>yI,hex:()=>vI,hostname:()=>gI,httpUrl:()=>XB,instanceof:()=>tk,int:()=>Px,int32:()=>wI,int64:()=>PI,intersection:()=>Y1,ipv4:()=>aI,ipv6:()=>lI,json:()=>ik,jwt:()=>fI,keyof:()=>NI,ksuid:()=>oI,lazy:()=>PS,literal:()=>jI,looseObject:()=>MI,looseRecord:()=>OI,mac:()=>sI,map:()=>VI,meta:()=>ek,nan:()=>ZI,nanoid:()=>eI,nativeEnum:()=>UI,never:()=>Lx,nonoptional:()=>mS,null:()=>K1,nullable:()=>Sf,nullish:()=>KI,number:()=>V1,object:()=>$I,optional:()=>Pf,partialRecord:()=>RI,pipe:()=>Ef,prefault:()=>fS,preprocess:()=>nk,promise:()=>HI,readonly:()=>wS,record:()=>rS,refine:()=>FS,set:()=>zI,strictObject:()=>DI,string:()=>_x,stringFormat:()=>mI,stringbool:()=>rk,success:()=>WI,superRefine:()=>BS,symbol:()=>EI,templateLiteral:()=>GI,transform:()=>Zx,tuple:()=>tS,uint32:()=>AI,uint64:()=>SI,ulid:()=>iI,undefined:()=>FI,union:()=>Kx,unknown:()=>Nl,url:()=>QB,uuid:()=>qB,uuidv4:()=>GB,uuidv6:()=>HB,uuidv7:()=>JB,void:()=>II,xid:()=>nI,xor:()=>TI});var yx={};po(yx,{endsWith:()=>ld,gt:()=>oo,gte:()=>Ir,includes:()=>ad,length:()=>kl,lowercase:()=>nd,lt:()=>no,lte:()=>gi,maxLength:()=>Il,maxSize:()=>Ha,mime:()=>cd,minLength:()=>Lo,minSize:()=>ao,multipleOf:()=>Ga,negative:()=>cx,nonnegative:()=>dx,nonpositive:()=>ux,normalize:()=>ud,overwrite:()=>An,positive:()=>lx,property:()=>px,regex:()=>id,size:()=>Bl,slugify:()=>fd,startsWith:()=>sd,toLowerCase:()=>pd,toUpperCase:()=>hd,trim:()=>dd,uppercase:()=>od});var vd={};po(vd,{ZodISODate:()=>bx,ZodISODateTime:()=>xx,ZodISODuration:()=>Ax,ZodISOTime:()=>wx,date:()=>_1,datetime:()=>A1,duration:()=>S1,time:()=>P1});var xx=A("ZodISODateTime",(r,e)=>{YA.init(r,e),rt.init(r,e)});function A1(r){return iP(xx,r)}var bx=A("ZodISODate",(r,e)=>{e_.init(r,e),rt.init(r,e)});function _1(r){return nP(bx,r)}var wx=A("ZodISOTime",(r,e)=>{t_.init(r,e),rt.init(r,e)});function P1(r){return oP(wx,r)}var Ax=A("ZodISODuration",(r,e)=>{r_.init(r,e),rt.init(r,e)});function S1(r){return aP(Ax,r)}var KB=(r,e)=>{cf.init(r,e),r.name="ZodError",Object.defineProperties(r,{format:{value:t=>df(r,t)},flatten:{value:t=>uf(r,t)},addIssue:{value:t=>{r.issues.push(t),r.message=JSON.stringify(r.issues,Gu,2)}},addIssues:{value:t=>{r.issues.push(...t),r.message=JSON.stringify(r.issues,Gu,2)}},isEmpty:{get(){return r.issues.length===0}}})},RD=A("ZodError",KB),Gr=A("ZodError",KB,{Parent:Error});var E1=Qu(Gr),F1=Xu(Gr),B1=Yu(Gr),I1=ed(Gr),k1=gy(Gr),N1=vy(Gr),$1=yy(Gr),D1=xy(Gr),M1=by(Gr),T1=wy(Gr),C1=Ay(Gr),R1=_y(Gr);var Be=A("ZodType",(r,e)=>(Ae.init(r,e),Object.assign(r["~standard"],{jsonSchema:{input:gd(r,"input"),output:gd(r,"output")}}),r.toJSONSchema=OP(r,{}),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(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),r.with=r.check,r.clone=(t,n)=>Br(r,t,n),r.brand=()=>r,r.register=(t,n)=>(t.add(r,n),r),r.parse=(t,n)=>E1(r,t,n,{callee:r.parse}),r.safeParse=(t,n)=>B1(r,t,n),r.parseAsync=async(t,n)=>F1(r,t,n,{callee:r.parseAsync}),r.safeParseAsync=async(t,n)=>I1(r,t,n),r.spa=r.safeParseAsync,r.encode=(t,n)=>k1(r,t,n),r.decode=(t,n)=>N1(r,t,n),r.encodeAsync=async(t,n)=>$1(r,t,n),r.decodeAsync=async(t,n)=>D1(r,t,n),r.safeEncode=(t,n)=>M1(r,t,n),r.safeDecode=(t,n)=>T1(r,t,n),r.safeEncodeAsync=async(t,n)=>C1(r,t,n),r.safeDecodeAsync=async(t,n)=>R1(r,t,n),r.refine=(t,n)=>r.check(FS(t,n)),r.superRefine=t=>r.check(BS(t)),r.overwrite=t=>r.check(An(t)),r.optional=()=>Pf(r),r.exactOptional=()=>cS(r),r.nullable=()=>Sf(r),r.nullish=()=>Pf(Sf(r)),r.nonoptional=t=>mS(r,t),r.array=()=>If(r),r.or=t=>Kx([r,t]),r.and=t=>Y1(r,t),r.transform=t=>Ef(r,Zx(t)),r.default=t=>pS(r,t),r.prefault=t=>fS(r,t),r.catch=t=>yS(r,t),r.pipe=t=>Ef(r,t),r.readonly=()=>wS(r),r.describe=t=>{let n=r.clone();return sr.add(n,{description:t}),n},Object.defineProperty(r,"description",{get(){return sr.get(r)?.description},configurable:!0}),r.meta=(...t)=>{if(t.length===0)return sr.get(r);let n=r.clone();return sr.add(n,t[0]),n},r.isOptional=()=>r.safeParse(void 0).success,r.isNullable=()=>r.safeParse(null).success,r.apply=t=>t(r),r)),Sx=A("_ZodString",(r,e)=>{Fl.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(n,i,o)=>VP(r,n,i,o);let t=r._zod.bag;r.format=t.format??null,r.minLength=t.minimum??null,r.maxLength=t.maximum??null,r.regex=(...n)=>r.check(id(...n)),r.includes=(...n)=>r.check(ad(...n)),r.startsWith=(...n)=>r.check(sd(...n)),r.endsWith=(...n)=>r.check(ld(...n)),r.min=(...n)=>r.check(Lo(...n)),r.max=(...n)=>r.check(Il(...n)),r.length=(...n)=>r.check(kl(...n)),r.nonempty=(...n)=>r.check(Lo(1,...n)),r.lowercase=n=>r.check(nd(n)),r.uppercase=n=>r.check(od(n)),r.trim=()=>r.check(dd()),r.normalize=(...n)=>r.check(ud(...n)),r.toLowerCase=()=>r.check(pd()),r.toUpperCase=()=>r.check(hd()),r.slugify=()=>r.check(fd())}),xd=A("ZodString",(r,e)=>{Fl.init(r,e),Sx.init(r,e),r.email=t=>r.check(jy(Ex,t)),r.url=t=>r.check(wf(Ff,t)),r.jwt=t=>r.check(sx(Ux,t)),r.emoji=t=>r.check(qy(Fx,t)),r.guid=t=>r.check(bf(_f,t)),r.uuid=t=>r.check(Ly(so,t)),r.uuidv4=t=>r.check(Ky(so,t)),r.uuidv6=t=>r.check(Wy(so,t)),r.uuidv7=t=>r.check(Zy(so,t)),r.nanoid=t=>r.check(Gy(Bx,t)),r.guid=t=>r.check(bf(_f,t)),r.cuid=t=>r.check(Hy(Ix,t)),r.cuid2=t=>r.check(Jy(kx,t)),r.ulid=t=>r.check(Qy(Nx,t)),r.base64=t=>r.check(nx(Ox,t)),r.base64url=t=>r.check(ox(Vx,t)),r.xid=t=>r.check(Xy($x,t)),r.ksuid=t=>r.check(Yy(Dx,t)),r.ipv4=t=>r.check(ex(Mx,t)),r.ipv6=t=>r.check(tx(Tx,t)),r.cidrv4=t=>r.check(rx(Cx,t)),r.cidrv6=t=>r.check(ix(Rx,t)),r.e164=t=>r.check(ax(zx,t)),r.datetime=t=>r.check(A1(t)),r.date=t=>r.check(_1(t)),r.time=t=>r.check(P1(t)),r.duration=t=>r.check(S1(t))});function _x(r){return Y_(xd,r)}var rt=A("ZodStringFormat",(r,e)=>{tt.init(r,e),Sx.init(r,e)}),Ex=A("ZodEmail",(r,e)=>{KA.init(r,e),rt.init(r,e)});function WB(r){return jy(Ex,r)}var _f=A("ZodGUID",(r,e)=>{jA.init(r,e),rt.init(r,e)});function ZB(r){return bf(_f,r)}var so=A("ZodUUID",(r,e)=>{LA.init(r,e),rt.init(r,e)});function qB(r){return Ly(so,r)}function GB(r){return Ky(so,r)}function HB(r){return Wy(so,r)}function JB(r){return Zy(so,r)}var Ff=A("ZodURL",(r,e)=>{WA.init(r,e),rt.init(r,e)});function QB(r){return wf(Ff,r)}function XB(r){return wf(Ff,{protocol:/^https?$/,hostname:Zi.domain,...L.normalizeParams(r)})}var Fx=A("ZodEmoji",(r,e)=>{ZA.init(r,e),rt.init(r,e)});function YB(r){return qy(Fx,r)}var Bx=A("ZodNanoID",(r,e)=>{qA.init(r,e),rt.init(r,e)});function eI(r){return Gy(Bx,r)}var Ix=A("ZodCUID",(r,e)=>{GA.init(r,e),rt.init(r,e)});function tI(r){return Hy(Ix,r)}var kx=A("ZodCUID2",(r,e)=>{HA.init(r,e),rt.init(r,e)});function rI(r){return Jy(kx,r)}var Nx=A("ZodULID",(r,e)=>{JA.init(r,e),rt.init(r,e)});function iI(r){return Qy(Nx,r)}var $x=A("ZodXID",(r,e)=>{QA.init(r,e),rt.init(r,e)});function nI(r){return Xy($x,r)}var Dx=A("ZodKSUID",(r,e)=>{XA.init(r,e),rt.init(r,e)});function oI(r){return Yy(Dx,r)}var Mx=A("ZodIPv4",(r,e)=>{i_.init(r,e),rt.init(r,e)});function aI(r){return ex(Mx,r)}var O1=A("ZodMAC",(r,e)=>{o_.init(r,e),rt.init(r,e)});function sI(r){return tP(O1,r)}var Tx=A("ZodIPv6",(r,e)=>{n_.init(r,e),rt.init(r,e)});function lI(r){return tx(Tx,r)}var Cx=A("ZodCIDRv4",(r,e)=>{a_.init(r,e),rt.init(r,e)});function cI(r){return rx(Cx,r)}var Rx=A("ZodCIDRv6",(r,e)=>{s_.init(r,e),rt.init(r,e)});function uI(r){return ix(Rx,r)}var Ox=A("ZodBase64",(r,e)=>{c_.init(r,e),rt.init(r,e)});function dI(r){return nx(Ox,r)}var Vx=A("ZodBase64URL",(r,e)=>{u_.init(r,e),rt.init(r,e)});function pI(r){return ox(Vx,r)}var zx=A("ZodE164",(r,e)=>{d_.init(r,e),rt.init(r,e)});function hI(r){return ax(zx,r)}var Ux=A("ZodJWT",(r,e)=>{p_.init(r,e),rt.init(r,e)});function fI(r){return sx(Ux,r)}var bd=A("ZodCustomStringFormat",(r,e)=>{h_.init(r,e),rt.init(r,e)});function mI(r,e,t={}){return md(bd,r,e,t)}function gI(r){return md(bd,"hostname",Zi.hostname,r)}function vI(r){return md(bd,"hex",Zi.hex,r)}function yI(r,e){let t=e?.enc??"hex",n=`${r}_${t}`,i=Zi[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return md(bd,n,i,e)}var wd=A("ZodNumber",(r,e)=>{Dy.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(n,i,o)=>zP(r,n,i,o),r.gt=(n,i)=>r.check(oo(n,i)),r.gte=(n,i)=>r.check(Ir(n,i)),r.min=(n,i)=>r.check(Ir(n,i)),r.lt=(n,i)=>r.check(no(n,i)),r.lte=(n,i)=>r.check(gi(n,i)),r.max=(n,i)=>r.check(gi(n,i)),r.int=n=>r.check(Px(n)),r.safe=n=>r.check(Px(n)),r.positive=n=>r.check(oo(0,n)),r.nonnegative=n=>r.check(Ir(0,n)),r.negative=n=>r.check(no(0,n)),r.nonpositive=n=>r.check(gi(0,n)),r.multipleOf=(n,i)=>r.check(Ga(n,i)),r.step=(n,i)=>r.check(Ga(n,i)),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 V1(r){return sP(wd,r)}var $l=A("ZodNumberFormat",(r,e)=>{f_.init(r,e),wd.init(r,e)});function Px(r){return cP($l,r)}function xI(r){return uP($l,r)}function bI(r){return dP($l,r)}function wI(r){return pP($l,r)}function AI(r){return hP($l,r)}var Ad=A("ZodBoolean",(r,e)=>{mf.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>UP(r,t,n,i)});function z1(r){return fP(Ad,r)}var _d=A("ZodBigInt",(r,e)=>{My.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(n,i,o)=>jP(r,n,i,o),r.gte=(n,i)=>r.check(Ir(n,i)),r.min=(n,i)=>r.check(Ir(n,i)),r.gt=(n,i)=>r.check(oo(n,i)),r.gte=(n,i)=>r.check(Ir(n,i)),r.min=(n,i)=>r.check(Ir(n,i)),r.lt=(n,i)=>r.check(no(n,i)),r.lte=(n,i)=>r.check(gi(n,i)),r.max=(n,i)=>r.check(gi(n,i)),r.positive=n=>r.check(oo(BigInt(0),n)),r.negative=n=>r.check(no(BigInt(0),n)),r.nonpositive=n=>r.check(gi(BigInt(0),n)),r.nonnegative=n=>r.check(Ir(BigInt(0),n)),r.multipleOf=(n,i)=>r.check(Ga(n,i));let t=r._zod.bag;r.minValue=t.minimum??null,r.maxValue=t.maximum??null,r.format=t.format??null});function _I(r){return gP(_d,r)}var jx=A("ZodBigIntFormat",(r,e)=>{m_.init(r,e),_d.init(r,e)});function PI(r){return yP(jx,r)}function SI(r){return xP(jx,r)}var U1=A("ZodSymbol",(r,e)=>{g_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>LP(r,t,n,i)});function EI(r){return bP(U1,r)}var j1=A("ZodUndefined",(r,e)=>{v_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>WP(r,t,n,i)});function FI(r){return wP(j1,r)}var L1=A("ZodNull",(r,e)=>{y_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>KP(r,t,n,i)});function K1(r){return AP(L1,r)}var W1=A("ZodAny",(r,e)=>{x_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>GP(r,t,n,i)});function BI(){return _P(W1)}var Z1=A("ZodUnknown",(r,e)=>{b_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>HP(r,t,n,i)});function Nl(){return PP(Z1)}var q1=A("ZodNever",(r,e)=>{w_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>qP(r,t,n,i)});function Lx(r){return SP(q1,r)}var G1=A("ZodVoid",(r,e)=>{A_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>ZP(r,t,n,i)});function II(r){return EP(G1,r)}var Bf=A("ZodDate",(r,e)=>{__.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(n,i,o)=>JP(r,n,i,o),r.min=(n,i)=>r.check(Ir(n,i)),r.max=(n,i)=>r.check(gi(n,i));let t=r._zod.bag;r.minDate=t.minimum?new Date(t.minimum):null,r.maxDate=t.maximum?new Date(t.maximum):null});function kI(r){return FP(Bf,r)}var H1=A("ZodArray",(r,e)=>{P_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>l1(r,t,n,i),r.element=e.element,r.min=(t,n)=>r.check(Lo(t,n)),r.nonempty=t=>r.check(Lo(1,t)),r.max=(t,n)=>r.check(Il(t,n)),r.length=(t,n)=>r.check(kl(t,n)),r.unwrap=()=>r.element});function If(r,e){return kP(H1,r,e)}function NI(r){let e=r._zod.def.shape;return Wx(Object.keys(e))}var kf=A("ZodObject",(r,e)=>{S_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>c1(r,t,n,i),L.defineLazy(r,"shape",()=>e.shape),r.keyof=()=>Wx(Object.keys(r._zod.def.shape)),r.catchall=t=>r.clone({...r._zod.def,catchall:t}),r.passthrough=()=>r.clone({...r._zod.def,catchall:Nl()}),r.loose=()=>r.clone({...r._zod.def,catchall:Nl()}),r.strict=()=>r.clone({...r._zod.def,catchall:Lx()}),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(qx,r,t[0]),r.required=(...t)=>L.required(Gx,r,t[0])});function $I(r,e){let t={type:"object",shape:r??{},...L.normalizeParams(e)};return new kf(t)}function DI(r,e){return new kf({type:"object",shape:r,catchall:Lx(),...L.normalizeParams(e)})}function MI(r,e){return new kf({type:"object",shape:r,catchall:Nl(),...L.normalizeParams(e)})}var Nf=A("ZodUnion",(r,e)=>{gf.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>fx(r,t,n,i),r.options=e.options});function Kx(r,e){return new Nf({type:"union",options:r,...L.normalizeParams(e)})}var J1=A("ZodXor",(r,e)=>{Nf.init(r,e),E_.init(r,e),r._zod.processJSONSchema=(t,n,i)=>fx(r,t,n,i),r.options=e.options});function TI(r,e){return new J1({type:"union",options:r,inclusive:!1,...L.normalizeParams(e)})}var Q1=A("ZodDiscriminatedUnion",(r,e)=>{Nf.init(r,e),F_.init(r,e)});function CI(r,e,t){return new Q1({type:"union",options:e,discriminator:r,...L.normalizeParams(t)})}var X1=A("ZodIntersection",(r,e)=>{B_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>u1(r,t,n,i)});function Y1(r,e){return new X1({type:"intersection",left:r,right:e})}var eS=A("ZodTuple",(r,e)=>{Ty.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>d1(r,t,n,i),r.rest=t=>r.clone({...r._zod.def,rest:t})});function tS(r,e,t){let n=e instanceof Ae,i=n?t:e,o=n?e:null;return new eS({type:"tuple",items:r,rest:o,...L.normalizeParams(i)})}var $f=A("ZodRecord",(r,e)=>{I_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>p1(r,t,n,i),r.keyType=e.keyType,r.valueType=e.valueType});function rS(r,e,t){return new $f({type:"record",keyType:r,valueType:e,...L.normalizeParams(t)})}function RI(r,e,t){let n=Br(r);return n._zod.values=void 0,new $f({type:"record",keyType:n,valueType:e,...L.normalizeParams(t)})}function OI(r,e,t){return new $f({type:"record",keyType:r,valueType:e,mode:"loose",...L.normalizeParams(t)})}var iS=A("ZodMap",(r,e)=>{k_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>a1(r,t,n,i),r.keyType=e.keyType,r.valueType=e.valueType,r.min=(...t)=>r.check(ao(...t)),r.nonempty=t=>r.check(ao(1,t)),r.max=(...t)=>r.check(Ha(...t)),r.size=(...t)=>r.check(Bl(...t))});function VI(r,e,t){return new iS({type:"map",keyType:r,valueType:e,...L.normalizeParams(t)})}var nS=A("ZodSet",(r,e)=>{N_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>s1(r,t,n,i),r.min=(...t)=>r.check(ao(...t)),r.nonempty=t=>r.check(ao(1,t)),r.max=(...t)=>r.check(Ha(...t)),r.size=(...t)=>r.check(Bl(...t))});function zI(r,e){return new nS({type:"set",valueType:r,...L.normalizeParams(e)})}var yd=A("ZodEnum",(r,e)=>{$_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(n,i,o)=>QP(r,n,i,o),r.enum=e.entries,r.options=Object.values(e.entries);let t=new Set(Object.keys(e.entries));r.extract=(n,i)=>{let o={};for(let a of n)if(t.has(a))o[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new yd({...e,checks:[],...L.normalizeParams(i),entries:o})},r.exclude=(n,i)=>{let o={...e.entries};for(let a of n)if(t.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new yd({...e,checks:[],...L.normalizeParams(i),entries:o})}});function Wx(r,e){let t=Array.isArray(r)?Object.fromEntries(r.map(n=>[n,n])):r;return new yd({type:"enum",entries:t,...L.normalizeParams(e)})}function UI(r,e){return new yd({type:"enum",entries:r,...L.normalizeParams(e)})}var oS=A("ZodLiteral",(r,e)=>{D_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>XP(r,t,n,i),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 jI(r,e){return new oS({type:"literal",values:Array.isArray(r)?r:[r],...L.normalizeParams(e)})}var aS=A("ZodFile",(r,e)=>{M_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>t1(r,t,n,i),r.min=(t,n)=>r.check(ao(t,n)),r.max=(t,n)=>r.check(Ha(t,n)),r.mime=(t,n)=>r.check(cd(Array.isArray(t)?t:[t],n))});function LI(r){return NP(aS,r)}var sS=A("ZodTransform",(r,e)=>{T_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>o1(r,t,n,i),r._zod.parse=(t,n)=>{if(n.direction==="backward")throw new La(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 i=e.transform(t.value,t);return i instanceof Promise?i.then(o=>(t.value=o,t)):(t.value=i,t)}});function Zx(r){return new sS({type:"transform",transform:r})}var qx=A("ZodOptional",(r,e)=>{Cy.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>mx(r,t,n,i),r.unwrap=()=>r._zod.def.innerType});function Pf(r){return new qx({type:"optional",innerType:r})}var lS=A("ZodExactOptional",(r,e)=>{C_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>mx(r,t,n,i),r.unwrap=()=>r._zod.def.innerType});function cS(r){return new lS({type:"optional",innerType:r})}var uS=A("ZodNullable",(r,e)=>{R_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>h1(r,t,n,i),r.unwrap=()=>r._zod.def.innerType});function Sf(r){return new uS({type:"nullable",innerType:r})}function KI(r){return Pf(Sf(r))}var dS=A("ZodDefault",(r,e)=>{O_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>m1(r,t,n,i),r.unwrap=()=>r._zod.def.innerType,r.removeDefault=r.unwrap});function pS(r,e){return new dS({type:"default",innerType:r,get defaultValue(){return typeof e=="function"?e():L.shallowClone(e)}})}var hS=A("ZodPrefault",(r,e)=>{V_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>g1(r,t,n,i),r.unwrap=()=>r._zod.def.innerType});function fS(r,e){return new hS({type:"prefault",innerType:r,get defaultValue(){return typeof e=="function"?e():L.shallowClone(e)}})}var Gx=A("ZodNonOptional",(r,e)=>{z_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>f1(r,t,n,i),r.unwrap=()=>r._zod.def.innerType});function mS(r,e){return new Gx({type:"nonoptional",innerType:r,...L.normalizeParams(e)})}var gS=A("ZodSuccess",(r,e)=>{U_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>r1(r,t,n,i),r.unwrap=()=>r._zod.def.innerType});function WI(r){return new gS({type:"success",innerType:r})}var vS=A("ZodCatch",(r,e)=>{j_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>v1(r,t,n,i),r.unwrap=()=>r._zod.def.innerType,r.removeCatch=r.unwrap});function yS(r,e){return new vS({type:"catch",innerType:r,catchValue:typeof e=="function"?e:()=>e})}var xS=A("ZodNaN",(r,e)=>{L_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>YP(r,t,n,i)});function ZI(r){return IP(xS,r)}var Hx=A("ZodPipe",(r,e)=>{K_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>y1(r,t,n,i),r.in=e.in,r.out=e.out});function Ef(r,e){return new Hx({type:"pipe",in:r,out:e})}var Jx=A("ZodCodec",(r,e)=>{Hx.init(r,e),vf.init(r,e)});function qI(r,e,t){return new Jx({type:"pipe",in:r,out:e,transform:t.decode,reverseTransform:t.encode})}var bS=A("ZodReadonly",(r,e)=>{W_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>x1(r,t,n,i),r.unwrap=()=>r._zod.def.innerType});function wS(r){return new bS({type:"readonly",innerType:r})}var AS=A("ZodTemplateLiteral",(r,e)=>{Z_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>e1(r,t,n,i)});function GI(r,e){return new AS({type:"template_literal",parts:r,...L.normalizeParams(e)})}var _S=A("ZodLazy",(r,e)=>{H_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>w1(r,t,n,i),r.unwrap=()=>r._zod.def.getter()});function PS(r){return new _S({type:"lazy",getter:r})}var SS=A("ZodPromise",(r,e)=>{G_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>b1(r,t,n,i),r.unwrap=()=>r._zod.def.innerType});function HI(r){return new SS({type:"promise",innerType:r})}var ES=A("ZodFunction",(r,e)=>{q_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>n1(r,t,n,i)});function JI(r){return new ES({type:"function",input:Array.isArray(r?.input)?tS(r?.input):r?.input??If(Nl()),output:r?.output??Nl()})}var Df=A("ZodCustom",(r,e)=>{J_.init(r,e),Be.init(r,e),r._zod.processJSONSchema=(t,n,i)=>i1(r,t,n,i)});function QI(r){let e=new it({check:"custom"});return e._zod.check=r,e}function XI(r,e){return $P(Df,r??(()=>!0),e)}function FS(r,e={}){return DP(Df,r,e)}function BS(r){return MP(r)}var YI=TP,ek=CP;function tk(r,e={}){let t=new Df({type:"custom",check:"custom",fn:n=>n instanceof r,abort:!0,...L.normalizeParams(e)});return t._zod.bag.Class=r,t._zod.check=n=>{n.value instanceof r||n.issues.push({code:"invalid_type",expected:r.name,input:n.value,inst:t,path:[...t._zod.def.path??[]]})},t}var rk=(...r)=>RP({Codec:Jx,Boolean:Ad,String:xd},...r);function ik(r){let e=PS(()=>Kx([_x(r),V1(),z1(),K1(),If(e),rS(_x(),e)]));return e}function nk(r,e){return Ef(Zx(r),e)}var VD={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 zD(r){Ft({customError:r})}function UD(){return Ft().customError}var IS;IS||(IS={});var J={...Af,...yx,iso:vd},jD=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function LD(r,e){let t=r.$schema;return t==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":t==="http://json-schema.org/draft-07/schema#"?"draft-7":t==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function KD(r,e){if(!r.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let t=r.slice(1).split("/").filter(Boolean);if(t.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(t[0]===n){let i=t[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${r}`);return e.defs[i]}throw new Error(`Reference not found: ${r}`)}function ok(r,e){if(r.not!==void 0){if(typeof r.not=="object"&&Object.keys(r.not).length===0)return J.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(r.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(r.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(r.if!==void 0||r.then!==void 0||r.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(r.dependentSchemas!==void 0||r.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(r.$ref){let i=r.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return J.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let o=KD(i,e),a=vr(o,e);return e.refs.set(i,a),e.processing.delete(i),a}if(r.enum!==void 0){let i=r.enum;if(e.version==="openapi-3.0"&&r.nullable===!0&&i.length===1&&i[0]===null)return J.null();if(i.length===0)return J.never();if(i.length===1)return J.literal(i[0]);if(i.every(a=>typeof a=="string"))return J.enum(i);let o=i.map(a=>J.literal(a));return o.length<2?o[0]:J.union([o[0],o[1],...o.slice(2)])}if(r.const!==void 0)return J.literal(r.const);let t=r.type;if(Array.isArray(t)){let i=t.map(o=>{let a={...r,type:o};return ok(a,e)});return i.length===0?J.never():i.length===1?i[0]:J.union(i)}if(!t)return J.any();let n;switch(t){case"string":{let i=J.string();if(r.format){let o=r.format;o==="email"?i=i.check(J.email()):o==="uri"||o==="uri-reference"?i=i.check(J.url()):o==="uuid"||o==="guid"?i=i.check(J.uuid()):o==="date-time"?i=i.check(J.iso.datetime()):o==="date"?i=i.check(J.iso.date()):o==="time"?i=i.check(J.iso.time()):o==="duration"?i=i.check(J.iso.duration()):o==="ipv4"?i=i.check(J.ipv4()):o==="ipv6"?i=i.check(J.ipv6()):o==="mac"?i=i.check(J.mac()):o==="cidr"?i=i.check(J.cidrv4()):o==="cidr-v6"?i=i.check(J.cidrv6()):o==="base64"?i=i.check(J.base64()):o==="base64url"?i=i.check(J.base64url()):o==="e164"?i=i.check(J.e164()):o==="jwt"?i=i.check(J.jwt()):o==="emoji"?i=i.check(J.emoji()):o==="nanoid"?i=i.check(J.nanoid()):o==="cuid"?i=i.check(J.cuid()):o==="cuid2"?i=i.check(J.cuid2()):o==="ulid"?i=i.check(J.ulid()):o==="xid"?i=i.check(J.xid()):o==="ksuid"&&(i=i.check(J.ksuid()))}typeof r.minLength=="number"&&(i=i.min(r.minLength)),typeof r.maxLength=="number"&&(i=i.max(r.maxLength)),r.pattern&&(i=i.regex(new RegExp(r.pattern))),n=i;break}case"number":case"integer":{let i=t==="integer"?J.number().int():J.number();typeof r.minimum=="number"&&(i=i.min(r.minimum)),typeof r.maximum=="number"&&(i=i.max(r.maximum)),typeof r.exclusiveMinimum=="number"?i=i.gt(r.exclusiveMinimum):r.exclusiveMinimum===!0&&typeof r.minimum=="number"&&(i=i.gt(r.minimum)),typeof r.exclusiveMaximum=="number"?i=i.lt(r.exclusiveMaximum):r.exclusiveMaximum===!0&&typeof r.maximum=="number"&&(i=i.lt(r.maximum)),typeof r.multipleOf=="number"&&(i=i.multipleOf(r.multipleOf)),n=i;break}case"boolean":{n=J.boolean();break}case"null":{n=J.null();break}case"object":{let i={},o=r.properties||{},a=new Set(r.required||[]);for(let[l,u]of Object.entries(o)){let d=vr(u,e);i[l]=a.has(l)?d:d.optional()}if(r.propertyNames){let l=vr(r.propertyNames,e),u=r.additionalProperties&&typeof r.additionalProperties=="object"?vr(r.additionalProperties,e):J.any();if(Object.keys(i).length===0){n=J.record(l,u);break}let d=J.object(i).passthrough(),p=J.looseRecord(l,u);n=J.intersection(d,p);break}if(r.patternProperties){let l=r.patternProperties,u=Object.keys(l),d=[];for(let h of u){let g=vr(l[h],e),v=J.string().regex(new RegExp(h));d.push(J.looseRecord(v,g))}let p=[];if(Object.keys(i).length>0&&p.push(J.object(i).passthrough()),p.push(...d),p.length===0)n=J.object({}).passthrough();else if(p.length===1)n=p[0];else{let h=J.intersection(p[0],p[1]);for(let g=2;g<p.length;g++)h=J.intersection(h,p[g]);n=h}break}let s=J.object(i);r.additionalProperties===!1?n=s.strict():typeof r.additionalProperties=="object"?n=s.catchall(vr(r.additionalProperties,e)):n=s.passthrough();break}case"array":{let i=r.prefixItems,o=r.items;if(i&&Array.isArray(i)){let a=i.map(l=>vr(l,e)),s=o&&typeof o=="object"&&!Array.isArray(o)?vr(o,e):void 0;s?n=J.tuple(a).rest(s):n=J.tuple(a),typeof r.minItems=="number"&&(n=n.check(J.minLength(r.minItems))),typeof r.maxItems=="number"&&(n=n.check(J.maxLength(r.maxItems)))}else if(Array.isArray(o)){let a=o.map(l=>vr(l,e)),s=r.additionalItems&&typeof r.additionalItems=="object"?vr(r.additionalItems,e):void 0;s?n=J.tuple(a).rest(s):n=J.tuple(a),typeof r.minItems=="number"&&(n=n.check(J.minLength(r.minItems))),typeof r.maxItems=="number"&&(n=n.check(J.maxLength(r.maxItems)))}else if(o!==void 0){let a=vr(o,e),s=J.array(a);typeof r.minItems=="number"&&(s=s.min(r.minItems)),typeof r.maxItems=="number"&&(s=s.max(r.maxItems)),n=s}else n=J.array(J.any());break}default:throw new Error(`Unsupported type: ${t}`)}return r.description&&(n=n.describe(r.description)),r.default!==void 0&&(n=n.default(r.default)),n}function vr(r,e){if(typeof r=="boolean")return r?J.any():J.never();let t=ok(r,e),n=r.type||r.enum!==void 0||r.const!==void 0;if(r.anyOf&&Array.isArray(r.anyOf)){let s=r.anyOf.map(u=>vr(u,e)),l=J.union(s);t=n?J.intersection(t,l):l}if(r.oneOf&&Array.isArray(r.oneOf)){let s=r.oneOf.map(u=>vr(u,e)),l=J.xor(s);t=n?J.intersection(t,l):l}if(r.allOf&&Array.isArray(r.allOf))if(r.allOf.length===0)t=n?t:J.any();else{let s=n?t:vr(r.allOf[0],e),l=n?0:1;for(let u=l;u<r.allOf.length;u++)s=J.intersection(s,vr(r.allOf[u],e));t=s}r.nullable===!0&&e.version==="openapi-3.0"&&(t=J.nullable(t)),r.readOnly===!0&&(t=J.readonly(t));let i={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of o)s in r&&(i[s]=r[s]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let s of a)s in r&&(i[s]=r[s]);for(let s of Object.keys(r))jD.has(s)||(i[s]=r[s]);return Object.keys(i).length>0&&e.registry.add(t,i),t}function ak(r,e){if(typeof r=="boolean")return r?J.any():J.never();let t=LD(r,e?.defaultTarget),n=r.$defs||r.definitions||{},i={version:t,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??sr};return vr(r,i)}var kS={};po(kS,{bigint:()=>GD,boolean:()=>qD,date:()=>HD,number:()=>ZD,string:()=>WD});function WD(r){return eP(xd,r)}function ZD(r){return lP(wd,r)}function qD(r){return mP(Ad,r)}function GD(r){return vP(_d,r)}function HD(r){return BP(Bf,r)}Ft(Ry());var lk=[1,2,4,8],ck=[1,2,3,4,5,6,7,8],uk=Ue.object({metronome:Ue.object({enabled:Ue.boolean(),beatSubDivision:Ue.union(lk.map(r=>Ue.literal(r))),gain:Ue.number().min(Number.NEGATIVE_INFINITY).max(0)}).default({enabled:!1,beatSubDivision:1,gain:-6}),playback:Ue.object({timestampEnabled:Ue.boolean(),pauseOnLoopDisabled:Ue.boolean(),truncateNotesAtRegionEnd:Ue.boolean()}).default({timestampEnabled:!0,pauseOnLoopDisabled:!1,truncateNotesAtRegionEnd:!1}),recording:Ue.object({countInBars:Ue.union(ck.map(r=>Ue.literal(r)))}).default({countInBars:1})}),sk;(function(r){r.BeatSubDivisionOptions=lk,r.RecordingCountInBars=ck})(sk||(sk={}));var Pd={[Dt.Instrument]:0,[Dt.Aux]:1,[Dt.Bus]:2,[Dt.Output]:3};var Qx;(function(r){r.create=({boxGraph:e,mandatoryBoxes:{rootBox:t,primaryAudioBus:n}},i,o,a)=>{let s=a??r.orderAndGetIndex(t,i);return console.debug(`createAudioUnit type: ${i}, insertIndex: ${s}`),ut.create(e,w.generate(),l=>{l.collection.refer(t.audioUnits),l.output.refer(n.input),l.index.setValue(s),l.type.setValue(i),o.ifSome(u=>l.capture.refer(u))})},r.orderAndGetIndex=(e,t)=>{let n=Jl.collectIndexedBoxes(e.audioUnits,ut),i=Pd[t],o=0;for(;o<n.length&&!(Pd[n[o].type.getValue()]>i);o++);let a=o;for(;o<n.length;)n[o].index.setValue(++o);return a},r.trackTypeToCapture=(e,t)=>{switch(t){case oe.Audio:return m.wrap(ra.create(e,w.generate()));case oe.Notes:return m.wrap(ia.create(e,w.generate()));default:return m.None}}})(Qx||(Qx={}));var dk;(function(r){r.create=(e,t,n,i,o)=>{console.debug(`createAudioBus '${t}', type: ${i}, color: ${o}`);let{boxGraph:a,mandatoryBoxes:{rootBox:s}}=e;T(s.isAttached(),"rootBox not attached");let l=w.generate(),u=Qi.create(a,l,p=>{p.collection.refer(s.audioBusses),p.label.setValue(t),p.icon.setValue(Oe.toName(n)),p.color.setValue(o.toString())}),d=Qx.create(e,i,m.None);return wr.create(a,w.generate(),p=>{p.tracks.refer(d.tracks),p.target.refer(d),p.index.setValue(0),p.type.setValue(oe.Undefined)}),u.output.refer(d.input),u}})(dk||(dk={}));var pk;(function(r){r.forAudioType=e=>{switch(e){case Dt.Output:return oa.blue;case Dt.Aux:return oa.purple;case Dt.Bus:return oa.orange;case Dt.Instrument:return oa.green;default:return oa.dark}},r.forTrackType=e=>{switch(e){case oe.Audio:return 200;case oe.Notes:return 45;case oe.Value:return 156;default:return 0}}})(pk||(pk={}));var hk;(function(r){r.Tape={defaultName:"Tape",defaultIcon:Oe.Tape,description:"Plays audio regions & clips",manualPage:ue.Tape,trackType:oe.Audio,create:(n,i,o,a,s)=>hc.create(n,w.generate(),l=>{l.label.setValue(o),l.icon.setValue(Oe.toName(a)),l.flutter.setValue(.2),l.wow.setValue(.05),l.noise.setValue(.02),l.saturation.setValue(.5),l.host.refer(i)})},r.Nano={defaultName:"Nano",defaultIcon:Oe.NanoWave,description:"Simple sampler",manualPage:ue.Nano,trackType:oe.Notes,create:(n,i,o,a,s)=>{let l;if(Z(s))l=s;else{let u=w.parse("c1678daa-4a47-4cba-b88f-4f4e384663c3"),d=5.34;l=n.findBox(u).unwrapOrElse(()=>Lt.create(n,u,p=>{p.fileName.setValue("Rhode"),p.endInSeconds.setValue(d)}))}return dc.create(n,w.generate(),u=>{u.label.setValue(o),u.icon.setValue(Oe.toName(a)),u.file.refer(l),u.host.refer(i)})}},r.Playfield={defaultName:"Playfield",defaultIcon:Oe.Playfield,description:"Drum computer",manualPage:ue.Playfield,trackType:oe.Notes,create:(n,i,o,a,s)=>{let l=pc.create(n,w.generate(),u=>{u.label.setValue(o),u.icon.setValue(Oe.toName(a)),u.host.refer(i)});return Z(s)&&s.filter(({note:u,uuid:d,name:p,durationInSeconds:h,exclude:g})=>{let v=e(n,d,p,h);na.create(n,w.generate(),y=>{y.device.refer(l.samples),y.file.refer(v),y.index.setValue(u),y.exclude.setValue(g)})}),l}},r.Vaporisateur={defaultName:"Vaporisateur",defaultIcon:Oe.Piano,description:"Classic subtractive synthesizer",manualPage:ue.Vaporisateur,trackType:oe.Notes,create:(n,i,o,a,s)=>lc.create(n,w.generate(),l=>{l.label.setValue(o),l.icon.setValue(Oe.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(Dn.Polyphonic),l.lfo.rate.setInitValue(1),l.oscillators.fields()[0].waveform.setInitValue(Qe.saw),l.oscillators.fields()[0].volume.setInitValue(-6),l.oscillators.fields()[1].volume.setInitValue(Number.NEGATIVE_INFINITY),l.oscillators.fields()[1].waveform.setInitValue(Qe.square),l.host.refer(i),l.version.setValue(2)})},r.MIDIOutput={defaultName:"MIDIOutput",defaultIcon:Oe.Midi,description:"MIDI Output",manualPage:ue.MIDIOutput,trackType:oe.Notes,create:(n,i,o,a,s)=>cc.create(n,w.generate(),l=>{l.label.setValue(o),l.icon.setValue(Oe.toName(a)),l.host.refer(i)})},r.Soundfont={defaultName:"Soundfont",defaultIcon:Oe.SoundFont,description:"Soundfont Player",manualPage:ue.Soundfont,trackType:oe.Notes,create:(n,i,o,a,s)=>{s??(s={uuid:"d9f51577-2096-4671-9067-27ca2e12b329",name:"Upright Piano KW"});let l=s.uuid,u=w.parse(l),d=t(n,u,s.name);return uc.create(n,w.generate(),p=>{p.label.setValue(o),p.icon.setValue(Oe.toName(a)),p.host.refer(i),p.file.refer(d)})}},r.Named={Vaporisateur:r.Vaporisateur,Playfield:r.Playfield,Nano:r.Nano,Tape:r.Tape,Soundfont:r.Soundfont,MIDIOutput:r.MIDIOutput};let e=(n,i,o,a)=>n.findBox(i).unwrapOrElse(()=>Lt.create(n,i,s=>{s.fileName.setValue(o),s.endInSeconds.setValue(a)})),t=(n,i,o)=>n.findBox(i).unwrapOrElse(()=>Tr.create(n,i,a=>a.fileName.setValue(o)))})(hk||(hk={}));var Ya;(function(r){r.empty=n=>{let i=new ms(m.wrap(gs.create)),o=new Date().toISOString();console.debug(`New Project created on ${o}`),i.beginTransaction();let a=ac.create(i,w.generate(),h=>{h.label.setValue("Groove Shuffle")}),s=Ql.create(i,w.generate(),h=>{h.groove.refer(a),h.created.setValue(o)}),l=Qi.create(i,w.generate(),h=>{h.collection.refer(s.audioBusses),h.label.setValue("Output"),h.icon.setValue(Oe.toName(Oe.SpeakerHeadphone)),h.color.setValue(oa.blue.toString())}),u=ut.create(i,w.generate(),h=>{h.type.setValue(Dt.Output),h.collection.refer(s.audioUnits),h.output.refer(s.outputDevice),h.index.setValue(0)});n.createOutputCompressor&&sc.create(i,w.generate(),h=>{h.label.setValue("Master Compressor"),h.index.setValue(0),h.host.refer(u.audioEffects),h.threshold.setValue(0),h.ratio.setValue(24)});let d=ys.create(i,w.generate());Ji.create(i,w.generate(),h=>d.tempoTrack.events.refer(h.owners)),s.timeline.refer(d.root),l.output.refer(u.input);let p=[];if(n.createDefaultUser){let h=vs.create(i,w.generate());h.root.refer(s.users),p.push(h)}return i.endTransaction(),{boxGraph:i,mandatoryBoxes:{rootBox:s,primaryAudioBus:l,primaryAudioOutputUnit:u,timelineBox:d,userInterfaceBoxes:p}}},r.encode=n=>{let i=Ut.create();i.writeInt(1330660686),i.writeInt(2);let o=n.toArrayBuffer();return i.writeInt(o.byteLength),i.writeBytes(new Int8Array(o)),i.toArrayBuffer()},r.decode=n=>{let i=new mt(n);T(i.readInt()===1330660686,"Corrupt header. Probably not an openDAW project file."),T(i.readInt()===2,"Deprecated Format");let o=i.readInt(),a=new Int8Array(o);i.readBytes(a);let s=new ms(m.wrap(gs.create));return s.fromArrayBuffer(a.buffer),{boxGraph:s,mandatoryBoxes:r.findMandatoryBoxes(s)}},r.findMandatoryBoxes=n=>{let i=n.boxes().find(o=>o.accept({visitRootBox:()=>!0}));if(Z(i)){let o=Te(i.outputDevice.pointerHub.incoming().at(0)?.box,ut),a=Te(o.input.pointerHub.incoming().at(0)?.box,Qi),s=Te(i.timeline.targetVertex.unwrap("TimelineBox not found").box,ys),l=i.users.pointerHub.incoming().map(({box:u})=>Te(u,vs));return{rootBox:i,primaryAudioBus:a,primaryAudioOutputUnit:o,timelineBox:s,userInterfaceBoxes:l}}return B("Could not find mandatory boxes")}})(Ya||(Ya={}));var Sd;(function(r){let e=({graph:s},{graph:l})=>s===l,t=(s,l)=>s.index.getValue()-l.index.getValue(),n=s=>s.accept({visitTrackBox:l=>!0})===!0;r.extractAudioUnits=(s,{boxGraph:l,mandatoryBoxes:{primaryAudioBus:u,rootBox:d}},p={})=>{T(O.satisfy(s,e),"AudioUnits must share the same BoxGraph"),T(!p.includeAux&&!p.includeBus,"Options are not yet implemented");let h=p?.excludeTimeline===!0?n:Wo.alwaysFalse,g=s.flatMap(M=>Array.from(M.graph.dependenciesOf(M,{alwaysFollowMandatory:!1,excludeBox:h}).boxes)),v=s.flatMap(M=>M.input.pointerHub.incoming().map(({box:U})=>U)),y=w.newSet(M=>M),x=[...g,...v].filter(M=>M.name!==$n.ClassName&&M.name!==ws.ClassName).filter(M=>y.opt(M.address.uuid).nonEmpty()?!1:(y.add(M.address.uuid),!0)),$=i(s,x,d.audioUnits.address.uuid,u.address.uuid);return o($,l,s,x),a($,s,d),console.debug("inTransaction",l.inTransaction()),s.map(M=>Te(d.graph.findBox($.get(M.address.uuid).target).unwrap("Target Track has not been copied"),ut))},r.extractRegions=(s,{boxGraph:l,mandatoryBoxes:{primaryAudioBus:u,rootBox:d}},p=0)=>{T(O.satisfy(s,e),"Region smust be from the same BoxGraph");let h=new Set(s),g=new Set,v=new Vl;s.forEach(V=>{let re=Te(V.regions.targetVertex.unwrap().box,wr);g.add(re);let Y=Te(re.tracks.targetVertex.unwrap().box,ut);v.add(Y,re)}),console.debug(`Found ${v.keyCount()} audioUnits`),console.debug(`Found ${g.size} tracks`);let y=[...v.keys()],x=V=>Ke(V,wr)&&!g.has(V)||ja.isRegionBox(V)&&!h.has(V),$=y.flatMap(V=>Array.from(V.graph.dependenciesOf(V,{excludeBox:x,alwaysFollowMandatory:!0}).boxes)).filter(V=>V.name!==$n.ClassName&&V.name!==ws.ClassName),M=i(y,$,d.audioUnits.address.uuid,u.address.uuid);o(M,l,y,$),a(M,y,d),v.forEach((V,re)=>[...re].sort(t).forEach((Y,de)=>{let Q=l.findBox(M.get(Y.address.uuid).target).unwrap("Target Track has not been copied");Te(Q,wr).index.setValue(de)}));let U=s.reduce((V,re)=>Math.min(V,re.position.getValue()),Number.MAX_VALUE),C=p-U;s.forEach(V=>{let re=l.findBox(M.get(V.address.uuid).target).unwrap("Target Track has not been copied"),Y=ja.asRegionBox(re).position;Y.setValue(Y.getValue()+C)})};let i=(s,l,u,d)=>{let p=w.newSet(({source:h})=>h);return p.addMany([...s.filter(({output:{targetAddress:h}})=>h.nonEmpty()).map(h=>({source:h.output.targetAddress.unwrap().uuid,target:d})),...s.map(h=>({source:h.collection.targetAddress.unwrap("AudioUnitBox was not connected to a RootBox").uuid,target:u})),...s.map(h=>({source:h.address.uuid,target:w.generate()})),...l.map(({address:{uuid:h},name:g})=>({source:h,target:g===Lt.ClassName||g===Tr.ClassName?h:w.generate()}))]),p},o=(s,l,u,d)=>{let p=w.newSet(h=>h);d.forEach(h=>{(h instanceof Lt||h instanceof Tr)&&l.findBox(h.address.uuid).nonEmpty()&&p.add(h.address.uuid)}),F.decodeWith({map:(h,g)=>g.map(v=>s.opt(v.uuid).match({none:()=>v,some:({target:y})=>v.moveTo(y)}))},()=>{u.forEach(h=>{let g=new mt(h.toArrayBuffer()),v=h.name,y=s.get(h.address.uuid).target;l.createBox(v,y,x=>x.read(g))}),d.forEach(h=>{if((h instanceof Lt||h instanceof Tr)&&p.opt(h.address.uuid).nonEmpty())return;if(h instanceof nc){let x=h.owner.targetAddress.unwrap().uuid;if(p.opt(x).nonEmpty())return}let g=new mt(h.toArrayBuffer()),v=h.name,y=s.get(h.address.uuid).target;l.createBox(v,y,x=>x.read(g))})})},a=(s,l,u)=>l.toSorted(t).map(d=>Te(u.graph.findBox(s.get(d.address.uuid).target).unwrap("Target Track has not been copied"),ut)).forEach(d=>Jl.collectIndexedBoxes(u.audioUnits,ut).toSorted((p,h)=>{let g=Pd[p.type.getValue()],v=Pd[h.type.getValue()],y=g-v;return y===0?h===d?-1:1:y}).forEach((p,h)=>p.index.setValue(h)))})(Sd||(Sd={}));var es;(function(r){r.MAGIC_HEADER_OPEN=1330664005,r.FORMAT_VERSION=1})(es||(es={}));var fk;(function(r){r.decode=(e,t)=>{let n=new mt(e.slice(0,8));if(n.readInt()!==es.MAGIC_HEADER_OPEN){jl.info({headline:"Could Not Import Preset",message:"Invalid preset file"}).then();return}if(n.readInt()!==es.FORMAT_VERSION){jl.info({headline:"Could Not Import Preset",message:"Invalid preset version"}).then();return}let i=new ms(m.wrap(gs.create));try{i.fromArrayBuffer(e.slice(8))}catch(a){jl.info({headline:"Could Not Import Preset",message:String(a)}).then();return}let o=i.boxes().filter(a=>Ke(a,ut)).filter(a=>a.type.getValue()!==Dt.Output);Sd.extractAudioUnits(o,t,{excludeTimeline:!0}).filter(a=>a.type.getValue()!==Dt.Output).forEach(a=>{let s=a.input.pointerHub.incoming().at(0)?.box;Z(s)&&a.capture.targetVertex.ifSome(({box:l})=>{l instanceof ia?wr.create(t.boxGraph,w.generate(),u=>{u.index.setValue(0),u.type.setValue(oe.Notes),u.target.refer(a),u.tracks.refer(a.tracks)}):l instanceof ra&&wr.create(t.boxGraph,w.generate(),u=>{u.index.setValue(0),u.type.setValue(oe.Audio),u.target.refer(a),u.tracks.refer(a.tracks)})})})},r.replaceAudioUnit=(e,t,n)=>{console.debug("ReplaceAudioUnit with preset...");let i=Ya.empty({createDefaultUser:!1,createOutputCompressor:!1}),o=i.boxGraph,a=t.graph;o.beginTransaction(),r.decode(e,i),o.endTransaction();let s=i.mandatoryBoxes.rootBox.audioUnits.pointerHub.incoming().map(({box:x})=>Te(x,ut)).find(x=>x.type.getValue()!==Dt.Output);if(Gf(s))return Sn.err("Preset contains no valid audio unit. Please send the file to the developers.");let l=s.capture.targetVertex.mapOr(({box:x})=>x.name,""),u=t.capture.targetVertex.mapOr(({box:x})=>x.name,"");if(l!==u)return Sn.err("Cannot replace incompatible instruments");let d=n?.keepMIDIEffects!==!0,p=n?.keepAudioEffects!==!0;console.debug("replaceMIDIEffects",d),console.debug("replaceAudioEffects",p),se(t.input.pointerHub.incoming().at(0)?.box,"Target has no input").delete(),d?t.midiEffects.pointerHub.incoming().forEach(({box:x})=>x.delete()):(o.beginTransaction(),s.midiEffects.pointerHub.incoming().forEach(({box:x})=>x.delete()),o.endTransaction()),p?t.audioEffects.pointerHub.incoming().forEach(({box:x})=>x.delete()):(o.beginTransaction(),s.audioEffects.pointerHub.incoming().forEach(({box:x})=>x.delete()),o.endTransaction());let h=x=>x.accept({visitTrackBox:$=>!0,visitCaptureMidiBox:$=>!0,visitCaptureAudioBox:$=>!0})===!0,g=w.newSet(({source:x})=>x),v=Array.from(o.dependenciesOf(s,{excludeBox:h,alwaysFollowMandatory:!1}).boxes);g.addMany([{source:s.address.uuid,target:t.address.uuid},...v.map(({address:{uuid:x},name:$})=>({source:x,target:$===Lt.ClassName||$===Tr.ClassName?x:w.generate()}))]);let y=w.newSet(x=>x);return v.forEach(x=>{(x instanceof Lt||x instanceof Tr)&&a.findBox(x.address.uuid).nonEmpty()&&y.add(x.address.uuid)}),F.decodeWith({map:(x,$)=>$.map(M=>g.opt(M.uuid).match({none:()=>M,some:({target:U})=>M.moveTo(U)}))},()=>{v.forEach(x=>{if((x instanceof Lt||x instanceof Tr)&&y.opt(x.address.uuid).nonEmpty())return;let $=new mt(x.toArrayBuffer()),M=x.name,U=g.get(x.address.uuid).target;a.createBox(M,U,C=>C.read($))})}),Sn.Ok}})(fk||(fk={}));var mk;(function(r){r.encode=e=>{let t=Ut.create();t.writeInt(es.MAGIC_HEADER_OPEN),t.writeInt(es.FORMAT_VERSION);let n=Ya.empty({createOutputCompressor:!1,createDefaultUser:!1});return n.boxGraph.beginTransaction(),Sd.extractAudioUnits([e],n,{excludeTimeline:!0}),n.boxGraph.endTransaction(),console.debug("SAVING..."),n.boxGraph.debugBoxes(),O.concatArrayBuffers(t.toArrayBuffer(),n.boxGraph.toArrayBuffer())}})(mk||(mk={}));var gk;(function(r){r.existingInstrumentNames=e=>e.audioUnits.pointerHub.incoming().map(({box:t})=>{let n=Te(t,ut).input.pointerHub.incoming().at(0);if(n===void 0)return"N/A";let i=n.box;return"label"in i&&i.label instanceof D?i.label.getValue():"N/A"})})(gk||(gk={}));var vk=Ue.object({name:Ue.string(),bpm:Ue.number(),duration:Ue.number(),sample_rate:Ue.number(),origin:Ue.enum(["openDAW","recording","import"])});var Fee=vk.extend({uuid:w.zType(Ue)});var JD,QD,XD,YD,eM,tM;JD=new WeakMap,QD=new WeakMap,XD=new WeakMap,YD=new WeakMap,eM=new WeakMap,tM=new WeakMap;var Ed=function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},rM,iM,NS,$S,DS,nM,oM;iM=new WeakMap,NS=new WeakMap,$S=new WeakMap,DS=new WeakMap,nM=new WeakMap,rM=new WeakSet,oM=function(e){return e.pointerHub.catchupAndSubscribe({onAdded:t=>{let n=Te(t.box,$n);T(n.isAttached(),"SelectionBox is not attached");let i=n.selectable.targetVertex.unwrap(()=>`SelectionBox has no target (${n.selectable.targetAddress.unwrapOrUndefined()?.toString()??"No address"})`),o={box:n,selectable:i};Ed(this,DS,"f").proxy.onSelected(i),T(Ed(this,NS,"f").add(o),"Could not add to entityMap"),T(Ed(this,$S,"f").add(o),"Could not add to selectableMap")},onRemoved:t=>{let n=Te(t.box,$n),i=Ed(this,NS,"f").removeByKey(n.address.uuid);T(i.box===n,"Broken selection");let o=i.selectable;Ed(this,DS,"f").proxy.onDeselected(o),Ed(this,$S,"f").removeByKey(o.address)}},c.Selection)};var yk=Ue.object({name:Ue.string(),size:Ue.number().int(),url:Ue.string(),license:Ue.string(),origin:Ue.enum(["openDAW","import"])});var jee=yk.extend({uuid:w.zType(Ue)});var xk;(function(r){r.cut=(e,t,n)=>{if(!(e.position>=t||t>=e.complete))if($0.isLoopableRegion(e)){let{position:i,complete:o,loopOffset:a,loopDuration:s}=e;e.duration=t-i,e.copyTo({position:t,duration:o-t,loopOffset:Vd(a+(t-i),s),consolidate:n})}else return B("Not yet implemented")},r.clip=(e,t,n)=>{if($0.isLoopableRegion(e)){let{position:i,complete:o,loopOffset:a,loopDuration:s}=e;if(o-n<=0)return B(`duration will zero or negative(${o-n})`);e.duration=t-i,e.copyTo({position:n,duration:o-n,loopOffset:Vd(a+(n-i),s)})}else return B("Not yet implemented")}})(xk||(xk={}));var ts;(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"})(ts||(ts={}));var Mf;(function(r){r[r.WRITE=0]="WRITE",r[r.READ=1]="READ"})(Mf||(Mf={}));var Fd;(function(r){r[r.ID=15793935]="ID",r[r.START=15790320]="START",r[r.END=986895]="END"})(Fd||(Fd={}));var Xx=class r{static create(e,t){return new r(e.channel(t))}#e=[];#t=new SharedArrayBuffer(1);#r=new Int8Array(this.#t);#i;#n=Ut.create(0);#o=m.None;#a=m.None;#s=m.None;#l=-1;#c=-1;#u=!1;#d=!1;#p=0;constructor(e){this.#i=Hi.sender(e,({dispatchAndForget:t})=>new class{sendShareLock(n){t(this.sendShareLock,n)}sendUpdateData(n){t(this.sendUpdateData,n)}sendUpdateStructure(n){t(this.sendUpdateStructure,n)}})}flush(){let e=this.#h();if(e.nonEmpty()){this.#d||(this.#i.sendShareLock(this.#t),this.#d=!0),this.#i.sendUpdateStructure(e.unwrap());let t=this.#e.length,n=this.#f(),i=t+n;if(this.#o.isEmpty()||this.#o.unwrap().byteLength<i||t!==this.#p){let a=En(i),s=new SharedArrayBuffer(a);this.#a=m.wrap(new Uint8Array(s,0,t)),this.#n=Ut.use(s,t),this.#o=m.wrap(s),this.#p=t,this.#i.sendUpdateData(s)}}this.#o.isEmpty()||Atomics.load(this.#r,0)===Mf.WRITE&&(this.#m(this.#n),this.#n.position=0,Atomics.store(this.#r,0,Mf.READ))}broadcastFloat(e,t){return this.#v(new class{type=ts.Float;address=e;capacity=8;put(n,i){n.writeFloat(t())}})}broadcastInteger(e,t){return this.#v(new class{type=ts.Integer;address=e;capacity=8;put(n,i){n.writeInt(t())}})}broadcastFloats(e,t,n){return this.#v(new class{type=ts.FloatArray;address=e;capacity=4+(t.byteLength<<2);put(i,o){n?.(o),i.writeInt(t.length);for(let a of t)i.writeFloat(a)}})}broadcastIntegers(e,t,n){return this.#v(new class{type=ts.IntegerArray;address=e;capacity=4+(t.byteLength<<2);put(i,o){n(o),i.writeInt(t.length),t.forEach(a=>i.writeInt(a))}})}broadcastByteArray(e,t,n){return this.#v(new class{type=ts.ByteArray;address=e;capacity=4+t.byteLength;put(i,o){n(o),i.writeInt(t.byteLength),i.writeBytes(t)}})}#h(){if(this.#u){try{this.#s=m.wrap(this.#A())}catch(e){throw e}this.#u=!1}if(this.#s.nonEmpty()){let e=this.#s;return this.#s=m.None,e}return m.None}#f(){return this.#c===-1&&(this.#c=this.#g()+12),this.#c}terminate(){O.clear(this.#e),this.#s=m.None,this.#u=!1,this.#c=0}#m(e){T(!this.#u&&this.#s.isEmpty(),"Cannot flush while update is available");let t=this.#f();T(e.remaining>=t,"Insufficient data"),e.writeInt(this.#l),e.writeInt(Fd.START);let n=this.#a;for(let i=0;i<this.#e.length;i++){let o=n.nonEmpty()&&n.unwrap()[i]!==0;this.#e[i].put(e,o)}e.writeInt(Fd.END)}#g(){return this.#e.reduce((e,t)=>e+t.capacity,0)}#v(e){return this.#e.push(e),this.#w(),{terminate:()=>{O.removeOpt(this.#e,e),this.#w()}}}#w(){this.#c=-1,this.#u=!0}#A(){let e=Ut.create();e.writeInt(Fd.ID),e.writeInt(++this.#l),e.writeInt(this.#e.length);for(let{address:t,type:n}of this.#e)t.write(e),e.writeByte(n);return e.toArrayBuffer()}};var Tf=class{#e=new R;#t;constructor(e,t){this.#t=this.#e.own(new im(t)),this.#e.own(Hi.executor(e,{updateSettings:n=>this.#t.update(n)}))}get settings(){return this.#t.data}catchupAndSubscribe(e,...t){return this.#t.catchupAndSubscribe(e,...t)}terminate(){this.#e.terminate(),this.#t.terminate()}};var Bd;(e=>e.create=(t,n,i,o)=>0|(t?1:0)|(n?2:0)|(i?4:0)|(o?8:0))(Bd||={});var Fe=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;#s=0;#l=0;constructor(e,t){this.#e=e,this.#t=t,this.#r=new Float32Array(4),this.#i=O.create(()=>new Gl(r.RMS_WINDOW),2),this.#n=this.#e.broadcastFloats(this.#t,this.#r,n=>{this.#r[0]=this.#o,this.#r[1]=this.#a,this.#r[2]=this.#s,this.#r[3]=this.#l})}clear(){this.#i[0].clear(),this.#i[1].clear(),this.#o=0,this.#a=0}process(e,t,n=0,i=he){let o=i-n,a=r.PEAK_DECAY**o,s=0,l=0;for(let u=n;u<i;u++){let d=Math.abs(e[u]),p=Math.abs(t[u]);d>s&&(s=d),p>l&&(l=p)}this.#o=Math.max(s,this.#o*a),this.#a=Math.max(l,this.#a*a),this.#s=this.#i[0].processBlock(e,n,i),this.#l=this.#i[1].processBlock(t,n,i)}processStereo([e,t],n=0,i=he){this.process(e,t,n,i)}terminate(){this.#n.terminate()}};var Yx=class{#e=new R;#t;#r;#i;#n=m.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(n=>{this.#o=n.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(){T(this.#n.isEmpty(),"Already broadcasting"),this.#n=m.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(){T(this.#n.nonEmpty(),"Never started broadcasting"),this.#n.unwrap().terminate(),this.#n=m.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 Id=class{#e;constructor(){this.#e=new tm}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 yr=class{#e=new R;#t;#r;#i;#n;#o=m.None;constructor(e){this.#t=e,this.#r=new Id,this.#i=[],this.#n=[]}parameterChanged(e,t){return B(`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 Yx(this.#t,e);return t.ownAll(e.field.pointerHub.catchupAndSubscribe({onAdded:n=>{this.#o.isEmpty()&&(this.#o=m.wrap(this.#t.updateClock.addEventOutput(this.#r))),this.#n.push(t),t.onStartAutomation()},onRemoved:n=>{O.remove(this.#n,t),this.#n.length===0&&(this.#o.ifSome(i=>i.terminate()),this.#o=m.None),t.onStopAutomation()}},c.Automation),t.subscribe(()=>this.parameterChanged(t))),this.#i.push(t),t}updateParameters(e,t){this.#n.forEach(n=>{n.updateAutomation(e)&&this.parameterChanged(n,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=m.None,this.#i.length=0,this.#e.terminate()}toString(){return`{${this.constructor.name}}`}};var Cf;(e=>e.isOfType=t=>t.type==="update-event")(Cf||={});var eb=class extends yr{#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:n,flags:i},o)=>{if(ct.every(i,1))for(let a of Go.iterate(t,n,vm)){let s={type:"update-event",position:a};this.#e.forEach(l=>l.add(o,s))}})}toString(){return`{${this.constructor.name}}`}};var Re=class extends yr{constructor(e){super(e)}process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:n,p0:i,s0:o,s1:a,bpm:s}=t,l=null,u=o;for(let d of this.eventInput.get(n)){let p=d.position-i,h=Math.abs(p)<1e-7?o:o+Math.floor(G.pulsesToSamples(p,s,sampleRate));T(o<=h&&h<=a,()=>`${h} out of bounds. event: ${d.position} (${d.type}), p0: ${i}`),l?.forEach(g=>this.handleEvent(g)),l=null,u<h&&(this.processAudio(t,u,h),u=h),Cf.isOfType(d)?this.updateParameters(d.position,o/sampleRate+G.pulsesToSeconds(d.position-i,s)):(l??=[]).push(d)}l?.forEach(d=>this.handleEvent(d)),l=null,u<a&&this.processAudio(t,u,a)}),this.eventInput.clear(),this.finishProcess()}introduceBlock(e){}handleEvent(e){return B(`${this} received an event but has no accepting method.`)}finishProcess(){}};var aM=50,sM=250,tb=class r{static FilterMapping=S.exponential(20/sampleRate,2e4/sampleRate);#e;#t;#r;#i;#n;#o;#a;#s;#l;#c;#u;#d;#p=0;#h=0;#f=0;#m=0;#g=0;#v=0;feedback=.5;cross=0;lfoPhaseIncr=0;#w=0;lfoDepth=0;wet=.75;dry=.75;#A=!1;constructor(e){let t=En(e);this.#e=t,this.#t=t-1,this.#r=[new Float32Array(t),new Float32Array(t)],this.#i=[new $t,new $t],this.#n=new Bn,this.#o=Math.floor(.25*sampleRate),this.#a=new Kd(e,this.#o),this.#s=new Kd(e,this.#o),this.#l=[new Float32Array(128),new Float32Array(128)],this.#c=new Xr(.003,sampleRate),this.#u=Math.exp(-1/(sampleRate*aM)),this.#d=Math.exp(-1/(sampleRate*sM))}reset(){this.#h=0,this.#a.clear(),this.#s.clear(),this.#A&&(this.#i.forEach(e=>e.reset()),this.#r.forEach(e=>e.fill(0)),this.#A=!1,this.#v=0,this.#w=0),this.#E()}set preDelayLeftOffset(e){this.#a.offset=Math.max(0,Math.min(e,this.#e-1))}set preDelayRightOffset(e){this.#s.offset=Math.max(0,Math.min(e,this.#e-1))}set offset(e){(e<0||e>=this.#e)&&B(`DelayDeviceDsp offset ${e} out of bounds [0, ${this.#e})`),this.#f!==e&&(this.#f=e,this.#A?this.#F():this.#E())}get offset(){return this.#f}set filter(e){e===0?this.#n.identity():e>0?this.#n.setHighpassParams(r.FilterMapping.y(e)):e<0&&this.#n.setLowpassParams(r.FilterMapping.y(1+e))}setLfoDepth(e){this.lfoDepth=e}process(e,t,n,i){let o=e[0],a=e[1],s=t[0],l=t[1];this.#a.process(this.#l[0],o,n,i),this.#s.process(this.#l[1],a,n,i);let u=this.cross,d=1-u,p=this.#t,h=this.#e,g=this.feedback,v=this.wet,y=this.dry,x=this.#n,[$,M]=this.#i,[U,C]=this.#r,[V,re]=this.#l;for(let Y=n;Y<i;++Y){this.#g>0?(this.#p+=this.#m,this.#g--):this.#p=this.#f;let de=this.#c.process(this.lfoDepth),Q=2*Math.abs(this.#w-.5)*de;this.#w+=this.lfoPhaseIncr,this.#w>=1&&(this.#w-=1);let Pe=this.#h-(this.#p+de-Q);Pe<0&&(Pe+=h);let ce=Pe|0,je=ce+1&p,_e=Pe-ce,Ge=U[ce&p],Le=C[ce&p],ge=Ge+_e*(U[je]-Ge),Ze=Le+_e*(C[je]-Le),zt=Math.max(Math.abs(ge),Math.abs(Ze));this.#v=zt>this.#v?this.#u*(this.#v-zt)+zt:this.#d*(this.#v-zt)+zt,this.#v>1&&(ge/=this.#v,Ze/=this.#v);let co=$.processFrame(x,(ge*d+Ze*u)*.96)*g+1e-18-1e-18,qi=M.processFrame(x,(Ze*d+ge*u)*.96)*g+1e-18-1e-18;U[this.#h]=V[Y]+co,C[this.#h]=re[Y]+qi,s[Y]=o[Y]*y+co*v,l[Y]=a[Y]*y+qi*v,this.#h=this.#h+1&p,U[this.#h]=0,C[this.#h]=0}this.#A=!0}#E(){this.#p=this.#f,this.#g=0}#F(){this.#f!==this.#p&&(this.#g=this.#o,this.#m=(this.#f-this.#p)/this.#g)}};var rb=class r extends Re{static ID=0;#e=r.ID++;#t;parameterPreSyncTimeLeft;parameterPreMillisTimeLeft;parameterPreSyncTimeRight;parameterPreMillisTimeRight;parameterDelay;parameterMillisTime;parameterFeedback;parameterCross;parameterLfoSpeed;parameterLfoDepth;parameterFilter;parameterDry;parameterWet;#r;#i;#n;#o=m.None;#a=!0;#s=!0;#l=!0;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Fe(e.broadcaster,t.address));let{namedParameter:n}=t;this.parameterPreSyncTimeLeft=this.own(this.bindParameter(n.preSyncTimeLeft)),this.parameterPreMillisTimeLeft=this.own(this.bindParameter(n.preMillisTimeLeft)),this.parameterPreSyncTimeRight=this.own(this.bindParameter(n.preSyncTimeRight)),this.parameterPreMillisTimeRight=this.own(this.bindParameter(n.preMillisTimeRight)),this.parameterDelay=this.own(this.bindParameter(n.delay)),this.parameterMillisTime=this.own(this.bindParameter(n.millisTime)),this.parameterFeedback=this.own(this.bindParameter(n.feedback)),this.parameterCross=this.own(this.bindParameter(n.cross)),this.parameterLfoSpeed=this.own(this.bindParameter(n.lfoSpeed)),this.parameterLfoDepth=this.own(this.bindParameter(n.lfoDepth)),this.parameterFilter=this.own(this.bindParameter(n.filter)),this.parameterDry=this.own(this.bindParameter(n.dry)),this.parameterWet=this.own(this.bindParameter(n.wet));let{Fractions:i}=Rt,o=Yt.toPPQN(i[i.length-1]),a=G.pulsesToSamples(o,Yh.min,sampleRate),s=Rt.MAX_MILLIS_TIME*.001*sampleRate,l=Rt.LFO_DEPTH_MAX*.001*sampleRate,u=a+s+l;this.#n=new tb(Math.ceil(u)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing)),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=m.wrap(e),{terminate:()=>this.#o=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio({bpm:e,flags:t},n,i){if(this.#o.isEmpty())return;let o=ct.some(t,8);if(this.#s||o){let u=this.parameterPreSyncTimeLeft.getValue(),d=Rt.Fractions[u],p=G.pulsesToSamples(Yt.toPPQN(d),e,sampleRate),h=this.parameterPreMillisTimeLeft.getValue()*.001*sampleRate;this.#n.preDelayLeftOffset=p+h,this.#s=!1}if(this.#l||o){let u=this.parameterPreSyncTimeRight.getValue(),d=Rt.Fractions[u],p=G.pulsesToSamples(Yt.toPPQN(d),e,sampleRate),h=this.parameterPreMillisTimeRight.getValue()*.001*sampleRate;this.#n.preDelayRightOffset=p+h,this.#l=!1}if(this.#a||o){let u=this.parameterDelay.getValue(),d=Yt.toPPQN(Rt.Fractions[u]),p=G.pulsesToSamples(d,e,sampleRate),h=this.parameterMillisTime.getValue()*.001*sampleRate;this.#n.offset=p+h,this.#a=!1}let s=this.#o.unwrap().channels(),l=this.#r.channels();this.#n.process(s,l,n,i),this.#i.process(l[0],l[1],n,i)}parameterChanged(e){e===this.parameterPreSyncTimeLeft||e===this.parameterPreMillisTimeLeft?this.#s=!0:e===this.parameterPreSyncTimeRight||e===this.parameterPreMillisTimeRight?this.#l=!0:e===this.parameterDelay||e===this.parameterMillisTime?this.#a=!0:e===this.parameterFeedback?this.#n.feedback=this.parameterFeedback.getValue():e===this.parameterCross?this.#n.cross=this.parameterCross.getValue():e===this.parameterLfoSpeed?this.#n.lfoPhaseIncr=this.parameterLfoSpeed.getValue()/sampleRate:e===this.parameterLfoDepth?this.#n.setLfoDepth(this.parameterLfoDepth.getValue()*.001*sampleRate):e===this.parameterFilter?this.#n.filter=this.parameterFilter.getValue():(e===this.parameterDry||e===this.parameterWet)&&(this.#n.dry=Ce(this.parameterDry.getValue()),this.#n.wet=Ce(this.parameterWet.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})}`}};var Rf=class r extends yr{static ID=0;#e=r.ID++;#t;#r;#i;#n=m.None;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Fe(e.broadcaster,t.address)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing))}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=m.wrap(e),{terminate:()=>this.#n=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}process(e){if(this.#n.isEmpty())return;let t=this.#n.unwrap(),[n,i]=t.channels(),[o,a]=this.#r.channels();for(let s=0;s<he;s++)o[s]=n[s],a[s]=i[s];this.#i.process(o,a)}parameterChanged(e){}toString(){return`{${this.constructor.name} (${this.#e})`}};var kd=class r extends yr{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 Fe(e.broadcaster,t.address)),this.#n=[],this.own(e.registerProcessor(this))}get noteEventTarget(){return m.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,n]=this.#r.channels();for(let i of this.#n){let[o,a]=i.channels();for(let s=0;s<he;s++)t[s]+=o[s],n[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 ye;(s=>{s.Comparator=(l,u)=>{let d=l.position-u.position;return d!==0?d:l.type==="note-complete-event"?-1:u.type==="note-complete-event"?1:0},s.start=(l,u,d,p,h=0)=>({type:"note-event",position:l,duration:u,pitch:d,velocity:p,cent:h,id:++a}),s.startWith=(l,u,d)=>({type:"note-event",position:u??l.position,duration:d??l.duration,pitch:l.pitch,cent:l.cent,velocity:l.velocity,id:++a}),s.stop=({id:l,pitch:u},d)=>({type:"note-complete-event",position:d,pitch:u,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})(ye||={});var lo=class{#e=new R;#t;#r;#i;#n=m.None;constructor(e,t,n){this.#t=e,this.#r=this.#e.own(new Ki(t,n)),this.#i=new Array(16)}setNoteEventSource(e){return T(this.#n.isEmpty(),"NoteEventSource already set"),this.#n=m.wrap(e),this.#t.reset(),q.create(()=>{this.#n=m.None,this.#t.reset()})}introduceBlock({index:e,p0:t,p1:n,flags:i}){if(!this.#n.isEmpty()){for(let o of this.#n.unwrap().processNotes(t,n,i))this.#i.push(o);this.#i.sort(ye.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){ye.isStart(e)?this.#r.noteOn(e.pitch):ye.isStop(e)&&this.#r.noteOff(e.pitch)}};var MS;(e=>e.NotSet={start:()=>B("VoicingStrategy.start"),stop:()=>B("VoicingStrategy.stop"),forceStop:()=>fo,process:()=>B("VoicingStrategy.process"),reset:fo,processing:()=>O.empty()})(MS||={});var ib=class{#e;#t=[];constructor(e=MS.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,n,i){this.#e.process(e,t,n,i);for(let o=this.#t.length-1;o>=0;o--)this.#t[o].process(e,t,n,i)&&this.#t.splice(o,1)}reset(){this.#t.forEach(e=>e.reset()),this.#t.length=0,this.#e.reset()}};var nb=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 n=this.#e.computeFrequency(e),i=this.#e.create();isNaN(t)?i.start(e,n,1,0):(i.start(e,t,1,0),i.startGlide(n,this.#e.glideTime)),this.#r.push(i),this.#t.push(i)}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,n,i){e.clear(n,i);for(let o=this.#t.length-1;o>=0;o--){let a=this.#t[o];a.process(e,t,n,i)&&(O.removeIf(this.#r,s=>s===a),this.#t.splice(o,1))}return this.#t.length===0}processing(){return this.#t}};var ob=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}let t=NaN;Z(this.#n)&&(t=this.#n.currentFrequency,this.#n.forceStop());let n=this.#e.create(),i=this.#e.computeFrequency(e);isNaN(t)?n.start(e,i,1,0):(n.start(e,t,1,0),n.startGlide(i,this.#e.glideTime)),this.#i=n,this.#n=n,this.#t.push(n)}stop(e){let t=this.#r.findIndex(n=>n.id===e);if(t!==-1&&(this.#r.splice(t,1),!!Z(this.#i))){if(t===this.#r.length){let n=this.#r.at(-1);if(Z(n)){this.#i.startGlide(this.#e.computeFrequency(n),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,n,i){e.clear(n,i);for(let o=this.#t.length-1;o>=0;o--){let a=this.#t[o];a.process(e,t,n,i)&&(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 Of=class{#e;#t=[];#r=new ql;#i;gate=!0;id=-1;constructor(e,t){this.#e=e,this.#i=t}get currentFrequency(){return this.#r.currentFrequency()}start(e,t,n,i){if(this.id=e.id,this.#r.init(t),this.#i===1){let o=this.#e();o.start(e,t,n,i),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(i))*a+i;s.start(e,t,n/Math.sqrt(this.#i),l),this.#t.push(s)}}startGlide(e,t){this.#r.glideTo(e,t),this.#t.forEach(n=>n.startGlide(e,t))}process(e,t,n,i){this.#r.advance(t.bpm,n,i);for(let o=this.#t.length-1;o>=0;o--)this.#t[o].process(e,t,n,i)&&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[bk,wk,TS,Ak,_k,ab,Pk,Sk,sb]=iE(Float32Array,he),Vf=class{device;oscA;oscB;lfo;filter;env;glide;gainASmooth;gainBSmooth;gainVcaSmooth;#e=os("NoteEvent not set");#t=1;#r=1;id=-1;phase=0;filter_keyboard_delta=0;constructor(e){this.device=e,this.oscA=new qd(sampleRate),this.oscB=new qd(sampleRate),this.lfo=new pm(sampleRate),this.filter=new om(Xn.MIN_CUTOFF,Xn.MAX_CUTOFF,sampleRate),this.filter.order=1,this.env=new Kl(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 ql,this.gainASmooth=new Xr(.003,sampleRate),this.gainBSmooth=new Xr(.003,sampleRate),this.gainVcaSmooth=new Xr(.003,sampleRate)}start(e,t,n,i){this.#e=e,this.#t=n,this.#r=i,this.filter_keyboard_delta=hm.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},n,i){let{gainOscA:o,gainOscB:a,oscA_waveform:s,oscB_waveform:l,flt_cutoff:u,flt_resonance:d,flt_env_amount:p,flt_order:h,frequencyAMultiplier:g,frequencyBMultiplier:v,parameterLfoShape:y,parameterLfoRate:x,parameterLfoTargetTune:$,parameterLfoTargetCutoff:M,parameterLfoTargetVolume:U,parameterUnisonDetune:C,parameterUnisonStereo:V}=this.device,re=Zl(this.#e.velocity)*this.#t,Y=2**(this.#r*(C.getValue()/1200)),de=this.#r*V.getValue(),[Q,Pe]=yo.panningToGains(de,In.Linear),[ce,je]=e.channels();TS.fill(Y,n,i),this.glide.process(TS,t,n,i),this.lfo.fill(Pk,y.getValue(),x.getValue(),n,i),this.env.process(ab,n,i);let _e=$.getValue(),Ge=M.getValue(),Le=U.getValue();for(let ge=n;ge<i;ge++){let Ze=Pk[ge];Sk[ge]=u+this.filter_keyboard_delta+ab[ge]*p+Ze*Ge,ab[ge]*=yi(re+Ze*Le);let zt=TS[ge]*2**(Ze*_e);Ak[ge]=zt*g,_k[ge]=zt*v}this.oscA.generateFromFrequencies(bk,Ak,s,n,i),this.oscB.generateFromFrequencies(wk,_k,l,n,i);for(let ge=n;ge<i;ge++)sb[ge]=bk[ge]*this.gainASmooth.process(o)+wk[ge]*this.gainBSmooth.process(a);this.filter.order=h,this.filter.process(sb,sb,Sk,d,n,i);for(let ge=n;ge<i;ge++){let Ze=this.gainVcaSmooth.process(yi(ab[ge])),zt=sb[ge]*Ze;if(ce[ge]+=zt*Q,je[ge]+=zt*Pe,this.env.complete&&Ze<nm)return!0}return!1}};var lb=class extends Re{#e;#t;#r;#i;#n;#o;#a;#s;#l;#c;#u;#d;#p;#h;#f;#m;#g;#v;#w;#A;#E;#F;#I;#_;#y;#b;#P;#M;#N;#$;#B;#S;#k;gainOscA=1;gainOscB=1;frequencyAMultiplier=1;frequencyBMultiplier=1;env_attack=1;env_decay=1;env_sustain=1;env_release=1;oscA_waveform=Qe.sine;oscB_waveform=Qe.sine;flt_cutoff=1;flt_resonance=Math.SQRT1_2;flt_env_amount=0;flt_order=1;#D=0;#T=!0;constructor(e,t){super(e),this.#e=t,this.#t=new ib,this.#r=new lo(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new xe,this.#n=new gm(sampleRate),this.#o=this.own(new Fe(e.broadcaster,t.address));let{box:n,namedParameter:i}=this.#e,{oscillators:o}=i;this.#a=this.own(this.bindParameter(o[0].waveform)),this.#s=this.own(this.bindParameter(o[0].octave)),this.#l=this.own(this.bindParameter(o[0].tune)),this.#c=this.own(this.bindParameter(o[0].volume)),this.#u=this.own(this.bindParameter(o[1].waveform)),this.#d=this.own(this.bindParameter(o[1].octave)),this.#p=this.own(this.bindParameter(o[1].tune)),this.#h=this.own(this.bindParameter(o[1].volume)),this.#f=this.own(this.bindParameter(i.attack)),this.#m=this.own(this.bindParameter(i.decay)),this.#g=this.own(this.bindParameter(i.sustain)),this.#v=this.own(this.bindParameter(i.release)),this.#w=this.own(this.bindParameter(i.cutoff)),this.#A=this.own(this.bindParameter(i.resonance)),this.#E=this.own(this.bindParameter(i.filterEnvelope)),this.#F=this.own(this.bindParameter(i.filterOrder)),this.#I=this.own(this.bindParameter(i.filterKeyboard)),this.#_=this.own(this.bindParameter(i.glideTime)),this.#y=this.own(this.bindParameter(i.voicingMode)),this.#b=this.own(this.bindParameter(i.unisonCount)),this.#P=this.own(this.bindParameter(i.unisonDetune)),this.#M=this.own(this.bindParameter(i.unisonStereo)),this.#N=this.own(this.bindParameter(i.lfoWaveform)),this.#$=this.own(this.bindParameter(i.lfoRate)),this.#B=this.own(this.bindParameter(i.lfoTargetTune)),this.#S=this.own(this.bindParameter(i.lfoTargetCutoff)),this.#k=this.own(this.bindParameter(i.lfoTargetVolume));let a=new Float32Array(32);this.ownAll(n.enabled.catchupAndSubscribe(s=>{this.#T=s.getValue(),this.#T||this.reset()}),e.broadcaster.broadcastFloats(t.address.append(0),a,s=>{if(!s)return;let l=0;this.#t.strategy.processing().forEach(u=>{let p=Te(u,Of).processing().at(0);p instanceof Vf&&(a[l++]=p.env.phase),a.length-1}),a[l]=-1}),e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#i,this.outgoing)),this.readAllParameters()}computeFrequency(e){return Ld(e.pitch+e.cent/100,440)}get glideTime(){return this.#D}get parameterFilterKeyboard(){return this.#I}get parameterLfoShape(){return this.#N}get parameterLfoRate(){return this.#$}get parameterLfoTargetTune(){return this.#B}get parameterLfoTargetCutoff(){return this.#S}get parameterLfoTargetVolume(){return this.#k}get parameterUnisonDetune(){return this.#P}get parameterUnisonStereo(){return this.#M}create(){return new Of(()=>new Vf(this),this.#b.getValue())}get noteEventTarget(){return m.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){ye.isStart(e)?this.#t.start(e):ye.isStop(e)&&this.#t.stop(e.id)}processAudio(e,t,n){this.#T&&(this.#t.process(this.#i,e,t,n),this.#n.replace(this.#i,t,n))}parameterChanged(e){if(e===this.#c)this.gainOscA=Ce(this.#c.getValue());else if(e===this.#h)this.gainOscB=Ce(this.#h.getValue());else if(e===this.#s||e===this.#l)this.frequencyAMultiplier=2**(this.#s.getValue()+this.#l.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.#g)this.env_sustain=this.#g.getValue();else if(e===this.#v)this.env_release=this.#v.getValue();else if(e===this.#a)this.oscA_waveform=vi(this.#a.getValue(),Qe);else if(e===this.#u)this.oscB_waveform=vi(this.#u.getValue(),Qe);else if(e===this.#w)this.flt_cutoff=this.#w.getUnitValue();else if(e===this.#A)this.flt_resonance=this.#A.getValue();else if(e===this.#E)this.flt_env_amount=this.#E.getValue();else if(e===this.#F)this.flt_order=this.#F.getValue();else if(e===this.#_)this.#D=this.#_.getValue()*G.Bar;else if(e===this.#y){let t=this.#y.getValue();switch(t){case Dn.Monophonic:{this.#t.strategy=new ob(this);return}case Dn.Polyphonic:{this.#t.strategy=new nb(this);return}default:return B(`Unknown VoicingMode '${t}'`)}}}finishProcess(){this.#i.assertSanity(),this.#o.process(this.#i.getChannel(0),this.#i.getChannel(1))}toString(){return"{VaporisateurDevice}"}};var Dl=class{#e;#t;#r;#i;#n;#o;#a=0;#s;#l=0;constructor(e,t,n=0,i=0){this.#e=e,this.#t=t,this.#r=Math.round(.02*sampleRate),this.#o=n,this.#s=i,this.#o>=t.numberOfFrames?(this.#i=2,this.#n=0):n===0?(this.#i=1,this.#n=0):(this.#i=0,this.#n=1)}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)}process(e,t){let[n,i]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],u=this.#r,d=a-u,p=this.#s,h=this.#l,g=this.#i,v=this.#n,y=this.#o,x=this.#a;for(let $=0;$<t&&g!==2;$++){if($<p)continue;let M=e+$,U;if(g===0&&v>0)U=x/u,++x>=u&&(g=1,x=0,v=0);else if(g===0&&v<0){if($<h)U=1;else if(U=1-x/u,++x>=u){g=2;break}}else U=1;y>=0&&y<a&&(n[M]+=s[y]*U,i[M]+=l[y]*U),y++,g===1&&y>=d&&(g=0,v=-1,x=0)}this.#i=g,this.#n=v,this.#o=y,this.#a=x,this.#s=0,this.#l=0}};var is=class{#e;#t;#r;#i;#n;#o;#a=0;#s;#l;#c=0;constructor(e,t,n,i,o=0,a=0){this.#e=e,this.#t=t,this.#r=n,this.#s=i,this.#o=o,this.#l=a,this.#o>=t.numberOfFrames?(this.#i=2,this.#n=0):o===0?(this.#i=1,this.#n=0):(this.#i=0,this.#n=1)}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.#c=e)}setPlaybackRate(e){this.#s=e}process(e,t){let[n,i]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],u=this.#r,d=this.#s,p=a-u*d,h=this.#l,g=this.#c,v=this.#i,y=this.#n,x=this.#o,$=this.#a;for(let M=0;M<t&&v!==2;M++){if(M<h)continue;let U=e+M,C;if(v===0&&y>0)C=$/u,++$>=u&&(v=1,$=0,y=0);else if(v===0&&y<0){if(M<g)C=1;else if(C=1-$/u,++$>=u){v=2;break}}else C=1;let V=x|0;if(V>=0&&V<a-1){let re=x-V,Y=s[V],de=l[V];n[U]+=(Y+re*(s[V+1]-Y))*C,i[U]+=(de+re*(l[V+1]-de))*C}x+=d,v===1&&x>=p&&(v=0,y=-1,$=0)}this.#i=v,this.#n=y,this.#o=x,this.#a=$,this.#l=0,this.#c=0}};var Nd=class{#e;#t;#r;#i;#n;#o;#a=1;#s=0;#l=0;#c=0;#u=0;#d=0;constructor(e,t,n,i,o,a,s){this.#e=e,this.#t=t,this.#r=o,this.#o=i,this.#i=Math.round(.02*s),this.#n=1/this.#i,this.#c=n,this.#u=a,this.#d=0,n>0?(this.#a=0,this.#s=1,this.#l=0):(this.#a=1,this.#s=0,this.#l=0)}done(){return this.#a===2}isFadingOut(){return this.#a===0&&this.#s<0}readPosition(){return this.#c}segmentEnd(){return this.#o}setSegmentEnd(e){this.#o=e}startFadeOut(e){if(this.#a!==2&&!(this.#a===0&&this.#s<0)){if(this.#a===0&&this.#s>0){let t=this.#l*this.#n;this.#l=this.#i*(1-t)}else this.#l=0;this.#a=0,this.#s=-1,this.#d=e}}process(e,t){if(this.#a===2)return;let[n,i]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],u=this.#o,d=this.#i,p=this.#n,h=this.#r,g=this.#d,v=this.#a,y=this.#s,x=this.#l,$=this.#c;for(let M=this.#u;M<t&&v!==2;M++){let U=e+M,C;if(v===0){if(y>0)C=x*p,x+=1,x>=d&&(v=1,x=0,y=0);else if(M<g)C=1;else if(C=1-x*p,x+=1,x>=d){v=2;break}}else C=1;let V=$|0;if(V>=0&&V<a-1){let re=$-V,Y=s[V],de=l[V];n[U]+=(Y+re*(s[V+1]-Y))*C,i[U]+=(de+re*(l[V+1]-de))*C}$+=h}this.#a=v,this.#s=y,this.#l=x,this.#c=$,this.#u=0,this.#d=0}};var ub=class{#e;#t;#r;#i;#n;#o;#a;#s;#l;#c;#u=1;#d=0;#p=0;#h=0;#f=0;#m=0;#g=0;#v=0;constructor(e,t,n,i,o,a,s,l){this.#e=e,this.#t=t,this.#r=o,this.#c=i;let u=.01*s,d=.02*s;this.#i=n+u,this.#n=i-d,this.#o=Math.round(.02*s),this.#a=1/this.#o,this.#s=Math.round(.01*s),this.#l=1/this.#s,this.#h=l??n,this.#g=a,this.#v=0,this.#f=0,this.#m=0,l!==void 0||n>0?(this.#u=0,this.#d=1,this.#p=0):(this.#u=1,this.#d=0,this.#p=0),this.#i>=this.#n&&(this.#u=2)}done(){return this.#u===2}isFadingOut(){return this.#u===0&&this.#d<0}readPosition(){return this.#h}segmentEnd(){return this.#c}setSegmentEnd(e){this.#c=e}startFadeOut(e){if(this.#u!==2&&!(this.#u===0&&this.#d<0)){if(this.#u===0&&this.#d>0){let t=this.#p*this.#a;this.#p=this.#o*(1-t)}else this.#p=0;this.#u=0,this.#d=-1,this.#v=e}}process(e,t){if(this.#u===2)return;let[n,i]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],u=this.#i,p=this.#n-this.#s,h=this.#o,g=this.#a,v=this.#s,y=this.#l,x=this.#r,$=this.#v,M=this.#u,U=this.#d,C=this.#p,V=this.#h,re=this.#f,Y=this.#m;for(let de=this.#g;de<t&&M!==2;de++){let Q=e+de,Pe;if(M===0){if(U>0)Pe=C*g,C+=1,C>=h&&(M=1,C=0,U=0);else if(de<$)Pe=1;else if(Pe=1-C*g,C+=1,C>=h){M=2;break}}else Pe=1;let ce=0,je=0,_e=V|0;if(_e>=0&&_e<a-1){let Ge=V-_e,Le=s[_e],ge=l[_e];ce=Le+Ge*(s[_e+1]-Le),je=ge+Ge*(l[_e+1]-ge)}if(re===0&&V>=p&&(re=1,Y=u),re>0){let Ge=Y|0;if(Ge>=0&&Ge<a-1){let Le=Y-Ge,ge=s[Ge],Ze=l[Ge],zt=ge+Le*(s[Ge+1]-ge),co=Ze+Le*(l[Ge+1]-Ze),qi=re*y;ce=ce*(1-qi)+zt*qi,je=je*(1-qi)+co*qi}Y+=x,re+=1,re>=v&&(V=Y,re=0)}n[Q]+=ce*Pe,i[Q]+=je*Pe,V+=x}this.#u=M,this.#d=U,this.#p=C,this.#h=V,this.#f=re,this.#m=Y,this.#g=0,this.#v=0}};var zf=class{#e;#t;#r;#i;#n;#o;#a;#s;#l;#c=1;#u=0;#d=0;#p=0;#h=1;#f=0;#m=0;#g=0;#v=0;constructor(e,t,n,i,o,a,s,l){this.#e=e,this.#t=t,this.#r=o,this.#l=i;let u=.01*s,d=.02*s;this.#i=n+u,this.#n=i-d,this.#o=Math.round(.02*s),this.#a=1/this.#o,this.#s=Math.round(.01*s),this.#p=l?.position??n,this.#h=l?.direction??1,this.#g=a,this.#v=0,this.#f=0,this.#m=0,l!==void 0||n>0?(this.#c=0,this.#u=1,this.#d=0):(this.#c=1,this.#u=0,this.#d=0),this.#i>=this.#n&&(this.#c=2)}done(){return this.#c===2}isFadingOut(){return this.#c===0&&this.#u<0}readPosition(){return this.#p}segmentEnd(){return this.#l}setSegmentEnd(e){this.#l=e}startFadeOut(e){if(this.#c!==2&&!(this.#c===0&&this.#u<0)){if(this.#c===0&&this.#u>0){let t=this.#d*this.#a;this.#d=this.#o*(1-t)}else this.#d=0;this.#c=0,this.#u=-1,this.#v=e}}process(e,t){if(this.#c===2)return;let[n,i]=this.#e.channels(),{frames:o,numberOfFrames:a}=this.#t,s=o[0],l=o.length===1?o[0]:o[1],u=this.#i,d=this.#n,p=d-this.#s,h=u+this.#s,g=this.#o,v=this.#a,y=this.#s,x=this.#r,$=this.#v,M=this.#c,U=this.#u,C=this.#d,V=this.#p,re=this.#h,Y=this.#f,de=this.#m;for(let Q=this.#g;Q<t&&M!==2;Q++){let Pe=e+Q,ce;if(M===0){if(U>0)ce=C*v,C+=1,C>=g&&(M=1,C=0,U=0);else if(Q<$)ce=1;else if(ce=1-C*v,C+=1,C>=g){M=2;break}}else ce=1;let je=0,_e=0,Ge=V|0;if(Ge>=0&&Ge<a-1){let Le=V-Ge,ge=s[Ge],Ze=l[Ge];je=ge+Le*(s[Ge+1]-ge),_e=Ze+Le*(l[Ge+1]-Ze)}if(Y===0&&(re>0&&V>=p?(Y=1,de=d):re<0&&V<=h&&(Y=1,de=u)),Y>0){let Le=de|0;if(Le>=0&&Le<a-1){let ge=de-Le,Ze=s[Le],zt=l[Le],co=Ze+ge*(s[Le+1]-Ze),qi=zt+ge*(l[Le+1]-zt),Kf=Y/y,Wf=Math.cos(Kf*Math.PI*.5),uo=Math.sin(Kf*Math.PI*.5);je=je*Wf+co*uo,_e=_e*Wf+qi*uo}de-=re*x,Y+=1,Y>=y&&(V=de,re=-re,Y=0)}n[Pe]+=je*ce,i[Pe]+=_e*ce,V+=re*x}this.#c=M,this.#u=U,this.#d=C,this.#p=V,this.#h=re,this.#f=Y,this.#m=de,this.#g=0,this.#v=0}};var db=class{#e=[];#t=-1;#r=0;constructor(){}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,n,i,o,a,s){let{p0:l,p1:u,bpm:d,flags:p}=a,h=i.warpMarkers,g=i.transientPlayMode,v=i.playbackRate,{sampleRate:y,numberOfFrames:x}=t,$=x/y;ct.some(p,2)&&this.reset();let M=u-l,U=a.s0,V=a.s1-U,re=(s.resultStart-l)/M,Y=(s.resultEnd-l)/M,de=U+V*re|0,Pe=(U+V*Y|0)-de,ce=h.first(),je=h.last();if(!wt(ce)||!wt(je))return;let _e=s.resultStart-s.rawStart;if(_e<ce.position||_e>=je.position)return;let Ge=_e+M,Le=this.#o(Ge,h);if(!wt(Le))return;let ge=Le+o;if(ge<0||ge>=$)return;let Ze=this.#o(_e,h)??0,zt=Le-Ze,co=M/(960*d/60),qi=co>0?zt/co:1,Kf=.02*qi*v*(t.sampleRate/y),Wf=ge+Kf,uo=n.floorLastIndex(Wf);if(uo<this.#t&&this.reset(),uo>this.#t&&uo>=0){let Jt=n.optAt(uo);wt(Jt)&&(this.#i(e,t,n,h,g,v,o,d,y,uo,Jt.position),this.#t=uo)}for(let Jt of this.#e){if(!(Jt instanceof Nd)||Jt.done()||Jt.isFadingOut())continue;let uw=Jt.readPosition(),ZS=Jt.segmentEnd();if(uw>=ZS){Jt.startFadeOut(0);continue}if(g!==aa.Once){let Zf=this.#n(n,this.#t,t);if(wt(Zf)){let{startSamples:GS,endSamples:HS,hasNext:Nk,nextTransientFileSeconds:$k}=Zf,JS=HS-GS,QS=Number.POSITIVE_INFINITY;if(Nk){let Md=n.optAt(this.#t);if(wt(Md)){let Dk=Md.position-o,Mk=this.#a(Dk,h),Tk=$k-o,Ck=this.#a(Tk,h)-Mk;QS=G.pulsesToSeconds(Ck,d)*y}}let XS=QS*v,YS=JS/XS;if(!(YS>=.99&&YS<=1.01)&&XS>JS){Jt.startFadeOut(0);let Md=this.#s(e,t,GS,HS,v,0,y,g,!0,uw);wt(Md)&&this.#e.push(Md);continue}}}let qS=(ZS-uw)/v;if(qS<Pe){let Zf=Math.max(0,Math.floor(qS));Jt.startFadeOut(Zf)}}for(let Jt of this.#e)Jt.process(de,Pe);for(let Jt=this.#e.length-1;Jt>=0;Jt--)this.#e[Jt].done()&&this.#e.splice(Jt,1)}#i(e,t,n,i,o,a,s,l,u,d,p){let h=this.#n(n,d,t);if(!wt(h))return;let{startSamples:g,endSamples:v,hasNext:y,nextTransientFileSeconds:x}=h,$=v-g,M=Number.POSITIVE_INFINITY;if(y){let _e=p-s,Ge=this.#a(_e,i),Le=x-s,Ze=this.#a(Le,i)-Ge;M=G.pulsesToSeconds(Ze,l)*u}let U=.02*u,C=.02*t.sampleRate*a,V=null;for(let _e of this.#e){if(_e.done()||!(_e instanceof Nd))continue;let Le=_e.readPosition()+C-g;if(!(Math.abs(Le)>=U)){this.#r+=Le,Math.abs(this.#r)<U?(V=_e,_e.setSegmentEnd(v)):this.#r=0;break}}if(wt(V)){for(let _e of this.#e)_e!==V&&!_e.done()&&_e.startFadeOut(0);return}for(let _e of this.#e)_e.done()||_e.startFadeOut(0);let re=M*a,Y=$/re,Q=!(Y>=.99&&Y<=1.01)&&re>$,Pe=.02*t.sampleRate*a,ce=d===0?g:Math.max(0,g-Pe),je=this.#s(e,t,ce,v,a,0,u,o,Q);wt(je)&&this.#e.push(je),this.#r=0}#n(e,t,n){let i=e.optAt(t);if(!wt(i))return null;let o=e.optAt(t+1);return{startSamples:i.position*n.sampleRate,endSamples:wt(o)?o.position*n.sampleRate:n.numberOfFrames,hasNext:wt(o),nextTransientFileSeconds:wt(o)?o.position:Number.POSITIVE_INFINITY}}#o(e,t){for(let n=0;n<t.length()-1;n++){let i=t.optAt(n),o=t.optAt(n+1);if(!(!wt(i)||!wt(o))&&e>=i.position&&e<o.position){let a=(e-i.position)/(o.position-i.position);return i.seconds+a*(o.seconds-i.seconds)}}return null}#a(e,t){for(let i=0;i<t.length()-1;i++){let o=t.optAt(i),a=t.optAt(i+1);if(!(!wt(o)||!wt(a))&&e>=o.seconds&&e<a.seconds){let s=(e-o.seconds)/(a.seconds-o.seconds);return o.position+s*(a.position-o.position)}}let n=t.last();return wt(n)&&e>=n.seconds?n.position:0}#s(e,t,n,i,o,a,s,l,u,d){return n>=i?null:l===aa.Once||!u?new Nd(e,t,n,i,o,a,s):l===aa.Repeat?new ub(e,t,n,i,o,a,s,d):Z(d)?new zf(e,t,n,i,o,a,s,{position:d,direction:1}):new zf(e,t,n,i,o,a,s)}};var pb=class extends yr{#e;#t;#r;#i;#n=!0;constructor(e,t){super(e),this.#e=t,this.#t=new xe(2),this.#r=this.own(new Fe(e.broadcaster,t.address)),this.#i=w.newSet(({adapter:{uuid:n}})=>n),this.ownAll(this.#e.box.enabled.catchupAndSubscribe(n=>{this.#n=n.getValue(),this.#n||this.reset()}),this.#e.deviceHost().audioUnitBoxAdapter().tracks.catchupAndSubscribe({onAdd:n=>this.#i.add({adapter:n,voices:[],sequencer:new db}),onRemove:n=>this.#i.removeByKey(n.uuid),onReorder:n=>{}}),e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#t,this.outgoing))}get noteEventTarget(){return m.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}){if(!this.#n)return;this.#t.clear(0,he),this.#i.forEach(i=>e.forEach(o=>this.#o(i,o))),this.#t.assertSanity();let[t,n]=this.#t.channels();this.#r.process(t,n)}parameterChanged(e){}#o(e,t){let{adapter:n}=e;if(n.type!==oe.Audio||!n.enabled.getValue()){e.voices.forEach(l=>l.startFadeOut(0)),e.sequencer.reset();return}let{p0:i,p1:o,flags:a}=t;if(!ct.every(a,5))return;let s=this.context.clipSequencing.iterate(n.uuid,i,o);for(let{optClip:l,sectionFrom:u,sectionTo:d}of s)l.match({none:()=>{for(let p of n.regions.collection.iterateRange(i,o)){if(p.mute||!Ke(p,xa))continue;let h=p.file,g=h.getOrCreateLoader().data;if(g.isEmpty())return;let v=p.waveformOffset.getValue(),y=p.asPlayModeTimeStretch;if(y.nonEmpty()){let x=h.transients;if(x.length()<2)return;for(let $ of lr.locateLoops(p,i,o)){let M=y.unwrap();this.#c(e,t,$,g.unwrap(),M,x,v)}}else for(let x of lr.locateLoops(p,i,o))this.#a(e,t,x,p,g.unwrap())}},some:p=>{if(!Ke(p,ma))return;let h=p.file,g=h.getOrCreateLoader().data;if(g.isEmpty())return;let v=p.asPlayModeTimeStretch;if(v.nonEmpty()){let y=v.unwrap(),x=h.transients;if(x.length()<2)return;for(let $ of lr.locateLoops({position:0,loopDuration:p.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},u,d))this.#c(e,t,$,g.unwrap(),y,x,p.waveformOffset.getValue())}else for(let y of lr.locateLoops({position:0,loopDuration:p.duration,loopOffset:0,complete:Number.POSITIVE_INFINITY},u,d))this.#a(e,t,y,p,g.unwrap())}})}#a(e,t,n,i,o){let{p0:a,p1:s,s0:l,s1:u,flags:d}=t,p=u-l,h=s-a,g=(n.resultStart-a)/h,v=(n.resultEnd-a)/h,y=l+p*g,x=l+p*v,$=x-y|0,M=i.waveformOffset.getValue();T(l<=y&&x<=u,()=>`Out of bounds ${y}, ${x}`),ct.some(d,2)&&(e.voices.forEach(C=>C.startFadeOut(0)),e.sequencer.reset());let U=i.asPlayModePitchStretch;if(i.isPlayModeNoStretch){let C=n.resultStartValue*o.numberOfFrames+M*o.sampleRate|0;this.#s(e,o,C,0)}else if(U.isEmpty()){let C=o.numberOfFrames,re=(n.resultEndValue-n.resultStartValue)*C,Y=(n.resultEnd-n.resultStart)/h*p,de=re/Y,Q=n.resultStartValue*o.numberOfFrames+M*o.sampleRate;this.#l(e,o,de,Q,0)}else{let V=U.unwrap().warpMarkers,re=V.first(),Y=V.last();if(re===null||Y===null){e.voices.forEach(je=>je.startFadeOut(0));return}let de=n.resultStart-n.rawStart;if(de<re.position||de>=Y.position){e.voices.forEach(je=>je.startFadeOut(0));return}let Q=this.#d(de,n.resultStartValue,V),Pe=this.#u(de,V,o.sampleRate,h,p),ce=(Q+M)*o.sampleRate;this.#l(e,o,Pe,ce,0)}for(let C of e.voices)C.process(y|0,$);e.voices=e.voices.filter(C=>!C.done())}#s(e,t,n,i){let o=Math.round(.02*t.sampleRate),a=!1;for(let s of e.voices)s instanceof Dl&&!s.isFadingOut()?Math.abs(s.readPosition-n)>o?s.startFadeOut(i):a=!0:s.startFadeOut(i);a||e.voices.push(new Dl(this.#t,t,n,i))}#l(e,t,n,i,o){let a=Math.round(.02*t.sampleRate);if(e.voices.length===0)e.voices.push(new is(this.#t,t,a,n,i,o));else{let s=!1;for(let l of e.voices)if(l instanceof is){if(l.isFadingOut())continue;Math.abs(l.readPosition-i)>a?l.startFadeOut(o):(l.setPlaybackRate(n),s=!0)}else l.startFadeOut(o);s||e.voices.push(new is(this.#t,t,a,n,i,o))}}#c(e,t,n,i,o,a,s){for(let l of e.voices)(l instanceof is||l instanceof Dl)&&l.startFadeOut(0);e.sequencer.process(this.#t,i,a,o,s,t,n),e.voices=e.voices.filter(l=>(l instanceof is||l instanceof Dl)&&!l.done())}#u(e,t,n,i,o){let a=t.floorLastIndex(e),s=t.optAt(a),l=t.optAt(a+1);if(s===null||l===null)return 1;let u=l.position-s.position,h=(l.seconds-s.seconds)*n/u,g=o/i;return h/g}#d(e,t,n){let i=n.floorLastIndex(e),o=n.optAt(i),a=n.optAt(i+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 Hr=class extends yr{process({blocks:e}){e.forEach(t=>{this.introduceBlock(t);let{index:n,p0:i,p1:o,s0:a,bpm:s}=t,l=null,u=i;for(let d of this.eventInput.get(n))l?.forEach(p=>this.handleEvent(t,p)),l=null,u<d.position&&(this.processEvents(t,u,d.position),u=d.position),Cf.isOfType(d)?this.updateParameters(d.position,a/sampleRate+G.pulsesToSeconds(d.position-i,s)):(l??=[]).push(d);l?.forEach(d=>this.handleEvent(t,d)),l=null,u<o&&this.processEvents(t,u,o)}),this.eventInput.clear()}introduceBlock(e){}};var $d;(t=>(t.create=()=>({mult:1,add:0}),t.apply=(n,i)=>i*n.mult+n.add))($d||={});var hb=Object.freeze([{name:"up",run:(r,e,t,n,i,o)=>{let a=r.length,s=a*e,l=t%a,u=Math.floor(t%s/a),d=r[l];return ye.start(n,i,d.pitch+u*12,$d.apply(o,d.velocity))}},{name:"down",run:(r,e,t,n,i,o)=>{let a=r.length,s=a*e,l=a-1-t%a,u=e-1-Math.floor(t%s/a),d=r[l];return ye.start(n,i,d.pitch+u*12,$d.apply(o,d.velocity))}},{name:"up-down",run:(r,e,t,n,i,o)=>{let a=r.length,s=a*e,l=Math.max(1,s*2-2),u=t%l,d=u<s?u:l-u,p=d%a,h=Math.floor(d/a),g=r[p];return ye.start(n,i,g.pitch+h*12,$d.apply(o,g.velocity))}}]);var fb=class extends Hr{#e;#t;#r;#i;#n;#o;#a;#s;#l;#c=$d.create();#u=m.None;#d=hb[0];#p=NaN;#h=1;#f=1;#m=1;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new cs,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.#s=this.own(this.bindParameter(t.namedParameter.numOctaves)),this.#l=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 m.wrap(this)}setNoteEventSource(e){return T(this.#u.isEmpty(),"NoteEventSource already set"),this.#u=m.wrap(e),q.create(()=>this.#u=m.None)}*processNotes(e,t,n){if(this.#r.nonEmpty())if(ct.every(n,2))for(let o of this.#r.releaseAll())yield ye.stop(o,e);else for(let o of this.#r.releaseLinearCompleted(t))yield ye.stop(o,o.position+o.duration);if(this.#u.nonEmpty()){let i=this.#u.unwrap();for(let a of i.processNotes(e,t,n));let o=!ct.every(n,1);for(let{position:a,index:s}of Go.iterateWithIndex(e,t,this.#p)){let l=Array.from(i.iterateActiveNotesAt(a,o));if(l.length===0)continue;let u=Math.floor(s/this.#f),d=Math.max(1,Math.floor(this.#p*this.#h)),p=this.#d.run(l,this.#m,u,a,d,this.#c);this.#r.addAndRetain({...p}),yield p}for(let a of this.#r.releaseLinearCompleted(t))yield ye.stop(a,a.position+a.duration)}}*iterateActiveNotesAt(e,t){this.#u.isEmpty()||t||(yield*this.#r.overlapping(e,cr.Comparator))}reset(){this.#t.length=0,this.#r.clear(),this.eventInput.clear()}processEvents(e,t,n){}parameterChanged(e){if(e===this.#i)this.#d=hb.at(this.#i.getValue())??hb[0];else if(e===this.#n)this.#p=Yt.toPPQN(pn.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.#s)this.#m=this.#s.getValue();else if(e===this.#l){let t=this.#l.getValue();t<=0?(this.#c.add=1+t,this.#c.mult=0):(this.#c.add=1-t,this.#c.mult=t)}}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var mb=class extends Hr{#e;#t;#r;#i;#n;#o=m.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Ki(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 T(this.#o.isEmpty(),"NoteEventSource already set"),this.#o=m.wrap(e),q.create(()=>this.#o=m.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,n){if(!this.#o.isEmpty())for(let i of this.#o.unwrap().processNotes(e,t,n))if(ye.isStart(i)){this.#t.noteOn(i.pitch);let{cent:o,octaves:a,semiTones:s}=this.#e.namedParameter;yield Jr.overwrite(i,{pitch:i.pitch+a.valueAt(i.position)*12+s.valueAt(i.position),cent:i.cent+o.valueAt(i.position)})}else this.#t.noteOff(i.pitch),yield i}*iterateActiveNotesAt(e,t){if(!this.#o.isEmpty()){for(let n of this.#o.unwrap().iterateActiveNotesAt(e,t))if(n.type==="note-event"){let{cent:i,octaves:o,semiTones:a}=this.#e.namedParameter;yield Jr.overwrite(n,{pitch:n.pitch+o.valueAt(n.position)*12+a.valueAt(n.position),cent:n.cent+i.valueAt(n.position)})}}}reset(){this.eventInput.clear()}processEvents(e,t,n){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var gb=class r extends Re{static ID=0;#e=r.ID++;#t;#r;#i;#n;#o;#a;#s;#l;#c;#u;#d;#p;#h;#f;#m;#g;#v;#w;#A;#E;#F;#I;#_;#y;#b;#P;#M;#N;#$;#B;#S;#k;#D;#T;#V;#R;#C=m.None;#O=!1;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Fe(e.broadcaster,t.address)),this.#n=new Tl,this.#o=new Float32Array(this.#n.numBins()),this.#a=O.create(()=>new Bn,7),this.#s=[new Zo(4),new Zo(4)],this.#l=[new Zo(4),new Zo(4)],this.#c=[this.#l,[new $t,new $t],[new $t,new $t],[new $t,new $t],[new $t,new $t],[new $t,new $t],this.#s],this.#u=O.create(()=>!0,7);let n=this.#t.namedParameter;this.#d=this.own(this.bindParameter(n.highPass.enabled)),this.#h=this.own(this.bindParameter(n.highPass.q)),this.#p=this.own(this.bindParameter(n.highPass.frequency)),this.#f=this.own(this.bindParameter(n.highPass.order)),this.#m=this.own(this.bindParameter(n.lowShelf.enabled)),this.#g=this.own(this.bindParameter(n.lowShelf.frequency)),this.#v=this.own(this.bindParameter(n.lowShelf.gain)),this.#w=this.own(this.bindParameter(n.lowBell.enabled)),this.#A=this.own(this.bindParameter(n.lowBell.frequency)),this.#E=this.own(this.bindParameter(n.lowBell.gain)),this.#F=this.own(this.bindParameter(n.lowBell.q)),this.#I=this.own(this.bindParameter(n.midBell.enabled)),this.#_=this.own(this.bindParameter(n.midBell.frequency)),this.#y=this.own(this.bindParameter(n.midBell.gain)),this.#b=this.own(this.bindParameter(n.midBell.q)),this.#P=this.own(this.bindParameter(n.highBell.enabled)),this.#M=this.own(this.bindParameter(n.highBell.frequency)),this.#N=this.own(this.bindParameter(n.highBell.gain)),this.#$=this.own(this.bindParameter(n.highBell.q)),this.#B=this.own(this.bindParameter(n.highShelf.enabled)),this.#S=this.own(this.bindParameter(n.highShelf.frequency)),this.#k=this.own(this.bindParameter(n.highShelf.gain)),this.#D=this.own(this.bindParameter(n.lowPass.enabled)),this.#T=this.own(this.bindParameter(n.lowPass.frequency)),this.#V=this.own(this.bindParameter(n.lowPass.q)),this.#R=this.own(this.bindParameter(n.lowPass.order)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing),e.broadcaster.broadcastFloats(t.spectrum,this.#o,i=>{this.#O=i,i&&(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.#c.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.#C=m.wrap(e),{terminate:()=>this.#C=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,n){if(this.#C.isEmpty())return;let[i,o]=this.#r.channels(),a=this.#C.unwrap();if(this.#u.some(s=>s)){let[s,l]=a.channels();this.#a.forEach((u,d)=>{if(this.#u[d]){let[p,h]=this.#c[d];p.process(u,s,i,t,n),h.process(u,l,o,t,n),s=i,l=o}})}else{let[s,l]=a.channels();for(let u=t;u<n;u++)i[u]=s[u],o[u]=l[u]}this.#i.process(i,o,t,n),this.#O&&this.#n.process(i,o,t,n)}parameterChanged(e){if(e===this.#R){let n=this.#R.getValue()+1;this.#s[0].order=n,this.#s[1].order=n}else if(e===this.#f){let n=this.#f.getValue()+1;this.#l[0].order=n,this.#l[1].order=n}else if(e===this.#p||e===this.#h){let t=this.#p.getValue(),n=this.#h.getValue();this.#a[0].setHighpassParams(t/sampleRate,n)}else if(e===this.#g||e===this.#v){let t=this.#g.getValue(),n=this.#v.getValue();this.#a[1].setLowShelfParams(t/sampleRate,n)}else if(e===this.#A||e===this.#E||e===this.#F){let t=this.#A.getValue(),n=this.#E.getValue(),i=this.#F.getValue();this.#a[2].setPeakingParams(t/sampleRate,i,n)}else if(e===this.#_||e===this.#y||e===this.#b){let t=this.#_.getValue(),n=this.#y.getValue(),i=this.#b.getValue();this.#a[3].setPeakingParams(t/sampleRate,i,n)}else if(e===this.#M||e===this.#N||e===this.#$){let t=this.#M.getValue(),n=this.#N.getValue(),i=this.#$.getValue();this.#a[4].setPeakingParams(t/sampleRate,i,n)}else if(e===this.#S||e===this.#k){let t=this.#S.getValue(),n=this.#k.getValue();this.#a[5].setHighShelfParams(t/sampleRate,n)}else if(e===this.#T||e===this.#V){let t=this.#T.getValue(),n=this.#V.getValue();this.#a[6].setLowpassParams(t/sampleRate,n)}else e===this.#d?this.#u[0]=this.#d.getValue():e===this.#m?this.#u[1]=this.#m.getValue():e===this.#w?this.#u[2]=this.#w.getValue():e===this.#I?this.#u[3]=this.#I.getValue():e===this.#P?this.#u[4]=this.#P.getValue():e===this.#B?this.#u[5]=this.#B.getValue():e===this.#D&&(this.#u[6]=this.#D.getValue())}toString(){return`{${this.constructor.name} (${this.#e})`}};var vb=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);#s=new Float32Array(2048);#l=new Float32Array(1024);#c=new Float32Array(512);#u=new Float32Array(512);#d=new Float32Array(256);#p=new Float32Array(2048);#h=new Float32Array(2048);#f=new Float32Array(2048);#m=new Float32Array(2048);#g=new Float32Array(2048);#v=new Float32Array(2048);#w=new Float32Array(2048);#A=new Float32Array(2048);#E=new Float32Array(1024);#F=new Float32Array(512);#I=new Float32Array(512);#_=new Float32Array(256);#y;#b;#P=0;#M=0;#N=0;#$=0;#B=0;#S=0;#k=0;#D=0;#T=0;#V=0;#R=0;#C=0;#O=0;#U=0;#j=0;#L=0;#K=0;#W=0;#Z=0;#z=0;#G=0;#H=0;#J=0;#Q=0;#X=0;#Y=0;#ee=0;#te=0;#re=0;#ie=0;#ne=0;#oe=0;#ae=0;#se=0;#le=0;#ce=0;#ue=0;#de=0;#pe=0;#he=0;#x=0;#q=0;constructor(e=.5){this.#y=En(Math.ceil(e*sampleRate)),this.#b=new Float32Array(this.#y<<1),this.damp=0,this.roomSize=.5,this.wetGain=.3333,this.dryGain=1-this.wetGain,this.#x=0,this.#q=0,this.predelayInSamples=.008*sampleRate,this.clearHistory()}clear(){this.#x=0,this.#q=0,this.clearHistory(),this.clearBuffers()}process(e,t,n,i){let[o,a]=t.channels(),[s,l]=e.channels(),u=.4*this.damp,d=1-u,p=.7+.28*this.roomSize;for(let h=n;h<i;++h){let g=o[h],v=a[h],y=this.#q-this.predelayInSamples;y<0&&(y+=this.#y);let x;x=y<<1;let $=.01,M=this.#b[x]*$,U=this.#b[x+1]*$;x=this.#q<<1,this.#b[x]=g,this.#b[x+1]=v,this.#q=this.#q+1&this.#y-1;let C=this.#x&2047;this.#P=d*this.#M+u*this.#P,this.#e[C]=M+p*this.#P,this.#M=this.#e[this.#x-1617&2047],this.#N=d*this.#$+u*this.#N,this.#t[C]=M+p*this.#N,this.#$=this.#t[this.#x-1557&2047],this.#B=d*this.#S+u*this.#B,this.#r[C]=M+p*this.#B,this.#S=this.#r[this.#x-1491&2047],this.#k=d*this.#D+u*this.#k,this.#i[C]=M+p*this.#k,this.#D=this.#i[this.#x-1422&2047],this.#T=d*this.#V+u*this.#T,this.#n[C]=M+p*this.#T,this.#V=this.#n[this.#x-1356&2047],this.#R=d*this.#C+u*this.#R,this.#o[C]=M+p*this.#R,this.#C=this.#o[this.#x-1277&2047],this.#O=d*this.#U+u*this.#O,this.#a[C]=M+p*this.#O,this.#U=this.#a[this.#x-1188&2047],this.#j=d*this.#L+u*this.#j,this.#s[C]=M+p*this.#j,this.#L=this.#s[this.#x-1116&2047];let V=this.#L+this.#U+this.#C+this.#V+this.#D+this.#S+this.#$+this.#M,re=this.#K-V,Y=this.#W-re,de=this.#Z-Y;this.#l[this.#x&1023]=V+.5*this.#K,this.#K=this.#l[this.#x-556&1023],this.#c[this.#x&511]=re+.5*this.#W,this.#W=this.#c[this.#x-441&511],this.#u[this.#x&511]=Y+.5*this.#Z,this.#Z=this.#u[this.#x-341&511],this.#d[this.#x&255]=de+.5*this.#z,this.#z=this.#d[this.#x-225&255],s[h]=this.dryGain*g+this.wetGain*(this.#z-de),this.#G=d*this.#H+u*this.#G,this.#p[C]=U+p*this.#G,this.#H=this.#p[this.#x-1640&2047],this.#J=d*this.#Q+u*this.#J,this.#h[C]=U+p*this.#J,this.#Q=this.#h[this.#x-1580&2047],this.#X=d*this.#Y+u*this.#X,this.#f[C]=U+p*this.#X,this.#Y=this.#f[this.#x-1514&2047],this.#ee=d*this.#te+u*this.#ee,this.#m[C]=U+p*this.#ee,this.#te=this.#m[this.#x-1445&2047],this.#re=d*this.#ie+u*this.#re,this.#g[C]=U+p*this.#re,this.#ie=this.#g[this.#x-1379&2047],this.#ne=d*this.#oe+u*this.#ne,this.#v[C]=U+p*this.#ne,this.#oe=this.#v[this.#x-1300&2047],this.#ae=d*this.#se+u*this.#ae,this.#w[C]=U+p*this.#ae,this.#se=this.#w[this.#x-1211&2047],this.#le=d*this.#ce+u*this.#le,this.#A[C]=U+p*this.#le,this.#ce=this.#A[this.#x-1139&2047];let Q=this.#ce+this.#se+this.#oe+this.#ie+this.#te+this.#Y+this.#Q+this.#H,Pe=this.#ue-Q,ce=this.#de-Pe,je=this.#pe-ce;this.#E[this.#x&1023]=Q+.5*this.#ue,this.#ue=this.#E[this.#x-579&1023],this.#F[this.#x&511]=Pe+.5*this.#de,this.#de=this.#F[this.#x-464&511],this.#I[this.#x&511]=ce+.5*this.#pe,this.#pe=this.#I[this.#x-364&511],this.#_[this.#x&255]=je+.5*this.#he,this.#he=this.#_[this.#x-248&255],l[h]=this.dryGain*v+this.wetGain*(this.#he-je),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.#s.fill(0),this.#l.fill(0),this.#c.fill(0),this.#u.fill(0),this.#d.fill(0),this.#p.fill(0),this.#h.fill(0),this.#f.fill(0),this.#m.fill(0),this.#g.fill(0),this.#v.fill(0),this.#w.fill(0),this.#A.fill(0),this.#E.fill(0),this.#F.fill(0),this.#I.fill(0),this.#_.fill(0),this.#b.fill(0)}clearHistory(){this.#P=0,this.#M=0,this.#N=0,this.#$=0,this.#B=0,this.#S=0,this.#k=0,this.#D=0,this.#T=0,this.#V=0,this.#R=0,this.#C=0,this.#O=0,this.#U=0,this.#j=0,this.#L=0,this.#K=0,this.#W=0,this.#Z=0,this.#z=0,this.#G=0,this.#H=0,this.#J=0,this.#Q=0,this.#X=0,this.#Y=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.#ce=0,this.#ue=0,this.#de=0,this.#pe=0,this.#he=0}};var yb=class r extends Re{static ID=0;#e=r.ID++;#t;#r;#i;#n;#o;#a;#s;#l;#c;#u=m.None;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Fe(e.broadcaster,t.address)),this.#n=new vb;let{decay:n,preDelay:i,damp:o,wet:a,dry:s}=this.#t.namedParameter;this.#o=this.own(this.bindParameter(n)),this.#a=this.own(this.bindParameter(i)),this.#s=this.own(this.bindParameter(o)),this.#l=this.own(this.bindParameter(a)),this.#c=this.own(this.bindParameter(s)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing)),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.#u=m.wrap(e),{terminate:()=>this.#u=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,n){if(this.#u.isEmpty())return;this.#n.process(this.#r,this.#u.unwrap(),t,n);let[i,o]=this.#r.channels();this.#i.process(i,o,t,n)}parameterChanged(e){this.#o===e?this.#n.roomSize=this.#o.getValue():this.#a===e?this.#n.predelayInSamples=Math.ceil(this.#a.getValue()*sampleRate):this.#s===e?this.#n.damp=this.#s.getValue():this.#l===e?this.#n.wetGain=Ce(this.#l.getValue()):this.#c===e&&(this.#n.dryGain=Ce(this.#c.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})`}};var xb=class extends Re{#e;#t;#r;#i;#n;#o;#a;#s=!0;gain=1;release=1;loader=m.None;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new xe,this.#i=new lo(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#n=this.own(new Fe(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(t.box.enabled.catchupAndSubscribe(n=>{this.#s=n.getValue(),this.#s||this.reset()}),e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing),t.box.file.catchupAndSubscribe(n=>this.loader=n.targetVertex.map(({box:i})=>e.sampleManager.getOrCreate(i.address.uuid)))),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}get noteEventTarget(){return m.wrap(this)}introduceBlock(e){this.#i.introduceBlock(e)}setNoteEventSource(e){return this.#i.setNoteEventSource(e)}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){ye.isStart(e)?this.#t.push(new VS(this,e)):ye.isStop(e)&&this.#t.find(t=>t.event().id===e.id)?.stop()}processAudio(e,t,n){if(this.#s){this.#r.clear(t,n);for(let i=this.#t.length-1;i>=0;i--)this.#t[i].processAdd(this.#r,t,n)&&this.#t.splice(i,1)}}parameterChanged(e){e===this.#o?this.gain=Ce(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))}terminate(){super.terminate(),this.loader=m.None}toString(){return"{NanoDevice}"}},VS=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,n){let i=this.#e.loader;if(i.isEmpty())return!0;let o=i.unwrap();return o.data.isEmpty()?!0:this.processSimple(e.channels(),o.data.unwrap(),t,n)}processSimple(e,t,n,i){let[o,a]=e,s=t.frames[0],l=t.frames[1]??s,u=t.numberOfFrames,d=t.sampleRate/sampleRate,p=this.#e.gain*this.#t.velocity,h=this.#e.release,g=1/h;for(let v=n;v<i;v++){let y=this.#i|0;if(y>=u-1)return!0;let x=this.#i-y,$=this.#o<this.#n?this.#o/this.#n:1,M=(Math.min(1-(this.#o-this.#a)*g,1)*$)**2,U=s[y]*(1-x)+s[y+1]*x,C=l[y]*(1-x)+l[y+1]*x;if(o[v]+=U*p*M,a[v]+=C*p*M,this.#i+=this.#r*d,++this.#o-this.#a>h)return!0}return!1}};var bb=class extends Hr{#e;#t;#r=!0;constructor(e,t){super(e),this.#e=t,this.#t=new lo(this,e.broadcaster,t.adapter.audioUnitBoxAdapter().address),this.own(e.registerProcessor(this)),this.readAllParameters()}setEnabled(e){this.#r=e,e||this.reset()}introduceBlock(e){this.#t.introduceBlock(e)}setNoteEventSource(e){return this.#t.setNoteEventSource(e)}reset(){this.eventInput.clear(),this.#t.clear()}processEvents(e,t,n){}handleEvent({index:e},t){this.#r&&(ye.isStart(t)?this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:n})=>n.add(e,t)):ye.isStop(t)&&this.#e.optSampleProcessor(t.pitch).ifSome(({eventInput:n})=>n.add(e,t)))}toString(){return"{PlayfieldSequencer}"}};var wb=class extends Re{#e;#t;#r;#i;#n;constructor(e,t){super(e),this.#e=t,this.#t=new xe,this.#r=this.own(new Fe(e.broadcaster,t.adapter.address)),this.#i=[],this.#n=new Id,this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.adapter.address,this.#t,this.outgoing)),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,n){}reset(){this.#r.clear()}finishProcess(){this.#t.clear();let[e,t]=this.#t.channels();for(let n of this.#i){let[i,o]=n.channels();for(let a=0;a<he;a++)e[a]+=i[a],t[a]+=o[a]}this.#t.assertSanity(),this.#r.process(this.#t.getChannel(0),this.#t.getChannel(1))}toString(){return"{PlayfieldMixProcessor}"}};var Ab=class r{static create(e,t,n,i){return new r(e,t,n,i)}#e=new R;#t;#r;#i=[];#n=!0;constructor(e,t,n,i){this.#t=w.newSet(({device:o})=>o.uuid),this.#r=this.#e.own(new R),this.#e.ownAll(t.catchupAndSubscribe({onAdd:o=>{this.invalidateWiring();let a=jf.create(e,o.box),s=this.#t.add({device:a,subscription:a.adapter().enabledField.subscribe(()=>this.invalidateWiring())});T(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=n;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(i.setAudioSource(a.audioOutput)),this.#r.own(e.registerEdge(a.outgoing,i.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 Lf=Math.floor(.005*sampleRate),_b=class{#e;#t;#r;#i;#n;#o;#a=0;#s=Number.POSITIVE_INFINITY;#l;#c;#u;#d;#p;#h;#f=!0;#m=!1;constructor(e,t,n,i){this.#e=e,this.#t=t,this.#i=n,this.#r=i,this.#n=e.gate,this.#o=Zl(this.#r.velocity);let{attack:o,release:a,sampleStart:s,sampleEnd:l}=this.#t;this.#l=o.getValue()*sampleRate,this.#c=a.getValue()*sampleRate,this.#u=(n.numberOfFrames-1)*s.getValue(),this.#d=(n.numberOfFrames-1)*l.getValue(),this.#p=this.#u,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.#c=Lf,this.#g(),this.#f=!1):this.#n!==io.Off&&this.#g())}processAdd(e,t,n){let[i,o]=e,{frames:a,numberOfFrames:s}=this.#i,l=a[0],u=a[1]??l,{pitch:d}=this.#t,p=this.#d-this.#u,h=Math.sign(p),g=this.#i.sampleRate/sampleRate*h*2**(d.getValue()/1200),v=0;for(let y=t;y<n;y++){let x=this.#p|0,$=this.#p-x,M=l[x]*(1-$)+(l[x+1]??0)*$,U=u[x]*(1-$)+(u[x+1]??0)*$;if(v=Math.min(this.#a/this.#l,1-(this.#a-(this.#s+this.#l))/this.#c,1),this.#p+=g,h>0){if(this.#n===io.Off){if(this.#p>=s)return!0;!this.#m&&this.#p>=this.#d&&this.#g()}else if(this.#n===io.On){if(this.#p>=this.#d-Lf){if(this.#p>=this.#d)return!0;v*=(this.#d-this.#p)/Lf}}else if(this.#n===io.Loop)for(;this.#p>=this.#d;)this.#p-=p}else if(h<0){if(this.#n===io.Off){if(this.#p<=0)return!0;!this.#m&&this.#p<=this.#d&&this.#g()}else if(this.#n===io.On){if(this.#p<=this.#d+Lf){if(this.#p<=this.#d)return!0;v*=(this.#d-this.#p)/Lf}}else if(this.#n===io.Loop)for(;this.#p<=this.#d;)this.#p-=p}if(++this.#a-this.#s>this.#l+this.#c)return!0;v*=this.#o*v,i[y]+=M*v,o[y]+=U*v}return this.#h=v,!1}toString(){return"{PlayfieldSampleVoice}"}#g(){this.#m||(this.#m=!0,this.#s=this.#a<this.#l?this.#a-this.#l:this.#a)}};var Pb=class extends Re{#e;#t;#r;#i;#n;#o;constructor(e,t,n,i){super(e),this.#e=t,this.#t=n,this.#r=[],this.#i=new xe,this.#n=this.own(new Fe(e.broadcaster,n.peakAddress));let{sampleStart:o,sampleEnd:a,attack:s,release:l,pitch:u}=n.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(u))});let d=new Float32Array(16);this.ownAll(Ab.create(e,n.audioEffects,this,i),e.broadcaster.broadcastFloats(n.address,d,p=>{if(!p)return;let h=this.#r.length<d.length?this.#r:this.#r.slice(0,d.length);h.forEach(({position:g},v)=>d[v]=g),d[h.length]=-1}),e.audioOutputBufferRegistry.register(n.address,this.#i,this.outgoing),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(ye.isStart(e)){let t=this.#t.file().flatMap(d=>d.getOrCreateLoader().data);if(t.isEmpty())return;let{mute:n,solo:i,polyphone:o,exclude:a}=this.#t.namedParameter,s=n.getValue(),l=i.getValue();if(s||this.#e.hasSolo()&&!l)return;o.getValue()||this.#r.forEach(d=>d.release(!0)),a.getValue()&&this.#e.stopExcludeOthers(this.#t),this.#r.push(new _b(this.#t,this.#o,t.unwrap(),e))}else ye.isStop(e)&&this.#r.find(t=>t.event.id===e.id)?.release()}processAudio(e,t,n){this.#i.clear(t,n);for(let i=this.#r.length-1;i>=0;i--)this.#r[i].processAdd(this.#i.channels(),t,n)&&this.#r.splice(i,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 Sb=class{#e=new R;#t;#r;#i;#n;#o=!0;constructor(e,t){this.#t=t,this.#r=this.#e.own(new bb(e,this)),this.#i=this.#e.own(new wb(e,this)),this.#n=w.newSet(n=>n.uuid),this.#e.ownAll(t.box.enabled.catchupAndSubscribe(n=>{this.#o=n.getValue(),this.#r.setEnabled(this.#o),this.#o||this.#i.reset()}),t.samples.catchupAndSubscribe({onAdd:n=>{let i=new Pb(e,this,n,this.#i);this.#n.add({uuid:n.uuid,processor:i,terminable:e.registerEdge(this.#r,i)}),e.sampleManager.getOrCreate(n.fileUUID())},onRemove:n=>{let{terminable:i,processor:o}=this.#n.removeByKey(n.uuid);i.terminate(),o.terminate()},onReorder:n=>{}}),{terminate:()=>{this.#n.forEach(({terminable:n,processor:i})=>{n.terminate(),i.terminate()}),this.#n.clear()}})}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get noteEventTarget(){return m.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:n})=>n.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 Eb=class extends Re{#e;#t;#r;#i=Qt.stereoMatrix(sampleRate);#n={gain:0,panning:0,stereo:0,invertL:!1,invertR:!1,swap:!1};#o;#a;#s;#l;#c;#u;#d=m.None;#p=In.Linear;#h=!0;#f=!1;constructor(e,t){super(e),this.#e=t,this.#t=new xe,this.#r=this.own(new Fe(e.broadcaster,t.address)),this.#o=this.own(this.bindParameter(t.namedParameter.volume)),this.#a=this.own(this.bindParameter(t.namedParameter.panning)),this.#s=this.own(this.bindParameter(t.namedParameter.stereo)),this.#l=this.own(this.bindParameter(t.namedParameter.invertL)),this.#c=this.own(this.bindParameter(t.namedParameter.invertR)),this.#u=this.own(this.bindParameter(t.namedParameter.swap)),this.ownAll(t.box.panningMixing.catchupAndSubscribe(n=>{this.#p=n.getValue(),this.#h=!0}),e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#t,this.outgoing)),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=m.wrap(e),{terminate:()=>this.#d=m.None}}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}processAudio(e,t,n){if(this.#d.isEmpty())return;this.#h&&(this.#i.update(this.#n,this.#p,this.#f),this.#h=!1);let i=this.#d.unwrap().channels(),o=this.#t.channels();this.#i.processFrames(i,o,t,n),this.#r.processStereo(o,t,n),this.#f=!0}parameterChanged(e){switch(e){case this.#o:this.#n.gain=Ce(this.#o.getValue()),this.#h=!0;return;case this.#a:this.#n.panning=this.#a.getValue(),this.#h=!0;return;case this.#s:this.#n.stereo=this.#s.getValue(),this.#h=!0;return;case this.#l:this.#n.invertL=this.#l.getValue(),this.#h=!0;return;case this.#c:this.#n.invertR=this.#c.getValue(),this.#h=!0;return;case this.#u:this.#n.swap=this.#u.getValue(),this.#h=!0;return}}toString(){return`{${this.constructor.name}}`}};var Fb=class extends Hr{#e;#t;#r=m.None;#i=m.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Ki(e.broadcaster,t.address)),this.ownAll(t.box.groove.catchupAndSubscribe(n=>{this.#r.ifSome(i=>i.terminate()),this.#r=m.wrap(n.targetVertex.isEmpty()?null:e.boxAdapters.adapterFor(n.targetVertex.unwrap().box,wl.checkType))}),q.create(()=>{this.#r.ifSome(n=>n.terminate()),this.#r=m.None}),e.registerProcessor(this))}get uuid(){return this.#e.uuid}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}setNoteEventSource(e){return T(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=m.wrap(e),q.create(()=>this.#i=m.None)}*processNotes(e,t,n){if(this.#i.isEmpty())return;let i=this.#i.unwrap(),o=this.#r.mapOr(Cd,Zd.Identity);for(let a of i.processNotes(o.unwarp(e),o.unwarp(t),n))ye.isStart(a)?this.#t.noteOn(a.pitch):this.#t.noteOff(a.pitch),yield Jr.overwrite(a,{position:pe(o.warp(a.position),e,t)})}*iterateActiveNotesAt(e,t){if(this.#i.isEmpty())return;let n=this.#i.unwrap(),i=this.#r.mapOr(Cd,Zd.Identity);for(let o of n.iterateActiveNotesAt(i.unwarp(e),t))yield Jr.overwrite(o,{position:i.warp(o.position)})}reset(){this.eventInput.clear()}parameterChanged(e){}handleEvent(e,t){}processEvents(e,t,n){}};var Bb=class extends Hr{#e;#t;#r=m.None;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Ki(e.broadcaster,t.address)),this.own(e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return T(this.#r.isEmpty(),"NoteEventSource already set"),this.#r=m.wrap(e),q.create(()=>this.#r=m.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,n){if(!this.#r.isEmpty())for(let i of this.#r.unwrap().processNotes(e,t,n))yield i}*iterateActiveNotesAt(e,t){if(!this.#r.isEmpty())for(let n of this.#r.unwrap().iterateActiveNotesAt(e,t))yield n}reset(){this.eventInput.clear()}processEvents(e,t,n){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Ib=(r,e)=>(r[e]??r[e.toString()])?.value,Dd=(r,e,t)=>Ib(e,t)??Ib(r,t),Ek=new Float32Array(he),kb=class{event;sampleData;envelope;#e;rootKey;sampleRate;loopStart;loopEnd;pan;shouldLoop;playbackPosition=0;isReleasing=!1;constructor(e,t,n,i){this.event=e;let o=t.generators,a=n?.generators,s=Ib(a,53)??0,l=n?.sample??i.samples[s];this.sampleData=l.data,this.rootKey=Ib(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 u=Dd(o,a,54)??0;this.shouldLoop=u===1||u===3,this.pan=(Dd(o,a,17)??0)/1e3;let d=Dd(o,a,34),p=Dd(o,a,36),h=Dd(o,a,37),g=Dd(o,a,38),v=ns(d)?Math.pow(2,d/1200):.005,y=ns(p)?Math.pow(2,p/1200):.005,x=1-(h??0)/1e3,$=ns(g)?Math.pow(2,g/1200):.005;this.envelope=new Kl(sampleRate),this.envelope.set(v,y,x,$),this.envelope.gateOn(),this.#e=new Xr(.003,sampleRate)}release(){this.isReleasing=!0,this.envelope.gateOff()}processAdd(e,t,n){let o=Ld(this.event.pitch+this.event.cent/100,440)/Ld(this.rootKey,440)*(this.sampleRate/sampleRate),a=Zl(this.event.velocity),s=Math.cos((this.pan+1)*Math.PI/4),l=Math.sin((this.pan+1)*Math.PI/4);this.envelope.process(Ek,t,n);let u=e.getChannel(0),d=e.getChannel(1);for(let p=t;p<n;p++){let h=Math.floor(this.playbackPosition),v=this.#t(h)/32768*a*this.#e.process(Ek[p]);if(u[p]+=v*s,d[p]+=v*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<nm}#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 Nb=class extends Re{#e;#t;#r;#i;#n;#o=m.None;#a=!0;constructor(e,t){super(e),this.#e=t,this.#t=[],this.#r=new lo(this,e.broadcaster,t.audioUnitBoxAdapter().address),this.#i=new xe,this.#n=this.own(new Fe(e.broadcaster,t.address)),this.ownAll(t.box.enabled.catchupAndSubscribe(n=>{this.#a=n.getValue(),this.#a||this.reset()}),e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#i,this.outgoing),t.box.file.catchupAndSubscribe(n=>this.#o=n.targetVertex.map(({box:i})=>e.soundfontManager.getOrCreate(i.address.uuid))))}introduceBlock(e){this.#r.introduceBlock(e)}setNoteEventSource(e){return this.#r.setNoteEventSource(e)}get noteEventTarget(){return m.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){if(!this.#a)return;let t=this.#o.flatMap(i=>i.soundfont);if(t.isEmpty())return;let n=t.unwrap();if(ye.isStart(e)){let i=n.presets[this.#e.presetIndex]??n.presets[0];if(Gf(i)){console.warn("No preset available");return}let o=0;for(let a of i.zones){let s=Math.round(e.velocity*127);if(this.#s(e.pitch,s,a)){let l=a.instrument.zones;for(let u=0;u<l.length;u++){let d=l[u];this.#s(e.pitch,s,d)&&(this.#t.push(new kb(e,a,d,n)),o++)}}}}else ye.isStop(e)&&this.#t.forEach(i=>{i.event.id===e.id&&i.release()})}processAudio(e,t,n){if(this.#a){this.#i.clear(t,n);for(let i=this.#t.length-1;i>=0;i--)this.#t[i].processAdd(this.#i,t,n)&&this.#t.splice(i,1)}}finishProcess(){this.#a&&(this.#i.assertSanity(),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1)))}terminate(){super.terminate(),this.#o=m.None}toString(){return"{SoundfontDevice}"}#s(e,t,n){return this.#l(n.generators[44]?.range,t)&&this.#l(n.generators[43]?.range,e)}#l(e,t){return Cl(e)||t>=e.lo&&t<=e.hi}};var cM=.2,uM=.005,Fk=-.001,$b=class r extends Re{static ID=0;#e=r.ID++;#t;#r;#i;#n;parameterThreshold;#o;#a;#s=new Float32Array(1);#l;#c;#u=0;#d=0;#p=0;#h=0;#f=!0;#m=!1;#g=0;#v=m.None;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Fe(e.broadcaster,t.address.append(1))),this.#n=this.own(new Fe(e.broadcaster,t.address)),this.#l=Math.exp(-1/(sampleRate*cM)),this.#a=Qt.linear(sampleRate,.01),this.#c=Math.ceil(uM*sampleRate)|0,this.#o=[new Float32Array(this.#c),new Float32Array(this.#c)];let{threshold:n}=t.namedParameter;this.parameterThreshold=this.own(this.bindParameter(n)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing),e.broadcaster.broadcastFloats(t.address.append(0),this.#s,()=>{this.#s[0]=this.#g,this.#g=0}),t.box.lookahead.catchupAndSubscribe(()=>{this.#f=t.box.lookahead.getValue(),this.#u=0,this.#d=0})),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#m=!1,this.#i.clear(),this.#n.clear(),this.#r.clear(),this.eventInput.clear(),this.#u=0,this.#d=0,this.#p=0,this.#h=0,this.#o[0].fill(0),this.#o[1].fill(0),this.#g=0}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#v=m.wrap(e),{terminate:()=>this.#v=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,n){if(this.#v.isEmpty())return;let i=this.#v.unwrap(),o=i.getChannel(0),a=i.getChannel(1),s=this.#r.getChannel(0),l=this.#r.getChannel(1);if(this.#f){let u=this.#o,d=this.#c,p=u[0],h=u[1];for(let g=t;g<n;g++){let v=o[g],y=a[g],x=Math.max(Math.abs(v),Math.abs(y));x>this.#p?(this.#p=x,this.#h=this.#c):this.#h>0?this.#h--:this.#p=x,this.#d<this.#p?this.#d=Math.min(this.#p,this.#d+this.#p/this.#c):this.#d=this.#p+this.#l*(this.#d-this.#p);let $=this.#a.moveAndGet(),M=Math.min(0,$-Wl(this.#d)),U=Ce(M)*Ce(Fk-$),C=p[this.#u]*U,V=h[this.#u]*U;s[g]=pe(C,-1,1),l[g]=pe(V,-1,1),p[this.#u]=v,h[this.#u]=y,this.#u=(this.#u+1)%d,M<this.#g&&(this.#g=M)}}else for(let u=t;u<n;u++){let d=o[u],p=a[u],h=Math.max(Math.abs(d),Math.abs(p));h>this.#p?(this.#p=h,this.#h=this.#c):this.#h>0?this.#h--:this.#p=h,this.#d<this.#p?this.#d=Math.min(this.#p,this.#d+this.#p/this.#c):this.#d=this.#p+this.#l*(this.#d-this.#p);let g=this.#a.moveAndGet(),v=Math.min(0,g-Wl(this.#d)),y=Ce(v)*Ce(Fk-g),x=d*y,$=p*y;s[u]=x,l[u]=$,v<this.#g&&(this.#g=v)}this.#i.process(o,a,t,n),this.#n.process(s,l,t,n),this.#m=!0}parameterChanged(e){e===this.parameterThreshold&&this.#a.set(this.parameterThreshold.getValue(),this.#m)}toString(){return`{${this.constructor.name} (${this.#e})}`}};var Bk=r=>r>0?20*Math.log10(r):-100,Ik=r=>Math.pow(10,r*.05);var Db=class{#e=.08;#t=1;#r;#i;#n=0;#o=.14;#a=0;#s=.14;#l=0;#c=0;#u=0;constructor(e){this.#r=Math.exp(-1/(e*.2)),this.#i=1-this.#r}process(e,t,n){this.#l===0&&(this.#l=e[0]),this.#c===0&&(this.#c=e[0]),this.#a=0,this.#s=0;for(let o=t;o<n;++o){let a=e[o]*e[o];this.#l=Math.max(a,this.#r*this.#l+this.#i*a),this.#c=this.#r*this.#c+this.#i*a;let s=this.#l/this.#c;this.#u=s>0?s:0,this.#u>0&&(this.#n=2*(this.#e/this.#u),this.#o=2*(this.#t/this.#u)-this.#n,this.#a+=this.#n,this.#s+=this.#o)}let i=n-t;this.#a/=i,this.#s/=i}getAvgAttack(){return this.#a}getAvgRelease(){return this.#s}};var Mb=class{#e=[];#t;#r;#i;#n=0;constructor(e,t,n,i){this.#i=i,this.#r=Math.floor(e*t),this.#t=n+this.#r;for(let o=0;o<i;o++)this.#e[o]=new Float32Array(this.#t);this.#n=0}process(e,t,n){if(this.#r===0)return;let i=(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=i;for(let u=t;u<n;u++){let d=this.#e[o][l];this.#e[o][s]=a[u],a[u]=d,s=(s+1)%this.#t,l=(l+1)%this.#t}}this.#n=(this.#n+(n-t))%this.#t}};var Tb=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,n){for(let i=t;i<n;++i){let o=Math.max(Math.abs(e[i]),1e-6),a=Bk(o);e[i]=this.applyCompression(a)}}};var Ml=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 Cb=class{#e;#t;#r;#i;#n=.01;#o=0;#a=.14;#s=0;#l=0;#c=0;#u=!1;#d=!1;constructor(e){this.#e=e,this.#t=new Db(e),this.#r=new Ml(e),this.#i=new Ml(e),this.#o=Math.exp(-1/(e*this.#n)),this.#s=Math.exp(-1/(e*this.#a)),this.#l=0,this.#c=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.#s=Math.exp(-1/(this.#e*this.#a)))}setAutoAttack(e){this.#u=e}setAutoRelease(e){this.#d=e}#p(e){return e<this.#l?this.#l=this.#o*this.#l+(1-this.#o)*e:this.#l=this.#s*this.#l+(1-this.#s)*e,this.#l}applyBallistics(e,t,n){for(let i=t;i<n;++i)e[i]=this.#p(e[i])}processCrestFactor(e,t,n){(this.#u||this.#d)&&(this.#t.process(e,t,n),this.#r.process(this.#t.getAvgAttack()),this.#i.process(this.#t.getAvgRelease()),this.#u&&this.setAttack(this.#r.getState()),this.#d&&this.setRelease(this.#i.getState()))}};var Rb=class{#e;#t;#r;#i=0;#n=0;constructor(e,t,n){this.#t=Math.floor(e*t),this.#r=n+this.#t,this.#e=new Float32Array(this.#r),this.#i=0}process(e,t,n){this.#o(e,t,n),this.#s(),this.#a(e,t,n)}#o(e,t,n){for(let i=t;i<n;i++)this.#e[this.#i]=e[i],this.#i=(this.#i+1)%this.#r;this.#n=n-t}#a(e,t,n){let i=this.#i-this.#n-this.#t;i<0&&(i+=this.#r);for(let o=t;o<n;o++)e[o]=this.#e[i],i=(i+1)%this.#r}#s(){let e=this.#i-1;e<0&&(e+=this.#r);let t=0,n=0;for(let o=0;o<this.#n;o++){let a=this.#e[e];a>t?(this.#e[e]=t,t+=n):(n=-a/this.#t,t=a+n),e=e-1,e<0&&(e+=this.#r)}let i=!1;for(let o=0;o<this.#t&&!i;o++){if(this.#e[e]>t)this.#e[e]=t,t+=n;else{i=!0;break}e=e-1,e<0&&(e+=this.#r)}}};var Ob=class r extends Re{static PEAK_DECAY_PER_SAMPLE=Math.exp(-1/(sampleRate*.5));static REDUCTION_DECAY_PER_SAMPLE=he/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;#s;#l;#c;#u;#d=.005;#p;#h;#f=new R;#m=m.None;#g=m.None;#v=!1;#w=!1;#A=!1;#E=!1;#F=!1;#I=-10;#_=2;#y=6;#b=2;#P=140;#M=0;#N=1;#$=0;#B=0;#S=0;#k=0;#D=!1;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Fe(e.broadcaster,t.address)),this.#p=new Float32Array([Number.NEGATIVE_INFINITY,0,Number.NEGATIVE_INFINITY]),this.#h=Qt.linear(sampleRate);let{lookahead:n,automakeup:i,autoattack:o,autorelease:a,inputgain:s,threshold:l,ratio:u,knee:d,attack:p,release:h,makeup:g,mix:v}=t.namedParameter;this.parameterLookahead=this.own(this.bindParameter(n)),this.parameterAutomakeup=this.own(this.bindParameter(i)),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(u)),this.parameterKnee=this.own(this.bindParameter(d)),this.parameterAttack=this.own(this.bindParameter(p)),this.parameterRelease=this.own(this.bindParameter(h)),this.parameterMakeup=this.own(this.bindParameter(g)),this.parameterMix=this.own(this.bindParameter(v)),this.#n=new Cb(sampleRate),this.#o=new Tb,this.#a=new Mb(sampleRate,.005,he,2),this.#s=new Rb(sampleRate,this.#d,he),this.#l=new Ml(sampleRate),this.#l.setAlpha(.03),this.#c=new Float32Array(he),this.#u=[new Float32Array(he),new Float32Array(he)],this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing),e.broadcaster.broadcastFloats(t.address.append(0),this.#p,y=>{this.#p[0]=Wl(this.#B),this.#p[1]=this.#k,this.#p[2]=Wl(this.#S)}),t.sideChain.catchupAndSubscribe(()=>{this.#f.terminate(),this.#g=m.None,this.#v=!0}),e.subscribeProcessPhase(y=>{y===0&&this.#v&&(this.#v=!1,t.sideChain.targetVertex.map(({box:x})=>x.address).ifSome(x=>{e.audioOutputBufferRegistry.resolve(x).ifSome($=>{this.#g=m.wrap($.buffer),this.#f.own(e.registerEdge($.processor,this.incoming))})}))}),this.#f),this.readAllParameters()}get incoming(){return this}get outgoing(){return this}reset(){this.#D=!1,this.#r.clear(),this.#i.clear(),this.eventInput.clear(),this.#c.fill(0),this.#u[0].fill(0),this.#u[1].fill(0),this.#$=0,this.#B=0,this.#S=0,this.#k=0}get uuid(){return this.#t.uuid}get audioOutput(){return this.#r}setAudioSource(e){return this.#m=m.wrap(e),{terminate:()=>this.#m=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio(e,t,n){if(this.#m.isEmpty())return;let i=this.#m.unwrap(),o=i.getChannel(0),a=i.getChannel(1),s=this.#r.getChannel(0),l=this.#r.getChannel(1);for(let u=t;u<n;u++){let d=this.#h.moveAndGet();s[u]=o[u]*d,l[u]=a[u]*d}if(this.#c.fill(0,t,n),this.#g.nonEmpty()){let u=this.#g.unwrap(),d=u.getChannel(0),p=u.getChannel(1);for(let h=t;h<n;h++)this.#c[h]=Math.max(Math.abs(d[h]),Math.abs(p[h]))}else for(let u=t;u<n;u++)this.#c[u]=Math.max(Math.abs(s[u]),Math.abs(l[u]));for(let u=t;u<n;u++){let d=this.#c[u];this.#B<=d?this.#B=d:this.#B*=r.PEAK_DECAY_PER_SAMPLE}this.#n.processCrestFactor(this.#c,t,n),this.#o.applyCompressionToBuffer(this.#c,t,n),this.#n.applyBallistics(this.#c,t,n);for(let u=t;u<n;u++){let d=this.#c[u];this.#k>=d?this.#k=d:this.#k+=r.REDUCTION_DECAY_PER_SAMPLE}this.#$=this.#T(this.#c,t,n),this.#w&&(this.#a.process(this.#r,t,n),this.#s.process(this.#c,t,n));for(let u=t;u<n;u++)this.#c[u]=Ik(this.#c[u]+this.#M+this.#$);for(let u=t;u<n;u++)this.#u[0][u]=s[u],this.#u[1][u]=l[u];for(let u=t;u<n;u++)s[u]*=this.#c[u],l[u]*=this.#c[u];for(let u=t;u<n;u++){let d=s[u]*this.#N+this.#u[0][u]*(1-this.#N),p=l[u]*this.#N+this.#u[1][u]*(1-this.#N),h=Math.max(Math.abs(d),Math.abs(p));this.#S<=h?this.#S=h:this.#S*=r.PEAK_DECAY_PER_SAMPLE,s[u]=d,l[u]=p}this.#i.process(s,l,t,n),this.#D=!0}#T(e,t,n){let i=0;for(let o=t;o<n;o++)i+=e[o];return this.#l.process(-i/(n-t)),this.#A?this.#l.getState():0}parameterChanged(e){e===this.parameterLookahead?this.#w=this.parameterLookahead.getValue():e===this.parameterAutomakeup?this.#A=this.parameterAutomakeup.getValue():e===this.parameterAutoattack?(this.#E=this.parameterAutoattack.getValue(),this.#n.setAutoAttack(this.#E),this.#E||this.#n.setAttack(this.#b*.001)):e===this.parameterAutorelease?(this.#F=this.parameterAutorelease.getValue(),this.#n.setAutoRelease(this.#F),this.#F||this.#n.setRelease(this.#P*.001)):e===this.parameterInputgain?this.#h.set(Ce(this.parameterInputgain.getValue()),this.#D):e===this.parameterThreshold?(this.#I=this.parameterThreshold.getValue(),this.#o.setThreshold(this.#I)):e===this.parameterRatio?(this.#_=this.parameterRatio.getValue(),this.#o.setRatio(this.#_)):e===this.parameterKnee?(this.#y=this.parameterKnee.getValue(),this.#o.setKnee(this.#y)):e===this.parameterAttack?(this.#b=this.parameterAttack.getValue(),this.#E||this.#n.setAttack(this.#b*.001)):e===this.parameterRelease?(this.#P=this.parameterRelease.getValue(),this.#F||this.#n.setRelease(this.#P*.001)):e===this.parameterMakeup?this.#M=this.parameterMakeup.getValue():e===this.parameterMix&&(this.#N=this.parameterMix.getValue())}toString(){return`{${this.constructor.name} (${this.#e})}`}};var Vb=class r extends Re{static ID=0;#e=r.ID++;#t;#r;#i;#n;parameterCrusherRate;parameterBitDepth;parameterBoost;parameterMix;#o=m.None;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=new am(sampleRate),this.#n=this.own(new Fe(e.broadcaster,t.address));let{crush:n,bits:i,boost:o,mix:a}=t.namedParameter;this.parameterCrusherRate=this.own(this.bindParameter(n)),this.parameterBitDepth=this.own(this.bindParameter(i)),this.parameterBoost=this.own(this.bindParameter(o)),this.parameterMix=this.own(this.bindParameter(a)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing)),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=m.wrap(e),{terminate:()=>this.#o=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,n){if(this.#o.isEmpty())return;let i=this.#o.unwrap();this.#i.process(i.channels(),this.#r.channels(),t,n),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1),t,n)}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 dM=[2,4,8],kk=8,zb=class r extends Re{static ID=0;#e=r.ID++;#t;#r;#i;#n;parameterDrive;parameterVolume;#o=m.None;#a=!1;#s;#l;#c;#u;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=[new Float32Array(he*kk),new Float32Array(he*kk)],this.#n=this.own(new Fe(e.broadcaster,t.address));let{drive:n,volume:i}=t.namedParameter;this.parameterDrive=this.own(this.bindParameter(n)),this.parameterVolume=this.own(this.bindParameter(i)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing),t.box.overSampling.catchupAndSubscribe(o=>{let a=dM[o.getValue()];this.#s=new mm(a),this.#c=Qt.linear(sampleRate*a),this.#c.set(Ce(this.parameterDrive.getValue()),this.#a),this.#u=Qt.linear(sampleRate*a),this.#u.set(Ce(this.parameterVolume.getValue()),this.#a),this.#l=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=m.wrap(e),{terminate:()=>this.#o=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio(e,t,n){if(this.#o.isEmpty())return;this.#s.upsample(this.#o.unwrap().channels(),this.#i,t,n);let i=(n-t)*this.#l,[o,a]=this.#i;for(let s=0;s<i;s++){let l=this.#u.moveAndGet(),u=this.#c.moveAndGet();o[s]=Sw(o[s]*u)*l,a[s]=Sw(a[s]*u)*l}this.#s.downsample(this.#i,this.#r.channels(),t,n),this.#n.process(this.#r.getChannel(0),this.#r.getChannel(1),t,n),this.#a=!0}parameterChanged(e){e===this.parameterDrive?this.#c.set(Ce(this.parameterDrive.getValue()),this.#a):e===this.parameterVolume&&this.#u.set(Ce(this.parameterVolume.getValue()),this.#a)}toString(){return`{${this.constructor.name} (${this.#e})`}};var Ub=class extends Re{#e;#t;#r=[];#i;#n;#o=!0;#a=m.None;constructor(e,t){super(e),this.#e=t,this.#t=new xe,this.#i=[];let{midiDevice:n,box:i,parameters:o}=t;this.#n=i.channel.getValue(),this.ownAll(i.enabled.catchupAndSubscribe(a=>{this.#o=a.getValue(),this.#o||this.reset()}),i.parameters.pointerHub.catchupAndSubscribe({onAdded:({box:a})=>this.#i.push(this.bindParameter(o.parameterAt(Te(a,Yi).value.address))),onRemoved:({box:a})=>O.removeIf(this.#i,s=>s.address===Te(a,Yi).value.address)}),i.channel.subscribe(a=>{n.ifSome(s=>this.#r.forEach(l=>e.sendMIDIData(s.id.getValue(),ft.noteOff(this.#n,l),s.delayInMs.getValue()))),this.#r.length=0,this.#n=a.getValue()}),e.registerProcessor(this)),this.readAllParameters()}get noteEventTarget(){return m.wrap(this)}introduceBlock({p0:e,p1:t,s0:n,flags:i,bpm:o}){if(this.#a.isEmpty()||!this.#o)return;let{box:{channel:a,device:s}}=this.#e,l=s.targetVertex.match({none:()=>m.None,some:({box:d})=>m.wrap(Te(d,Xi))}),u=l.mapOr(d=>d.delayInMs.getValue(),0);for(let d of this.#a.unwrap().processNotes(e,t,i))if(d.pitch>=0&&d.pitch<=127){let p=n/sampleRate,h=G.pulsesToSeconds(d.position-e,o),g=(p+h)*1e3+u,v=a.getValue();if(ye.isStart(d)){let y=Math.round(d.velocity*127);this.#r.push(d.pitch),l.ifSome(x=>this.context.sendMIDIData(x.id.getValue(),ft.noteOn(v,d.pitch,y),g))}else if(ye.isStop(d)){let y=this.#r.indexOf(d.pitch);y>-1&&this.#r.splice(y,1),l.ifSome(x=>this.context.sendMIDIData(x.id.getValue(),ft.noteOff(v,d.pitch),g))}}}setNoteEventSource(e){return this.#a=m.wrap(e),q.create(()=>this.#a=m.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,n){}parameterChanged(e,t=0){let{box:{channel:n,device:i}}=this.#e;if(i.isEmpty()||!this.#o)return;let{id:o,delayInMs:a}=Te(i.targetVertex.unwrap().box,Xi),s=t*1e3*a.getValue(),l=Te(e.adapter.field.box,Yi).controller.getValue(),u=Math.round(e.getValue()*127),d=ft.control(n.getValue(),l,u);this.context.sendMIDIData(o.getValue(),d,s)}finishProcess(){}toString(){return"{MIDIOutputDeviceProcessor}"}};var jb=class extends Hr{#e;#t;#r;#i=m.None;#n;constructor(e,t){super(e),this.#e=t,this.#t=this.own(new Ki(e.broadcaster,t.address)),this.#r=new Int32Array(1024),this.#n=0;let{magnetPosition:n,magnetStrength:i,randomSeed:o,randomAmount:a,offset:s,mix:l}=t.namedParameter;this.ownAll(this.bindParameter(n),this.bindParameter(i),this.bindParameter(o),this.bindParameter(a),this.bindParameter(s),this.bindParameter(l),e.broadcaster.broadcastIntegers(t.address.append(0),this.#r,u=>{this.#r[this.#n]=0,this.#n=0}),e.registerProcessor(this)),this.readAllParameters()}setNoteEventSource(e){return T(this.#i.isEmpty(),"NoteEventSource already set"),this.#i=m.wrap(e),q.create(()=>this.#i=m.None)}get uuid(){return this.#e.uuid}get incoming(){return this}get outgoing(){return this}*processNotes(e,t,n){if(!this.#i.isEmpty())for(let i of this.#i.unwrap().processNotes(e,t,n))if(ye.isStart(i)){this.#t.noteOn(i.pitch);let o=this.#e.computeVelocity(i.position,i.velocity);this.#r[this.#n++]=Math.round(i.velocity*127)|Math.round(o*127)<<8|65536,yield Jr.overwrite(i,{velocity:o})}else this.#t.noteOff(i.pitch),yield i}*iterateActiveNotesAt(e,t){if(!this.#i.isEmpty())for(let n of this.#i.unwrap().iterateActiveNotesAt(e,t))n.type==="note-event"&&(yield Jr.overwrite(n,{velocity:this.#e.computeVelocity(n.position,n.velocity)}))}reset(){this.eventInput.clear()}processEvents(e,t,n){}parameterChanged(e){}handleEvent(e,t){}index(){return this.#e.indexField.getValue()}adapter(){return this.#e}};var Lb=class r extends Re{static ID=0;#e=r.ID++;#t;#r;#i;#n;#o;#a;#s;#l;#c;#u;#d;#p;#h=m.None;#f=!0;#m=0;constructor(e,t){super(e),this.#t=t,this.#r=new xe,this.#i=this.own(new Fe(e.broadcaster,t.address)),this.#n=new sm,this.#o=new Xr(.003,sampleRate),this.#a=new Xr(.003,sampleRate);let{rate:n,depth:i,slope:o,symmetry:a,offset:s,channelOffset:l}=t.namedParameter;this.#s=this.bindParameter(n),this.#l=this.bindParameter(i),this.#c=this.bindParameter(o),this.#u=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),e.audioOutputBufferRegistry.register(t.address,this.#r,this.outgoing)),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=m.wrap(e),{terminate:()=>this.#h=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}processAudio({p0:e,bpm:t,flags:n},i,o){if(this.#h.isEmpty())return;let a=this.#h.unwrap(),[s,l]=a.channels(),[u,d]=this.#r.channels();this.#f&&(this.#n.set(this.#l.getValue(),this.#c.getValue(),this.#u.getValue()),this.#f=!1);let{RateFractions:p}=yn,h=G.samplesToPulses(1,t,sampleRate),v=1/Yt.toPPQN(p[this.#s.getValue()]),y=this.#d.getValue()/360,x=y+this.#p.getValue()/360;for(let $=i;$<o;$++){let M=(e+$*h)*v+y,U=(e+$*h)*v+x;u[$]=s[$]*this.#o.process(this.#n.compute(M-Math.floor(M))),d[$]=l[$]*this.#a.process(this.#n.compute(U-Math.floor(U)))}this.#i.process(u,d),ct.every(n,5)&&(this.#m=(e+(o-i)*h)*v)}parameterChanged(e){(e===this.#l||e===this.#c||e===this.#u)&&(this.#f=!0)}toString(){return`{${this.constructor.name} (${this.#e})`}};var Kb=class{#e;#t=[];#r;#i;#n;#o=0;#a=0;#s=0;#l=0;#c=0;#u=0;#d=.9999;#p=.75;#h=.625;#f=.5;#m=.7;#g=.5;#v=.005;#w=.5;#A=.7;#E=.3;#F=.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(i=>this.#I(i));let n=[.008937872,.099929438,.064278754,.067067639,.066866033,.006283391,.035818689,.011861161,.121870905,.041262054,.08981553,.070931756,.011256342,.004065724];this.#i=Int16Array.from(n,i=>Math.round(i*e))}#I(e){let t=Math.round(e*this.#e),n=2**Math.ceil(Math.log2(t));this.#t.push([new Float32Array(n),t-1,0,n-1])}#_(e,t){return this.#t[e][0][this.#t[e][1]]=t}#y(e){return this.#t[e][0][this.#t[e][2]]}#b(e,t){let n=this.#t[e];return n[0][n[2]+t&n[3]]}#P(e,t){let n=this.#t[e],i=t-~~t,o=~~t+n[2]-1,a=n[3],s=n[0][o++&a],l=n[0][o++&a],u=n[0][o++&a],d=n[0][o&a],p=(3*(l-u)-s+d)*.5,h=2*u+s-(5*l+d)*.5,g=(u-s)*.5;return((p*i+h)*i+g)*i+l}set preDelayMs(e){this.#u=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.#g=e*.999999}set damping(e){this.#v=e}set excursionRate(e){this.#w=e*2}set excursionDepth(e){this.#A=e*2}set wetGain(e){this.#E=e}set dryGain(e){this.#F=e}reset(){this.#r.fill(0),this.#t.forEach(e=>e[0].fill(0)),this.#o=0,this.#a=0,this.#s=0,this.#l=0,this.#c=0}process(e,t,n,i){let o=this.#u,a=this.#d,s=this.#p,l=this.#h,u=this.#f,d=this.#m,p=this.#g,h=1-this.#v,g=this.#w/this.#e,v=this.#A*this.#e/1e3,y=this.#E*.6,x=this.#F,$=e[0],M=e[1],U=t[0],C=t[1];for(let V=n;V<i;V++){let re=$[V],Y=M[V];this.#r[this.#o]=(re+Y)*.5,U[V]=re*x,C[V]=Y*x;let de=this.#r[(this.#n+this.#o-o)%this.#n];this.#a+=a*(de-this.#a);let Q=this.#_(0,this.#a-s*this.#y(0));Q=this.#_(1,s*(Q-this.#y(1))+this.#y(0)),Q=this.#_(2,s*Q+this.#y(1)-l*this.#y(2)),Q=this.#_(3,l*(Q-this.#y(3))+this.#y(2));let Pe=l*Q+this.#y(3),ce=v*(1+Math.cos(this.#c*6.28)),je=v*(1+Math.sin(this.#c*6.2847)),_e=this.#_(4,Pe+u*this.#y(11)+d*this.#P(4,ce));this.#_(5,this.#P(4,ce)-d*_e),this.#s+=h*(this.#y(5)-this.#s),_e=this.#_(6,u*this.#s-p*this.#y(6)),this.#_(7,this.#y(6)+p*_e),_e=this.#_(8,Pe+u*this.#y(7)+d*this.#P(8,je)),this.#_(9,this.#P(8,je)-d*_e),this.#l+=h*(this.#y(9)-this.#l),_e=this.#_(10,u*this.#l-p*this.#y(10)),this.#_(11,this.#y(10)+p*_e);let Ge=this.#b(9,this.#i[0])+this.#b(9,this.#i[1])-this.#b(10,this.#i[2])+this.#b(11,this.#i[3])-this.#b(5,this.#i[4])-this.#b(6,this.#i[5])-this.#b(7,this.#i[6]),Le=this.#b(5,this.#i[7])+this.#b(5,this.#i[8])-this.#b(6,this.#i[9])+this.#b(7,this.#i[10])-this.#b(9,this.#i[11])-this.#b(10,this.#i[12])-this.#b(11,this.#i[13]);U[V]+=Ge*y,C[V]+=Le*y,this.#c+=g,this.#o=(this.#o+1)%this.#n;for(let ge=0;ge<this.#t.length;ge++){let Ze=this.#t[ge];Ze[1]=Ze[1]+1&Ze[3],Ze[2]=Ze[2]+1&Ze[3]}}}};var Wb=class r extends Re{static ID=0;#e=r.ID++;#t;parameterPreDelay;parameterBandwidth;parameterInputDiffusion1;parameterInputDiffusion2;parameterDecay;parameterDecayDiffusion1;parameterDecayDiffusion2;parameterDamping;parameterExcursionRate;parameterExcursionDepth;parameterWet;parameterDry;#r;#i;#n;#o=m.None;constructor(e,t){super(e),this.#t=t,this.#i=new xe,this.#n=this.own(new Fe(e.broadcaster,t.address)),this.#r=new Kb(sampleRate);let{preDelay:n,bandwidth:i,inputDiffusion1:o,inputDiffusion2:a,decay:s,decayDiffusion1:l,decayDiffusion2:u,damping:d,excursionRate:p,excursionDepth:h,wet:g,dry:v}=t.namedParameter;this.parameterPreDelay=this.own(this.bindParameter(n)),this.parameterBandwidth=this.own(this.bindParameter(i)),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(u)),this.parameterDamping=this.own(this.bindParameter(d)),this.parameterExcursionRate=this.own(this.bindParameter(p)),this.parameterExcursionDepth=this.own(this.bindParameter(h)),this.parameterWet=this.own(this.bindParameter(g)),this.parameterDry=this.own(this.bindParameter(v)),this.ownAll(e.registerProcessor(this),e.audioOutputBufferRegistry.register(t.address,this.#i,this.outgoing)),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=m.wrap(e),{terminate:()=>this.#o=m.None}}index(){return this.#t.indexField.getValue()}adapter(){return this.#t}handleEvent(e){}processAudio(e,t,n){if(this.#o.isEmpty())return;let i=this.#o.unwrap();this.#r.process(i.channels(),this.#i.channels(),t,n),this.#n.process(this.#i.getChannel(0),this.#i.getChannel(1),t,n)}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=Ce(this.parameterWet.getValue()):e===this.parameterDry&&(this.#r.dryGain=Ce(this.parameterDry.getValue()))}toString(){return`{${this.constructor.name} (${this.#e})}`}};var zS;(e=>e.create=(t,n)=>n.accept({visitAudioBusBox:i=>new kd(t,t.boxAdapters.adapterFor(i,_r)),visitVaporisateurDeviceBox:i=>new lb(t,t.boxAdapters.adapterFor(i,wu)),visitNanoDeviceBox:i=>new xb(t,t.boxAdapters.adapterFor(i,Pu)),visitTapeDeviceBox:i=>new pb(t,t.boxAdapters.adapterFor(i,bu)),visitPlayfieldDeviceBox:i=>new Sb(t,t.boxAdapters.adapterFor(i,Oa)),visitSoundfontDeviceBox:i=>new Nb(t,t.boxAdapters.adapterFor(i,Cu)),visitMIDIOutputDeviceBox:i=>new Ub(t,t.boxAdapters.adapterFor(i,Ku))}))(zS||={});var US;(e=>e.create=(t,n)=>se(n.accept({visitUnknownMidiEffectDeviceBox:i=>new Bb(t,t.boxAdapters.adapterFor(i,Du)),visitArpeggioDeviceBox:i=>new fb(t,t.boxAdapters.adapterFor(i,pn)),visitPitchDeviceBox:i=>new mb(t,t.boxAdapters.adapterFor(i,Au)),visitVelocityDeviceBox:i=>new jb(t,t.boxAdapters.adapterFor(i,Wu)),visitZeitgeistDeviceBox:i=>new Fb(t,t.boxAdapters.adapterFor(i,Nu))}),`Could not create midi-effect for'${n.name}'`))(US||={});var jf;(e=>e.create=(t,n)=>se(n.accept({visitUnknownAudioEffectDeviceBox:i=>new Rf(t,t.boxAdapters.adapterFor(i,$u)),visitStereoToolDeviceBox:i=>new Eb(t,t.boxAdapters.adapterFor(i,Iu)),visitMaximizerDeviceBox:i=>new $b(t,t.boxAdapters.adapterFor(i,Ru)),visitCompressorDeviceBox:i=>new Ob(t,t.boxAdapters.adapterFor(i,Ou)),visitDelayDeviceBox:i=>new rb(t,t.boxAdapters.adapterFor(i,Rt)),visitDattorroReverbDeviceBox:i=>new Wb(t,t.boxAdapters.adapterFor(i,Zu)),visitTidalDeviceBox:i=>new Lb(t,t.boxAdapters.adapterFor(i,yn)),visitCrusherDeviceBox:i=>new Vb(t,t.boxAdapters.adapterFor(i,Vu)),visitFoldDeviceBox:i=>new zb(t,t.boxAdapters.adapterFor(i,Uu)),visitReverbDeviceBox:i=>new yb(t,t.boxAdapters.adapterFor(i,tu)),visitRevampDeviceBox:i=>new gb(t,t.boxAdapters.adapterFor(i,ru)),visitModularDeviceBox:i=>new Rf(t,t.boxAdapters.adapterFor(i,$a))}),`Could not create audio-effect for'${n.name}'`))(jf||={});var Zb=class extends Re{#e;#t;#r;#i;#n;#o;#a=m.None;#s=!0;#l=!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=m.wrap(e),{terminate:()=>this.#a=m.None}}get audioOutput(){return this.#t}processAudio(e,t,n){if(this.#a.isEmpty())return;if(this.#s){let u=Ce(this.#n.getValue()),d=this.#o.getValue();this.#r.set((1-Math.max(0,d))*u,this.#l),this.#i.set((1+Math.min(0,d))*u,this.#l),this.#s=!1}let i=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 u=t;u<n;u++)i[u]=s[u]*this.#r.moveAndGet(),o[u]=l[u]*this.#i.moveAndGet();else{let u=this.#r.get(),d=this.#i.get();for(let p=t;p<n;p++)i[p]=s[p]*u,o[p]=l[p]*d}this.#l=!0}parameterChanged(e){this.#s=!0}};var qb=class extends Re{#e;#t;#r;#i;#n;#o;#a;#s;#l=Qt.linear(sampleRate);#c=Qt.linear(sampleRate);#u=Qt.linear(sampleRate);#d=m.None;#p=!0;#h=!1;constructor(e,t){super(e),this.#e=t,this.#t=new xe,this.#r=[new Float32Array(he),new Float32Array(he)],this.#i=this.own(new Fe(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.#s=this.own(this.bindParameter(this.#e.namedParameter.solo)),this.ownAll(e.registerProcessor(this),e.mixer.attachChannelStrip(this),e.audioOutputBufferRegistry.register(t.address,this.#t,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.#s.getValue()}get adapter(){return this.#e}get audioOutput(){return this.#t}handleEvent(e){}processAudio(e,t,n){if(this.#d.isEmpty())return;if(this.#p){let p=this.context.mixer;p.updateSolo();let h=this.isSolo||p.isVirtualSolo(this),g=this.isMute||p.hasChannelSolo()&&!h&&!this.#e.isOutput,v=Ce(this.#n.getValue()),y=this.#o.getValue();this.#l.set((1-Math.max(0,y))*v,this.#h),this.#c.set((1+Math.min(0,y))*v,this.#h),this.#u.set(g?0:1,this.#h),this.#p=!1}let i=this.#d.unwrap(),[o,a]=i.channels(),[s,l]=this.#t.channels(),[u,d]=this.#r;if(this.#l.isInterpolating()||this.#c.isInterpolating()||this.#u.isInterpolating())for(let p=t;p<n;p++){let h=this.#u.moveAndGet(),g=o[p]*this.#l.moveAndGet(),v=a[p]*this.#c.moveAndGet();s[p]=g*h,l[p]=v*h,u[p]=g,d[p]=v}else{let p=this.#l.get(),h=this.#c.get(),g=this.#u.get();for(let v=t;v<n;v++){let y=o[v]*p,x=a[v]*h;u[v]=y,d[v]=x,s[v]=y*g,l[v]=x*g}}this.#i.process(u,d,t,n),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.#s&&this.context.mixer.onChannelStripSoloChanged(this)}requestGainUpdate(){this.#p=!0}requestSoloUpdate(){this.#p=!0}setAudioSource(e){return this.#d=m.wrap(e),{terminate:()=>this.#d=m.None}}toString(){return`{${this.constructor.name}}`}};var Gb=class{#e=new R;#t;#r;#i;#n;#o;#a;#s=[];#l=!1;constructor(e,t){this.#t=e,this.#r=t,this.#i=w.newSet(n=>n.adapter.uuid),this.#n=this.#e.own(new qb(this.#t.context,this.#t.adapter)),this.#o=w.newSet(({device:n})=>n.uuid),this.#a=this.#e.own(new R),this.#e.ownAll(this.#t.adapter.audioEffects.catchupAndSubscribe({onAdd:n=>{this.invalidateWiring();let i=jf.create(this.#t.context,n.box),o=this.#o.add({device:i,subscription:i.adapter().enabledField.subscribe(()=>{i.incoming.reset(),i.outgoing.reset(),this.invalidateWiring()})});T(o,"Could not add.")},onRemove:n=>{this.invalidateWiring();let{device:i,subscription:o}=this.#o.removeByKey(n.uuid);o.terminate(),i.terminate()},onReorder:n=>this.invalidateWiring()}),this.#t.adapter.auxSends.catchupAndSubscribe({onAdd:n=>{this.invalidateWiring();let i=this.#i.add(new Zb(this.#t.context,n));T(i,"Could not add.")},onRemove:({uuid:n})=>{this.invalidateWiring(),this.#i.removeByKey(n).terminate()},onReorder:n=>{}}),this.#t.adapter.output.catchupAndSubscribe(n=>this.invalidateWiring()),this.#t.context.subscribeProcessPhase(n=>{n===0&&this.#l&&(this.#c(),this.#l=!1)}))}get channelStrip(){return this.#n}invalidateWiring(){this.#a.terminate(),this.#l=!0}terminate(){this.#e.terminate(),this.#o.forEach(({device:e})=>e.terminate()),this.#o.clear(),this.#s=[]}toString(){return`{${this.constructor.name}}`}#c(){let e=this.#t.adapter.isOutput,t=this.#t.context,n=this.#t.input(),i=this.#t.adapter.output.adapter.map(a=>t.getAudioUnit(a.deviceHost().uuid).inputAsAudioBus());if(n.isEmpty()||i.isEmpty()&&!e)return;let o=n.unwrap();if(this.#r.includeAudioEffects){O.replace(this.#s,this.#t.adapter.audioEffects.adapters().map(({uuid:a})=>this.#o.get(a).device));for(let a of this.#s)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)),i.nonEmpty()&&!e){let a=i.unwrap();this.#a.own(a.addAudioSource(this.#n.audioOutput)),this.#a.own(t.registerEdge(this.#n,a))}}};var Hb=class{#e=new R;#t;#r;#i;#n;#o;#a;#s;constructor(e,t){this.#t=e,this.#r=t,this.#i=zl.create(268431651),this.#n=new Set,this.#o=[],this.#a=new cs,this.#s=new cs,this.#e.ownAll(this.#t.subscribeProcessPhase(n=>{if(n===1)for(let i of this.#n)i.gate||this.#n.delete(i)}))}get uuid(){return this.#r.uuid}terminate(){this.#e.terminate()}pushRawNoteOn(e,t){this.#n.add({pitch:e,velocity:t,gate:!0,running:m.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}}auditionNote(e,t,n){this.#o.push({pitch:e,duration:t,velocity:n})}*processNotes(e,t,n){let i=ct.every(n,5),o=ct.every(n,2);if(this.#s.nonEmpty()&&(!i||o?yield*this.#d(e):yield*this.#p(e,t)),this.#a.nonEmpty())if(o)for(let a of this.#a.releaseAll())yield ye.stop(a,e);else for(let a of this.#a.releaseLinearCompleted(t))yield ye.stop(a,a.position+a.duration);if(this.#n.size>0)for(let a of this.#n){if(a.running.isEmpty()){let{pitch:s,velocity:l}=a,u=Number.POSITIVE_INFINITY,d=ye.start(e,u,s,l);a.running=m.wrap(d),yield d}a.gate||(this.#n.delete(a),yield ye.stop(a.running.unwrap("raw note never started"),e))}if(this.#o.length>0){for(let a of this.#a.releaseAll())yield ye.stop(a,e);for(let{pitch:a,duration:s,velocity:l}of this.#o){let u=ye.start(e,s,a,l);this.#a.addAndRetain({...u}),yield u}this.#o.length=0}if(i){let a=this.#r.tracks.collection.adapters().filter(s=>s.type===oe.Notes&&s.enabled.getValue());for(let s of a){let l=this.#t.clipSequencing.iterate(s.uuid,e,t);for(let{optClip:u,sectionFrom:d,sectionTo:p}of l)u.isEmpty()?yield*this.#c(s,d,p):yield*this.#l(u.unwrap(),d,p)}yield*this.#p(e,t)}}*iterateActiveNotesAt(e,t){if(this.#n.size>0)for(let{pitch:n,velocity:i}of this.#n)yield{type:"note-event",position:e,duration:Number.POSITIVE_INFINITY,pitch:n,velocity:i,cent:0};yield*this.#a.overlapping(e,cr.Comparator),!t&&(yield*this.#s.overlapping(e,cr.Comparator))}reset(){this.#n.clear(),this.#s.clear(),this.#o.length=0,this.#a.clear()}toString(){return`{${this.constructor.name}}`}*#l(e,t,n){if(e.optCollection.isEmpty())return;let i=this.#t.preferences.settings.playback.truncateNotesAtRegionEnd,o=e.optCollection.unwrap(),a=e.duration,s=mo(t,a),l=s+a,u=i?a:Number.POSITIVE_INFINITY;n>l?(yield*this.#u(o,t-s,l-s,s,u),yield*this.#u(o,0,n-l,l,u)):yield*this.#u(o,t-s,n-s,s,u)}*#c(e,t,n){let i=this.#t.preferences.settings.playback.truncateNotesAtRegionEnd;for(let o of e.regions.collection.iterateRange(t,n)){if(this.#t.ignoresRegion(o.address.uuid)||o.mute||!Ke(o,ba))continue;let a=o.optCollection;if(a.isEmpty())continue;let s=a.unwrap();for(let{resultStart:l,resultEnd:u,rawStart:d,rawEnd:p}of lr.locateLoops(o,t,n)){let h=i?Math.min(p,o.complete):Number.POSITIVE_INFINITY;yield*this.#u(s,l-d,u-d,d,h-d)}}}*#u(e,t,n,i,o){for(let a of e.events.iterateRange(t-e.maxDuration,n)){if(!cr.isOfType(a))continue;let{position:s,duration:l,chance:u,playCount:d,playCurve:p}=a;if(!(u<100&&this.#i.nextDouble(0,100)>u)){if(d>1){let h=cr.inverseCurveFunc((t-s)/l,p),g=cr.inverseCurveFunc((n-s)/l,p),v=Math.floor(h*d),y=v/d;for(;y<g;){if(y>=h){let x=cr.curveFunc(y,p)*l;if(x>=l)break;let $=cr.curveFunc(y+1/d,p)*l,M=ye.startWith(a,s+x+i,$-x);this.#s.addAndRetain({...M}),yield M}y=++v/d}}else if(t<=s&&s<n){let h=Math.min(a.duration,o-s),g=ye.startWith(a,s+i,h);this.#s.addAndRetain({...g}),yield g}}}}*#d(e){for(let t of this.#s.releaseAll())yield ye.stop(t,e)}*#p(e,t){for(let n of this.#s.releaseLinearCompleted(t)){let i=pe(n.position+n.duration,e,t);yield ye.stop(n,i)}}};var Jb=class{#e=new R;#t;#r;#i;#n;#o=!1;constructor(e){this.#t=e,this.#r=this.#e.own(new Hb(this.#t.context,this.#t.adapter)),this.#i=w.newSet(({device:t})=>t.uuid),this.#n=this.#e.own(new R),this.#e.ownAll(this.#t.adapter.midiEffects.catchupAndSubscribe({onAdd:t=>{this.invalidateWiring();let n=US.create(this.#t.context,t.box),i=this.#i.add({device:n,subscription:n.adapter().enabledField.subscribe(()=>{n.reset(),this.invalidateWiring()})});T(i,"Could not add.")},onRemove:t=>{this.invalidateWiring();let{device:n,subscription:i}=this.#i.removeByKey(t.uuid);i.terminate(),n.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(i=>i.noteEventTarget);if(e.isEmpty())return;let t=e.unwrap(),n=this.#r;this.#t.adapter.midiEffects.adapters().map(i=>this.#i.get(i.uuid).device).forEach(i=>{i.adapter().enabledField.getValue()&&(this.#n.ownAll(i.setNoteEventSource(n),this.#t.context.registerEdge(i,t.incoming)),n=i)}),this.#n.own(t.setNoteEventSource(n))}};var Qb=class r{static ID=0;#e=r.ID++;#t=new R;#r;#i;#n;#o;#a=m.None;constructor(e,t,n){this.#r=e,this.#i=t,this.#n=this.#t.own(new Jb(this)),this.#o=this.#t.own(new Gb(this,n)),this.#t.ownAll(this.#i.input.catchupAndSubscribe(i=>{this.#n.invalidateWiring(),this.#o.invalidateWiring(),this.#a.ifSome(o=>o.terminate()),this.#a=i.getValue().flatMap(o=>m.wrap(zS.create(e,o.box.box)))}))}input(){return this.#a}inputAsAudioBus(){return Te(this.#a.unwrap("No input available"),kd)}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(){this.#t.terminate(),this.#a.ifSome(e=>e.terminate()),this.#a=m.None}toString(){return`{${this.constructor.name}(${this.#e})}`}};var Xb=class{#e;#t;#r;#i=!1;constructor(){this.#e=w.newSet(e=>e.adapter.uuid),this.#t=new Set,this.#r=new Set}attachChannelStrip(e){return this.#e.add(e),q.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=new Set,n=o=>{e.has(o)||(e.add(o),o.adapter.input.getValue().ifSome(a=>{a.type==="bus"&&a.box.input.pointerHub.filter(c.AudioOutput).map(s=>se(s.box.accept({visitAudioUnitBox:({address:{uuid:l}})=>this.#e.get(l),visitAuxSendBox:({audioUnit:{targetVertex:l}})=>this.#e.get(l.unwrap().address.uuid)}),"Could not resolve channel-strip")).forEach(s=>{s.isSolo||this.#r.add(s),n(s)})}))},i=o=>{t.has(o)||(t.add(o),o.adapter.output.adapter.ifSome(a=>{let s=this.#e.get(a.audioUnitBoxAdapter().uuid);s.isSolo||(this.#r.add(s),i(s))}))};this.#e.forEach(o=>{o.isSolo&&(n(o),i(o))}),this.#i=!1}};var Yb=class{#e;#t=new xe;#r=[];constructor(e){this.#e=e}process({blocks:e}){let t=this.#e.timeInfo.metronomeEnabled,n=this.#e.timelineBoxAdapter.signatureTrack,i=this.#e.preferences.settings.metronome,{beatSubDivision:o,gain:a}=i;e.forEach(({p0:s,p1:l,bpm:u,s0:d,s1:p,flags:h})=>{if(t&&ct.every(h,1))for(let[g,v]of Ye.pairWise(n.iterateAll())){let y=g.accumulatedPpqn,x=wt(v)?v.accumulatedPpqn:1/0;if(x<=s)continue;if(y>=l&&g.index!==-1)break;let $=g.index===-1?s:Math.max(s,y),M=Math.min(l,x),U=g.denominator*o,C=G.fromSignature(1,U),V=$-y,re=Math.ceil(V/C),Y=y+re*C;for(;Y<M;){let de=Math.floor(G.pulsesToSamples(Y-s,u,sampleRate)),Q=Math.round((Y-y)/C);this.#r.push(new jS(d+de,Q%U===0,a)),Y+=C}}this.#t.clear(d,p);for(let g=this.#r.length-1;g>=0;g--)this.#r[g].processAdd(this.#t,d,p)&&this.#r.splice(g,1)})}get output(){return this.#t}},jS=class{#e;#t;#r=0;#i=0;constructor(e,t,n){T(e>=0&&e<he,`${e} out of bounds`),this.#e=t?880:440,this.#t=n,this.#i=e}processAdd(e,t,n){let[i,o]=e.channels(),a=Math.floor(.002*sampleRate),s=Math.floor(.05*sampleRate),l=Ce(this.#t);for(let u=Math.max(this.#i,t);u<n;u++){let d=Math.min(this.#r/a,1-(this.#r-a)/s),p=Math.sin(this.#r/sampleRate*Gi*this.#e)*l*d*d;if(i[u]+=p,o[u]+=p,++this.#r>a+s)return!0}return this.#i=0,!1}};var ew=class{#e;constructor(){this.#e=Se.newSet(({address:e})=>e)}register(e,t,n){return this.#e.add({address:e,buffer:t,processor:n}),{terminate:()=>this.#e.removeByKey(e)}}resolve(e){return this.#e.opt(e)}};var tw=class{#e=new R;#t;#r;#i=!1;#n=null;#o=!1;#a=0;#s=m.None;#l;constructor(e){this.#t=e;let{timelineBoxAdapter:t}=e,{box:{bpm:n},markerTrack:i}=t;this.#l=n.getValue(),i.subscribe(()=>this.#o=!0),this.#e.ownAll(n.subscribe(o=>{this.#s.isEmpty()&&(this.#l=o.getValue(),this.#i=!0)}),t.catchupAndSubscribeTempoAutomation(o=>{this.#s=o,o.isEmpty()&&(this.#l=n.getValue()),this.#i=!0})),this.#r=new Vl}get bpm(){return this.#l}setCallback(e,t){return this.#r.add(e,t),q.create(()=>this.#r.remove(e,t))}reset(){this.#i=!1,this.#o=!1,this.#a=0,this.#n=null}process(e){let t=!1,{timeInfo:n,timelineBoxAdapter:{box:i,markerTrack:o},preferences:{settings:a}}=this.#t,s=a.playback.pauseOnLoopDisabled,l=n.transporting;if(l){let u=[],d=n.position,p=0,h=0,g=n.getLeapStateAndReset();for(;p<he;){if(this.#o||g){this.#o=!1;let Q=o.events.lowerEqual(d);(this.#n?.at(0)??null)!==Q&&(this.#n=Z(Q)?[Q,0]:null,t=!0)}if(g&&this.#s.nonEmpty()){let Q=this.#s.unwrap().valueAt(d,this.#l);Q!==this.#l&&(this.#l=Q,this.#i=!0)}let v=he-p,y=d+G.samplesToPulses(v,this.#l,sampleRate),x=null,$=Number.POSITIVE_INFINITY;if(o.enabled){let Q=Array.from(Ye.take(o.events.iterateFrom(d),2));if(Q.length>0){let[Pe,ce]=Q;this.#n===null?Pe.position>=d&&Pe.position<y&&(x={type:"marker",prev:Pe,next:ce},$=Pe.position):Z(ce)&&ce!==this.#n[0]&&Pe.position<d&&ce.position<y&&(x={type:"marker",prev:Pe,next:ce},$=ce.position)}}let{isRecording:M,isCountingIn:U}=this.#t.timeInfo,{from:C,to:V,enabled:re}=i.loopArea;if(re.getValue()&&!(M||U)||s){let Q=V.getValue();d<Q&&y>Q&&Q<$&&(x={type:"loop",target:C.getValue()},$=Q)}if(this.#r.keyCount()>0)for(let Q of this.#r.keys())d<Q&&y>Q&&Q<$&&(x={type:"callback",position:Q,callbacks:this.#r.get(Q)},$=Q);if(this.#s.nonEmpty()&&!this.#s.unwrap().events.isEmpty()){let Q=Od(d,ss);if(Q>=d&&Q<y&&Q<$){let Pe=this.#s.unwrap().valueAt(Q,this.#l);Pe!==this.#l&&(x={type:"tempo",position:Q,bpm:Pe},$=Q)}}let de=!n.isCountingIn;if(x===null){let Q=p+v;u.push({index:h++,p0:d,p1:y,s0:p,s1:Q,bpm:this.#l,flags:Bd.create(l,g,de,this.#i)}),g=!1,d=y,p=Q}else{let Q=()=>{if($>d){let ce=p+G.pulsesToSamples($-d,this.#l,sampleRate)|0;ce>p&&(u.push({index:h++,p0:d,p1:$,s0:p,s1:ce,bpm:this.#l,flags:Bd.create(l,g,de,this.#i)}),g=!1),d=$,p=ce}},Pe=()=>{if(p<he){let ce=p+G.pulsesToSamples(y-d,this.#l,sampleRate)|0;u.push({index:h++,p0:d,p1:$,s0:p,s1:ce,bpm:this.#l,flags:Bd.create(!1,!1,!1,this.#i)}),p=ce}};switch(x.type){case"loop":{Q(),s?(this.#t.timeInfo.pause(),Pe()):(d=x.target,g=!0);break}case"marker":{let{prev:ce,next:je}=x;!Z(this.#n)||this.#n[0]!==ce?this.#n=[ce,0]:++this.#n[1]<ce.plays||ce.plays===0?(Q(),d=ce.position,g=!0):this.#n=[je,0],t=!0;break}case"callback":{Q(),x.callbacks.forEach(ce=>ce());break}case"tempo":{Q(),this.#l=x.bpm,this.#i=!0;break}}}}e({blocks:u}),n.advanceTo(d),g=!1,this.#a=d,this.#i=!1}else{let u=n.getLeapStateAndReset();if((u||this.#i)&&this.#s.nonEmpty()){let g=this.#s.unwrap().valueAt(this.#t.timeInfo.position,this.#l);g!==this.#l&&(this.#l=g,this.#i=!0)}if(this.#o||u){this.#o=!1;let g=o.events.lowerEqual(n.position);g!==null&&this.#n?.at(0)!==g&&(this.#n=[g,0],t=!0)}let d=this.#a,p=d+G.samplesToPulses(he,this.#l,sampleRate),h={blocks:[{index:0,p0:d,p1:p,s0:0,s1:he,bpm:this.#l,flags:Bd.create(!1,!1,!1,this.#i)}]};e(h),this.#i=!1,this.#a=p}t&&this.#t.engineToClient.switchMarkerState(Z(this.#n)?[this.#n[0].uuid,this.#n[1]]:null)}terminate(){this.#e.terminate()}};var LS=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchAudio(e).then(n=>this.#t=m.wrap(n))}peaks=m.None;#e={type:"idle"};#t=m.None;get data(){return this.#t}get state(){return this.#e}subscribe(e){return q.Empty}invalidate(){}terminate(){this.#t=m.None}toString(){return"{SampleLoaderWorklet}"}},rw=class{#e;#t;constructor(e){this.#e=e,this.#t=w.newSet(({uuid:t})=>t)}record(e){}getOrCreate(e){return this.#t.getOrCreate(e,t=>new LS(t,this.#e))}remove(e){this.#t.removeByKey(e).terminate()}register(e){return q.Empty}invalidate(e){}terminate(){this.#t.forEach(e=>e.terminate()),this.#t.clear()}};var iw=class{constructor(e){this.uuid=e}waiting=m.None;playing=m.None},nw=class{#e;#t;#r=[];#i=[];#n=[];constructor(e){this.#e=e,this.#e.subscribeToAllUpdatesImmediate({onUpdate:t=>{if(t.type==="delete"){let n=t.uuid;this.#t.opt(n).ifSome(i=>{i.playing.ifSome(o=>this.#a(o.uuid)),i.playing=m.None,i.waiting=m.None}),this.#t.forEach(i=>{i.playing.nonEmpty()&&w.equals(i.playing.unwrap().uuid,n)&&(i.playing=m.None,this.#a(n));let o=i.waiting.flatMap(Cd);o.nonEmpty()&&w.equals(o.unwrap().uuid,n)&&(i.waiting=m.None)})}}}),this.#t=w.newSet(t=>t.uuid)}schedulePlay(e){e.trackBoxAdapter.ifSome(({uuid:t})=>{let n=this.#t.getOrCreate(t,o=>new iw(o));if(n.playing.nonEmpty()&&n.playing.unwrap()===e){console.debug(`${e} is already playing (ignore)`);return}let i=n.waiting.flatMap(o=>o);i.nonEmpty()&&(console.debug("obsolete",i.unwrap()),this.#n.push(i.unwrap().uuid),n.waiting=m.None),console.debug(`schedulePlay(${w.toString(n.uuid)} > ${e})`),O.removeOpt(this.#n,e.uuid),n.waiting=m.wrap(m.wrap(e))})}scheduleStop({uuid:e}){let t=this.#t.getOrCreate(e,i=>new iw(i)),n=t.waiting.flatMap(i=>i);n.nonEmpty()&&(console.debug("obsolete",n.unwrap()),this.#n.push(n.unwrap().uuid),t.waiting=m.None),t.playing.nonEmpty()&&(console.debug(`scheduleStop(${w.toString(e)})`),t.waiting=m.wrap(m.None))}reset(){this.#t.forEach(e=>{e.waiting.ifSome(t=>t.ifSome(n=>this.#n.push(n.uuid))),e.waiting=m.None,e.playing.ifSome(t=>this.#a(t.uuid)),e.playing=m.None}),this.#t.clear()}*iterate(e,t,n){let i=this.#t.getOrNull(e);if(i===null){yield{optClip:m.None,sectionFrom:t,sectionTo:n};return}if(i.waiting.nonEmpty()){let o=i.waiting.unwrap(),a=i.playing.mapOr(l=>l.duration,G.Bar),s=mo(n,a);s>=t?(t<s&&(yield{optClip:i.playing,sectionFrom:t,sectionTo:s}),i.waiting=m.None,i.playing.ifSome(l=>this.#a(l.uuid)),o.nonEmpty()?(i.playing=o,this.#o(o.unwrap().uuid)):i.playing=m.None,yield{optClip:i.playing,sectionFrom:s,sectionTo:n}):yield{optClip:i.playing,sectionFrom:t,sectionTo:n}}else if(i.playing.nonEmpty()){let o=i.playing.unwrap();if(o.box.triggerMode.loop.getValue())yield{optClip:i.playing,sectionFrom:t,sectionTo:n};else{let a=mo(t,o.duration)+o.duration;a<=n?(yield{optClip:i.playing,sectionFrom:t,sectionTo:a},i.playing=m.None,this.#a(o.uuid),a<n&&(yield{optClip:m.None,sectionFrom:a,sectionTo:n})):yield{optClip:i.playing,sectionFrom:t,sectionTo:n}}}else yield{optClip:m.None,sectionFrom:t,sectionTo:n}}changes(){if(this.#r.length>0||this.#i.length>0||this.#n.length>0){let e=m.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 m.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 KS;(e=>e.Default={includeAudioEffects:!0,includeSends:!0})(KS||={});var WS=class{constructor(e,t){this.uuid=e;this.engineToClient=t;t.fetchSoundfont(e).then(n=>this.#t=m.wrap(n))}peaks=m.None;#e={type:"idle"};#t=m.None;get soundfont(){return this.#t}get state(){return this.#e}subscribe(e){return q.Empty}invalidate(){}toString(){return"{SoundfontLoaderWorklet}"}},ow=class{#e;#t;constructor(e){this.#e=e,this.#t=w.newSet(t=>t.uuid)}getOrCreate(e){return this.#t.getOrCreate(e,t=>new WS(t,this.#e))}remove(e){}invalidate(e){}};var aw=class r extends yr{static ClockRate=G.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 n=t.filter(i=>i.sendTransportMessages.getValue()&&i.id.getValue()!=="");if(n.length===0){this.#t.length=0;return}n.forEach(i=>{let o=i.id.getValue(),a=i.delayInMs.getValue();this.#t.forEach(s=>this.context.sendMIDIData(o,s,a)),this.#t.length=0}),e.forEach(({p0:i,p1:o,s0:a,bpm:s,flags:l})=>{let u=a/sampleRate;if(ct.every(l,1))for(let d of Go.iterate(i,o,r.ClockRate)){let p=G.pulsesToSeconds(d-i,s);n.forEach(h=>{let g=h.id.getValue(),v=h.delayInMs.getValue(),y=(u+p)*1e3+v;this.context.sendMIDIData(g,ft.Clock,y)})}})}toString(){return`{${this.constructor.name}}`}};var sw=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,n){let i=this.#n.get(e);if(Cl(i)){if(i=this.#o.length,i>=64)return console.error(`Too many MIDI devices: ${i}, max is 64`),!1;this.#n.set(e,i),this.#o.push(e),this.#e.postMessage({registerDevice:e,id:i})}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,u=t[1]??0,d=t[2]??0,p=s<<30|i<<24|l<<16|u<<8|d,h=n|0,g=o<<1;return this.#r[g]=p,this.#r[g+1]=h,Atomics.store(this.#t,0,a),this.#e.postMessage(null),!0}};var pM=!1,lw=class extends AudioWorkletProcessor{#e;#t;#r;#i;#n;#o;#a;#s;#l;#c;#u;#d;#p;#h;#f;#m;#g;#v;#w;#A;#E;#F;#I;#_;#y;#b;#P;#M;#N;#$;#B;#S=m.None;#k=m.None;#D=m.None;#T=m.None;#V=!1;#R=!0;#C=0;#O=0;constructor({processorOptions:{syncStreamBuffer:e,controlFlagsBuffer:t,project:n,exportConfiguration:i}}){super();let{boxGraph:o,mandatoryBoxes:{rootBox:a,timelineBox:s}}=Ya.decode(n);this.#e=new R,this.#t=mE.for(this.port),this.#r=new Tf(this.#t.channel("engine-preferences"),uk.parse({})),this.#i=o,this.#n=new cg,this.#N=new Int32Array(t),this.#o=Hi.sender(this.#t.channel("engine-to-client"),d=>new class{log(p){d.dispatchAndForget(this.log,p)}error(p){d.dispatchAndForget(this.error,p)}fetchAudio(p){return d.dispatchAndReturn(this.fetchAudio,p)}fetchSoundfont(p){return d.dispatchAndReturn(this.fetchSoundfont,p)}notifyClipSequenceChanges(p){d.dispatchAndForget(this.notifyClipSequenceChanges,p)}switchMarkerState(p){d.dispatchAndForget(this.switchMarkerState,p)}ready(){d.dispatchAndForget(this.ready)}}),this.#s=this.#e.own(new rw(this.#o)),this.#l=new ow(this.#o),this.#c=w.newSet(d=>d.adapter.uuid),this.#h=new ay,this.#a=this.#e.own(new ty(this)),this.#d=this.#a.adapterFor(s,Bi),this.#p=new uy(this.timelineBoxAdapter),this.#u=this.#a.adapterFor(a,xu),this.#f=new cm,this.#m=new um(this.#f),this.#g=new te,this.#v=new Xb,this.#_=new Yb(this),this.#y=new aw(this,this.#u),this.#b=new ew,this.#P=this.#e.own(new tw(this)),this.#B=w.newSet(d=>d),this.#M=Ll.writer(fF(),e,d=>{let{transporting:p,isCountingIn:h,isRecording:g,position:v}=this.#n,y=this.#d.box.signature.denominator.getValue();d.position=v,d.bpm=this.#P.bpm,d.playbackTimestamp=this.#O,d.countInBeatsRemaining=h?(this.#C-v)/G.fromSignature(1,y):0,d.isPlaying=p,d.isRecording=g,d.isCountingIn=h}),this.#w=this.#e.own(Xx.create(this.#t,"engine-live-data")),this.#E=new eb(this),this.#F=this.#e.own(new Fe(this.#w,qu.PEAKS)),this.#I=new Tl;let l=new Float32Array(this.#I.numBins()),u=new Float32Array(this.#I.numBins());this.#e.own(this.#w.broadcastFloats(qu.SPECTRUM,l,d=>{d&&(l.set(this.#I.bins()),this.#I.decay=!0)})),this.#e.own(this.#w.broadcastFloats(qu.WAVEFORM,u,d=>{d&&u.set(this.#I.waveform())})),this.#A=this.#e.own(new nw(this.#i)),this.#e.ownAll(gE(this.#i,this.#t.channel("engine-sync")),this.#r.catchupAndSubscribe(d=>this.#n.metronomeEnabled=d,"metronome","enabled"),Hi.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(),queryLoadingComplete:()=>Promise.resolve(this.#i.boxes().every(d=>d.accept({visitAudioFileBox:p=>this.#s.getOrCreate(p.address.uuid).data.nonEmpty()&&p.pointerHub.nonEmpty()})??!0)),panic:()=>this.#V=!0,noteSignal:d=>{if(Uo.isOn(d)){let{uuid:p,pitch:h,velocity:g}=d;this.optAudioUnit(p).ifSome(v=>v.midiDeviceChain.noteSequencer.pushRawNoteOn(h,g))}else if(Uo.isOff(d)){let{uuid:p,pitch:h}=d;this.optAudioUnit(p).ifSome(g=>g.midiDeviceChain.noteSequencer.pushRawNoteOff(h))}else if(Uo.isAudition(d)){let{uuid:p,pitch:h,duration:g,velocity:v}=d;this.optAudioUnit(p).ifSome(y=>y.midiDeviceChain.noteSequencer.auditionNote(h,g,v))}},ignoreNoteRegion:d=>this.#B.add(d),scheduleClipPlay:d=>{d.forEach(p=>{let h=this.#i.findBox(p);if(h.isEmpty())console.warn(`Could not scheduleClipPlay. Cannot find clip: '${w.toString(p)}'`);else{let g=Ig.for(this.#a,h.unwrap());this.#A.schedulePlay(g)}}),this.#n.transporting=!0,this.#y.schedule(ft.Start)},scheduleClipStop:d=>{d.forEach(p=>{let h=this.#i.findBox(p);h.isEmpty()?console.warn(`Could not scheduleClipStop. Cannot find track: '${w.toString(p)}'`):this.#A.scheduleStop(this.#a.adapterFor(h.unwrap(),_t))})},setupMIDI:(d,p)=>{this.#T=m.wrap(new sw(d,p))},terminate:()=>{this.#D.ifSome(d=>d.terminate()),this.#D=m.None,this.#R=!1,this.#B.clear(),this.#e.terminate()}}),this.#u.audioUnits.catchupAndSubscribe({onAdd:d=>{let p=w.toString(d.uuid),h=Z(i?.[p])?i[p]:KS.Default,g=new Qb(this,d,h),v=this.#c.add(g);if(T(v,`Could not add ${g}`),g.adapter.isOutput){T(this.#k.isEmpty(),"Output can only assigned once."),this.#k=m.wrap(g);return}},onRemove:({uuid:d})=>this.#c.removeByKey(d).terminate(),onReorder:fo}),(()=>{for(let d of this.#i.boxes())d instanceof Lt&&this.#s.getOrCreate(d.address.uuid);return this.#i.subscribeToAllUpdates({onUpdate:d=>{d instanceof hs&&d.name===Lt.ClassName?this.#s.getOrCreate(d.uuid):d instanceof fs&&d.name===Lt.ClassName&&this.#s.remove(d.uuid)}})})()),this.#$=m.wrap(i).match({none:()=>O.empty(),some:d=>Object.keys(d).map(p=>this.#c.get(w.parse(p)))}),this.#o.ready(),console.log=(...d)=>this.#o.log(d.join(", "))}ignoresRegion(e){return this.#B.hasKey(e)}process(e,t){if(!this.#R)return!1;if(Atomics.load(this.#N,0)===1)return!0;try{return this.render(e,t)}catch(n){return console.debug(n),this.#R=!1,this.#o.error(n),this.terminate(),!1}}render(e,[t]){if(!this.#R)return!1;if(this.#V)return B("Manual Panic");let n=this.#n.metronomeEnabled;this.#g.notify(0),this.#S.isEmpty()&&(this.#m.update(),this.#S=m.wrap(this.#m.sorted().concat()),pM&&console.debug(`%cAudio-Graph%c
43
+ ${this.#S.unwrap().map((o,a)=>`${a+1}: ${o}`).join(`
44
+ `)}`,"color: hsl(200, 83%, 60%)","color: inherit"));let i=this.#S.unwrap();return this.#P.process(o=>{i.forEach(a=>a.process(o)),n&&this.#_.process(o)}),this.#$.length===0?(this.#k.unwrap().audioOutput().replaceInto(t),n&&this.#_.output.mixInto(t),this.#F.process(t[0],t[1]),this.#I.process(t[0],t[1],0,he)):this.#$.forEach((o,a)=>{let[s,l]=o.audioOutput().channels();t[a*2].set(s),t[a*2+1].set(l)}),this.#g.notify(1),this.#A.changes().ifSome(o=>this.#o.notifyClipSequenceChanges(o)),this.#M.tryWrite(),this.#w.flush(),!0}getAudioUnit(e){return this.#c.get(e)}optAudioUnit(e){return this.#c.opt(e)}subscribeProcessPhase(e){return this.#g.subscribe(e)}registerProcessor(e){return this.#f.addVertex(e),this.#S=m.None,{terminate:()=>{this.#f.removeVertex(e),this.#S=m.None}}}registerEdge(e,t){return this.#f.addEdge([e,t]),this.#S=m.None,{terminate:()=>{this.#f.removeEdge([e,t]),this.#S=m.None}}}get preferences(){return this.#r}get boxGraph(){return this.#i}get boxAdapters(){return this.#a}get sampleManager(){return this.#s}get soundfontManager(){return this.#l}get rootBoxAdapter(){return this.#u}get timelineBoxAdapter(){return this.#d}get tempoMap(){return this.#p}get liveStreamBroadcaster(){return this.#w}get liveStreamReceiver(){return B("Only available in main thread")}get parameterFieldAdapters(){return this.#h}get clipSequencing(){return this.#A}get broadcaster(){return this.#w}get updateClock(){return this.#E}get timeInfo(){return this.#n}get mixer(){return this.#v}get engineToClient(){return this.#o}get isMainThread(){return!1}get isAudioContext(){return!0}get audioOutputBufferRegistry(){return this.#b}sendMIDIData(e,t,n){this.#T.ifSome(i=>i.send(e,t,n))}terminate(){console.trace(`terminate: ${this}`),this.#e.terminate(),this.#c.forEach(e=>e.terminate()),this.#c.clear()}#U(){this.#r.settings.playback.timestampEnabled&&(this.#n.position=this.#O,this.#y.schedule(ft.positionInPPQN(this.#n.position))),this.#n.transporting=!0,this.#y.schedule(ft.Start)}#j(e){(this.#n.isRecording||this.#n.isCountingIn)&&(this.#n.isRecording=!1,this.#n.isCountingIn=!1,this.#n.position=this.#r.settings.playback.timestampEnabled?this.#O:0,this.#y.schedule(ft.positionInPPQN(this.#n.position)));let t=this.#n.transporting;this.#n.transporting=!1,this.#n.metronomeEnabled=this.#z(),this.#B.clear(),(e||!t)&&this.#Z(),this.#y.schedule(ft.Stop)}#L(e){this.#n.isRecording||(this.#n.position=this.#O=e,this.#y.schedule(ft.positionInPPQN(this.#n.position)))}#K(e){if(!(this.#n.isRecording||this.#n.isCountingIn))if(!this.#n.transporting&&e){let t=this.#n.position,[n,i]=this.#d.signature,o=G.fromSignature(this.#r.settings.recording.countInBars*n,i);this.#C=mo(t,G.fromSignature(n,i)),this.#n.isCountingIn=!0,this.#n.metronomeEnabled=!0,this.#n.transporting=!0,this.#n.position=this.#C-o;let a=this.#P.setCallback(this.#C,()=>{this.#n.isCountingIn=!1,this.#n.isRecording=!0,this.#n.metronomeEnabled=this.#z(),a.terminate()});this.#y.schedule(ft.positionInPPQN(this.#n.position))}else this.#n.transporting=!0,this.#n.isRecording=!0,this.#y.schedule(ft.Start)}#W(){!this.#n.isRecording&&!this.#n.isCountingIn||(this.#n.isRecording=!1,this.#n.isCountingIn=!1,this.#n.metronomeEnabled=this.#z(),this.#n.transporting=!1,this.#B.clear(),this.#y.schedule(ft.Stop))}#Z(){this.#O=0,this.#n.isRecording=!1,this.#n.isCountingIn=!1,this.#n.metronomeEnabled=this.#z(),this.#n.position=0,this.#n.transporting=!1,this.#P.reset(),this.#A.reset(),this.#m.sorted().forEach(e=>e.reset()),this.#F.clear()}#z(){return this.#r.settings.metronome.enabled}};var cw=class extends AudioWorkletProcessor{#e;constructor({processorOptions:e}){super(),this.#e=ly.writer(e)}process(e){return this.#e.write(e[0]),!0}};registerProcessor("meter-processor",xm);registerProcessor("engine-processor",lw);registerProcessor("recording-processor",cw);
28
45
  //# sourceMappingURL=processors.js.map